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 SNAPSHOT uploads for Artifactory repositories #318

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

sugarmanz
Copy link
Contributor

What is the goal of this PR?

Fix SNAPSHOT uploads for Artifactory repositories. Due to the order of upload, Artifactory would expand the SNAPSHOT differently for the POM and JAR artifacts, resulting in mismatched artifacts:

Screen Shot 2021-09-16 at 2 13 05 PM

You can see that the POM version SNAPSHOT resolved to 20210916.163241-1 and the JAR version SNAPSHOT resolved to 20210916.163242-2. Furthermore, the POM checksum uploads would fail as they would be attempted to upload for the latest SNAPSHOT, 20210916.163242-2, which wouldn't exist:

Target file to set checksum on doesn't exist: MySnapshotRepo:com/example/bazel/plugin/0.0.9canary13-SNAPSHOT/plugin-0.0.9canary13-20210916.163242-2.pom

What are the changes implemented in this PR?

Uploading the JAR artifact first fixes this issue and didn't affect uploads to release repositories.

Screen Shot 2021-09-16 at 2 21 25 PM

@lolski
Copy link
Member

lolski commented Sep 16, 2021

Thank you @sugarmanz ! The PR looks sensible.

I would like to understand the issue a bit more: is the issue caused by the fact we upload the POM first before the JAR, instead of the other way around? If that's the case, does every maven repository implementation impose this particular ordering?

@lolski lolski self-requested a review September 17, 2021 12:59
@sugarmanz
Copy link
Contributor Author

Hey @lolski! The issue is indeed caused by uploading the POM first before the JAR. That being said, I've struggled to find explicit documentation on this matter for Artifactory. I have a meeting with our Artifactory team to see if they have any more knowledge than I and can update here with any findings, or lack-thereof.

In terms of whether this is affects other Maven repository managers, I'm not entirely sure as I really only was trying to upload to an Artifactory repo. I'll pull down the latest Nexus docker and test it out though. If there are any other repository managers you'd like me to test out, let me know!

@sugarmanz
Copy link
Contributor Author

I did verify that on Nexus, ordering does not matter. i.e. both master and the PR branch works for uploading snapshot artifacts to a Nexus repository.

@lolski
Copy link
Member

lolski commented Sep 20, 2021

I did verify that on Nexus, ordering does not matter.

@sugarmanz right. So are you saying that the issue affects Artifactory only, and not Nexus?

@sugarmanz
Copy link
Contributor Author

@sugarmanz right. So are you saying that the issue affects Artifactory only, and not Nexus?

Correct.

@lolski lolski merged commit 04f0948 into typedb:master Sep 24, 2021
@lolski
Copy link
Member

lolski commented Sep 24, 2021

PR merged. Thank you for your contribution @sugarmanz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants