feat: add registry CLI search and add - #493
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: ce4d4f5a-0d76-488c-abe3-40e386c431ac
There was a problem hiding this comment.
Pull request overview
This PR introduces an initial (“Phase 1”) registry workflow to help users discover shared artifacts and append remote grader preset references into an eval, while scaffolding configuration/schema support for registry index sources.
Changes:
- Add
waza registrycommand group withsearchandaddsubcommands (stubbed registry/resolution logic pending #15). - Add project config + JSON schema support for
registries:sources (including defaults) and extend schema parity/config tests. - Document the new commands across README, GUIDE, and the site CLI reference.
Show a summary per file
| File | Description |
|---|---|
| site/src/content/docs/reference/cli.mdx | Adds CLI reference docs for waza registry, including flags and examples. |
| schemas/config.schema.json | Adds registries config schema with default public source. |
| README.md | Documents registry commands and flags in the main README. |
| internal/projectconfig/schema_parity_test.go | Ensures schema defaults match Go defaults for registries. |
| internal/projectconfig/config.go | Adds Registries to project config defaults/merge/validation. |
| internal/projectconfig/config_test.go | Adds coverage for registries defaults and load behavior. |
| internal/config/registry.go | Introduces RegistrySource and default registry sources. |
| docs/GUIDE.md | Adds a guide section explaining registry presets and usage. |
| cmd/waza/root.go | Wires the new registry command into the CLI root. |
| cmd/waza/cmd_registry.go | Defines the waza registry command and help text. |
| cmd/waza/cmd_registry_test.go | Adds tests for command wiring, search output, add behavior, and program-grader confirmation. |
| cmd/waza/cmd_registry_search.go | Implements registry search (currently with stubbed catalog). |
| cmd/waza/cmd_registry_add.go | Implements registry add to update eval YAML + scaffold waza.lock. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 4
- Review effort level: Low
| tw := tabwriter.NewWriter(w, 0, 0, 2, ' ', 0) | ||
| fmt.Fprintln(tw, "REF\tKIND\tDESCRIPTION\tSTARS") //nolint:errcheck | ||
| for _, result := range results { | ||
| fmt.Fprintf(tw, "%s\t%s\t%s\t%d\n", result.Ref, result.Kind, result.Description, result.Stars) //nolint:errcheck | ||
| } | ||
| tw.Flush() //nolint:errcheck |
| return fmt.Errorf("%s field modules must be a list", lockPath) | ||
| } | ||
|
|
||
| modules.Content = append(modules.Content, registryLockEntry(resolved, trusted)) |
| key, value, ok := strings.Cut(raw, "=") | ||
| if !ok || strings.TrimSpace(key) == "" { | ||
| return nil, fmt.Errorf("invalid --set %q: expected key=value", raw) | ||
| } | ||
| setNestedValue(entry, strings.Split(strings.TrimSpace(key), "."), scalarNode(strings.TrimSpace(value))) | ||
| } |
| for i, registry := range cfg.Registries { | ||
| if strings.TrimSpace(registry.Name) == "" { | ||
| return fmt.Errorf("registries[%d].name must not be empty", i) | ||
| } | ||
| if strings.TrimSpace(registry.URL) == "" { | ||
| return fmt.Errorf("registries[%d].url must not be empty", i) | ||
| } | ||
| } |
|
High-signal review notes before merge:
I’m keeping this as the canonical #17 branch once (1) and (2) are addressed in-branch or via explicit dependency gating. |
|
Correction (formatting): High-signal review notes before merge:
Keeping this as the canonical #17 branch once (1) and (2) are addressed. |
Summary
waza registrywithsearchandaddsubcommands.registries:config defaults/schema for registry index sources.ref:grader entries toeval.yamland scaffoldwaza.lockentries pending resolver integration.Notes
Validation
go test ./...go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1 runNot run
cd site && npm run build— blocked becausenpm cicould not fetchplaywright-corefrom the configured package proxy/public registry in this environment (E404thenENOTCONN).