Fix and consolidate generation of st2.conf.sample#5710
Merged
cognifloyd merged 4 commits intomasterfrom Aug 19, 2022
Merged
Conversation
arm4b
approved these changes
Aug 16, 2022
Comment on lines
+80
to
+83
| INIT_COMMENT = """ | ||
| # Sample config which contains all the available options which the corresponding descriptions | ||
| # Note: This file is automatically generated using tools/config_gen.py - DO NOT UPDATE MANUALLY | ||
| """.strip() |
Member
There was a problem hiding this comment.
that's definitely much better place for the config autogenerated note 👍
e960375 to
85827b2
Compare
85827b2 to
06da276
Compare
nzlosh
reviewed
Aug 19, 2022
06da276 to
cf94559
Compare
cf94559 to
1fa58ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
I'm working towards introducing
pants. One of the first things we will use it for is linting / reformatting (it will run black, flake8, etc). Updating sample conf must happen whenever the source python files change. Pants will know which file changes require regenerating the sample conf, so it is advantageous to let it handle that. So, we'll hook that up so pants runs it when it runs fmt and other tools.Overview
Pants will not use the Makefile to generate
st2.conf.sample, it will usetools/config_gen.pydirectly. So, this moves a header comment from the Makefile intotools/config_gen.py, with the rest of the generation logic.It also fixes a long standing issue where our
st2.conf.samplefile was actually invalid.[sensorcontainer].partition_providershould not have a python dict literal, but that's how it got serialized. It should have space separtedkey:valuepairs forpartition_providerconfig. So, this also adjusttools/config_gen.pyto fix that issue.