Add SEC-006 conformance coverage for E009/E010 in safe-output processor paths - #47003
Conversation
PR Triage
WIP draft — no committed files yet. Copilot check in progress. Fixes E009/E010 error code references in processor handlers. Defer until CI and files land. Run §29809051050
|
|
@copilot apply changes |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds SEC-006 coverage for Safe Outputs error codes E009 and E010.
Changes:
- Extends the error-code catalog.
- Adds E009 to hash-verification failures.
- Adds E010 rate-limit exhaustion handling and tests.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/error_codes.cjs |
Defines E009/E010 constants. |
actions/setup/js/error_codes.test.cjs |
Tests new constants. |
actions/setup/js/check_workflow_timestamp_api.cjs |
Emits E009 for hash failures. |
actions/setup/js/check_workflow_timestamp_api.test.cjs |
Verifies E009 failures. |
actions/setup/js/error_recovery.cjs |
Classifies and reports exhausted rate limits. |
actions/setup/js/error_recovery.test.cjs |
Tests E010 retry behavior. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (2)
actions/setup/js/error_recovery.cjs:242
- This checks E010 only on the configured final attempt, not after the mandated third retry.
RATE_LIMIT_RETRY_CONFIG.maxRetriesis 5, so production callers using it make two extra attempts and emit E010 after five retries while the message still says three. Fail rate-limit errors whenattemptreaches 3 (or cap rate-limit retry budgets to 3) to satisfy the linked specification.
// E010 applies only when retry budget is at least 3 retries.
const hasEnoughRetriesForE010 = fullConfig.maxRetries >= 3;
if (hasEnoughRetriesForE010 && isRateLimitError(error)) {
actions/setup/js/error_recovery.cjs:249
- The E010 error omits the rate-limit reset time. Safe Outputs §9.5 requires E010 details to include
X-RateLimit-Reset, but the context passed here contains neither that header nor an equivalent timestamp, so downstream consumers cannot determine when the quota resets. Extract the response header and include it in the standardized error details.
throw enhanceError(error, {
operation: operationName,
attempt: attempt + 1,
maxRetries: fullConfig.maxRetries,
retryable: true,
code: `${SAFE_OUTPUT_E010} ${RATE_LIMIT_EXCEEDED}`,
suggestion: "RATE_LIMIT_EXCEEDED: GitHub API rate limit persisted after 3 retries.",
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Medium
| "rate limit", // GitHub API rate limiting | ||
| "secondary rate limit", // GitHub secondary rate limits | ||
| "abuse detection", // GitHub abuse detection | ||
| ...RATE_LIMIT_INDICATORS, // GitHub rate limiting signals (including HTTP 429 text) |
|
@copilot please run the Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "pi.dev"See Network Configuration for more information.
|
I've made the fix locally (commit Fix in // Status-based rate-limit detection handles cases where the message text is
// not descriptive enough (e.g. Octokit errors with status 429 and a generic
// "Request failed" message). Must be checked before the text patterns.
if (isRateLimitError(error)) {
return true;
}Tests added in
All 51 |
|
@copilot apply fix #47003 (comment) |
…add test coverage Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed in the latest commit. |
|
🎉 This pull request is included in a new release. Release: |
Safe Outputs spec v1.26.0 requires processor-visible catalog coverage for
E009 (CONFIG_HASH_MISMATCH)andE010 (RATE_LIMIT_EXCEEDED). The processor currently referencedE001–E008only, leaving hash-mismatch and rate-limit exhaustion paths without the standardized machine-readable codes expected by conformance checks and downstream consumers.Error catalog extension (
actions/setup/js/error_codes.cjs)SAFE_OUTPUT_E009/CONFIG_HASH_MISMATCHSAFE_OUTPUT_E010/RATE_LIMIT_EXCEEDEDE009 on config/hash verification failure (
check_workflow_timestamp_api.cjs)E009 CONFIG_HASH_MISMATCHin the failure message emitted viacore.setFailed(...).E010 on rate-limit retry exhaustion (
error_recovery.cjs)E010 RATE_LIMIT_EXCEEDEDthrough the standardized enhanced error path."Too Many Requests"so 429-text errors follow retry flow.Focused unit test updates
error_codes.test.cjs: validates export presence/value for E009/E010 + named codes.check_workflow_timestamp_api.test.cjs: asserts E009/CONFIG_HASH_MISMATCHis present on hash mismatch failure.error_recovery.test.cjs: covers E010 emission when 429 persists through 3 retries.Run: https://github.com/github/gh-aw/actions/runs/29816999996
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
pi.devSee Network Configuration for more information.