-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix extend+exclude interaction #62862
Fix extend+exclude interaction #62862
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for writing tests. For me the pull request looks really nice. I don't know if exclude can hold none. I'll try and find that information for you. But It does not hurt to have it.
@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
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
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
None
can 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.