Skip to content

Unify python-gardenlinux-lib based feature and cname parsing#115

Draft
NotTheEvilOne wants to merge 1 commit intomainfrom
feature/python-lib-support
Draft

Unify python-gardenlinux-lib based feature and cname parsing#115
NotTheEvilOne wants to merge 1 commit intomainfrom
feature/python-lib-support

Conversation

@NotTheEvilOne
Copy link
Contributor

@NotTheEvilOne NotTheEvilOne commented Jun 25, 2025

What this PR does / why we need it:
Currently builder/parse_features provides duplicated code and features with python-gardenlinux-lib to parse and return information about GardenLinux features, flavors and canonical names. To unify and ensure code quality this PR replaces it with the CLI utilities of python-gardenlinux-lib.

Which issue(s) this PR fixes:
Related gardenlinux/python-gardenlinux-lib#129

@NotTheEvilOne NotTheEvilOne self-assigned this Jun 25, 2025
@NotTheEvilOne NotTheEvilOne added the kind/enhancement Enhancement, improvement, extension label Jun 25, 2025
@NotTheEvilOne NotTheEvilOne force-pushed the feature/python-lib-support branch 2 times, most recently from 6423af1 to 794f3bd Compare August 1, 2025 04:44
@NotTheEvilOne NotTheEvilOne force-pushed the feature/python-lib-support branch from 794f3bd to 2fbc117 Compare August 1, 2025 04:48
@NotTheEvilOne NotTheEvilOne requested review from a team and nkraetzschmar August 1, 2025 08:55
@NotTheEvilOne NotTheEvilOne marked this pull request as ready for review August 1, 2025 08:55
@NotTheEvilOne NotTheEvilOne force-pushed the feature/python-lib-support branch from 2fbc117 to 8b2977a Compare August 1, 2025 08:56
@nkraetzschmar
Copy link
Contributor

We should consider how this relates to the following issues and maybe resolve those first, before we proceed here

Signed-off-by: Tobias Wolf <wolf@b1-systems.de>
On-behalf-of: SAP <tobias.wolf@sap.com>
@NotTheEvilOne NotTheEvilOne force-pushed the feature/python-lib-support branch from 4ffdd12 to 741db9b Compare February 5, 2026 10:04
features_platforms="$$(gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH)' --cname '$*'platforms)"
features_elements="$$(gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH)' --cname '$*'elements)"
features_flags="$$(gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH)' --cname '$*'flags)"
BUILDER_CNAME='$*'
Copy link
Contributor

Choose a reason for hiding this comment

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

With the change from .build/%-$(SHORT_COMMIT).tar to .build/%.tar $* would now include the commit. This would break the expected value in this field that is later exported into /etc/os-release. Other tools (e.g. gardenlinux-update) rely on the format of this value so we can not just change this without good reason.

features_platforms="$$$$(gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH)' --cname '$$*' platforms)"
features_elements="$$$$(gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH)' --cname '$$*' elements)"
features_flags="$$$$(gl-features-parse --feature-dir features --default-arch '$$(DEFAULT_ARCH)' --cname '$$*' flags)"
BUILDER_CNAME='$$*'
Copy link
Contributor

Choose a reason for hiding this comment

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

see above

@nkraetzschmar
Copy link
Contributor

How does this behave in cases where one builds e.g. ./build kvm-arm64-1877.10-5282bd31 while the current checked out git tree is actually at commit e3c5962a?

If I read the Makefile correctly this would result in internally inconsistent values in the /etc/os-release, as the value GARDENLINUX_CNAME would include the commit 5282bd31 at the end, but GARDENLINUX_COMMIT_ID would be e3c5962a.

Even if the GARDENLINUX_COMMIT_ID was corrected to also be 5282bd31 this would still be incorrect, since the image was after all build from commit e3c5962a. This is why the commit value must not come from the cname provided as build target and has to instead come exclusively from ./get_commit so that the features repo using the builder has complete control over what goes in here.

@NotTheEvilOne
Copy link
Contributor Author

How does this behave in cases where one builds e.g. ./build kvm-arm64-1877.10-5282bd31 while the current checked out git tree is actually at commit e3c5962a?

Good catch. While this was already verified for commits it was not checked for versions. Added the additional checks to gardenlinux/python-gardenlinux-lib#306

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

Labels

kind/enhancement Enhancement, improvement, extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants