Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/66d5e5f5-dd7a-4218-8904-99986e1e68cd Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/66d5e5f5-dd7a-4218-8904-99986e1e68cd Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot rename to ignore-missing-branch |
There was a problem hiding this comment.
Pull request overview
Adds an opt-in mode for push-to-pull-request-branch to treat “PR branch missing/deleted” push failures as a skipped outcome (instead of failing the workflow), and enables it for design-decision-gate.
Changes:
- Introduces
ignore-missing-branch-failurein workflow YAML schema + Go compiler parsing, and emitsignore_missing_branch_failureinto the runtime handler config. - Updates the JS handler to detect missing-branch conditions across ls-remote/fetch/rev-parse paths and return
skipped: truewhen configured, with accompanying JS tests. - Enables the option in
.github/workflows/design-decision-gate.mdand recompiles the lock workflow.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/push_to_pull_request_branch.go | Adds config field and parsing for ignore-missing-branch-failure. |
| pkg/workflow/compiler_safe_outputs_handlers.go | Wires the parsed flag into handler-manager JSON config (ignore_missing_branch_failure). |
| pkg/parser/schemas/main_workflow_schema.json | Extends schema to allow ignore-missing-branch-failure under safe outputs config. |
| pkg/workflow/push_to_pull_request_branch_test.go | Adds compiler/lockfile regression test for the new config flag. |
| actions/setup/js/push_to_pull_request_branch.cjs | Implements opt-in missing-branch skip behavior and centralizes error matching. |
| actions/setup/js/push_to_pull_request_branch.test.cjs | Adds tests covering skip behavior for deleted/missing branches. |
| .github/workflows/design-decision-gate.md | Enables ignore-missing-branch-failure for the workflow. |
| .github/workflows/design-decision-gate.lock.yml | Updates compiled workflow config to include the new handler flag. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
actions/setup/js/push_to_pull_request_branch.cjs:538
- The
git rev-parse --verifyfailure path is skipped for any error whenignore_missing_branch_failureis enabled. That can hide unrelated failures (e.g., unexpected git errors) as a missing/deleted branch. Consider checking the error text withlooksLikeMissingRemoteBranchError(...)(or a tighter rev-parse-specific pattern set like "needed a single revision"/"unknown revision") before returningskipped: true; otherwise return the current hard failure.
const missingBranchError = MISSING_BRANCH_ERROR_TEMPLATE(branchName);
if (ignoreMissingBranchFailure) {
core.warning(`${missingBranchError} Skipping as configured by ignore-missing-branch-failure.`);
return { success: false, error: missingBranchError, skipped: true };
}
- Files reviewed: 8/8 changed files
- Comments generated: 1
| "did not match any file(s) known to git", | ||
| "unknown revision or path not in the working tree", | ||
| "fatal: couldn't find remote ref", | ||
| "exit code 128", |
There was a problem hiding this comment.
looksLikeMissingRemoteBranchError treats any error text containing "exit code 128" as a missing-branch signal. Exit code 128 is a generic git failure (auth, network, repo state, etc.), so with ignore_missing_branch_failure enabled this can incorrectly mark real failures as skipped. Remove this pattern (or replace it with more specific stderr substrings tied to missing refs) so only true missing-branch cases are skipped.
This issue also appears on line 534 of the same file.
| "exit code 128", |
🧪 Test Quality Sentinel ReportTest Quality Score: 90/100✅ Excellent test quality
Test Classification Details
Test Inflation NoteThe Go test file gained 37 lines against 8 new production lines in Language SupportTests analyzed:
JavaScript mocking note: Verdict
📖 Understanding Test ClassificationsDesign Tests (High Value) verify what the system does:
Implementation Tests (Low Value) verify how the system does it:
Goal: Shift toward tests that describe the system's behavioral contract — the promises it makes to its users and collaborators. References: §24635898531
|
design-decision-gatewas failing whenpush_to_pull_request_branchran after the target PR branch had been deleted. This change adds an opt-in mode to treat missing/deleted branch push failures as skipped instead of terminal, and enables it for that workflow.Safe-output behavior
ignore-missing-branch-failuretopush-to-pull-request-branch.skipped: trueinstead of a hard failure.ls-remote, fetch/rev-parse failure paths) for consistent handling.Compiler + schema wiring
safe-outputs.push-to-pull-request-branch.ignore-missing-branch-failureinmain_workflow_schema.json.ignore-missing-branch-failure.ignore_missing_branch_failure).Workflow enablement
.github/workflows/design-decision-gate.md:Maintainability adjustments