Skip to content

Conversation

@Thanhphan1147
Copy link
Contributor

@Thanhphan1147 Thanhphan1147 commented Apr 15, 2024

Description

Fixes #1042.

When deploying a bundle, although the plan is properly generated with the correct revision for the charms in the bundle, and the change steps are generated with the correct parameter. I believe that the addCharm step does not take into account the specified "revision" of the charm to deploy, as a result the revision deployed is the latest revision instead of the specified revision. ref:

origin = client.CharmOrigin(source=Source.CHARM_HUB.value,
architecture=arch,
risk=ch.risk,
track=ch.track,
base=base)

This PR simply adds the missing parameter to the AddCharmChange step and propagate the value to client.CharmOrigin to add the correct revision.

QA Steps

  1. Create a bundle containing one or more charms with revision
  2. Deploy the bundle with model.deploy
  3. The deployed charms in the bundle should have the revision specified in the bundle.
  • Code style: imports ordered, good names, simple structure, etc
  • Comments saying why design decisions were made
  • Go unit tests, with comments saying what you're testing
  • Integration tests, with comments saying what you're testing
  • doc.go added or updated in changed package (I think this is too small of a change to warrant a doc update)

@jujubot
Copy link
Contributor

jujubot commented Apr 15, 2024

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial

1 similar comment
@jujubot
Copy link
Contributor

jujubot commented Apr 15, 2024

Thanks for opening a pull request! Please follow the instructions here to ensure your pull request is ready for review. Then, a maintainer will review your patch.

@hpidcock @anvial

Copy link
Member

@jameinel jameinel left a comment

Choose a reason for hiding this comment

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

It definitely feels like we are missing a test of some form (plausibly an integration test), to ensure that bundles with charm revisions are properly deployed, but the change itself seems plausible.

@Thanhphan1147 Thanhphan1147 requested a review from jameinel April 16, 2024 15:53
Copy link
Contributor

@cderici cderici left a comment

Choose a reason for hiding this comment

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

Thanks for the change @Thanhphan1147! A little fix for the failing test is needed on this one, let's get that passing, then we can take over and do some manual QA to get this landed👍

Thanhphan1147 and others added 2 commits April 17, 2024 11:20
Co-authored-by: Caner Derici <caner.derici@canonical.com>
Co-authored-by: Caner Derici <caner.derici@canonical.com>
@Thanhphan1147 Thanhphan1147 requested a review from cderici April 17, 2024 09:22
…thub.com:Thanhphan1147/python-libjuju into add_missing_revision_params_in_bundle_add_charms
@Thanhphan1147
Copy link
Contributor Author

the added integration test seems to be passing locally for me.

@Thanhphan1147
Copy link
Contributor Author

Thanhphan1147 commented Apr 17, 2024

@cderici Seems like a few other integration tests are having issues, maybe a few updates on the bundle definitions as jammy is not a supported series for the old charms.

The one I added seems to be fine:

[gw0] [ 45%] PASSED tests/integration/test_model.py::test_deploy_bundle_with_pinned_charm_revision 

Copy link
Contributor

@cderici cderici left a comment

Choose a reason for hiding this comment

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

This LGTM, manual QA performed against 3.4, everything seems to be working fine 👍

@Thanhphan1147 I can confirm that the failing tests are known test failures that'll be fixed soon (and unrelated to this change), this can land safely 👍thanks again for the contribution, much appreciated!

@jameinel
Copy link
Member

@Thanhphan1147 Caner is off until Monday. I would tend to wait for him to merge this, but if you need it sooner, let us know.

@Thanhphan1147
Copy link
Contributor Author

@jameinel nothing urgent from me, thanks for your help on this PR!

@cderici
Copy link
Contributor

cderici commented Apr 23, 2024

/merge

@cderici
Copy link
Contributor

cderici commented Apr 23, 2024

/build

@cderici
Copy link
Contributor

cderici commented Apr 23, 2024

/merge

@jujubot jujubot merged commit d4f6677 into juju:master Apr 23, 2024
jujubot added a commit that referenced this pull request May 31, 2024
#1056

## What's Changed
* Make consume respect the controller name in the url by @Aflynn50 in #1038
* Fix multiline description in textarea in bug template GH workflow by @cderici in #1041
* Fix issue with microk8s proxy by @Aflynn50 in #1044
* add missing "revision" parameter to addModel step. by @Thanhphan1147 in #1043
* Add user api to pylibjuju documentation by @cderici in #1049

## New Contributors
* @Thanhphan1147 made their first contribution in #1043

**Full Changelog**: 3.4.0.0...3.5.0.0
@Thanhphan1147 Thanhphan1147 deleted the add_missing_revision_params_in_bundle_add_charms branch August 16, 2024 13:25
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.

Pinned revision in bundle not taken into account when deploying with model.deploy()

4 participants