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

add a lib for juju topology #11

Merged
merged 16 commits into from
May 9, 2022
Merged

add a lib for juju topology #11

merged 16 commits into from
May 9, 2022

Conversation

simskij
Copy link
Member

@simskij simskij commented Apr 14, 2022

Issue

This PR adds a common library for JujuTopology. It strips away all of the complexity we've added in other charms in favor of a simple and coherent API.

Solution

  • Get rid of the abstract base class.
  • Get rid of the mix between properties and methods.
  • Add the ability to exclude items from the dict
  • Add the ability to remap keys in the dict

Context

N/A

Testing Instructions

  • Try the library with one of our existing charms, replacing the current implementation with the one in the library.
  • Run all tests, both unit and integration.
  • Perform manual sanity checks

Release Notes

Adds a reusable library for creating, generating and formatting Juju topology.

lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
tests/test_juju_topology.py Outdated Show resolved Hide resolved
tests/test_juju_topology.py Outdated Show resolved Hide resolved
simskij added a commit that referenced this pull request Apr 19, 2022
@jnsgruk
Copy link
Member

jnsgruk commented Apr 19, 2022

This could also do with a slight adjustment to the top-level README to add a reference to this lib :)

@simskij
Copy link
Member Author

simskij commented Apr 19, 2022

This could also do with a slight adjustment to the top-level README to add a reference to this lib :)

Good catch! Thanks!

sed-i
sed-i previously approved these changes Apr 19, 2022
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
tests/test_juju_topology.py Outdated Show resolved Hide resolved
Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com>
jnsgruk
jnsgruk previously approved these changes May 9, 2022
Copy link
Member

@jnsgruk jnsgruk left a comment

Choose a reason for hiding this comment

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

This looks good to me now. Comments are all nits on documentation and nothing concrete, can be punted into another PR if you'd prefer.

README.md Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
sed-i
sed-i previously approved these changes May 9, 2022
lib/charms/observability_libs/v0/juju_topology.py Outdated Show resolved Hide resolved
Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com>
@simskij simskij merged commit dee7b6d into main May 9, 2022
@simskij simskij deleted the add-juju-topology branch May 9, 2022 13: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.

None yet

6 participants