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

Fix download snapshot warnings #882

Merged
merged 7 commits into from
Oct 29, 2024

Conversation

ammachado
Copy link
Contributor

@ammachado ammachado commented Oct 24, 2024

What's changed?

Fix download warnings for SNAPSHOT components

What's your motivation?

Anything in particular you'd like reviewers to focus on?

No

Anyone you would like to review specifically?

@timtebeek

Have you considered any alternatives or workarounds?

No

Any additional context

No.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@ammachado ammachado marked this pull request as draft October 24, 2024 16:32
@ammachado ammachado requested a review from timtebeek October 24, 2024 16:32
@timtebeek timtebeek added bug Something isn't working enhancement New feature or request labels Oct 26, 2024
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great start! Thanks for the various improvements throughout and the cache introduction to fix the underlying issue. Let me know once you've worked through the final todo before a last review & merge.

@ammachado ammachado force-pushed the fix-download-snapshot-warnings branch from 5808c75 to cedabc5 Compare October 27, 2024 15:30
@ammachado ammachado force-pushed the fix-download-snapshot-warnings branch from cedabc5 to 547e934 Compare October 28, 2024 13:43
@ammachado ammachado changed the title [WIP] Fix download snapshot warnings Fix download snapshot warnings Oct 28, 2024
@ammachado ammachado requested a review from timtebeek October 28, 2024 14:03
@timtebeek timtebeek marked this pull request as ready for review October 28, 2024 16:36
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Great to see this @ammachado ; it was a bit of a puzzle for me correlating this with the MavenParser in openrewrite/rewrite, but I came up with a couple of questions that would be good to address I think. Curious to hear your thoughts, as you've perhaps already looked into those aspects.

I've also added a minimal test since I noticed none were using snapshot versions before. We might want to extend that with some assertions, although that might be a bit of a challenge with the testing framework used for plugins.

project.getGroupId(),
project.getArtifactId(),
project.getVersion(),
project.getVersion().endsWith("-SNAPSHOT") ? null : project.getVersion()
Copy link
Contributor

@timtebeek timtebeek Oct 29, 2024

Choose a reason for hiding this comment

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

Looking at MavenPomDownloader I wonder if we should even include a dated snapshot version here, or always have that be null or project.version(). What made you introduce this ternary?

ammachado and others added 2 commits October 29, 2024 13:41
Copy link
Contributor

@timtebeek timtebeek left a comment

Choose a reason for hiding this comment

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

Thanks again @ammachado ! Great to see these cleared out.

@timtebeek timtebeek merged commit 020ebcf into openrewrite:main Oct 29, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

rewrite:run (warns about) failing to download SNAPSHOT parent from local repository
2 participants