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

Charm review PR #34

Open
wants to merge 1 commit into
base: charm-review-base
Choose a base branch
from
Open

Charm review PR #34

wants to merge 1 commit into from

Conversation

shipperizer
Copy link
Contributor

PR for facilitating charm review process

DO NOT MERGE

@shipperizer shipperizer added help wanted Extra attention is needed invalid This doesn't seem right labels May 6, 2024
Copy link

@Gmerold Gmerold left a 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
Copy link

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/[email protected]
Copy link

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
Copy link

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
Copy link

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
Copy link

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,
Copy link

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,
Copy link

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(
Copy link

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,
)
Copy link

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(
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants