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

compatible: Adapt collect-bases step to parse platforms keyword #250

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lucasgameiroborges
Copy link
Member

@lucasgameiroborges lucasgameiroborges commented Nov 26, 2024

  • Small adaptations to make related workflows parse the new platforms keyword for snaps and charms (like what's already in place for rocks).
  • Adapt the build_charm helper to the new charmcraft 3.x naming: <charm>_<arch>.charm

Test workflows:

@lucasgameiroborges lucasgameiroborges changed the title feat(collect_bases.py): Adapt collect-bases to parse platforms keyword compatible: Adapt collect-bases step to parse platforms keyword Nov 26, 2024
@lucasgameiroborges lucasgameiroborges marked this pull request as ready for review November 26, 2024 11:34
Copy link

@Batalex Batalex left a comment

Choose a reason for hiding this comment

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

I don't have a strong familiarity with this code base, but LGTM as far as I can tell

@@ -36,7 +36,7 @@ def get_bases(*, craft_: craft.Craft, yaml_data):

For snaps & rocks, the Ubuntu version is the same for all architectures.
"""
if craft_ is craft.Craft.ROCK:
if craft_ is craft.Craft.ROCK or "platforms" in yaml_data:
Copy link

Choose a reason for hiding this comment

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

suggestion (non-blocking): I got a little worried of the fact that we may be looking for this string in the whole document. Turns out that yaml_data is a dict as this point. Would you mind adding a type hint in the signature?

Copy link

@taurus-forever taurus-forever left a comment

Choose a reason for hiding this comment

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

I am not confident to LGTM this (lack of experise here).
The code is OK, but changes can bite. @dragomirp do you see problems here?

The best case is to review with Carl.

P.S. I am worried about artifact name changes. Some workflow may expect -amd64.charm to fetch... and will start failing.

@lucasgameiroborges
Copy link
Member Author

Will give a more thorough usage of this during the rest of the week, it can wait for @carlcsaposs-canonical to return!

Copy link
Contributor

@dragomirp dragomirp left a comment

Choose a reason for hiding this comment

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

IMHO it's best to wait for @carlcsaposs-canonical. Changes look good, but we should most probably also update charmcraftcache-hub in lockstep.

Copy link

@zmraul zmraul left a comment

Choose a reason for hiding this comment

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

I would suggest waiting as @dragomirp said. platforms keyword is the new syntax across the board for base 24.04 on charms, and there will be changes required to accommodate base in addition or instead of bases.

24.04 support for charms looks like this, no support for bases yet:

base: [email protected]
platforms:
  amd64:

@zmraul
Copy link

zmraul commented Nov 29, 2024

Tried the fix, and as @taurus-forever, it's failing to find the packed charm: ci error

@lucasgameiroborges
Copy link
Member Author

lucasgameiroborges commented Dec 3, 2024

Tried the fix, and as @taurus-forever, it's failing to find the packed charm: ci error

Hey @zmraul , I think that's because you should also update the pyproject.toml to take into consideration the plugin update too, like here: https://github.com/canonical/postgresql-operator/pull/680/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711

@zmraul
Copy link

zmraul commented Dec 3, 2024

Hey @zmraul , I think that's because you should also update the pyproject.toml to take into consideration the plugin update too, like here: https://github.com/canonical/postgresql-operator/pull/680/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711

Seems like same issue is still popping up

@lucasgameiroborges
Copy link
Member Author

Seems like same issue is still popping up

Yep, thanks for testing, I will investigate!

Copy link
Contributor

@carlcsaposs-canonical carlcsaposs-canonical left a comment

Choose a reason for hiding this comment

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

Suggest using the approach in #253 instead to enable temporary testing of 24.04-based charms

Long term, currently thinking that next steps will be:

  1. stabilize charmcraft 3 (probably by limiting to poetry plugin)
  2. switch our charms, dpw, ccc, and ccc-hub to charmcraft 3 while only supporting the ST124 shorthand syntax (see https://github.com/canonical/charmcraftst124)
  3. when st124 is added to the crafts, deprecate https://github.com/canonical/charmcraftst124 and switch dpw snap/rock support to ST124 shorthand syntax only

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.

6 participants