Skip to content

Commit cafb027

Browse files
committed
fix: address review feedback on binary rename
## What Added explicit `binary: pvtr` to GoReleaser builds config so the archive contains the correctly named binary. Changed the plugin discovery filter from substring match to exact match so pvtr-* plugins like pvtr-github-repo-scanner remain discoverable. Reverted the README project structure directory name back to privateer/ since the repo is not being renamed. ## Why Copilot review correctly identified that GoReleaser would default the binary name to the module name (privateer), causing Homebrew install to fail. The substring filter would have hidden all pvtr-prefixed plugins from env output. ## Notes - The plugin filter now uses exact name matching (name == "pvtr" || name == "privateer") instead of strings.Contains - project_name remains privateer (archive naming unchanged), only the binary inside the archive is renamed to pvtr Signed-off-by: jmeridth <jmeridth@gmail.com>
1 parent e257865 commit cafb027

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

.goreleaser.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ before:
1313
- go mod tidy
1414

1515
builds:
16-
- env:
16+
- binary: pvtr
17+
env:
1718
- CGO_ENABLED=0
1819
goos:
1920
- linux

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ make testcov
9191
### Project Structure
9292

9393
```bash
94-
pvtr/
94+
privateer/
9595
├── cmd/ # CLI commands (run, list, generate-plugin, etc.)
9696
├── test/ # Test data and fixtures
9797
├── build/ # Build scripts and CI configurations

cmd/env.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func discoverPluginNames(pluginsDir string) string {
5858
var names []string
5959
for _, p := range pluginPaths {
6060
name := filepath.Base(p)
61-
if strings.Contains(name, "pvtr") || strings.Contains(name, "privateer") {
61+
if name == "pvtr" || name == "privateer" {
6262
continue
6363
}
6464
names = append(names, name)

cmd/env_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,21 @@ func TestDiscoverPluginNames_FiltersPvtrAndPrivateer(t *testing.T) {
120120

121121
result := discoverPluginNames(tmpDir)
122122

123-
if strings.Contains(result, "pvtr") {
124-
t.Errorf("expected pvtr binaries to be filtered out, got: %s", result)
123+
// Exact-name binaries should be filtered out
124+
for _, filtered := range []string{"pvtr", "privateer"} {
125+
// Check the result doesn't contain the exact name as a standalone entry
126+
for _, entry := range strings.Split(result, ", ") {
127+
if entry == filtered {
128+
t.Errorf("expected %q to be filtered out, got: %s", filtered, result)
129+
}
130+
}
131+
}
132+
// Prefixed plugin names should still be discoverable
133+
if !strings.Contains(result, "pvtr-foo") {
134+
t.Errorf("expected 'pvtr-foo' in result, got: %s", result)
125135
}
126-
if strings.Contains(result, "privateer") {
127-
t.Errorf("expected privateer binaries to be filtered out, got: %s", result)
136+
if !strings.Contains(result, "privateer-foo") {
137+
t.Errorf("expected 'privateer-foo' in result, got: %s", result)
128138
}
129139
if !strings.Contains(result, "my-plugin") {
130140
t.Errorf("expected 'my-plugin' in result, got: %s", result)

0 commit comments

Comments
 (0)