Skip to content

package_install_coverage_test.go still cuts ci.yml as text, and #504 has landed #545

Open

Description

@scttfrdmn

internal/config/package_install_coverage_test.go reaches ci.yml's packaging job with a
line-oriented text cut (jobSource, plus isJobHeader), and its own doc comment says why and what
to do about it:

A text cut and not a YAML descent, deliberately and with a caveat. #504 converged this package's four
workflow parsers into one, and the parsed form is the right way to reach a job's steps; the struct that
lands with it grows a Steps field that is not on this tree yet, and adding a fifth parser here to
bridge the gap would be the thing #504 exists to stop. So this cuts the text, and whoever holds both
halves should replace it with a steps: walk.

#504 has now merged (#540, 4cdea39), so that condition is satisfied: workflow_test.go declares
Steps any with a yaml:"steps" tag, and readWorkflow, readWorkflows, readWorkflowTexts,
cutStep and needsOf are all in the package. The caveat is stale and the note is the only thing
holding the shape in place.

Why it is worth doing rather than leaving

The text cut works and is guarded — a floor on the cut's length, and a ceiling asserting the body holds
exactly one runs-on:, which is how a cut that overruns into the next job gets caught. That second
guard exists because text cutting has this failure mode; a steps: walk does not have it, so the
guard and the helper both go away.

It also carries a second, subtler cost. runsCommand matches a line prefix after stripping sudo ,
because the first version used a substring match and the mutation deleting rpm -e objectfs from
ci.yml passed — the job's own echo "::error::... survived rpm -e" diagnostics satisfied it.
Walking steps: and searching each step's run: string does not remove that hazard (an echo is still
inside a run:), so runsCommand should survive the conversion unchanged. Worth stating explicitly so
the conversion does not "simplify" it away.

Work

  1. Replace jobSource with a descent through the converged parser to jobs.packaging.steps[].run.
  2. Delete jobSource, isJobHeader, and the two cut guards (the length floor and the runs-on:
    ceiling) — they guard a failure mode the parsed form does not have.
  3. Keep runsCommand and its line-prefix rule, and keep its comment: the defect it was written for
    is a property of run: bodies, not of how the job was located.
  4. Re-verify by mutation, since the gate is only worth what a mutation says: delete rpm -e objectfs
    from ci.yml and confirm TestEveryPackagedFormatIsInstalledAndRemovedInCI fails by name, and
    confirm the mutation still compiles.

No behaviour change and no user-facing effect. Filed so a comment that is now wrong does not quietly
become permanent.

Activity

  1. added
    type: technical-debt
    priority: low
    area: tests
    effort: small
    area: ci-cd
    on Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ci-cdarea: testseffort: smallpriority: lowtype: technical-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions