feat: add local plugin override workspace#49
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a “local plugin override workspace” feature to grounds-cli, enabling users to manage local plugin repos and selectively override plugin sources during grounds push (via generated resolved-plugin-source JSON for the Gradle push plugin).
Changes:
- Introduces a new
grounds workspacecommand group (scan/add/list/enable/doctor) backed by a persistedworkspace.yamlconfig. - Adds workspace scanning + resolution logic to map
grounds.yamlplugins to local artifacts (including variant support) and emits a JSON “plan” file. - Extends
grounds pushwith--local/--with-localflags and documents the workflow in the README.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents workspace scanning and push override workflow. |
| cmd/grounds/main.go | Registers the new top-level workspace command. |
| cmd/grounds/commands/workspace/workspace.go | Implements workspace management subcommands and config writes. |
| cmd/grounds/commands/workspace/workspace_test.go | Verifies workspace command structure and scan arg validation. |
| cmd/grounds/commands/push/push.go | Adds --local/--with-local to push and writes a resolved-plugins JSON file for Gradle. |
| cmd/grounds/commands/push/local_flags_test.go | Ensures the new push flags are defined. |
| internal/workspace/config.go | Adds workspace config model + load/save + variant resolution. |
| internal/workspace/config_test.go | Tests workspace config persistence and resolution behavior. |
| internal/workspace/scan.go | Scans root directories for candidate plugin repos and infers default build/artifact settings. |
| internal/workspace/scan_test.go | Tests workspace scanning behavior and variant detection. |
| internal/workspace/resolve.go | Resolves grounds.yaml plugin list into a “release vs local” plan with artifact hashing + git metadata. |
| internal/workspace/resolve_test.go | Tests resolution behavior for explicit/local overrides, variant selection, and artifact glob handling. |
Comments suppressed due to low confidence (1)
internal/workspace/resolve.go:178
- For mapping plugin entries, there’s no validation that
sourceis present/non-empty. Ifsourceis missing andidis omitted,inferIDFromSource(plugin.Source)will infer "." and the resolver will proceed with an invalid plugin. Consider rejecting mapping entries without asource(and rejecting empty/invalid inferred IDs) with an actionable error message.
var plugin struct {
ID string `yaml:"id"`
Variant string `yaml:"variant"`
Source string `yaml:"source"`
}
if err := node.Decode(&plugin); err != nil {
return nil, err
}
if plugin.ID == "" {
plugin.ID = inferIDFromSource(plugin.Source)
}
plugins = append(plugins, manifestPlugin{
ID: plugin.ID,
Variant: plugin.Variant,
Source: plugin.Source,
})
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2e05107 to
3d600f7
Compare
3d600f7 to
78bad8f
Compare
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.
Pull Request
Description
Adds local plugin override workspace support to the CLI. This introduces
grounds workspacemanagement commands, workspace scanning,grounds push --local/--with-local, resolved plugin source JSON generation for the Gradle push plugin, and README workflow examples.Type of Change
Related Issues
Testing
/home/lukas/.local/bin/pkgx +go.dev go test ./...Checklist