Tony Meyer

Results 36 comments of Tony Meyer
trafficstars

> what would be the recommended way of testing user secrets (adding, granting access, etc.) in an integration test environment? I see that we have [`add_secret`](https://github.com/canonical/operator/blob/a80d88aa20d946de52a34941d9d973ee809615da/ops/model.py#L437), but that models application...

Is it only the test that fails? I would have expected this to fail with a real Juju too. Handlers need to still exist when the emit happens, and in...

Closing since this isn't an issue with Scenario, but a limitation of Ops.

In retrospect, I suspect we should have done #1091 differently - adding a new attribute/method that excluded the breaking/broken relation and leaving the existing one alone. That's more aligned with...

> * on a deferred event that is executed before the ops relation-broken event For deferred events, I think we need to provide some solution, as per my comment above....

The Charm-Tech team discussed this in a meeting, and concluded that: * Changing the behaviour of `Model.relations` while running deferred event handlers is a slippery slope that we don't want...

One additional piece of context: prior to ops 2.14.1, `set_content()` had [this line](https://github.com/canonical/operator/blob/6197de962f9a64b00f06c4a647a558bc573275d2/ops/model.py#L1410): ```python self._content = None # invalidate cache so it's refetched next get_content() ``` I removed that, making...

Juju [does not cache the retrieved content even for the duration of the hook](https://matrix.to/#/!wJiiHsLipVywuWOyNi:ubuntu.com/$eyzEfOF7IgSG4-ZWVsIxaV9qnC5e5i57OzXD8_TEt3s?via=ubuntu.com&via=matrix.org). So we either say that if the charm doesn't want to call out to the secret...

This can be done much more simply by adding this at line 208 of `_main.py`: ```python if relation: relation.data._data[kwargs['unit']] = ops.model.RelationDataContent( relation, kwargs['unit'], model._backend ) ``` Pros/cons compared to the...

> @tonyandrewmeyer still draft or ready for review and possibly merge? Still draft, expecting to get back to this in the next few days.