Skip to content

ci: gate release publication on smoke tests - #8955

Open
atavism wants to merge 4 commits into
mainfrom
atavism/ci-updates
Open

ci: gate release publication on smoke tests#8955
atavism wants to merge 4 commits into
mainfrom
atavism/ci-updates

Conversation

@atavism

@atavism atavism commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Adds release preflight checks and requires every requested platform to build and pass its smoke tests before publishing artifacts

Summary by CodeRabbit

  • Release Improvements

    • Strengthened release validation across requested platforms and Linux architectures.
    • Added safeguards to prevent incomplete or unverified packages from being published.
    • Improved Windows installer signing and artifact availability during builds.
    • Linux packages are now uploaded promptly after verification.
  • Reliability

    • Added pre-release checks for tests, service availability, generated assets, and build readiness.
    • Improved failure diagnostics and notifications for scheduled releases and successful publication.

Copilot AI lite review requested due to automatic review settings August 6, 2026 12:48
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Release workflows now validate platform selections, run preflight checks, require complete candidate results, and gate publication. Build workflows adjust package uploads, installer signing, artifact handling, and Go cache usage.

Changes

Release and build workflow updates

Layer / File(s) Summary
Release input and preflight validation
.github/workflows/release.yml
Platform selections are validated and normalized. Preflight checks now cover workflow syntax, staging availability, Go dependencies, Flutter generation, and tests before approval and candidate builds.
Candidate gating and artifact verification
.github/workflows/release.yml
The nightly gate requires all requested candidates and validates every requested platform and Linux architecture artifact before publication.
Release publication and reporting
.github/workflows/release.yml
Store uploads, metadata updates, finalization, cleanup, and Slack notifications now use nightly-gate results.
Package artifact and signing workflow changes
.github/workflows/build-linux.yml, .github/workflows/build-windows.yml, .github/workflows/go.yml
Linux packages upload before verification. Windows installers sign before smoke tests and upload with warning-based missing-file handling. The Go cache action updates to version 4.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow
  participant Preflight
  participant CandidateBuilds
  participant NightlyGate
  participant ArtifactVerification
  participant Publication
  ReleaseWorkflow->>Preflight: run validation and tests
  Preflight->>CandidateBuilds: permit requested platform builds
  CandidateBuilds->>NightlyGate: report build results
  NightlyGate->>ArtifactVerification: verify requested artifacts
  ArtifactVerification->>Publication: allow release publication
Loading

Suggested reviewers: copilot, jay-418, myleshorton

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: release publication is gated on CI smoke tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch atavism/ci-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/release.yml (1)

559-595: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Pin the created tag to the built commit.

release-create now runs after nightly-gate, so it executes hours after the builds start. gh release create receives no --target, so for generated tags (schedule and workflow_dispatch nightly runs, where RELEASE_TAG is not an existing git tag) it creates the tag from the default branch HEAD at that moment. Commits merged during the build window make the tag point at a commit that was never built, so release notes and update metadata describe the wrong source.

Pass the workflow commit as the target. For push tag events the tag already exists, and --target is ignored.

🐛 Proposed fix
           gh release create "$RELEASE_TAG" \
             --draft \
             $PRERELEASE_FLAG \
+            --target "$GITHUB_SHA" \
             --title "$TITLE" \
             --notes "Publication [in progress](${WORKFLOW_URL})..."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 559 - 595, Update the gh release
create invocation in the Create GitHub Release step to pass the workflow commit
SHA via --target, using the existing github context expression for the commit.
Keep the current tag, draft, prerelease, title, and notes behavior unchanged;
for existing push tags, the target should remain harmlessly ignored.
🧹 Nitpick comments (3)
.github/workflows/build-linux.yml (1)

187-207: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Fail the Linux job when a required package is missing.

.github/workflows/release.yml requires every requested DEB, RPM, and Arch package. actions/upload-artifact@v4 succeeds with a warning when no files are found, and its default is warn. (github.com) A missing RPM or Arch package can therefore leave build-linux successful until the later publication check. Set if-no-files-found: error on all three uploads.

Suggested change
       - name: Upload Linux RPM candidate
         uses: actions/upload-artifact@v4
         with:
           name: lantern-installer-rpm-${{ matrix.arch }}
           path: ${{ env.FULL_INSTALLER_NAME }}.rpm
+          if-no-files-found: error
           retention-days: 2

       - name: Upload Linux DEB candidate
         uses: actions/upload-artifact@v4
         with:
           name: lantern-installer-deb-${{ matrix.arch }}
           path: ${{ env.FULL_INSTALLER_NAME }}.deb
+          if-no-files-found: error
           retention-days: 2

       - name: Upload Linux Arch candidate
         uses: actions/upload-artifact@v4
         with:
           name: lantern-installer-pkg-${{ matrix.arch }}
           path: ${{ env.FULL_INSTALLER_NAME }}.pkg.tar.zst
+          if-no-files-found: error
           retention-days: 2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-linux.yml around lines 187 - 207, Update the three
Linux artifact upload steps—“Upload Linux RPM candidate,” “Upload Linux DEB
candidate,” and “Upload Linux Arch candidate”—to set actions/upload-artifact’s
if-no-files-found option to error, ensuring the build-linux job fails when any
required package file is missing.

Source: MCP tools

.github/workflows/release.yml (2)

413-417: 🔒 Security & Privacy | 🔵 Trivial | 💤 Low value

Consider restore-only or disabled Go cache in the release gate.

Static analysis flags cache poisoning here. The Actions cache is writable from other refs in the same repository, and this job gates release publication. go mod verify limits the impact, but a release preflight gains little from populating a shared cache. Set cache: false for this job, or restrict caching to trusted workflows.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 413 - 417, Update the “Set up Go”
step in the release gate to disable Go module caching by setting its cache
option to false, preventing this release preflight from populating or trusting a
shared writable cache.

Source: Linters/SAST tools


1327-1339: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Suppress the failure alert for cancelled runs.

The condition uses always() without a cancellation guard. When a maintainer cancels a scheduled nightly, every job result becomes cancelled, so the job posts a "Lantern nightly blocked" Slack alert for an intentional cancellation. Add !cancelled() if only real failures should page the team.

♻️ Proposed change
     if: |
       always() &&
+      !cancelled() &&
       github.event_name == 'schedule' &&
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 1327 - 1339, Update the
failure-alert condition surrounding the visible always() expression to include a
!cancelled() guard, so scheduled runs intentionally cancelled by a maintainer do
not post the “Lantern nightly blocked” Slack alert while genuine job failures
still trigger it.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-windows.yml:
- Around line 290-303: Update the “Sign installer” step to expose the version,
signing policy, organization ID, and project slug through step-level environment
variables, then pass those variables via $env: references to sign-windows.ps1.
Keep the existing FULL_INSTALLER_NAME and API token handling unchanged, and
remove direct GitHub expression interpolation from the PowerShell command
arguments.

In @.github/workflows/release.yml:
- Around line 379-382: Disable credential persistence on both checkout steps in
.github/workflows/release.yml: lines 379-382 for the preflight job and 1279-1282
for release-success-notify by setting persist-credentials to false; no other
workflow changes are needed.

---

Outside diff comments:
In @.github/workflows/release.yml:
- Around line 559-595: Update the gh release create invocation in the Create
GitHub Release step to pass the workflow commit SHA via --target, using the
existing github context expression for the commit. Keep the current tag, draft,
prerelease, title, and notes behavior unchanged; for existing push tags, the
target should remain harmlessly ignored.

---

Nitpick comments:
In @.github/workflows/build-linux.yml:
- Around line 187-207: Update the three Linux artifact upload steps—“Upload
Linux RPM candidate,” “Upload Linux DEB candidate,” and “Upload Linux Arch
candidate”—to set actions/upload-artifact’s if-no-files-found option to error,
ensuring the build-linux job fails when any required package file is missing.

In @.github/workflows/release.yml:
- Around line 413-417: Update the “Set up Go” step in the release gate to
disable Go module caching by setting its cache option to false, preventing this
release preflight from populating or trusting a shared writable cache.
- Around line 1327-1339: Update the failure-alert condition surrounding the
visible always() expression to include a !cancelled() guard, so scheduled runs
intentionally cancelled by a maintainer do not post the “Lantern nightly
blocked” Slack alert while genuine job failures still trigger it.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 29ebe60c-92d6-4a8e-bab7-d5cc3dbbeeec

📥 Commits

Reviewing files that changed from the base of the PR and between 92fa744 and a6b71cf.

📒 Files selected for processing (4)
  • .github/workflows/build-linux.yml
  • .github/workflows/build-windows.yml
  • .github/workflows/go.yml
  • .github/workflows/release.yml

Comment on lines +290 to +303
- name: Sign installer
if: ${{ !inputs.skip_signing }}
shell: pwsh
env:
SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }}
FULL_INSTALLER_NAME: ${{ inputs.installer_base_name }}${{ inputs.build_type != 'production' && format('-{0}', inputs.build_type) || '' }}
run: |
./scripts/ci/sign-windows.ps1 `
-FilePath "$env:FULL_INSTALLER_NAME.exe" `
-SigningPolicy "${{ env.SIGNPATH_SIGNING_POLICY }}" `
-OrganizationId "${{ vars.SIGNPATH_ORG_ID }}" `
-ProjectSlug "${{ vars.SIGNPATH_PROJECT_SLUG }}" `
-ApiToken $env:SIGNPATH_API_TOKEN `
-Description "Installer - GitHub Actions build ${{ inputs.version }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 8 'workflow_dispatch|workflow_call|inputs:|version:|SIGNPATH_' .github/workflows || true
rg -n -C 8 'sign-windows\.ps1|SIGNPATH_API_TOKEN' .github scripts || true

