feat: track api-diff baseline via Renovate and store diffs in docs/apidiffs#2174
Merged
Conversation
…idiffs Derive the api-diff baseline from the latest published release instead of a hardcoded version, and commit per-module diffs so API changes are visible in review. - Move the baseline to the <api.diff.baseline.version> pom property (the single source of truth) and let Renovate bump it: a custom regex manager tracks the latest published io.prometheus:prometheus-metrics-core on Maven Central, on the renovate/api-diff-baseline branch. - generate-api-diff-baseline.yml regenerates docs/apidiffs on that branch and pushes the result back (mirrors generate-protobuf.yml). - mise run api-diff now syncs japicmp reports into docs/apidiffs via .github/scripts/sync-api-diffs.sh (volatile preamble stripped so files only churn on real API changes); the api-diff workflow fails if they are stale. - Mark docs/apidiffs as generated so flint skips it. Closes #2170 Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
The micrometer and jmx-exporter compatibility tests install local artifacts with -Dmaven.test.skip=true, which skips building the *:test-jar artifacts that the activeByDefault default profiles declare as test dependencies. Leaving the profile active broke dependency resolution (e.g. prometheus-metrics-exposition-textformats:jar:tests), failing on main and on every PR (e.g. #2173). Deactivate those profiles in the compat install (-P '!default'), the same approach the release task already uses (-P 'release,!default'). Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
b399f53 to
282dddb
Compare
Match opentelemetry-java's docs/apidiffs layout and format: - store per-module diffs under docs/apidiffs/current_vs_latest/<module>.txt instead of flat docs/apidiffs/<module>.diff - keep the 'Comparing ... .jar against ... .jar' header; drop only the ignore-missing-classes warning and the semantic-versioning suggestion - on a baseline bump, archive the previous current_vs_latest as docs/apidiffs/<new>_vs_<old>/ for per-release history Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
jaydeluca
approved these changes
Jun 2, 2026
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.
Summary
Fixes the manual-bump drift in the api-diff baseline (#2170) and makes API changes visible in review.
<api.diff.baseline.version>pom property (bumped from the already-drifted1.5.1to the actual latest release1.6.1).mise.tomlandapi-diff.ymlno longer hardcode it.io.prometheus:prometheus-metrics-coreon Maven Central and bumps the property on therenovate/api-diff-baselinebranch. Because Renovate only proposes published versions, there is no Maven Central propagation race and no post-release workflow or app token needed.docs/apidiffs/.mise run api-diffsyncs the japicmp per-module reports intodocs/apidiffs/<module>.diffvia.github/scripts/sync-api-diffs.sh, stripping the volatile preamble so files only churn on real API changes. The api-diff workflow fails if they are stale, so every API change shows up in the PR diff.generate-api-diff-baseline.ymlregeneratesdocs/apidiffson the Renovate branch and pushes it back, mirroringgenerate-protobuf.yml.docs/apidiffs/**is markedlinguist-generatedso flint skips it.Notes
1.6.1predates@StableApi(the bootstrap noise documented in feat: Add StableApi marker and API diff check #2168). They shrink to near-empty once a release contains the annotations.GITHUB_TOKENpush doesn't re-trigger CI — close/reopen the Renovate bump PR to run the api-diff check after regeneration (noted in the workflow).Validation
mise run api-diff(generates the 25 seed diffs; verified idempotent)mise run lintrenovate-config-validator --strict, actionlint, zizmorCloses #2170
Also fixes a pre-existing compat-test break on
mainmicrometer-compatibilityandjmx-exporter-compatibilityfail onmain(e.g. #2173), unrelated to this change. The compat harness installs local artifacts with-Dmaven.test.skip=true, which skips building the*:test-jarartifacts that theactiveByDefaultdefaultprofiles declare as test dependencies, breaking resolution (e.g.prometheus-metrics-exposition-textformats:jar:tests).Fixed by deactivating those profiles in the compat install (
-P !default), matching what the release task already does (-P release,!default). Verified locally: fullmvnw install -Dmaven.test.skip=true -P !default→ BUILD SUCCESS.Reviewer note: the seed diffs show the full stable surface (expected)
The committed
docs/apidiffs/current_vs_latest/*.txtlist the entire@StableApisurface as additions, not a small delta. This is the documented bootstrap state from #2168, not a bug:@io.prometheus.metrics.annotations.StableApi. The baseline1.6.1jar predates@StableApi, so its filtered surface is empty → every annotated class in current code registers as "NEW". The header genuinely compares against the1.6.1jar; the annotation filter is what makes everything look added.@StableApi-annotated types appear (non-stable classes likeCKMSQuantiles/Bufferare excluded;CallbackMetricshows only as an inheritedNEW SUPERCLASSreference). It is the same root cause as thebreaking-api-change-acceptedlabel on this PR.It self-corrects after the next release ships
@StableApi: Renovate bumps the baseline to that release, the bump workflow regeneratescurrent_vs_latest/as an annotated-vs-annotated (near-empty) diff, and the archived<new>_vs_<old>/becomes the first real release diff. So the current files are best read as a one-time record of the initial declared stable API surface.