Repository navigation
Standardize safe-output handler error codes - #67131
Merged
Merged
Conversation
1 of 18 tasks
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Standardize E001-E010 error codes in work-queue handlers
Standardize safe-output handler error codes
Oct 9, 2026
Collaborator
|
@copilot Use constants |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Collaborator
|
@copilot resolve the merge conflicts on this branch. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Many failure sites remain untagged, and some newly assigned codes do not represent the actual failure category.
3 open findings
What changed in this PR
Adds standardized safe-output error-code prefixes to selected work-queue handler failures.
Changes:
- Adds and tests the shared
SAFE_OUTPUT_E002constant. - Applies E001/E002 prefixes to selected validation and limit failures.
- Applies E007 to a reconciler API failure.
| File | Description |
|---|---|
actions/setup/js/error_codes.cjs |
Adds and exports E002. |
actions/setup/js/error_codes.test.cjs |
Tests E002 export and value. |
actions/setup/js/finish_work_queue_claim.cjs |
Tags delivery-proof validation. |
actions/setup/js/report_failed_jobs.cjs |
Tags metadata parsing failure. |
actions/setup/js/safe_output_action_handler.cjs |
Tags Claim-factory guard. |
actions/setup/js/work_queue_binding.cjs |
Tags policy size limit. |
actions/setup/js/work_queue_claim_adapters.cjs |
Tags verifier validation. |
actions/setup/js/work_queue_code_coverage.cjs |
Tags missing Claim factory. |
actions/setup/js/work_queue_code_scanning.cjs |
Tags missing Claim factory. |
actions/setup/js/work_queue_control_adapter.cjs |
Tags credential validation. |
actions/setup/js/work_queue_dispatch.cjs |
Tags observer-role guard. |
actions/setup/js/work_queue_git_tree_adapter.cjs |
Tags adapter validation. |
actions/setup/js/work_queue_graphql_adapter.cjs |
Tags operation-name validation. |
actions/setup/js/work_queue_issues.cjs |
Tags issues configuration validation. |
actions/setup/js/work_queue_prepare_claim_script.cjs |
Tags path validation. |
actions/setup/js/work_queue_reconciler.cjs |
Tags API response failure. |
actions/setup/js/work_queue_rest_adapter.cjs |
Tags REST route validation. |
actions/setup/js/work_queue_upload_assets.cjs |
Tags missing Claim factory. |
actions/setup/js/write_work_queue_snapshot.cjs |
Tags observer-role guard. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| for (const [key, field] of Object.entries(value)) { | ||
| if (typeof field !== "string" || !field.trim() || field.includes("${{") || Buffer.byteLength(field) > 256 || /[\x00-\x1f\x7f]/.test(field)) throw queueError("projection_invalid", `${key} must be a nonblank bounded literal`); | ||
| if (typeof field !== "string" || !field.trim() || field.includes("${{") || Buffer.byteLength(field) > 256 || /[\x00-\x1f\x7f]/.test(field)) | ||
| throw queueError("projection_invalid", `${SAFE_OUTPUT_E001}: ${key} must be a nonblank bounded literal`); |
| function routeFields(route) { | ||
| if (typeof route !== "string" || !/^\/repos\/\{owner\}\/\{repo\}\/[A-Za-z0-9_{}./-]+$/.test(route) || route.includes("..") || route.includes("//")) throw new Error("Trusted REST adapter requires a fixed repository-relative route"); | ||
| if (typeof route !== "string" || !/^\/repos\/\{owner\}\/\{repo\}\/[A-Za-z0-9_{}./-]+$/.test(route) || route.includes("..") || route.includes("//")) | ||
| throw new Error(`${SAFE_OUTPUT_E001}: Trusted REST adapter requires a fixed repository-relative route`); |
| async function main(config = {}, suppliedClient) { | ||
| const factoryClaim = currentClaimHandle(); | ||
| if (!factoryClaim) throw new Error("Queue asset adapter requires an immutable Claim factory"); | ||
| if (!factoryClaim) throw new Error(`${SAFE_OUTPUT_E001}: Queue asset adapter requires an immutable Claim factory`); |
…ardize-error-codes # Conflicts: # actions/setup/js/finish_work_queue_claim.cjs # actions/setup/js/work_queue_code_scanning.cjs # actions/setup/js/work_queue_git_tree_adapter.cjs # actions/setup/js/work_queue_graphql_adapter.cjs # actions/setup/js/work_queue_rest_adapter.cjs # actions/setup/js/work_queue_upload_assets.cjs Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Merged |
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Seventeen production handlers were flagged for lacking standardized error codes. Add catalog prefixes to representative validation, limit, and API errors across those handlers.
E001.E002for limit violations andE007for API failures.