Repository: getlantern/lantern

Length of output: 50374


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== build-windows workflow trigger/calls =="
sed -n '1,120p' .github/workflows/build-windows.yml

echo
echo "== build-windows release call and installer sign step =="
sed -n '330,405p' .github/workflows/release.yml
sed -n '286,305p' .github/workflows/build-windows.yml

echo
echo "== scripts/ci/sign-windows.ps1 outline and sign step =="
ast-grep outline scripts/ci/sign-windows.ps1 || true
sed -n '1,260p' scripts/ci/sign-windows.ps1

echo
echo "== workflow call inputs passed to build-windows from release.yml =="
rg -n -C 5 '\.github/workflows/build-windows\.yml|use: \.github/workflows/build-windows|inputs:|version:|installer_base_name:|skip_signing:|SIGNPATH' .github/workflows/release.yml .github/workflows/build-windows.yml .github/workflows/app-smoke-tests.yml

Repository: getlantern/lantern

Length of output: 38000


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== release.yml set-metadata version/build_type logic =="
sed -n '120,200p' .github/workflows/release.yml

echo
echo "== release.yml build-windows call inputs =="
sed -n '486,507p' .github/workflows/release.yml

echo
echo "== all callers of build-windows with signing/signing-related inputs =="
rg -n -C 3 '\.github/workflows/build-windows\.yml|with:|skip_signing:|sign_windows:' .github/workflows/release.yml .github/workflows/app-smoke-tests.yml .github/workflows/build-windows.yml

echo
echo "== GitHub variable secrets declarations =="
rg -n 'SIGNPATH_ORG_ID|SIGNPATH_PROJECT_SLUG|SIGNPATH_SIGNING_POLICY_SLUG|SIGNPATH_API_TOKEN' .github/workflows/release.yml .github/workflows/build-windows.yml

Repository: getlantern/lantern

Length of output: 27220


Keep release values out of PowerShell source.

Interpolating release metadata directly into a PowerShell command risks syntax escaping or injection. Set per-step environment variables for the signing call values, then reference them as $env:... in the sign-windows.ps1 arguments.

🧰 Tools
🪛 zizmor (1.29.0)

[warning] 299-299: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[info] 300-300: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[info] 301-301: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[error] 303-303: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-windows.yml around lines 290 - 303, Update the “Sign
installer” step to expose the version, signing policy, organization ID, and
project slug through step-level environment variables, then pass those variables
via $env: references to sign-windows.ps1. Keep the existing FULL_INSTALLER_NAME
and API token handling unchanged, and remove direct GitHub expression
interpolation from the PowerShell command arguments.

Source: Linters/SAST tools

Comment on lines +379 to +382
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

Two new jobs persist the job token in .git/config. Both new checkouts omit persist-credentials: false, and neither job pushes to the repository, so the token stays available to later steps and third-party actions without need.

  • .github/workflows/release.yml#L379-L382: add persist-credentials: false to the preflight checkout, which is followed by make gen, flutter test, and third-party actions.
  • .github/workflows/release.yml#L1279-L1282: add persist-credentials: false to the release-success-notify checkout, which only runs ./scripts/ci/format.sh slack.
🧰 Tools
🪛 zizmor (1.29.0)

[warning] 379-382: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

📍 Affects 1 file
  • .github/workflows/release.yml#L379-L382 (this comment)
  • .github/workflows/release.yml#L1279-L1282
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/release.yml around lines 379 - 382, Disable credential
persistence on both checkout steps in .github/workflows/release.yml: lines
379-382 for the preflight job and 1279-1282 for release-success-notify by
setting persist-credentials to false; no other workflow changes are needed.

Source: Linters/SAST tools

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens the release pipeline by adding a preflight job and a “candidate gate” that blocks publication unless all requested platform builds (and their smoke suites) succeed.

Changes:

  • Adds a preflight job to validate workflows, verify Go deps, and run Flutter unit/widget tests before any candidate builds proceed.
  • Introduces a nightly-gate job that enforces all-or-nothing success for the requested platform candidates before any publishing steps run.
  • Ensures candidate artifacts are verified before S3 publication, and adjusts Windows/Linux artifact upload/signing ordering to support the new gating flow.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
.github/workflows/release.yml Adds preflight + candidate gating and wires publication/release jobs to require gate success; validates candidate artifact completeness before publish.
.github/workflows/go.yml Updates Go CI caching action from actions/cache@v3 to @v4.
.github/workflows/build-windows.yml Moves installer signing earlier and uploads the installer artifact even on failure (warning if missing).
.github/workflows/build-linux.yml Uploads Linux candidate artifacts earlier (after package verification) to preserve them even if later smoke steps fail.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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