Skip to content

verify: The ops "How to manage actions" doc shows a snapshot action handler th - #26

Closed
github-actions[bot] wants to merge 1 commit into
mainfrom
probe/issue-22
Closed

github-actions[bot] wants to merge 1 commit into
mainfrom
probe/issue-22

Conversation

@github-actions

Copy link
Copy Markdown

The ops "How to manage actions" doc shows a snapshot action handler that ends with event.set_results({'result': msg}) — so the action results dict contains the key result, with a value like "Stored snapshot in db-snapshot.tar.gz.". The very next code block, the unit test, asserts 'snapshot-size' in ctx.action_results. I believe the doc is wrong here: the handler never sets a snapshot-size key, so that assertion would fail.

I implemented the snapshot action in the kepler charm exactly as the doc describes (log a message, do the snapshot, then event.set_results({'result': msg})), and added a test that asserts my understanding: that 'snapshot-size' is NOT in ctx.action_results (and that the results are exactly {'result': 'Stored snapshot in db-snapshot.tar.gz.'}). This test is expected to pass.

If CI passes, the doc's example unit test is incorrect — the documented assertion 'snapshot-size' in ctx.action_results does not hold against the documented handler, because the handler sets result, not snapshot-size. If CI fails (i.e., snapshot-size somehow IS in the results), then the doc's test would pass and the doc would be correct — but I'd be surprised, since nothing in the shown handler produces that key.

@github-actions

Copy link
Copy Markdown
Author

This PR is a draft. Inspect the changes, then mark it ready for review to run CI.

@dwilding
dwilding marked this pull request as ready for review August 22, 2026 03:54
@dwilding dwilding closed this Aug 22, 2026
@dwilding
dwilding deleted the probe/issue-22 branch August 22, 2026 04:36
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.

1 participant