Skip to content

feat: add local plugin override workspace#49

Merged
lusu007 merged 6 commits into
mainfrom
feat/local-plugin-overrides-cli
May 14, 2026
Merged

feat: add local plugin override workspace#49
lusu007 merged 6 commits into
mainfrom
feat/local-plugin-overrides-cli

Conversation

@lusu007
Copy link
Copy Markdown
Contributor

@lusu007 lusu007 commented May 14, 2026

Pull Request

Description

Adds local plugin override workspace support to the CLI. This introduces grounds workspace management 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

  • 🐛 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • ♻️ Refactoring
  • 📚 Documentation
  • 🔧 Chore

Related Issues

  • N/A

Testing

  • Unit tests pass: /home/lukas/.local/bin/pkgx +go.dev go test ./...
  • Manual testing completed
  • New tests added for new functionality

Checklist

  • I have performed a self-review of my own code
  • Tests have been added/updated and pass (if needed)
  • Documentation has been updated (if needed)

@lusu007 lusu007 marked this pull request as ready for review May 14, 2026 10:23
Copilot AI review requested due to automatic review settings May 14, 2026 10:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 workspace command group (scan/add/list/enable/doctor) backed by a persisted workspace.yaml config.
  • Adds workspace scanning + resolution logic to map grounds.yaml plugins to local artifacts (including variant support) and emits a JSON “plan” file.
  • Extends grounds push with --local / --with-local flags 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 source is present/non-empty. If source is missing and id is omitted, inferIDFromSource(plugin.Source) will infer "." and the resolver will proceed with an invalid plugin. Consider rejecting mapping entries without a source (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.

Comment thread cmd/grounds/commands/push/push.go Outdated
Comment thread README.md Outdated
Comment thread internal/workspace/resolve.go
Comment thread internal/workspace/resolve.go Outdated
Comment thread internal/workspace/resolve.go Outdated
Comment thread internal/workspace/resolve.go
Comment thread cmd/grounds/commands/workspace/workspace.go Outdated
Comment thread internal/workspace/config_test.go
Comment thread internal/workspace/resolve_test.go Outdated
Comment thread internal/workspace/resolve_test.go
@lusu007 lusu007 force-pushed the feat/local-plugin-overrides-cli branch from 2e05107 to 3d600f7 Compare May 14, 2026 11:04
@lusu007 lusu007 force-pushed the feat/local-plugin-overrides-cli branch from 3d600f7 to 78bad8f Compare May 14, 2026 11:09
@lusu007 lusu007 merged commit 50149b0 into main May 14, 2026
5 checks passed
@lusu007 lusu007 deleted the feat/local-plugin-overrides-cli branch May 14, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants