Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,11 @@ jobs:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
run: |
./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
# Pin the apidiff baseline to the just-released version.
sed -i "s/^val apidiffBaselineVersion = .*/val apidiffBaselineVersion = \"$VERSION\"/" build.gradle.kts
./gradlew --refresh-dependencies japicmp
git add docs/apidiffs
git add build.gradle.kts

- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh
Expand Down
2 changes: 2 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
// start - updated by ./.github/workflows/prepare-release-branch.yml
val snapshot = true
// end
val apidiffBaselineVersion = "1.43.0"

// The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes
var semanticConventionsVersion = "1.43.0"
Expand Down Expand Up @@ -51,6 +52,7 @@ allprojects {
ver += "-SNAPSHOT"
}
version = ver
extra["apidiffBaselineVersion"] = apidiffBaselineVersion
}

nexusPublishing {
Expand Down
19 changes: 6 additions & 13 deletions buildSrc/src/main/kotlin/otel.japicmp-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,11 @@ plugins {
}

/**
* The latest *released* version of the project. Evaluated lazily so the work is only done if necessary.
* The baseline version japicmp compares against. Pinned in build.gradle.kts and bumped
* atomically with docs/apidiffs/current_vs_latest/ by the post-release PR opened from
* .github/workflows/release.yml.
*/
val latestReleasedVersion: String by lazy {
// hack to find the current released version of the project
val temp: Configuration = configurations.create("tempConfig")
temp.resolutionStrategy.cacheDynamicVersionsFor(0, TimeUnit.SECONDS)
dependencies.add(temp.name, "io.opentelemetry.semconv:opentelemetry-semconv:latest.release")
val moduleVersion = configurations["tempConfig"].resolvedConfiguration.firstLevelModuleDependencies.elementAt(0).moduleVersion
configurations.remove(temp)
logger.debug("Discovered latest release version: " + moduleVersion)
moduleVersion
}
val apidiffBaselineVersion = rootProject.extra["apidiffBaselineVersion"] as String

class SourceIncompatibleRule : AbstractRecordingSeenMembers() {
override fun maybeAddViolation(member: JApiCompatibility): Violation? {
Expand Down Expand Up @@ -71,9 +64,9 @@ if (!project.hasProperty("otel.release")) {
// only output changes, not everything
onlyModified.set(true)

// the japicmp "old" version is either the user-specified one, or the latest release.
// the japicmp "old" version is either the user-specified one, or the pinned baseline.
val apiBaseVersion: String? by project
val baselineVersion = apiBaseVersion ?: latestReleasedVersion
val baselineVersion = apiBaseVersion ?: apidiffBaselineVersion
oldClasspath.from(
try {
files(findArtifact(baselineVersion))
Expand Down
Loading