Skip to content

chore: call the shared release workflow instead of this copy (ENG-9233) - #8

Merged
johnsca merged 1 commit into
mainfrom
johnsca/chore/ENG-9233/standardize-release
Oct 20, 2026
Merged

johnsca merged 1 commit into
mainfrom
johnsca/chore/ENG-9233/standardize-release

Conversation

@johnsca

@johnsca johnsca commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

ENG-9233

what

  • Replaces the release workflow with a dispatch caller for cut-release.yml in
    stacklet/github-tooling, pinned to a commit on
    that repository's main. The workflow there is this one, lifted.
  • Points both README examples at the Terraform Registry address rather than a
    GitHub URL with a tag ref, rewrites the Versioning section around version
    constraints, and updates the migration note to match.
  • The bump dropdown opens on (choose one) rather than defaulting to
    patch, matching fix: make the release dispatch ask which bump it wants (ENG-9233) github-tooling#5. A dispatch has to say which
    bump it wants.

why

  • This repository held the only copy of the workflow. The other five module
    repositories need it, and copying it five more times leaves six sets of the
    same guards to keep in step.
  • The guards are the part worth sharing, because a published release is
    immutable and a slip cannot be taken back.
  • The lifted copy is not identical. It takes bump as a string and rejects
    anything but patch, minor, or major, compares against the caller's default
    branch rather than the literal main, hardens the runner on the job that
    runs a third-party action, and claims the tag before publishing the release
    rather than letting gh release create make it. The PR on github-tooling
    covers each.

testing

  • just lint passes.
  • uvx zizmor@1.23.1 -v --gh-token=... .github/workflows/ reports no
    findings, with the five online audits scheduled rather than skipped.
  • The pin resolves to a commit via
    gh api repos/stacklet/github-tooling/commits/<sha>.
  • After merge, dispatch Release on main with dry run checked and confirm
    the summary reports v1.0.0 as previous and v1.0.1 as new. That shows
    the shared workflow reads this repository's tag history the way the copy
    it replaces did.
  • Publish the module to the registry, since the README now sends readers to
    an address that holds nothing yet.

docs

The README Versioning section drops the note about immutable tags and explains
version constraints instead, because the registry address is what callers now
set. The migration note no longer tells the reader to update a tag ref.

@johnsca
johnsca marked this pull request as ready for review October 20, 2026 17:25
@johnsca
johnsca requested a review from a team as a code owner October 20, 2026 17:25

@cubic-dev-ai cubic-dev-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.

All reported issues were addressed across 2 files

