Skip to content

fix(deps): update dependency me.champeau.gradle:japicmp-gradle-plugin to v0.4.3 (main) #11528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 3, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
me.champeau.gradle:japicmp-gradle-plugin 0.4.2 -> 0.4.3 age adoption passing confidence

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from a team June 3, 2024 19:43
@laurit
Copy link
Contributor

laurit commented Jun 4, 2024

melix/japicmp-gradle-plugin#70 changes the api diff file content to

Comparing source compatibility of opentelemetry-instrumentation-annotations-2.5.0-SNAPSHOT.jar against opentelemetry-instrumentation-annotations-2.4.0.jar
No changes.

from

Comparing source compatibility of  against 
No changes.

which totally makes sense but for us the old behavior was probably more comfortable because when nothing changed then we didn't need to regenerate the file after release. @trask wdyt do we want to keep the old behavior? We could do something like

diff --git a/conventions/src/main/kotlin/otel.japicmp-conventions.gradle.kts b/conventions/src/main/kotlin/otel.japicmp-conventions.gradle.kts
index e3fd6ed5d5..0c98d48396 100644
--- a/conventions/src/main/kotlin/otel.japicmp-conventions.gradle.kts
+++ b/conventions/src/main/kotlin/otel.japicmp-conventions.gradle.kts
@@ -3,6 +3,8 @@ import me.champeau.gradle.japicmp.JapicmpTask
 import me.champeau.gradle.japicmp.report.stdrules.RecordSeenMembersSetup
 import me.champeau.gradle.japicmp.report.stdrules.SourceCompatibleRule
 import me.champeau.gradle.japicmp.report.stdrules.UnchangedMemberRule
+import java.nio.charset.StandardCharsets
+import java.nio.file.Files

 plugins {
   base
@@ -51,7 +53,7 @@ fun findArtifact(version: String): File {
 if (project.findProperty("otel.stable") == "true") {
   afterEvaluate {
     tasks {
-      val jApiCmp by registering(JapicmpTask::class) {
+      val jApiCmpGenerate by registering(JapicmpTask::class) {
         dependsOn("jar")

         // the japicmp "new" version is either the user-specified one, or the locally built jar.
@@ -93,11 +95,37 @@ if (project.findProperty("otel.stable") == "true") {
         ignoreMissingClasses.set(true)
         packageExcludes.addAll("*.internal", "*.internal.*")
         val baseVersionString = if (apiBaseVersion == null) "latest" else baselineVersion
-        txtOutputFile.set(
-          apiNewVersion?.let { file("$rootDir/docs/apidiffs/${apiNewVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") }
-            ?: file("$rootDir/docs/apidiffs/current_vs_$baseVersionString/${base.archivesName.get()}.txt")
-        )
+        val outputFile = apiNewVersion?.let { layout.buildDirectory.file("apidiffs/${apiNewVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") }
+          ?: layout.buildDirectory.file("apidiffs/current_vs_$baseVersionString/${base.archivesName.get()}.txt")
+        txtOutputFile.set(outputFile)
+        outputs.file(outputFile)
       }
+      val jApiCmp by registering {
+        dependsOn(jApiCmpGenerate)
+
+        val apiBaseVersion: String? by project
+        val baselineVersion = apiBaseVersion ?: latestReleasedVersion
+        val baseVersionString = if (apiBaseVersion == null) "latest" else baselineVersion
+
+        val apiDiff = apiBaseVersion?.let { layout.buildDirectory.file("apidiffs/${apiBaseVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") }
+          ?: layout.buildDirectory.file("apidiffs/current_vs_$baseVersionString/${base.archivesName.get()}.txt")
+        val apiDiffPath = apiDiff.get().asFile.toPath()
+
+        val outputFile = apiBaseVersion?.let { file("$rootDir/docs/apidiffs/${apiBaseVersion}_vs_$baselineVersion/${base.archivesName.get()}.txt") }
+          ?: file("$rootDir/docs/apidiffs/current_vs_$baseVersionString/${base.archivesName.get()}.txt")
+        val outputPath = outputFile.toPath()
+        outputs.file(outputPath)
+
+        doLast {
+          val content = Files.readAllLines(apiDiffPath)
+          if (content.size > 0 && content[0].startsWith("Comparing source compatibility of")) {
+            content[0] = "Comparing source compatibility of  against "
+          }
+
+          Files.write(outputPath, content.joinToString("\n").trim().toByteArray(StandardCharsets.UTF_8))
+        }
+      }
+

@trask
Copy link
Member

trask commented Jun 4, 2024

@jack-berg do you have any preference since you have more stable modules in core repo and we'll want to coordinate

@jack-berg
Copy link
Member

when nothing changed then we didn't need to regenerate the file after release.

Even when nothing changes, we commit copies of the "No changes" files to a directory with that version. E.g.: https://github.com/open-telemetry/opentelemetry-java/pull/6453/files#diff-03e9cd5e2b2136b407e2c4d34ec0cd05952a55fba9f8312e851baa9c7865d2ac

So I don't see much of a difference of whether those files contain this additional information. Also, @jkwatson added automation for the post-release steps, so the impact on maintainers is marginal. I think unless it makes my life harder, I have a slight preference towards keeping our config close to the default behavior of japicmp - seems a little less fragile.

@laurit
Copy link
Contributor

laurit commented Jun 5, 2024

We don't add the apidiffs when there are no changes. It is the current vs latest one (https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt) that will now need updating when the version changes. I think it is better to handle this with post release automation.

Copy link
Contributor Author

renovate bot commented Jun 5, 2024

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@laurit laurit merged commit b8b1bff into main Jun 5, 2024
53 checks passed
@laurit laurit deleted the renovate/main-me.champeau.gradle-japicmp-gradle-plugin-0.4.x branch June 5, 2024 12:01
zeitlinger pushed a commit to zeitlinger/opentelemetry-java-instrumentation that referenced this pull request Jun 12, 2024
… to v0.4.3 (main) (open-telemetry#11528)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lauri Tulmin <[email protected]>
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