Skip to content

Align cname and flavor handling with ADR 0035 #377

Description

@nkraetzschmar

Context: ADR 0035

This library has the most significant divergence from the definitions in ADR 0035 and requires substantial rework:

  1. CName class and the role of platform: The library's CName class treats platform as a first-class field, exposing CName.platform and CName.features["platform"] as primary identifiers. Under this ADR, platform is simply a feature of type platform that sorts to the front of the cname — it has no special status in the cname string itself. The CName class should drop platform as a first-class accessor and instead expose it via the general feature-set breakdown if needed.

  2. Commit as primary cname component: The library's primary cname format is {cname}-{arch}-{version}-{commit}. The no-commit form exists only as an explicit workaround (labelled as such in a comment at cname.py:97). As a direct consequence, release_metadata_string writes GARDENLINUX_CNAME including the commit — which means release files generated by the library contain a different value for GARDENLINUX_CNAME than what the builder writes. Under this ADR, the .cname property must return only the feature encoding, and the commit-extended form should be exposed as a distinct property (e.g. .artifact_base_name). The workaround branch can be removed once the primary format is corrected.

  3. flavor property: CName.flavor currently returns the feature-encoding prefix (what this ADR calls the cname). It should be renamed to cname, and a new flavor property returning {cname}-{arch} introduced.

  4. flavors/parser.py: This separate module parses flavors.yaml and generates strings of the form {target}-{feature}-{arch}, which match the flavor definition here. The module name and its output are consistent with this ADR and require no renaming. However, the relationship between this module and features/parser.py (which also deals with something it calls "flavor") should be clarified in documentation.

  5. Sorting: The library's get_flavor_from_feature_set uses a reduce with simple underscore/hyphen logic. This does not reproduce the lexicographical topological sort defined here. For correctness, cname construction in the library must use the same algorithm as the builder, or — preferably — delegate to the builder's parse_features script rather than reimplementing the sort, e.g. by consuming GARDENLINUX_CNAME from /etc/os-release which is already correctly sorted and minimised by the builder.

Activity

  1. added this to the 2026-07 milestone on Sep 29, 2026
  2. NotTheEvilOne commented on Sep 29, 2026

    @NotTheEvilOne
    Contributor

    The changes for ADR 0035 are implemented in #393. The gardenlinux.features class names and implementation details are aligned in regard to ADR 0035. Inputs (formally known as CName most of the time) are splitted into specific terminology to provide specific information used for feature parsing and output. Sorting of gardenlinux.flavors and gardenlinux.features are aligned. Please note that, as long as no features parsing is done (e.g. cached from release file) no minimal feature set analysis is performed.

  3. modified the milestones: 2026-07, 2026-10 on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions