Skip to content

ci: gate release publication on smoke tests - #8955

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

ci: gate release publication on smoke tests#8955
atavism wants to merge 6 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 validation across selected platforms and Linux architectures.
    • Added safeguards to prevent incomplete or unverified packages from being published.
    • Improved Windows installer signing and Linux package upload handling.
    • Added preflight checks for tests, generated assets, dependencies, and service availability.
  • Reliability

    • Release steps now proceed only after successful validation and candidate checks.
    • Improved failure diagnostics and notifications for scheduled releases and successful publication.
    • Updated build caching for improved workflow maintenance.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 52535fb7-4b02-4d7c-afdc-9ca5c3d10dab

📥 Commits

Reviewing files that changed from the base of the PR and between a6b71cf and 2e5b2d5.

📒 Files selected for processing (3)
  • .github/workflows/build-linux.yml
  • .github/workflows/build-windows.yml
  • .github/workflows/release.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/build-windows.yml
  • .github/workflows/build-linux.yml
  • .github/workflows/release.yml

📝 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 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 after 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

Possibly related PRs

  • getlantern/lantern#8909: Related macOS CI workflow changes include macOS build configuration and integrated connect-smoke execution.
🚥 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 and concisely describes the main change: gating release publication on 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 thread .github/workflows/build-windows.yml Outdated
Comment thread .github/workflows/release.yml

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