Skip to content

Add state_events option for state module functions - #63316

Merged
garethgreenaway merged 7 commits into
saltstack:masterfrom
barneysowood:state-events-option
Feb 3, 2023
Merged

Add state_events option for state module functions#63316
garethgreenaway merged 7 commits into
saltstack:masterfrom
barneysowood:state-events-option

Conversation

@barneysowood

@barneysowood barneysowood commented Dec 14, 2022

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor

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

Comment thread salt/state.py Outdated
@garethgreenaway

Copy link
Copy Markdown
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
Copy Markdown
Collaborator 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.

Comment thread tests/pytests/integration/modules/state/test_state_state_events.py Outdated
Comment thread salt/modules/state.py Outdated
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