[WRONG BRANCH] fix(actions): reject spoofed issue-quality state - #232
[WRONG BRANCH] fix(actions): reject spoofed issue-quality state#232luvs01 wants to merge 1 commit into
Conversation
|
✅ Deterministic PR hygiene checks passed. |
📝 WalkthroughWalkthroughThe change centralizes canonical issue-quality comment detection, adds tests for accepted and rejected comment authors and markers, and updates workflow validation to use the shared predicate. ChangesIssue-quality comment canonicalization
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
⏳ DRAFT
What to do
Its title has been prefixed with |
There was a problem hiding this comment.
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 @.github/scripts/issue-quality.cjs:
- Line 107: Update the workflow’s comment detection and emission logic near
BOT_MARKER, STATE_RE, and isCanonicalIssueQualityComment to reuse the canonical
marker and state-prefix definitions owned by the exported predicate. Export the
shared constants or provide parse/format helpers, then remove the duplicate
workflow-local values so persisted state and maintainerOverride handling stay
consistent.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6d7803fd-c17f-4175-b508-fd0dbb736a73
📒 Files selected for processing (3)
.github/scripts/issue-quality.cjs.github/scripts/issue-quality.test.cjs.github/workflows/enforce-issue-quality.yml
| detectIssueKind, | ||
| validateIssue, | ||
| normalizeEquivalentBugEvidence, | ||
| isCanonicalIssueQualityComment, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win
Single-source the canonical comment format.
The exported predicate owns the marker and state-prefix constants, but the workflow still declares independent BOT_MARKER and STATE_RE values at Line 888 and Line 889. If the definitions diverge, the workflow can ignore its own persisted state, create duplicate comments, or miss maintainerOverride. Export the shared values or expose shared parse and format helpers for detection, parsing, and emission.
🤖 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/scripts/issue-quality.cjs at line 107, Update the workflow’s comment
detection and emission logic near BOT_MARKER, STATE_RE, and
isCanonicalIssueQualityComment to reuse the canonical marker and state-prefix
definitions owned by the exported predicate. Export the shared constants or
provide parse/format helpers, then remove the duplicate workflow-local values so
persisted state and maintainerOverride handling stay consistent.
Motivation
github-actions[bot]comments (for example translator bot comments) from spoofing the issue-quality hidden state and disabling automated closure via a forgedmaintainerOverridetag.Description
isCanonicalIssueQualityCommentin.github/scripts/issue-quality.cjsthat only accepts agithub-actions[bot]comment whose body begins with the issue-quality marker and the state tag..github/workflows/enforce-issue-quality.ymlto import and use the new predicate when choosing which comment to parse for saved state..github/scripts/issue-quality.test.cjscovering the canonical comment case, a spoofed translator-bot comment, and a matching comment authored by a non-bot user.Testing
node --test .github/scripts/issue-quality.test.cjswhich executed the suite containing the new tests and reported all tests passing (115 tests passed).git diff --checkand local checks for whitespace/parse errors which returned clean results.bun run prepush) partially; repository typecheck, GUI lint, and many tests ran, but the full prepush run encountered unrelated long-running test/timeouts in other suites and was stopped after those failures (these failures are not related to the issue-quality change).Codex Task
Summary by CodeRabbit
Bug Fixes
Tests