Repository navigation
Honor soft-skipped targets in safe-output handlers - #66555
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused changes preserve hard failures, and both handlers have regression coverage with appropriate test contexts.
Review effort: Balanced
Findings: None
What changed in this PR
Updates two safe-output handlers to honor soft-skipped targets, addressing #66487 without changing hard-error behavior.
Changes:
- Return skipped results for soft target-resolution misses.
- Add regression coverage for soft skips and hard failures in both handlers.
| File | Description |
|---|---|
| actions/setup/js/submit_pr_review.test.cjs | Covers registry-mode soft skips and hard failures. |
| actions/setup/js/submit_pr_review.cjs | Honors soft skips in registry mode. |
| actions/setup/js/set_issue_type.test.cjs | Covers issue-target soft skips and hard failures. |
| actions/setup/js/set_issue_type.cjs | Propagates soft skips while preserving hard errors. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed for PR #66555: has_implementation_label=false and default_business_additions=0 (threshold 100, no custom .design-gate.yml). 4 files changed, none adding >100 lines in business logic directories.
|
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Verdict
No merge-blocking issues found in this soft-skip handling change.
Highlights
The new branches preserve hard failures while converting context-mismatch target resolution into explicit skipped results, and the added tests cover both the soft-skip and hard-error paths for each handler. I did not find a changed-line regression that would justify blocking the PR.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 30 AIC · ⌖ 5.31 AIC · ⊞ 19.6K
Comment /review to run again
There was a problem hiding this comment.
Impeccable review (bug_fix → harden, audit)
Reviewed the two handler changes (set_issue_type.cjs, submit_pr_review.cjs) against harden/audit criteria for error/edge-state handling.
Findings: None blocking.
- The new
shouldFail === false→{ success: false, skipped: true, ... }branches in both handlers exactly mirror the established soft-skip convention already used inadd_labels.cjs,remove_labels.cjs, andreplace_label.cjs. - Error strings asserted in the new tests (
"not running in issue context","not running in pull request context") match the actual messages produced byresolveTargetinsafe_output_helpers.cjs. - Downstream consumers (
safe_output_handler_manager.cjs,safe_output_manifest.cjs) already special-caseresult.skipped === true, so these results will correctly avoid being treated as workflow-failing errors. - Regression tests cover both the soft-skip path and the pre-existing hard-failure path (
target: "*"with no identifier) for each handler, so behavior for genuine errors is preserved.
No changes requested.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 36.4 AIC · ⌖ 13.1 AIC · ⊞ 8.1K
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /codebase-design — overall the fix is solid and well-tested; one gap flagged, no blocking issues.
📋 Key Themes & Highlights
Key Themes
- Consistency: The
shouldFail === falsesoft-skip pattern matches existing handlers (add_labels.cjs,remove_labels.cjs,replace_label.cjs), so this is a clean, idiomatic fix rather than a new abstraction. - Test coverage: Both
set_issue_type.cjsand the registry-mode path ofsubmit_pr_review.cjsget new regression tests distinguishing soft-skip vs. hard-failure — good/tdddiscipline (root cause addressed, not just the symptom). - Gap: The legacy-buffer path in
submit_pr_review.cjs(handleWithLegacyBuffer) wasn't updated or tested for the same soft-skip semantics — flagged inline.
Positive Highlights
- ✅ Clear separation between "hard" (
shouldFail: true) and "soft" (shouldFail: false) target-resolution failures, now honored where it was previously conflated. - ✅ New tests assert both outcomes (
skipped: truevs. a real failure withTarget is "*") for each handler touched. - ✅
core.warningused appropriately to surface the skip reason without failing the workflow run.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 113.7 AIC · ⌖ 14.7 AIC · ⊞ 10.1K
Comment /matt to run again
Comments that could not be inline-anchored
actions/setup/js/submit_pr_review.cjs:265
[/tdd] The legacy-buffer path (handleWithLegacyBuffer) wasn't updated to surface shouldFail === false as skipped: true the way the new registry path was. There's no regression test covering a soft-skip in legacy mode.
<details>
<summary>💡 Suggested follow-up</summary>
With target: "triggering" on a non-PR event (e.g. workflow_dispatch), the legacy path's targetResult.shouldFail check only logs a warning when shouldFail is true; when it's false (soft skip) it silently does…
actions/setup/js/set_issue_type.cjs:247
[/codebase-design] Good consistency: this mirrors the established shouldFail === false soft-skip pattern already used in add_labels.cjs, remove_labels.cjs, and replace_label.cjs. One small nit — set_issue_type.cjs and submit_pr_review.cjs both return { skipped: true, reason: ..., error: ... } with reason and error duplicating the same string, while other handlers (e.g. assign_to_agent.cjs, comment_memory.cjs) only set skipped: true without a reason field.
<details…
|
🎉 This pull request is included in a new release. Release: |
When a triggering target falls outside its supported context,
set_issue_typeand registry-modesubmit_pull_request_reviewtreated the soft skip as a hard failure.