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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions