Skip to content
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

chore: ensure in CI that there is no dependency to snapshots #6221

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

monperrus
Copy link
Collaborator

reviving #5395

the top doc change in pom.xml is required by maven-enforcer-plugin

@monperrus monperrus force-pushed the no-snapshot branch 2 times, most recently from 1232172 to f3b5963 Compare March 12, 2025 14:54
@monperrus
Copy link
Collaborator Author

@I-Al-Istannen I need your help, I don't understand why Javadoc Quality fails here.

@I-Al-Istannen
Copy link
Collaborator

I-Al-Istannen commented Mar 12, 2025

You changed the spoon parent pom version, which the chore/run-with-spoon-javadoc-classpath.sh uses. But you did not change the version of spoon-javadoc itself. Therefore, it built and installed version 11.2.1-SNAPSHOT for spoon-javadoc, but tried to run with the version of the spoon parent pom, 11.2.0.

You would need to adjust the chore/run-with-spoon-javadoc-classpath.sh:

diff --git i/chore/run-with-spoon-javadoc-classpath.sh w/chore/run-with-spoon-javadoc-classpath.sh
index b6eeb84df..111814e4d 100755
--- i/chore/run-with-spoon-javadoc-classpath.sh
+++ w/chore/run-with-spoon-javadoc-classpath.sh
@@ -9,7 +9,7 @@ export CLASSPATH="$(cd "$SCRIPT_DIR/../spoon-javadoc" && mvn dependency:build-cl

 # Ourselves
 LOCAL_REPO="$(mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout)"
-SPOON_VERSION="$(cd "$SCRIPT_DIR/../spoon-javadoc" && mvn help:evaluate -Dexpression=project.parent.version -q -DforceStdout)"
+SPOON_VERSION="$(cd "$SCRIPT_DIR/../spoon-javadoc" && mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
 export CLASSPATH="$CLASSPATH:$LOCAL_REPO/fr/inria/gforge/spoon/spoon-javadoc/$SPOON_VERSION/spoon-javadoc-$SPOON_VERSION.jar"

 # A simple logger to disable the warning

I guess the original authors intent (probably me) was that the versions are identical, but now they aren't and using the project's version makes more sense.

@monperrus
Copy link
Collaborator Author

thanks a lot @I-Al-Istannen

indeed it's now all green.

@monperrus
Copy link
Collaborator Author

ping @I-Al-Istannen for merge

@I-Al-Istannen
Copy link
Collaborator

Ah, sorry. I had some concerns about the auto-release workflows changing that and not enough time to look into it, and then I forgot.

Trying out the release script, I think your changes only live until the next release. The release script contains

echo "::group::Updating poms to next target version"
mvn -f spoon-pom --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_RELEASE_VERSION" -DprocessAllModules
mvn --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_RELEASE_VERSION" -DprocessAllModules
mvn -f spoon-javadoc --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_RELEASE_VERSION" -DprocessAllModules
echo "::endgroup::"

which bumps all parents. This can be seen in 48659c6 and 5a96b9e.

I guess we want to change that as well then, somehow?

@monperrus
Copy link
Collaborator Author

which bumps all parents

if it bumps to just-released version, this is fine.

else, we should not bump parent deps via release, but via normal renovate PR.

@I-Al-Istannen
Copy link
Collaborator

Then we can use something like this patch, I think. Note that this also means, that any (dependency or other) updates to spoon-pom are not available in spoon during the development cycle. If we e.g. bump mockito, assertj or any other dependency for which the version is set in the spoon-pom, we need to cut a new public release, before we can use it in spoon. I am not sure I think that's a good idea, but at least the surface area seems to be relatively small, as many things are defined in the subprojects.

From 5ec8413dc07ab0baa202ff2bb9d6e9f2fdd3ddb0 Mon Sep 17 00:00:00 2001
From: I-Al-Istannen <i-al-istannen@users.noreply.github.com>
Date: Wed, 19 Mar 2025 17:46:22 +0100
Subject: [PATCH] chore: Do not bump parent versions after a release

---
 chore/release.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/chore/release.sh b/chore/release.sh
index 56e73d29e..0a867d3df 100755
--- a/chore/release.sh
+++ b/chore/release.sh
@@ -68,9 +68,7 @@ echo "::endgroup::"
 NEXT_RELEASE_VERSION="$(semver next patch "$NEXT_VERSION")-SNAPSHOT"
 
 echo "::group::Updating poms to next target version"
-mvn -f spoon-pom --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_RELEASE_VERSION" -DprocessAllModules
-mvn --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_RELEASE_VERSION" -DprocessAllModules
-mvn -f spoon-javadoc --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_RELEASE_VERSION" -DprocessAllModules
+mvn -f spoon-pom --no-transfer-progress --batch-mode versions:set -DnewVersion="$NEXT_RELEASE_VERSION" -DprocessAllModules -DprocessParent=false
 echo "::endgroup::"
 
 echo "::group::Committing changes"
-- 
2.47.2

@monperrus
Copy link
Collaborator Author

changed per your suggestion.

thanks a lot for spotting and fixing this, we're so happy with our working fully automated CD pipelines.

Copy link
Collaborator

@I-Al-Istannen I-Al-Istannen left a comment

Choose a reason for hiding this comment

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

I think this is what you had in mind now? We never update the parent version during releases now, but we do release a new parent. This means that spoon modules (core/javadoc) always lag one version behind spoon-pom.

Alternatively, we can update them all at once — but then we release a version that was never running anywhere before (as the repo state always references the last version).

I hope I didn't break any of the release scripts :P This is a bit of a more interesting model.

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.

2 participants