Architecture diagram
sequenceDiagram
    participant User as Release Engineer
    participant GHA as GitHub Actions
    participant Dispatch as Dispatch Caller Workflow (release.yml)
    participant SharedWF as Shared cut-release.yml (stacklet/github-tooling)
    participant GHAPI as GitHub API
    participant StepSecurity as Step Security API

    Note over User,SharedWF: NEW: Release flow now delegates to shared workflow
    
    User->>GHA: Dispatch release workflow with inputs (bump, dry_run)
    GHA->>Dispatch: Trigger workflow_dispatch
    Dispatch->>Dispatch: Enforce concurrency (one release at a time)
    Dispatch->>SharedWF: Call reusable workflow (pinned to commit 6fa4d7c)
    Dispatch-->>SharedWF: Pass inputs (bump, dry_run)
    Dispatch-->>SharedWF: Pass STEP_SECURITY_API_KEY secret

    alt Shared workflow version job
        SharedWF->>SharedWF: Read-only job (contents: read)
        SharedWF->>SharedWF: Validate bump input (patch|minor|major)
        SharedWF->>GHAPI: Checkout repo (fetch-depth: 0)
        GHAPI-->>SharedWF: Tag history
        SharedWF->>SharedWF: Derive next version from tags
        SharedWF->>SharedWF: Calculate new tag & changelog
        SharedWF-->>GHA: Output new_tag + changelog
    end

    Note over SharedWF,StepSecurity: Publish job (contents: write)
    alt Not dry run AND previous job succeeded
        SharedWF->>SharedWF: Verify first release is major (if no tags)
        SharedWF->>SharedWF: Enforce main branch (caller's default branch)
        SharedWF->>SharedWF: Refuse re-runs (run_attempt check)
        SharedWF->>StepSecurity: Run third-party release helper
        Note over SharedWF,StepSecurity: API key passed from caller
        
        alt Dry run enabled
            SharedWF-->>GHA: Report dry-run summary only
        else Publishing release
            SharedWF->>SharedWF: Claim tag before release
            SharedWF->>GHAPI: Check tag doesn't exist (matching-refs)
            alt Tag already exists
                SharedWF-->>GHA: Fail closed - refuse to overwrite
            else Tag available
                SharedWF->>SharedWF: Create release via gh CLI
                SharedWF-->>GHA: Release published with new tag
            end
        end
    else Dry run
        SharedWF-->>GHA: Skip publish job entirely
    end

    GHA-->>User: Report workflow completion status
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread README.md Resolved
@johnsca
johnsca force-pushed the johnsca/chore/ENG-9233/standardize-release branch from 8b1bc41 to d399b3e Compare October 20, 2026 19:07

@cubic-dev-ai cubic-dev-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.

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/release.yml Resolved
@johnsca
johnsca force-pushed the johnsca/chore/ENG-9233/standardize-release branch 2 times, most recently from a838700 to 4909f8c Compare October 20, 2026 19:53
[ENG-9233](https://stacklet.atlassian.net/browse/ENG-9233)

What
----

- Replaces the release workflow with a dispatch caller for `cut-release.yml` in
  `stacklet/github-tooling`, pinned to a commit on
  that repository's main. The workflow there is this one, lifted.
- Points both README examples at the Terraform Registry address rather than a
  GitHub URL with a tag ref, rewrites the Versioning section around `version`
  constraints, and updates the migration note to match.
- The `bump` dropdown opens on `(choose one)` rather than defaulting to
  `patch`, matching stacklet/github-tooling#5. A dispatch has to say which
  bump it wants.

Why
----

- This repository held the only copy of the workflow. The other five module
  repositories need it, and copying it five more times leaves six sets of the
  same guards to keep in step.
- The guards are the part worth sharing, because a published release is
  immutable and a slip cannot be taken back.
- The lifted copy is not identical. It takes `bump` as a string and rejects
  anything but patch, minor, or major, compares against the caller's default
  branch rather than the literal `main`, hardens the runner on the job that
  runs a third-party action, and claims the tag before publishing the release
  rather than letting `gh release create` make it. The PR on `github-tooling`
  covers each.

Testing
----

- [x] `just lint` passes.
- [x] `uvx zizmor@1.23.1 -v --gh-token=... .github/workflows/` reports no
      findings, with the five online audits scheduled rather than skipped.
- [x] The pin resolves to a commit via
      `gh api repos/stacklet/github-tooling/commits/<sha>`.
- [ ] After merge, dispatch Release on `main` with dry run checked and confirm
      the summary reports `v1.0.0` as previous and `v1.0.1` as new. That shows
      the shared workflow reads this repository's tag history the way the copy
      it replaces did.
- [ ] Publish the module to the registry, since the README now sends readers to
      an address that holds nothing yet.

Docs
----

The README Versioning section drops the note about immutable tags and explains
`version` constraints instead, because the registry address is what callers now
set. The migration note no longer tells the reader to update a tag ref.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@johnsca
johnsca force-pushed the johnsca/chore/ENG-9233/standardize-release branch from 4909f8c to 5d4bb28 Compare October 20, 2026 20:18

@jtroup jtroup 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.

Thanks @johnsca

@johnsca
johnsca merged commit 18f6d7c into main Oct 20, 2026
10 checks passed
@johnsca
johnsca deleted the johnsca/chore/ENG-9233/standardize-release branch October 20, 2026 21:04
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.

2 participants