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

refactor: use craft-platforms for build plans #1894

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

lengau
Copy link
Collaborator

@lengau lengau commented Sep 11, 2024

Only applies to platforms charms.

@lengau lengau linked an issue Sep 11, 2024 that may be closed by this pull request
@lengau lengau force-pushed the work/1876/CRAFT-3324/use-craft-platforms branch from 0ee54d6 to e641da8 Compare September 11, 2024 15:17
Only applies to `platforms` charms
@lengau lengau marked this pull request as ready for review September 11, 2024 16:49
platforms=platforms,
)
return [
models.BuildInfo(
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: maybe craft-application's BuildInfo should have a staticmethod to convert a craft-platform's BuildInfo

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Both of your comments here are things I'd like to address in canonical/craft-application#391 :-)

# https://github.com/canonical/craft-platforms/issues/43
craft_platforms.Platforms, # pyright: ignore[reportPrivateImportUsage]
{
name: (platform.marshal() if platform else None)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is just me rambling but it bothers me a bit that we have to do this 'round-trip' where we unmarshal the project, which includes validation (necessary) and possibly transformation (dangerous), and then re-marshal to pass to craft-platforms. This makes the assembling of the build plan a little different between the application and systems that just use craft-platforms (like launchpad), and makes us still need "all" of this code here.

I don't have any good suggestions to address this though; maybe the base BuildPlanner class should retain the original values of base, build-base and platforms somewhere?

@lengau lengau added this pull request to the merge queue Sep 13, 2024
Merged via the queue into main with commit f1755e8 Sep 13, 2024
20 checks passed
@lengau lengau deleted the work/1876/CRAFT-3324/use-craft-platforms branch September 13, 2024 21:53
github-merge-queue bot pushed a commit that referenced this pull request Sep 13, 2024
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.

Use craft-platforms for build plans
3 participants