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

Livepatch machine charm review #21

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

Conversation

mina1460
Copy link
Contributor

@mina1460 mina1460 commented Dec 7, 2023

No description provided.

Comment on lines +3 to +4
on:
workflow_dispatch:

Choose a reason for hiding this comment

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

todo: If I am not mistaken, the charm publishing only happens to edge manually, is that right?

We should be aiming to publish/release with every merge to main:

on:
  push:
    branches:
      - main

Copy link
Member

Choose a reason for hiding this comment

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

Done. I still kept the manual trigger in case we needed them.

Choose a reason for hiding this comment

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

question: Is this meant to be empty?

Copy link
Member

@babakks babakks Apr 18, 2024

Choose a reason for hiding this comment

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

Removed, because the relations are already tested in the integration tests.

Choose a reason for hiding this comment

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

question: Is this meant to be empty?

Copy link
Member

Choose a reason for hiding this comment

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

Removed, because the the action is already tested in the integration tests.

Choose a reason for hiding this comment

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

todo: Code coverage of core charm logic is fairly slim (<40%). There are a lot of conditional paths that aren't tested at all, as well as expected life-cycle events beyond just deploying.

I would aim to cover these as much as possible

Copy link
Member

Choose a reason for hiding this comment

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

I've improved the test coverage to 86% overall.

Name                             Stmts   Miss Branch BrPart  Cover   Missing
----------------------------------------------------------------------------
src/actions/enable.py               28      1      8      1    94%   14
src/actions/restart.py              22      1      6      1    93%   14
src/actions/schema_upgrade.py       22      1      6      2    89%   16, 22->exit
src/actions/set_basic_users.py      54      4     18      3    90%   15, 65, 94-95
src/charm.py                       198     28     72     18    81%   108-109, 151, 163->166, 168, 173-175, 184-186, 191, 199->exit, 236-237, 248, 251-252, 267, 282, 303, 372-373, 378-379, 382-389, 401, 410
src/constants/errors.py              2      0      0      0   100%
src/constants/snap.py                5      0      0      0   100%
src/constants/statuses.py            6      0      0      0   100%
src/state.py                        32      0      4      0   100%
src/util/schema_tool.py             19      4      0      0    79%   22-23, 37-38
----------------------------------------------------------------------------
TOTAL                              388     39    114     25    86%

Choose a reason for hiding this comment

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

todo: This is fairly bare bones I think for a published charm. I think it should be expanded on for a wider audience.

I've found that the canonical/seldon-core-operator README is a great example

Copy link
Member

Choose a reason for hiding this comment

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

Done. The readme files (charm and bundle) are now more fleshed out.

@@ -0,0 +1,22 @@
# Canonical livepatch machine charm

Choose a reason for hiding this comment

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

nitpick/style: Consider captialising 'Livepatch' throughout. It looks better imo.

Choose a reason for hiding this comment

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

nitpick/style: Consider adding the following at the top of the repo:

[![CharmHub Badge](https://charmhub.io/livepatch/badge.svg)](https://charmhub.io/livepatch)
[![Release](https://github.com/canonical/livepatch-machine-charm/actions/workflows/release.yaml/badge.svg)](https://github.com/canonical/livepatch-machine-charm/actions/workflows/release.yaml)
[![Tests](https://github.com/canonical/livepatch-machine-charm/actions/workflows/ci.yaml/badge.svg?branch=main)](https://github.com/canonical/livepatch-machine-charm/actions/workflows/ci.yaml?query=branch%3Amain)
[![Docs](https://github.com/canonical/livepatch-machine-charm/actions/workflows/sync_docs.yaml/badge.svg)](https://github.com/canonical/livepatch-machine-charm/actions/workflows/sync_docs.yaml)

NOTE - The links probably aren't correct, but hopefully they are self-explanatory enough to be replaced by ones relevant to your charm.

Choose a reason for hiding this comment

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

nitpick/style: Depending on the licensing and ownership of the product, you may be allowed to add logos and branding images. This goes a long way in legitimising the codebase.

Choose a reason for hiding this comment

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

suggestion: You can also link the Tutorial/How-To docs by following this https://juju.is/docs/sdk/add-docs-to-your-charmhub-page

Or by asking @tmihoc to give better instructions than I can provide. The end result will be something like:

image

Copy link
Member

Choose a reason for hiding this comment

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

I fixed the casing you mentioned, and also added the badges that apply. But for the logo and the organized docs, we don't have them yet, and as this is an optional thing, I think we'd like to proceed without them for now.

Choose a reason for hiding this comment

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

todo: Similar comments here as the base README. Though this can be focused more specifically on the features of the bundle itself, rather than the product as a whole.

@babakks
Copy link
Member

babakks commented Apr 18, 2024

@marcoppenheimer As I've already told you in the chat, here's the updated PR for review: #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants