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

feat: add the action's ID to the ActionEvent object #1124

Merged
merged 7 commits into from Feb 14, 2024

Conversation

tonyandrewmeyer
Copy link
Contributor

This PR exposes the JUJU_ACTION_UUID environment variable's value as ActionEvent.id.

Fixes #1121

Also add a basic test.
Also dump the ability to specify the ID in Harness, that doesn't seem useful.
@@ -1057,10 +1057,10 @@ class BoundStoredState:
if TYPE_CHECKING:
# to help the type checker and IDEs:
@property
def _data(self) -> StoredStateData: ... # noqa, type: ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, and the next change, are drive-bys. I weirdly get ruff complaining about these but only some of the time that it's run (I haven't dug into why that is). They do not seem to be necessary, so simplest to just remove.

ops/charm.py Outdated Show resolved Hide resolved
ops/charm.py Outdated Show resolved Hide resolved
ops/testing.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me -- thanks for this!

@benhoyt benhoyt merged commit b13ee4c into canonical:main Feb 14, 2024
28 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the action-id-1121 branch February 15, 2024 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expose JUJU_ACTION_UUID envvar
2 participants