Skip to content

ci: use the shared CI gate action - #342

Merged
uniqueg merged 2 commits into
devfrom
ci/shared-gate-action
Oct 30, 2026
Merged

uniqueg merged 2 commits into
devfrom
ci/shared-gate-action

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

The gate job of CI (passed, "CI passed") now runs the shared gate action of elixir-cloud-aai/.github v1.0.0, pinned to its commit, instead of its own jq script. Cloud Registry uses the same action.

  • Inputs: the gate passes needs: ${{ toJSON(needs) }}. It sets allow-skipped to push publish only where PUBLISH is "false" (on pull requests, and in forks without DOCKERHUB_ORG), which is the old rule.
  • What stays: the job keeps its name, if: always() and needs, so the required check doesn't change and the ruleset needs no update.
  • Permissions: the job now has permissions: {}, because the action needs no token.
  • Tests: tests/test_workflows.py now checks that the gate uses the shared action with these inputs and no permissions, and that every shared action is pinned to the same SHA with a # vX.Y.Z comment, as in Cloud Registry's tests. The check that no workflow uses a local action follows in ci: use the shared scan-image action #329, which drops the local scan-image action.
  • Docs: docs/development.md describes the shared gate and how its pins are bumped together, which Dependabot does.

Closes #330

Verification

  • pytest tests/test_workflows.py: 9 passed. Against the old ci.yml, 3 of them fail, so they were written first.
  • actionlint 1.7.12: passed. pre-commit run --all-files: passed. Locally, the actionlint hook ran as the standalone binary instead, because the hook's download was cut off.
  • mypy: passed. mkdocs build --strict: passed.
  • CI on this PR: all checks passed (CI passed, run with the shared gate action; Chart, Test, Lint, Docs, Smoke test, Scan image, CodeQL, Codecov, Read the Docs). Sourcery (after one nudge): one finding, answered (the prefix ends in @, so other actions cannot match) and resolved.
  • Reviews: adversarial and quality reviewer subagents (full lane, because the job's permissions change).
    • Adversarial reviewer: no findings. It ran the action's check.sh on edge cases: the allowed skip, an unexpected skip, a cancelled job, a failed job whose skip is allowed, and empty needs. All behaved as the old script did, or stricter.
    • Quality reviewer, fixed: the docs paragraph on the shared actions, a clearer comment on the gate, and a TODO for ci: use the shared scan-image action #329 in the pin test.

Declined review findings

  • Asserting the semantics of allow-skipped instead of the literal expression: the test pins the literal expression, as Cloud Registry's test does.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 2 commits October 30, 2026 18:38
Replace the jq script of the gate job (`passed`, "CI passed") with the
shared `gate` action of elixir-cloud-aai/.github v1.0.0, pinned to its
commit. `push` and `publish` may be skipped where `PUBLISH` is "false",
as before. The job keeps its name, condition and needs, so the required
check is unchanged; it now runs without token permissions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Document the shared gate action and how its pins are bumped, reword the
gate's comment, and mark the check for local actions that #329 adds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35530081 | 📁 Comparing 22d898e against latest (2b206e0)

  🔍 Preview build  

1 file changed
± development/index.html

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2b206e0) to head (22d898e).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #342   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         2195      2195           
=========================================
  Hits          2195      2195           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sourcery-ai

sourcery-ai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The PR migrates the required CI gate from a local jq script to the shared, pinned elixir-cloud-aai/.github gate action without changing its execution or skip semantics, restricts its permissions, and adds tests and documentation to enforce the shared-action pinning policy.

Flow diagram for the shared CI gate evaluation

flowchart TD
    Jobs[CI jobs in needs] --> Gate[Shared gate action]
    Gate --> Results{All results acceptable?}
    Results -->|success| Passed[CI passed]
    Results -->|skipped push or publish when PUBLISH is false| Passed
    Results -->|failure, cancelled, or unintended skip| Failed[Gate fails]
Loading

File-Level Changes

Change Details Files
Replace the CI gate’s inline jq result validation with the shared, commit-pinned gate action while preserving required-check behavior and skip rules.
  • Invoke the shared gate action with all job results serialized through needs.
  • Allow push and publish to be skipped only when PUBLISH is false.
  • Keep the job name, unconditional execution, dependency list, and add empty permissions.
.github/workflows/ci.yml
Add regression coverage for shared gate configuration and organization-wide action pin consistency.
  • Validate the gate action, inputs, and permissions from the parsed workflow.
  • Require shared action references to use one full commit SHA.
  • Require matching # vX.Y.Z release comments on every shared action pin.
tests/test_workflows.py
Document the shared gate action and coordinated pin-update policy.
  • Identify the gate as the only required CI check.
  • Document SHA-and-release-comment pinning and Dependabot-managed synchronized bumps.
docs/development.md

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@uniqueg
uniqueg marked this pull request as ready for review October 30, 2026 18:03
@uniqueg

uniqueg commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

@sourcery-ai review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tests/test_workflows.py" line_range="117" />
<code_context>
+    gate = _load(WORKFLOWS / "ci.yml")["jobs"][GATE]
+    assert gate["permissions"] == {}
+    (step,) = gate["steps"]
+    assert step["uses"].startswith("elixir-cloud-aai/.github/actions/gate@")
+    assert step["with"]["needs"] == "${{ toJSON(needs) }}"
+    assert step["with"]["allow-skipped"] == (
</code_context>
<issue_to_address>
**Wrong gate action passes validation**

When the workflow's action path is changed to another valid shared action whose name starts with `gate`, `test_gate_uses_shared_action` accepts any action path beginning with `elixir-cloud-aai/.github/actions/gate`, such as `gate-fallback`; the pin and release-comment tests also accept that name, so the tests pass while CI invokes a different action.

Assert the exact shared action path, allowing only the intended SHA ref after `gate@`.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and if the shared action handles job results or the skip allowlist incorrectly, the required CI check could pass despite a failed or unexpectedly skipped job, allowing code to merge without the intended checks. Reverting restores the inline gate, but it cannot undo a merge that already happened.

Blocking findings: tests/test_workflows.py:117


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread tests/test_workflows.py Resolved
@uniqueg
uniqueg merged commit eed105d into dev Oct 30, 2026
19 checks passed
@uniqueg
uniqueg deleted the ci/shared-gate-action branch October 30, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: use the shared CI gate action

1 participant