fix: normalise Secret.owner to 'app' for ops[testing] output state#2127
Conversation
|
We've got two alternatives here: opt 1a, as in this PR:
opt 1b. have Ops use 'app' internally:
|
|
I don't fully understand the context for this PR. |
tonyandrewmeyer
left a comment
There was a problem hiding this comment.
Code change looks good to me, but I think we need to have a clearer PR title (particularly, one suitable for the change log) and more information in the PR description, including a link to the issue.
|
James, #2125 is mandatory reading here I'm afraid. |
|
I've updated the title and descirption. PTAL. |
james-garner-canonical
left a comment
There was a problem hiding this comment.
Looks good to me, though I guess this should be fix! so it gets called out properly in the next release notes, even if we suspect no one is using it.
I feel like Here, we already documented that the value would be |
ops.Model.add_secret()currently setsowner='application', while Scenario’s declared type forSecret.ownerisLiteral['unit', 'app', None], causing an inconsistency in test (resulting state) output.This PR implements option 1a: translate 'application' → 'app' in the Scenario backend when constructing the output state, with no public API changes and no changes to the model or hookcmd call path.
The API stays the same, and most or majority of unit tests don't get broken.
Output state secret owner string could be validated in tests, but so far I didn't find a test like this across GitHub or the charms that we track the source code for.