Skip to content

ci: keep release please PRs green#450

Merged
hiqiancheng merged 2 commits into
mainfrom
fix/release-pr-449-ci
Jun 9, 2026
Merged

ci: keep release please PRs green#450
hiqiancheng merged 2 commits into
mainfrom
fix/release-pr-449-ci

Conversation

@hiqiancheng

Copy link
Copy Markdown
Collaborator

Summary

Fixes the two release automation failure modes seen on #449:

  • allow Release Please generated PR bodies when the PR comes from the release-please branch
  • push Release Please formatting commits with --no-verify so Husky pre-commit hooks do not block automation-only metadata commits

Related issue or RFC

Related to #449.

AI assistance disclosure

AI assisted with CI log analysis, regression tests, and implementation.

Testing evidence

  • pnpm.cmd --dir apps/desktop exec vitest run --configLoader runner tests/ci/pr-template-check.test.js tests/ci/release-workflow-environments.test.ts
  • pnpm.cmd format:check
  • pnpm.cmd lint:check
  • pnpm.cmd type:check
  • pnpm.cmd test:typecheck

Risk notes

Low. Changes are limited to release/PR CI workflows and PR-template validation for Release Please branches.

Screenshots or recordings

N/A.

Checklist

  • Added regression tests for Release Please PR template handling.
  • Added workflow coverage for --no-verify release formatting commits.
  • Verified local CI-equivalent frontend checks.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fd975a12-a9d7-49d7-92c3-d141e10db560

📥 Commits

Reviewing files that changed from the base of the PR and between bf2adec and a83a8be.

📒 Files selected for processing (3)
  • .github/workflows/pr-template-check.yml
  • apps/desktop/scripts/ci/pr-template-check.js
  • apps/desktop/tests/ci/pr-template-check.test.js
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Frontend Quality
  • GitHub Check: Rust Checks
  • GitHub Check: Frontend Tests
  • GitHub Check: Desktop E2E Smoke (Windows)
  • GitHub Check: CodeQL (rust)
  • GitHub Check: CodeQL (javascript-typescript)
🔇 Additional comments (9)
apps/desktop/scripts/ci/pr-template-check.js (5)

17-19: LGTM!


21-30: LGTM!


32-40: ✅ Past security issue resolved: Fork spoofing prevention implemented.

The provenance check at lines 34-36 now correctly prevents fork branches from bypassing PR template validation by ensuring headRepoFullName matches baseRepository. This fully addresses the spoofing vulnerability flagged in the previous review.


42-55: LGTM!


57-104: LGTM!

.github/workflows/pr-template-check.yml (1)

27-31: LGTM!

apps/desktop/tests/ci/pr-template-check.test.js (3)

12-26: LGTM!


28-79: LGTM!


81-93: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Improved PR template validation to recognize generated release PRs and normalize line endings.
    • Release workflow commit step now uses a no-verify commit for formatted release artifacts.
  • Tests
    • Added tests covering PR template validation and release-PR detection.
    • Updated workflow tests to verify the commit invocation and environment wiring.

Walkthrough

Validator now normalizes PR bodies and detects Release Please–generated release-branch PRs to skip template checks. The pr-template-check workflow passes PR head ref and head repo to the validator. Release-please commit uses --no-verify. Tests cover validator logic and workflow wiring.

Changes

Release Please PR Template Validation

Layer / File(s) Summary
Release Please detection and validator implementation
apps/desktop/scripts/ci/pr-template-check.js
Adds body normalization and Release Please detection helpers; validatePrTemplateBody(body, options = {}) may skip validation for genuine Release Please release-branch PRs and otherwise enforces required headers and the "## Related issue or RFC" section.
Workflow environment and release-please commit change
.github/workflows/pr-template-check.yml, .github/workflows/release-please.yml
Workflow exports PR_HEAD_REF and PR_HEAD_REPO_FULL_NAME to the validator; release-please workflow commit now uses git commit --no-verify -m "chore: format release please files".
Validator tests and workflow assertions
apps/desktop/tests/ci/pr-template-check.test.js, apps/desktop/tests/ci/release-workflow-environments.test.ts
Adds tests verifying Release Please PR acceptance on release branches, rejection on non-release or spoofed fork branches, and asserts the workflow wires PR_HEAD_REF/PR_HEAD_REPO_FULL_NAME and expects the --no-verify formatted-release commit.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TouchAI-org/TouchAI#438: Overlapping changes to the release-please workflow step that formats and commits Release Please–generated files.

Suggested labels

area:ci

Poem

🐰 I hop through CI with a curious cheer,
Release Please whispers and the rules disappear,
Head ref and repo pass along the trail,
Tests guard the path, so the checks don’t fail,
A tidy commit skips hooks — hop, hop, hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title follows conventional commit format and clearly describes the main change: fixing release automation by allowing Release Please PRs to pass template validation.
Description check ✅ Passed PR description covers all required sections: clear summary, related issue link, AI assistance disclosure, testing evidence, risk notes, and completed checklist items.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-pr-449-ci

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

@github-actions github-actions Bot added the area:ci CI, automation, or repository workflow changes label Jun 9, 2026

@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: 1

🤖 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 `@apps/desktop/scripts/ci/pr-template-check.js`:
- Around line 32-36: The Release-Please bypass in isReleasePleasePr (and the
other similar checks at the other occurrences) trusts only headRef and body,
which is spoofable; update isReleasePleasePr to also validate provenance by
requiring options.head?.repo?.full_name equals the trusted repository name (pass
that value from the workflow via env into options, e.g., github_repository) and
optionally check options.actor is a trusted bot; change the function to verify
options.headRef.startsWith(RELEASE_PLEASE_HEAD_PREFIX) &&
isReleasePleaseGeneratedBody(body) && options.head?.repo?.full_name ===
options.trustedRepo (and/or a trusted actor check), and wire the workflow env
values into options when invoking this function and the other occurrences at the
noted locations so only bona fide release-please PRs can bypass validation.
🪄 Autofix (Beta)

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 76617852-75f7-4689-b0d6-8093e3d100c5

📥 Commits

Reviewing files that changed from the base of the PR and between ee1f698 and bf2adec.

📒 Files selected for processing (5)
  • .github/workflows/pr-template-check.yml
  • .github/workflows/release-please.yml
  • apps/desktop/scripts/ci/pr-template-check.js
  • apps/desktop/tests/ci/pr-template-check.test.js
  • apps/desktop/tests/ci/release-workflow-environments.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: CodeQL (javascript-typescript)
  • GitHub Check: CodeQL (rust)
  • GitHub Check: Rust Checks
  • GitHub Check: Frontend Quality
  • GitHub Check: Frontend Tests
  • GitHub Check: Desktop E2E Smoke (Windows)
🔇 Additional comments (4)
.github/workflows/pr-template-check.yml (1)

29-30: LGTM!

.github/workflows/release-please.yml (1)

111-112: LGTM!

apps/desktop/tests/ci/pr-template-check.test.js (1)

29-35: LGTM!

Also applies to: 37-43, 45-66, 70-77

apps/desktop/tests/ci/release-workflow-environments.test.ts (1)

45-47: LGTM!

Comment thread apps/desktop/scripts/ci/pr-template-check.js
@hiqiancheng hiqiancheng added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit 4f38632 Jun 9, 2026
27 checks passed
@hiqiancheng hiqiancheng deleted the fix/release-pr-449-ci branch June 9, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, automation, or repository workflow changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant