-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Conversation
There was a problem hiding this 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
gradle/publish.gradle
Outdated
@@ -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 -> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
(I don't believe the failures in CI have anything to do with this change) |
gradle/publish.gradle
Outdated
@@ -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 -> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The CI failures seem unrelated -- is this OK to merge now? I myself don't have permission |
@dylrich merged 👍 |
This commit adds papertrail tracing on release to all modules we release. This tracing will run on every snapshot and release.