fix(registry): signer-workflow string format #4663#4666
Conversation
📝 WalkthroughWalkthroughThe PR updates JSON schema validation for GitHub artifact attestation signer workflow fields, replacing the generic Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@json-schema/registry.json`:
- Around line 268-272: The registry.json change appears to be a manual edit;
revert any manual edits to json-schema/registry.json and regenerate the file
from source using the project's generator: run the command `cmdx js` (per
json-schema/README.md / invopop/jsonschema flow) to produce an updated
registry.json, verify the generated file includes the intended pattern change
and that no other diffs remain, then commit the regenerated file instead of
manual edits to ensure the schema stays auto-generated.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 088ef278-75a0-4460-aa31-25221dab519c
📒 Files selected for processing (2)
json-schema/registry.jsonpkg/config/registry/github_cli.go
| "pattern": "^([^/]+/)?[^/]+/[^/]+/.+$" | ||
| }, | ||
| "signer-workflow": { | ||
| "type": "string", | ||
| "format": "regex" | ||
| "pattern": "^([^/]+/)?[^/]+/[^/]+/.+$" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether schema generation would introduce additional diffs.
# Expected: no diff if generated schema is up to date.
cmdx js
git diff -- json-schema/registry.jsonRepository: aquaproj/aqua
Length of output: 99
🏁 Script executed:
find . -type f -name "*.md" | head -20 | xargs grep -l "cmdx\|schema" | head -5Repository: aquaproj/aqua
Length of output: 130
🏁 Script executed:
ls -la json-schema/ && head -50 json-schema/registry.jsonRepository: aquaproj/aqua
Length of output: 1577
🏁 Script executed:
git log --oneline --all -- json-schema/registry.json | head -10Repository: aquaproj/aqua
Length of output: 690
🏁 Script executed:
find . -type f \( -name "cmdx*" -o -name "*command*" -o -name "Makefile" -o -name "package.json" \) | head -20Repository: aquaproj/aqua
Length of output: 571
🏁 Script executed:
cat cmdx.yaml | grep -A 20 "js:"Repository: aquaproj/aqua
Length of output: 39
🏁 Script executed:
git show df5b515 --statRepository: aquaproj/aqua
Length of output: 43490
🏁 Script executed:
git show df5b515 | head -100Repository: aquaproj/aqua
Length of output: 3131
🏁 Script executed:
cat json-schema/README.mdRepository: aquaproj/aqua
Length of output: 679
🏁 Script executed:
sed -n '265,275p' json-schema/registry.jsonRepository: aquaproj/aqua
Length of output: 346
🏁 Script executed:
git diff HEAD~1 json-schema/registry.json | head -50Repository: aquaproj/aqua
Length of output: 243
Verify that the JSON schema was regenerated before committing.
The json-schema/registry.json file must be generated using cmdx js, not edited manually. Per the project's json-schema/README.md: "Don't edit these files manually." These files are auto-generated from source code via invopop/jsonschema and should never contain manual edits.
Before committing, run cmdx js to regenerate the schema from the source code and verify no additional diffs are introduced.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@json-schema/registry.json` around lines 268 - 272, The registry.json change
appears to be a manual edit; revert any manual edits to
json-schema/registry.json and regenerate the file from source using the
project's generator: run the command `cmdx js` (per json-schema/README.md /
invopop/jsonschema flow) to produce an updated registry.json, verify the
generated file includes the intended pattern change and that no other diffs
remain, then commit the regenerated file instead of manual edits to ensure the
schema stays auto-generated.
|
Thank you for the contribution! |
Check List
Require signed commits, so all commits must be signedOverview
Fix the format validation for
signer-workflowandsigner_workflowfields inGitHubArtifactAttestations.Problem
The
signer-workflow/signer_workflowfields were using"format": "regex"in the JSON schema (andjsonschema:"format=regex"in Go struct tags), which incorrectly validates the value as a regular expression. These fields are not regex patterns — they represent a GitHub Actions workflow reference.According to the GitHub CLI documentation, the expected format for
--signer-workflowis:For example:
Changes
json-schema/registry.json: Replaced"format": "regex"with"pattern": "^([^/]+/)?[^/]+/[^/]+/.+$"for bothsigner_workflowandsigner-workflow.pkg/config/registry/github_cli.go: Replacedjsonschema:"format=regex"withjsonschema:"pattern=^([^/]+/)?[^/]+/[^/]+/.+$"in struct tags.Pattern explanation
^([^/]+/)?[^/]+/[^/]+/.+$([^/]+/)?github.com/)[^/]+/<owner>/[^/]+/<repo>/.+<path>/<to>/<workflow>(at least one path segment)Summary by CodeRabbit