Skip to content

Commit 6917a66

Browse files
authored
Ensure ignore_versions is respected for shared sources (#2138)
1 parent 4ebfb7d commit 6917a66

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

internal/cmd/fetcher/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"os"
1212
"os/exec"
1313
"path/filepath"
14+
"slices"
1415
"strings"
1516
"time"
1617

@@ -175,6 +176,12 @@ func run(ctx context.Context, root string) ([]createdPlugin, error) {
175176
}
176177
latestVersions[config.CacheKey()] = newVersion
177178
}
179+
// Some plugins share the same source but specify different ignore versions.
180+
// Ensure we continue to only fetch the latest version once but still respect ignores.
181+
if slices.Contains(config.Source.IgnoreVersions, newVersion) {
182+
log.Printf("skipping source: %s: %v", config.Filename, newVersion)
183+
continue
184+
}
178185
// example: plugins/grpc
179186
pluginDir := filepath.Dir(config.Filename)
180187
ok, err := checkDirExists(filepath.Join(pluginDir, newVersion))
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source:
22
ignore_versions:
3-
- v1.3.0 # Temporarily ignore version until a release is published.
3+
# Temporarily ignore version until a release is published.
4+
- v1.3.0
45
github:
56
owner: bufbuild
67
repository: protoc-gen-validate

0 commit comments

Comments
 (0)