Skip to content

fix(ci): load assignment helper from trusted workflow revision - #1976

Merged
dnlrsls merged 1 commit into
Gentleman-Programming:mainfrom
dnlrsls:fix/issue-auto-assign-workflow-revision
Oct 21, 2026
Merged

dnlrsls merged 1 commit into
Gentleman-Programming:mainfrom
dnlrsls:fix/issue-auto-assign-workflow-revision

Conversation

@dnlrsls

@dnlrsls dnlrsls commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked Issue

Closes #1974

Lifecycle Evidence

  • Linked issue is approved and assigned to dnlrsls; current-main reproduction, root cause, design and non-goals are recorded there.
  • Independent security/CI verification completed: no concrete candidate-caused findings; separate public Node check passed 2/2.
  • Native high-risk review of 2ab47d3f..743f6ff6 approved across risk/readability/reliability; exact acknowledgement completed (lineage review-7135769c52adc998).
  • Existing PR fix(mcp): bind omitted session_id to the host Claude process #1954 remains unchanged; no merge or settings change is included.

🏷️ PR Type

  • type:bug — Bug fix
  • type:feature — New feature
  • type:question — Question requiring tracked work
  • type:docs — Documentation only
  • type:refactor — Code refactoring
  • type:chore — Maintenance
  • type:breaking-change — Breaking change

📝 Summary

  • Load the companion helper from the executing trusted pull_request_target workflow revision, not a PR's historical base that may predate it.
  • Add an old-base regression and require trusted workflow provenance while rejecting head/base checkout.
  • Preserve permissions, event types, action pins, credentials, sparse checkout, concurrency and all assignment semantics; align contributor wording.

📂 Changes

File Change
.github/workflows/issue-auto-assign.yml Select github.workflow_sha and clarify the checkout step name
.github/scripts/issue-auto-assign.test.mjs Old-base-without-helper regression and updated trusted-source contract
CONTRIBUTING.md Correct helper provenance and integration/live-proof limitations

🧪 Test Plan

  • Exact current remote main 2ab47d3f2dcf12596e400718e8c278529c0abb88: read-only immutable-tree reproduction exits 1 as expected; selected historical base lacks the helper although the trusted workflow revision contains it. Evidence in fix(ci): linked-issue assignment fails for PRs with older bases #1974.
  • RED: node --test --test-name-pattern=old-base .github/scripts/issue-auto-assign.test.mjs — exit 1, specifically missing helper in selected historical revision.
  • GREEN focused: node --test .github/scripts/issue-auto-assign.test.mjs — exit 0, 30/30 passed.
  • Affected issue helpers: node --test .github/scripts/issue-*.test.mjs — exit 0, 348/348 passed.
  • Legacy policy helpers: node --test .github/scripts/merge-queue.test.mjs .github/scripts/label-policy.test.mjs .github/scripts/transient-artifacts.test.mjs .github/scripts/pr-size-notice.test.mjs — exit 0, 40/40 passed.
  • git diff --check — passed; exactly three tracked paths, 35 additions/8 deletions.
  • Independent security/CI check: public Node runner with --test-reporter=tap --test-name-pattern='old-base|workflow trust' on .github/scripts/issue-auto-assign.test.mjs — 2/2 passed, exit 0, stderr empty.

No Go behavior changed; broad Go, E2E, plugin, lint and Windows coverage is delegated to hosted CI, not claimed from local Node checks. actionlint/zizmor were unavailable locally and were not installed.

🤖 Automated Checks

Pending at publication; the Checks tab for exact head 743f6ff6a4695969651ef78892ba2c132ad50b90 is the authoritative hosted result. Required contexts remain unchanged:

Check Status
Check Issue Reference Pending
Check Issue Has status:approved Pending
Check PR Has type:* Label Pending
Unit Tests Pending
E2E Tests Pending
Plugin Tests Pending
Lint / Policy Helper Tests / artifact and Windows checks Pending

✅ Contributor Checklist

  • Linked the approved, assigned canonical bug.
  • Applied exactly one type:* label (type:bug), confirmed by API after creation.
  • Recorded actual focused/affected tests and applicable additional checks, including expected RED and proof limitations.
  • Updated the affected documentation.
  • Conventional work-unit commit 743f6ff6a4695969651ef78892ba2c132ad50b90 with no Co-Authored-By trailer.
  • Reviewed all changed paths against the transient-artifact policy; ignored audit/tracking files are excluded.

