Fix extend+exclude interaction#62862
Merged
garethgreenaway merged 3 commits intoOct 15, 2022
Merged
Conversation
cmcmarrow
reviewed
Oct 11, 2022
Contributor
Author
|
@cmcmarrow thanks for looking into that open question. Looking at the code again, I think I can remove the sentinel object either way. When I added it, I was doing I'll clean that up and squash the commits later today. |
35feb69 to
d94f750
Compare
Ch3LL
suggested changes
Oct 12, 2022
sls files that are excluded should not affect other sls files by extending their states. Exclude statements are processed very late in the state processing pipeline to ensure they are not overridden. By that time, extend declarations are already processed. Luckily, it's not necessary to change much, during the extend declarations processing it is easy to check if the sls file that contains a given extend declaration is excluded.
d94f750 to
856b23c
Compare
Ch3LL
approved these changes
Oct 13, 2022
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.
What does this PR do?
Exclude declarations that are specified in excluded SLS files are ignored. Users don't expect that exluded SLS files have any effect at all. The PR is a bit rough around the edges, I don't mind cleaning it up a bit but first I'd like to have feedback on the approach I took.
I haven't yet checked if
Nonecan be in__exclude__. If that never happens, I will remove the sentinel object.What issues does this PR fix or reference?
Fixes: #62082
Previous Behavior
An SLS file that is excluded affects other states if it contains an extend declaration.
New Behavior
An SLS file that is excluded does not extend other states.
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Always
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.