Skip to content

refactor(ci): replace the K8s gate case with alls-green #8

Done

Description

@dan-petty

Problem

The CI of this repository has a gate job "K8s" with its own Bash logic.

The code (lines at commit 39f92fb):

  • .github/workflows/ci.yml:158-179: a Bash case passes when each needed job succeeded or was skipped, and fails on each other result.
  • tests/test-ci-check-names.sh (66 lines) tests the gate with 7 cases for each caller.
  • dan-petty/infra has the same gate in .github/workflows/ci.yml:204-225 (commit e11cff6).

Breakage:

Change

Replace the gate with alls-green.

  • Tool: alls-green (https://github.com/re-actors/alls-green), BSD-3-Clause, v1.3.0 (2026-08-22).
  • One gate job needs each check job, with if: always(). It passes jobs: ${{ toJSON(needs) }} to the action. allowed-skips names the jobs that a path filter can skip.
  • Pin the action by commit SHA, as the other actions are.
  • Each repository then has a fixed required-check list: the gate and "PR title". The ruleset no longer names each check job.
  • Do the same in dan-petty/infra .github/workflows/ci.yml:204-225, in the same plan or in an item of that repository.

Delete:

  • The Bash case step of the gate job.
  • The cases of tests/test-ci-check-names.sh that test the case logic. actionlint checks the form of the workflow.

Risk: the name of the required check changes one time. Only a person edits a ruleset. The PR body names the ruleset change for that person.

Existing tool considered

  • re-actors/alls-green (BSD-3-Clause, v1.3.0). It covers the gate: it fails when a needed job failed or was cancelled, and it allows named skips. It does not change the ruleset.

Done when

  • No gate job in this repository has a Bash case on needs.*.result.
  • The gate job uses alls-green with jobs: ${{ toJSON(needs) }} and allowed-skips.
  • A CI run in which a needed job fails makes the gate fail. A run in which a filtered job is skipped makes the gate pass.
  • The infra gate is replaced too, or an item in dan-petty/infra tracks it.

Source

Source: https://github.com/dan-petty/github-workflows/blob/39f92fb644e550f84a5797cce46a80a891231d4a/.github/workflows/ci.yml

Activity

  1. added
    type/refactor
    status/new
    value/medium
    effort/low
    on Nov 28, 2026
  2. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor
  3. added
    source/agent
    scope/ci
    priority/p2-medium
    on Nov 28, 2026
  4. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Note from #21. When this item changes README.md, also correct one sentence of the section lint.yml. The sentence says that a self-hosted runner needs bash, git, xargs and HTTPS access to GitHub. jdx/mise-action v5.4.0 also needs tar, and curl or wget, to download and unpack mise.

    Correct text: "A self-hosted runner needs bash, git, tar, xargs, curl or wget, and HTTPS access to GitHub."

    Do not open a pull request for this sentence only.

  5. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 30, 2026
  6. removed
    status/in-review
    owner/agent
    on Dec 1, 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

    effort/lowpriority/p2-mediumscope/cisource/agenttype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions