Skip to content

promote-release.yml's "every pipeline it dispatches to is present" check validates nothing since ci-shared.yml switched to absolute uses: #29

Description

@matt-edmondson

What's wrong

The Resolve and validate step in .github/workflows/promote-release.yml (around lines 64–91 on current main) loads ci-shared.yml and checks that every pipeline it dispatches to exists at the commit being promoted. The check only examines jobs whose uses: starts with ./:

if not uses.startswith("./"):
    continue

Commit a343f55 ("Reference the pipelines absolutely, not relatively") changed both dispatch jobs in ci-shared.yml to absolute references:

uses: ktsu-dev/.github/.github/workflows/dotnet.yml@release          # line 152
uses: ktsu-dev/.github/.github/workflows/dotnet-private.yml@release  # line 161

Every job is now skipped. missing is always empty, and the step always prints "ci-shared.yml and every pipeline it dispatches to are present."

Failure scenario

A commit on main renames or deletes dotnet.yml or dotnet-private.yml. Promotion still succeeds and the release tag moves. Every repository's ci.yml then fails with "workflow was not found", which is the org-wide outage this check exists to prevent (see the comment above the step).

Verification

Parsing ci-shared.yml with PyYAML, the same way the step does, gives startswith('./') == False for both dotnet-public and dotnet-private. No job is checked.

Suggested fix

  1. Also resolve uses values of the form ktsu-dev/.github/<path>@<ref>: strip the repo prefix and @ref, then run git cat-file -e "$SHA:<path>".
  2. Fail on any uses that points at another repository, or at a ref other than release, that the check can't resolve.
  3. Fail when zero pipelines were checked, so the check can't silently pass again.

Acceptance criteria

  • Deleting dotnet.yml on a branch makes the promote dry run fail and name the missing pipeline.
  • The step reports how many pipelines it verified.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions