Merge ~tilmanbaumann/interface-prometheus:reactive_endpoints into interface-prometheus:master
Proposed by
Tilman Baumann
Status: | Merged |
---|---|
Approved by: | Stuart Bishop |
Approved revision: | 45a4be2ce15eb9ce170f06e2462e12693c78fc98 |
Merged at revision: | defa8b8ead4b33f58826be29b254fff9c024ac59 |
Proposed branch: | ~tilmanbaumann/interface-prometheus:reactive_endpoints |
Merge into: | interface-prometheus:master |
Diff against target: |
202 lines (+109/-55) 2 files modified
provides.py (+49/-21) requires.py (+60/-34) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Stuart Bishop (community) | Approve | ||
Canonical IS Reviewers | Pending | ||
Review via email: mp+367744@code.launchpad.net |
Commit message
Switch from RelationBase class to Endpoint
Description of the change
I converted the interface to the new Endpoint class because of unfixable bugs in the old method.
The code stays compatible with old charms expecting RelationBase. But I will propose patches to all charms using this interface to make use of the new features.
To post a comment you must log in.
Yes please. This is going to be a teaching example, as it is simple enough to comprehend and not need any weird stuff, but complex enough to demonstrate most of the Endpoint stuff (including implementing both provider and consumer; this is the first non-trivial Endpoint I've seen that has done that). The most magic thing is mixing to_publish for implicit JSON encoding with to_publish_raw for the legacy fields that need to be unencoded.
So I'd like to see two minor changes needed to support cross model relations fixed in this branch, so that when people inevitably cut&paste the code they get the good stuff. Some other comments inline too, primarily with setting the old flags for backwards compatibility.