Repository navigation
fix(check): keep --json output valid when a name or group does not resolve - #868
Merged
Merged
Conversation
…solve check <name> --json printed its warnings and the group expansion note on stdout before the JSON, so the output could not be parsed. When no name or group resolved it then printed an empty result and exited 0, while text mode exits 1, so a CI gate with a mistyped name passed. With --json, check now exits 1 with an error object when nothing resolves, lists skipped names in a warnings field when some do, and reports every other failure (bad flag combination, missing config) as the same error object. Text mode is unchanged.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
None. This is the second follow-up listed under "Not covered" in #865 and #867.
What and why
skillshare check <name> --jsoncould not be trusted as a CI gate:! nope: ...) was printed on stdout before the JSON object.check frontend --jsonprinted'frontend' is a group — expanding to ...before the JSON.✗ ...on stdout.With
--json,checknow:{"error": "no valid skills to check: <reasons>"}when nothing resolves;warningsarray when other names do resolve (the field is absent when there are none);errorobject.Text mode is unchanged.
check --jsonwithout names is unchanged, so the Herdr panel is not affected.Behavior changes to review
check <unknown> --json, or that read the plain-text error, will now see exit 1 and anerrorobject.warningsfield.Also updated: the Exit Status paragraph of
check.mdin English and four translations, and the built-in skill'schecksection.Checks
make checkin a devcontainer-image container on the worktree: exit 0.--exit-code, project mode), unknown group, a group of local skills only (positional and--group), a group name that expands, an unknown name beside a known one, an invalid flag combination, and a missing project config. Nine were run against the unfixed code and failed; the test for a group of local skills only was added after that run and has only been run with the fix.skillshare-code-reviewskill; its confirmed findings are fixed. The first version sent warnings to stderr; the review pointed at the structured-output contract inmain.go(nothing on stderr) and thewarningsfield other commands use.Not covered
check --group --json(a typo where--jsonis taken as the group name) runs in text mode and then appends an error object.check.mddescribeswarningsanderrorin prose and has no sample of them.Checklist
make check) — for code changes