-
Notifications
You must be signed in to change notification settings - Fork 2
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
Charm review PR #34
base: charm-review-base
Are you sure you want to change the base?
Charm review PR #34
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general comment, I think that this charm could use some docstrings. At least for the public methods.
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v4
is already out. You might wanna update this.
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Release charm to channel | ||
uses: canonical/charming-actions/release-charm@2.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.4.0
is available.
name: Promote charm | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you might wanna consider configuring Dependabot to automatically update the versions for you.
juju deploy ./glauth-k8s_ubuntu-*-amd64.charm --resource oci-image=$(yq eval '.resources.oci-image.upstream-source' metadata.yaml) | ||
``` | ||
|
||
## Observability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to ignore this, but doesn't README
seem more suitable for this part?
def test_when_missing_database_relation( | ||
self, | ||
harness: Harness, | ||
certificates_relation: int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used.
def test_when_missing_certificates_relation( | ||
self, | ||
harness: Harness, | ||
database_relation: int, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot of unused args all over the file. Looks like they can all be safely removed.
|
||
assert isinstance(harness.model.unit.status, BlockedStatus) | ||
|
||
def test_when_tls_certificates_not_exist( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a personal preference (and something to think about), but I'm a great fan of using given-when-then
in the tests. This can go either in the name of the test or a docstring. For someone not involved in the charm design process (like me :) ) it makes it easier to understand the expected behavior and hence provide a better review ;)
apps=[GLAUTH_APP], | ||
status="active", | ||
timeout=1000, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we wait for the target_unit_num
specifically?
|
||
import textwrap | ||
|
||
ANY_CHARM = textwrap.dedent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for having this instead of a minimal but real charm stored under the integration
dir? This seems pretty complicated. Charm code is here, overwrites in the test_charm.py
, charm name in the conftest.py
.
PR for facilitating charm review process
DO NOT MERGE