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

Avoid double patch bump #6

Merged
merged 6 commits into from
Jun 14, 2024
Merged

Avoid double patch bump #6

merged 6 commits into from
Jun 14, 2024

Conversation

dagguh
Copy link
Contributor

@dagguh dagguh commented Jun 13, 2024

No description provided.

@dagguh dagguh requested a review from a team as a code owner June 13, 2024 14:30
@dagguh dagguh enabled auto-merge (rebase) June 13, 2024 14:30
dagguh added a commit to atlassian/aws-infrastructure that referenced this pull request Jun 13, 2024
pczuj
pczuj previously approved these changes Jun 13, 2024
Copy link
Contributor

@pczuj pczuj left a comment

Choose a reason for hiding this comment

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

I understand those are only changes in tests and those make sense to me.

@dagguh
Copy link
Contributor Author

dagguh commented Jun 13, 2024

Yes, the tests show:

  • in the first commit, how consumers (like db-replica, aws-infrastructure) were getting double patch bumps
  • in the second commit, how they (me) were using markNextVersion wrongly and unnecessarily

PS. the CI is red (twice), but locally it's full green. Will take a look tomorrow.

The `release` task also bumps, a patch one by default.
So just don't use `markNextVersion` within the release process.
It's for manually marking a version for the future.

Show how to avoid atlassian-labs/db-replica#77
@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

After merging #7, I tried the "rebase" via GH GUI. It worked well, but the commits are no longer signed by me (obviously). I'll re-push my locally signed commits.
Edit, ah snap, I no longer have my GPG setup since they forced me to switch to macOS. Whatevs, no time for that now.

@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

The CI failure smells funny, it keeps talking about Gradle 6.7:

Illegal reflective access by org.codehaus.groovy.reflection.CachedConstructor$1 (file:/home/runner/.gradle/wrapper/dists/gradle-6.7-bin/efvqh8uyq79v2n7rcncuhu9sv/gradle-6.7/lib/groovy-all-1.3-2.5.12.jar) to constructor java.util.regex.Pattern(java.lang.String,int)

But the wrapper is 6.7. I learned that you can clear the GH caches via GH CLI, so I did:

» gh cache delete --all
✓ Deleted 10 caches from atlassian-labs/gradle-release

Let's see now...

@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

Didn't help. Next I'll try to avoid the deprecated gradle-build-action

@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

Also didn't help. BTW I see that 6.7 comes from our test sources, where we explicitly run a test project on Gradle 6.7. But the same thing happens locally and is green...

@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

It's environmental, maybe JDK version, maybe something else. I'll add build scans to compare them local vs CI.

@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

Yep, CI runs on Java 11, local on 8:
image

@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

Argh, still locally green on Java 11.
It's Homebrew OpenJDK Runtime Environment 11.0.23+0 vs Eclipse Temurin OpenJDK Runtime Environment 11.0.23+9, but I'll look for a more significant difference.

Hold the phone, I didn't inspect the test failure:

java.lang.AssertionError: 	
Expecting file:	
  </home/runner/.m2/repository/com/atlassian/performance/tools/publish-test/0.3.0-SNAPSHOT/publish-test-0.3.0-SNAPSHOT.pom>	
to exist.

It's definitely environmental. Suspects:

  • user.home property assumption is wrong
  • my local ~/.m2 is "dirty" and makes the test a false green

@dagguh
Copy link
Contributor Author

dagguh commented Jun 14, 2024

After cleaning my .m2 it repros locally!

rm -rf ~/.m2/repository/com/atlassian/performance/tools/publish-test

Gotta make the test better isolated from the env.

Now the `PublishTest` reproduces locally:
```
java.lang.AssertionError:
Expecting file:
  </Users/mkwidzinski/.m2/repository/com/atlassian/performance/tools/publish-test/0.3.0-SNAPSHOT/publish-test-0.3.0-SNAPSHOT.pom>
to exist.
```

It might look sketchy that we're mutating `~/.m2` in tests.
I thought about publishing to a custom isolated repo.
There are [`flatDir` repos], but they work differently:
> This type of repository does not support any meta-data formats like Ivy XML or Maven POM files.

POM generation is a crucial part of publication, so that would make the test lose too much value.

[`flatDir` repos]: https://docs.gradle.org/7.6.2/userguide/declaring_repositories.html#sub:flat_dir_resolver
We had to change the release tags for double-bump repro in 32a5808
@dagguh dagguh disabled auto-merge June 14, 2024 13:11
@dagguh dagguh merged commit 78e7b2c into master Jun 14, 2024
3 checks passed
@dagguh dagguh deleted the avoid-double-patch-bump branch June 14, 2024 13:11
dagguh added a commit to atlassian/aws-infrastructure that referenced this pull request Jun 24, 2024
dagguh added a commit to atlassian/aws-infrastructure that referenced this pull request Jun 24, 2024
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