Skip to content

Fallback to old muzzle resolution when pinned versions file is missing#18834

Open
zeitlinger wants to merge 2 commits into
open-telemetry:mainfrom
zeitlinger:gregor/muzzle-fallback-when-no-pinned-file
Open

Fallback to old muzzle resolution when pinned versions file is missing#18834
zeitlinger wants to merge 2 commits into
open-telemetry:mainfrom
zeitlinger:gregor/muzzle-fallback-when-no-pinned-file

Conversation

@zeitlinger
Copy link
Copy Markdown
Member

When .github/config/latest-dep-versions.json is present, keep using it to cap open-ended muzzle ranges for reproducible in-repo builds.

When that file is absent, fall back to the old behavior and resolve the full version range from the configured repositories instead of failing immediately.

This keeps the pinned-version behavior for this repository while restoring compatibility for external users such as distros and extension authors that apply the muzzle check plugin outside this repo.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@zeitlinger zeitlinger marked this pull request as ready for review May 22, 2026 18:17
@zeitlinger zeitlinger requested a review from a team as a code owner May 22, 2026 18:17
Copilot AI review requested due to automatic review settings May 22, 2026 18:17
Copy link
Copy Markdown
Contributor

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

This PR updates the Gradle muzzle-check plugin to keep using the repo’s pinned latest-dep versions file when present, but to gracefully fall back to resolving full version ranges from configured repositories when that pinned file is absent (supporting external users who apply the plugin outside this repo).

Changes:

  • Make .github/config/latest-dep-versions.json optional: log an informational message and fall back instead of failing fast when missing.
  • Propagate optional “upper bound” handling by making resolveUpperBound() return nullable and updating version filtering to treat a missing upper bound as “no cap”.
  • Update documentation comments to reflect the new fallback behavior.

Comment on lines +46 to +48
logger.info(
"Pinned latest-dep versions file is missing: ${file}; falling back to repository " +
"version resolution for muzzle checks."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Users of this plugin might not even be using github.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
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.

3 participants