💬 Notes for Reviewers

Risk: item 2 (trusted code provenance in an issues-write workflow); item 5 (CI). workflow_sha is appropriate because this existing event is pull_request_target, not a universal trust marker. No PR-head execution, fallback/bootstrap, helper implementation, assignment-policy, permission or required-check changes.

Local fixtures and hosted checks on this introducing PR do not prove old-base execution of its candidate trusted workflow. The correction becomes active only after trusted integration; a hosted old-base occurrence remains unproven. No #1954 rerun, assignment probe, merge or force push is included.

Summary by CodeRabbit

  • Bug Fixes

    • Updated automated issue assignment workflows to use the trusted workflow revision when retrieving helper code.
    • Prevented workflows from sourcing helper code from pull request or historical base revisions.
  • Documentation

    • Clarified trusted workflow behavior, revision handling, and testing limitations.
    • Documented that the correction applies after integration into the trusted branch.

Historical PR bases can predate the companion helper. Bind this existing pull_request_target checkout to its executing trusted workflow revision, retaining the original permissions and assignment policy.

Refs Gentleman-Programming#1974

Risk: item 2 (privileged workflow code provenance); item 5 (GitHub Actions).
@dnlrsls dnlrsls added the type:bug Bug fix label Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Gentleman-Programming/engram/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fd4d6746-118a-4e01-9fa9-e5750189e6cc
📥 Commits

Reviewing files that changed from the base of the PR and between 2ab47d3 and 743f6ff.

📒 Files selected for processing: 3
  • .github/scripts/issue-auto-assign.test.mjs
  • .github/workflows/issue-auto-assign.yml
  • CONTRIBUTING.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.

📝 Walkthrough

The workflow now checks out its issue-assignment helper from github.workflow_sha rather than the pull request base. Regression assertions cover missing helpers in historical bases and reject PR-head sourcing. Contributor documentation describes the source and local-test limits.

Changes: Trusted issue-assignment helper checkout

Layer / File(s) Summary
Select and verify the trusted helper revision
.github/workflows/issue-auto-assign.yml, .github/scripts/issue-auto-assign.test.mjs, CONTRIBUTING.md
The workflow checks out the helper from github.workflow_sha. Tests require that revision and reject base or PR-head references. Contributor documentation describes the executing workflow revision and the limitations of local tests.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • Gentleman-Programming/engram#1974 — The issue describes helper-loading failure for pull requests with older bases; this change selects the helper from github.workflow_sha and adds regression coverage for that case.

Suggested reviewers: gentleman-programming

Merge Risk: ⚪ Minimal · up to 743f6

The trusted helper provenance is correctly enforced in the changed workflow, with no established merge-blocking risk.

Pre-merge checks: Passed 4
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: loading the assignment helper from the trusted workflow revision.
Linked Issues check Passed Issue #1974 requires the existing pull_request_target assignment workflow to load its trusted helper when the historical PR base lacks that file, while preserving trust and assignment boundaries. Th…
Out of Scope Changes check Passed The diff contains only the workflow checkout-source correction, focused regression and contract assertions, and the affected contributor documentation. The tests support issue #1974. The documentation…
Full details: Linked Issues check

Explanation

Issue #1974 requires the existing pull_request_target assignment workflow to load its trusted helper when the historical PR base lacks that file, while preserving trust and assignment boundaries. The workflow now checks out .github/scripts/issue-auto-assign.mjs at ${{ github.workflow_sha }} and keeps sparse checkout, persist-credentials: false, pinned actions, permissions, event types, and assignment logic unchanged. The regression test models an absent old-base helper, verifies the workflow revision supplies it, and rejects PR-head selection. The trust test still rejects base/head checkout and preserves the executable boundary. The documentation update matches the approved provenance and proof limits.

Full details: Out of Scope Changes check

Explanation

The diff contains only the workflow checkout-source correction, focused regression and contract assertions, and the affected contributor documentation. The tests support issue #1974. The documentation explains the same trusted provenance and validation limits. No unrelated workflow, permission, settings, assignment-policy, PR #1954, merge, or production-assignment change is present.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@dnlrsls
dnlrsls added this pull request to the merge queue Oct 21, 2026
Merged via the queue into Gentleman-Programming:main with commit bf6f322 Oct 21, 2026
50 of 51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ci): linked-issue assignment fails for PRs with older bases

1 participant