Repository navigation
fix(submit): report failure when registry rejects submission - #70
Conversation
When `submitSkillsToRegistry` returns failed submissions (e.g. HTTP 429 non-JSON response from the registry), the JSON output incorrectly reported `success: true` with `exit_code: 0`. Automation relying on these signals would incorrectly treat the submission as successful. - Set `jsonOutput.success = false` when any submission lands in `failed[]` - Exit with `EXIT_CODES.NETWORK_ERROR` (3) in both JSON and TTY modes when the registry rejects the submission - Add `submit.test.ts` covering argument validation and the JSON failure contract Fixes #68 https://claude.ai/code/session_01CogjFAAGo379Vv3dPLPkzP
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06039a0602
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const { stdout, exitCode } = invokeCli([ | ||
| '--json', | ||
| 'submit', | ||
| 'skillfish-test-nonexistent-owner-xyz/nonexistent-repo-xyz', | ||
| '--yes', | ||
| ]); |
There was a problem hiding this comment.
Avoid live GitHub calls in submit tests
This test invokes the real CLI with a syntactically valid repo, so it proceeds into discovery and hits GitHub (fetchDefaultBranch calls https://api.github.com/repos/...). In CI runs without network, behind a proxy, or when GitHub rate-limits the runner, the test can fail or time out even though the JSON failure contract is unchanged; mock the discovery/registry path instead of depending on a live nonexistent repository.
Useful? React with 👍 / 👎.
|
The concern is valid, but the existing test infrastructure ( Generated by Claude Code |
|
Thanks — this covers the failure semantics I hit in #68 from the reporter side. I checked this branch locally and the important behavior is now aligned with what agents/CI need: JSON mode does not report a failed submission as Validation I ran on
I’m going to close my duplicate PR #69 so review can converge here. |
Summary
Fixes #68
When
submitSkillsToRegistryreturns failed submissions (e.g. HTTP 429 non-JSON from the registry), the JSON output incorrectly reportedsuccess: truewithexit_code: 0. Automation relying on these signals would silently miss failed submissions.Root cause (
src/commands/submit.ts): theelsebranch that pushes tofailed[]never setjsonOutput.success = false, and the JSON exit always calledoutputJsonAndExit(EXIT_CODES.SUCCESS)unconditionally.Changes:
jsonOutput.success = falsewhen any submission lands infailed[]EXIT_CODES.NETWORK_ERROR(3) in both JSON and TTY modes when the registry rejects the submissionsrc/__tests__/submit.test.tscovering argument validation and the JSON failure contractBefore:
{ "success": true, "failed": [{ "skill": "...", "reason": "Registry returned non-JSON response (HTTP 429): ..." }], "exit_code": 0 }After:
{ "success": false, "failed": [{ "skill": "...", "reason": "Registry returned non-JSON response (HTTP 429): ..." }], "exit_code": 3 }Test plan
submit.test.tstests passsuccess: false+ non-zeroexit_codefor invalid args in JSON modehttps://claude.ai/code/session_01CogjFAAGo379Vv3dPLPkzP
Generated by Claude Code