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

Add state_events option for state module functions #63316

Merged
merged 7 commits into from
Feb 3, 2023

Conversation

barneysowood
Copy link
Contributor

@barneysowood barneysowood commented Dec 14, 2022

What does this PR do?

Adds a state_events option to state.highstate, state.apply, state.sls, state.sls_id to enable state events whilst applying states.

Removes the need to set state_events globally in the master config, without requiring adding fire_event to every state.

The ability to send state events is really useful but under-utilised. I suspect this is because you either have to enable it globally in the master config

This is a pre-requisite to some work I'm doing to improve feedback in the salt cli command

Previous Behavior

State events could only be enabled globally in the master config

New Behavior

State events can be enabled on a per highstate or state.apply basis.

Merge requirements satisfied?

Commits signed with GPG?

No

@barneysowood barneysowood requested a review from a team as a code owner December 14, 2022 00:28
@barneysowood barneysowood requested review from whytewolf and removed request for a team December 14, 2022 00:28
@barneysowood barneysowood marked this pull request as draft December 14, 2022 00:28
@nicholasmhughes
Copy link
Collaborator

re-run pr-macosx-catalina-x86_64-py3-pytest

salt/state.py Outdated Show resolved Hide resolved
@garethgreenaway
Copy link
Contributor

re-run pr-macosx-catalina-x86_64-py3-pytest

MacOS test failures are a known failure right now due to a licensing issue that we're in the process of resolving.

@barneysowood
Copy link
Contributor Author

@nicholasmhughes and @whytewolf - I've added docs and a changelog entry for this - if you could review when you get a moment, that would be great.

whytewolf
whytewolf previously approved these changes Jan 31, 2023
@garethgreenaway garethgreenaway added the Sulfur v3006.0 release code name and version label Jan 31, 2023
@garethgreenaway garethgreenaway added this to the Sulphur v3006.0 milestone Jan 31, 2023
Adds a state_events option to state.highstate, state.apply, state.sls,
state.sls_id to enable state events whilst applying states.

Removes the need to set state_events globally in the master config,
without requiring adding fire_event to every state.
Updates the state_events opts handling to be consistent with how other
opts are processed in state.py
Adds additional documentation on the state_events option to the
Salt Master Events doc
Adds documentation on the fire_events state option to the
Salt Master Events doc for completeness.
@garethgreenaway garethgreenaway merged commit 3aa8c67 into saltstack:master Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sulfur v3006.0 release code name and version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants