Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make docs to build all docs #12499

Closed
Hipska opened this issue Jan 12, 2023 · 5 comments · Fixed by #12503
Closed

make docs to build all docs #12499

Hipska opened this issue Jan 12, 2023 · 5 comments · Fixed by #12503
Labels
docs Issues related to Telegraf documentation and configuration descriptions feature request Requests for new plugin and for new features to existing plugins

Comments

@Hipska
Copy link
Contributor

Hipska commented Jan 12, 2023

Use Case

When running make docs on a system, it currently only does that for plugins of your current operating system as this has been pointed out in #12426 (comment).

Expected behavior

The tool should build all docs regardless of current operating system.

Actual behavior

The tool only builds the docs for plugins that work on current operating system.

Additional info

Building for example Windows docs works fine with the following command: GOOS=windows make docs.

@Hipska Hipska added the feature request Requests for new plugin and for new features to existing plugins label Jan 12, 2023
@powersj
Copy link
Contributor

powersj commented Jan 12, 2023

To embed the docs we run the following target in the makefile for each plugin type:

go generate -run="readme_config_includer/generator$$" ./plugins/$*/...

which translates to:

go generate -run="readme_config_includer/generator$" ./plugins/inputs/...
go generate -run="readme_config_includer/generator$" ./plugins/outputs/...
go generate -run="readme_config_includer/generator$" ./plugins/processors/...
go generate -run="readme_config_includer/generator$" ./plugins/aggregators/...
go generate -run="readme_config_includer/generator$" ./plugins/secretstores/...

Per go help generate the $GOOS value is set when the generator is run, so our build tags are going to exclude plugins that are not supported for the user's value of GOOS.

Running the go generate 3x times for Windows, Linux, and Darwin seems excessive. @srebhan thoughts here?

@srebhan
Copy link
Member

srebhan commented Jan 12, 2023

I have no idea on how to work around the GOOS thing besides really run the code multiple times or have the generator tag in a non-OS dependent file i.e. without build flags...

@Hipska
Copy link
Contributor Author

Hipska commented Jan 13, 2023

I tried with the 4 types on my machine and it runs fast enough IMHO. Only problem I had was figuring out how to run these steps multiple times in the makefile.

powersj added a commit to powersj/telegraf that referenced this issue Jan 13, 2023
In order to correctly update all READMEs during go generate, pass the
primary three GOOS that we support. This way all README will get any
necessary changes.

fixes: influxdata#12499
@powersj
Copy link
Contributor

powersj commented Jan 13, 2023

@Hipska can you take a look at #12503 thanks!

@Hipska Hipska added the docs Issues related to Telegraf documentation and configuration descriptions label Jan 13, 2023
@Hipska
Copy link
Contributor Author

Hipska commented Jan 13, 2023

That's also a way to achieve it 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Issues related to Telegraf documentation and configuration descriptions feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants