-
Notifications
You must be signed in to change notification settings - Fork 298
Description
Conformance Check Failure
Check ID: USE-001
Severity: LOW
Category: Usability
Problem Description
actions/setup/js/generate_git_patch.cjs contains at least one throw new Error(…) statement that does not include a standardized error code (format: E###). The Safe Outputs specification and the codebase convention require that all error paths use codes in the E001–E010 range (or defined ERROR_ / ERR_ constants) so that callers and operators can reliably identify and handle failure modes.
Without a standardized code, automated tooling and dashboards cannot distinguish this error from generic JavaScript exceptions, and users receive less actionable failure messages.
Affected Components
- File:
actions/setup/js/generate_git_patch.cjs - Location: The internal
throw new Error("No remote refs available for merge-base calculation")inside Strategy 1 (full mode) — this error bubbles up through the outercatchblock
Current Behavior
throw new Error("No remote refs available for merge-base calculation");No E### code is present anywhere in the file.
Expected Behavior
Error messages should include a standardized code. For example:
throw new Error("E005: No remote refs available for merge-base calculation");Or, using a constant:
const ERR_NO_REMOTE_REFS = "E005";
throw new Error(`\$\{ERR_NO_REMOTE_REFS}: No remote refs available for merge-base calculation`);The exact code number should be chosen consistently with the codes used in sibling handlers (consult error_helpers.cjs or the specification's error code registry if one exists).
Remediation Steps
This task can be assigned to a Copilot coding agent with the following steps:
- Identify all
throw new Error(…)andcore.setFailed(…)calls ingenerate_git_patch.cjsthat lack anE###prefix. - Assign an appropriate standardized error code from the E001–E010 range (or define a new one if no suitable code exists — check other handlers for the current usage mapping).
- Prefix each error message with the code, e.g.,
"E005: No remote refs available …". - Update or add unit tests that assert the error message contains the standardized code.
Verification
After remediation, verify the fix by running:
bash scripts/check-safe-outputs-conformance.shCheck USE-001 should pass without errors. Also verify manually:
grep -E "E[0-9]{3}|ERROR_|ERR_" actions/setup/js/generate_git_patch.cjsThis should return at least one matching line.
References
- Safe Outputs Specification:
docs/src/content/docs/reference/safe-outputs-specification.md - Conformance Checker:
scripts/check-safe-outputs-conformance.sh(lines 182–205) - Run ID: §22524821700
- Date: 2026-02-28
Generated by Daily Safe Outputs Conformance Checker
- expires on Mar 1, 2026, 4:54 PM UTC