Skip to content

JAVA-5415: add artifact tracing on publish #1364

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
merged 1 commit into from
Apr 16, 2024
Merged

Conversation

dylrich
Copy link
Contributor

@dylrich dylrich commented Apr 11, 2024

This commit adds papertrail tracing on release to all modules we release. This tracing will run on every snapshot and release.

Copy link
Collaborator

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

LGTM minus a change to the commit message, and also added a question for @rozza

@@ -74,6 +74,13 @@ def scalaProjects = publishedProjects.findAll { it.name.contains('scala') }
def javaProjects = publishedProjects - scalaProjects
def projectsWithManifest = publishedProjects.findAll {it.name != 'driver-legacy' }

configure(publishedProjects) { project ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

By default, all .pom files are written to disk with the same file name. e.g. for bson it is written to bson/build/publications/mavenJava/pom-default.xml. Then when it's copied up to the snapshot repo, it's copied as bson-<version>.pom. The latter is what we want to capture in the Papertrail. By making this change, we configure the generatePomFileForMavenJavaPublication to just write the file with that name in the first place, e.g. bson/build/publications/mavenJava/bson-<version>.pom. That way the papertrail.trace command can just copy the file directly and not have to figure out how to rename it, with just:

         - "src/*/build/publications/mavenJava/*.pom"

@rozza given the requirements, is this the right place to actually do it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@dylrich please consider updating the commit message to provide some of this context, so that it's not lost?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated the commit message to include more of this context!

Copy link
Member

@rozza rozza Apr 15, 2024

Choose a reason for hiding this comment

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

I recommend removing this block and instead adding this to line 57:

maven {
    url = "$rootDir/build/repo"
}

This change then should publish to two locations: sonatype and the local root build/repo directory. You can then copy that directory for artifact tracing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have made this change and updated the commit message to reflect this approach instead. This seems much better!

@dylrich
Copy link
Contributor Author

dylrich commented Apr 11, 2024

(I don't believe the failures in CI have anything to do with this change)

@@ -74,6 +74,13 @@ def scalaProjects = publishedProjects.findAll { it.name.contains('scala') }
def javaProjects = publishedProjects - scalaProjects
def projectsWithManifest = publishedProjects.findAll {it.name != 'driver-legacy' }

configure(publishedProjects) { project ->
Copy link
Member

@rozza rozza Apr 15, 2024

Choose a reason for hiding this comment

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

I recommend removing this block and instead adding this to line 57:

maven {
    url = "$rootDir/build/repo"
}

This change then should publish to two locations: sonatype and the local root build/repo directory. You can then copy that directory for artifact tracing.

This commit adds papertrail tracing on release to all modules we release.
This tracing will run on every snapshot and release.

The change to publish.gradle was done because we need to ensure that
the generated .pom, .md5, and .sha1 files are available on disk for
tracing. We will now also "publish" these files to a location on disk
that enables simple tracing in Papertrail. The filename patterns were
chosen because the gradle publish command also includes non-release
files with duplicate names that we do not want to trace.
@jyemin jyemin self-requested a review April 15, 2024 23:12
Copy link
Collaborator

@jyemin jyemin left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

LGTM

@dylrich
Copy link
Contributor Author

dylrich commented Apr 16, 2024

The CI failures seem unrelated -- is this OK to merge now? I myself don't have permission

@rozza rozza merged commit bec3def into mongodb:master Apr 16, 2024
@rozza
Copy link
Member

rozza commented Apr 16, 2024

@dylrich merged 👍

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.

4 participants