Skip to content

Include shadowJar artifact to release workflow #8

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 60 commits into from
Jul 17, 2023

Conversation

GumpacG
Copy link

@GumpacG GumpacG commented Jul 12, 2023

Description

Included shadowJar artifact to release workflow and bumped to 1.4.0.1

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

GumpacG added 30 commits July 11, 2023 10:59
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: Guian Gumpac <[email protected]>
Copy link

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

I'm worrying that shadow jar would be published on maven too...

Copy link

@MaxKsyunz MaxKsyunz left a comment

Choose a reason for hiding this comment

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

Do we need to increment the version at this point?

Changes to Jenkins are necessary before we can release 1.4.0.1 so it includes shadow jar.

@GumpacG
Copy link
Author

GumpacG commented Jul 12, 2023

@MaxKsyunz what would the process be like? Merge shadowJar workflow changes, then Change Jenkins, then bump version?

@Yury-Fridlyand do we not want shadowJar on Maven?

@Yury-Fridlyand
Copy link

No idea, it is not harmful though.
Right, we have to update jenkins/release.jenkinsFile too and add there a task to upload shadowjar to artifacts. See how it works on ODBC driver.

@GumpacG
Copy link
Author

GumpacG commented Jul 13, 2023

Based on the Jenkins file in https://github.com/opensearch-project/sql-jdbc/blob/6cc8e0a3c7933f13c58e32cbc6da3bdb9fb0d066/jenkins/release.jenkinsFile#L13C13-L13C59,
I think it signs everything that is in build/repository which is where the shadowJar is being moved to with the changes in the PR. Is there a way to test this without actually publishing to Maven?

@Yury-Fridlyand
Copy link

I think no.

@MaxKsyunz
Copy link

Having the shadow jar on Maven Central would be confusing -- if you are getting a dependency from Maven Central, you can just as easily get its dependencies and retain control of which versions are used. If there's a CVE in one of the dependencies, without shadow jar a client application can force the build to use another version of the dependency, with shadow jar we would need to release a new version of the shadow jar with the CVE fixed.

Regarding artifacts, the easiest to follow solution would be to save shadow jar as a separate artifact and have a separate stage in Jenkins job to process it.

standardReleasePipelineWithGenericTrigger can accept the name of the artifact to download. See here.

sigOverwrite: true
)
publishToArtifactsProdBucket(
assumedRoleName: 'sql-jdbc-shadowJar-upload-role',

Choose a reason for hiding this comment

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

they have a separate role for shadowJars?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not actually too sure this works. I assumed that it was just a name for the jenkins job.
@param Map[assumedRoleName] <required> - IAM role to be assumed for uploading artifacts
Is from https://github.com/opensearch-project/opensearch-build-libraries/blob/de8ea9024a1a95a72c668562cbdd13065bf1ed46/vars/publishToArtifactsProdBucket.groovy#L12C1-L12C88 where that is being called.

@@ -14,4 +14,18 @@ standardReleasePipelineWithGenericTrigger(
mavenArtifactsPath: "$WORKSPACE/repository/",
autoPublish: true
)
publishToArtifactsProdBucket(

Choose a reason for hiding this comment

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

why do you have 2 publishToArtifactsProdBucket for one jar?
The second one seems more correct

Copy link
Author

Choose a reason for hiding this comment

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

Not sure how it works if we specify this. As I understand artifacts.tar.gz is uploaded by default. I'm not sure if it ignores this file if publishToArtifactsProdBucket is called.

)
publishToArtifactsProdBucket(
assumedRoleName: 'sql-jdbc-shadowJar-upload-role',
source: "$WORKSPACE/build/libs/opensearch-sql-jdbc-shadow-*.jar",

Choose a reason for hiding this comment

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

Suggested change
source: "$WORKSPACE/build/libs/opensearch-sql-jdbc-shadow-*.jar",
source: "$WORKSPACE/opensearch-sql-jdbc-shadow-${tag}.jar",

Copy link
Author

Choose a reason for hiding this comment

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

build/libs/opensearch-sql-jdbc-shadow-*.jar would be the location of where the shadowJar is generated when it is built.

Choose a reason for hiding this comment

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

Yes, but jenkins gets it from release artifacts.

Copy link
Author

Choose a reason for hiding this comment

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

Ohhh I see. Thanks

assumedRoleName: 'sql-jdbc-shadowJar-upload-role',
source: "$WORKSPACE/build/libs/opensearch-sql-jdbc-shadow-*.jar",
destination: "https://artifacts.opensearch.org/opensearch-clients/jdbc/opensearch-sql-jdbc-shadow-${tag}.jar",
signingPlatform: 'windows',

Choose a reason for hiding this comment

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

Suggested change
signingPlatform: 'windows',
signingPlatform: 'linux',

@GumpacG GumpacG merged commit b7f9188 into integ-shadow-release Jul 17, 2023
GumpacG added a commit that referenced this pull request Aug 22, 2023
…ct#106)

* Include shadowJar artifact to release workflow (#8)

* Test packaging tar with shadowJar

Signed-off-by: Guian Gumpac <[email protected]>

* Setting version as a variable

Signed-off-by: Guian Gumpac <[email protected]>

* Changed release-drafter to include shadowJar

Signed-off-by: Guian Gumpac <[email protected]>

* Bumped version to 1.4.0.1

Signed-off-by: Guian Gumpac <[email protected]>

* Bumped version to 1.4.0.1

Signed-off-by: Guian Gumpac <[email protected]>

* Simplified adding shadowJar to artifacts

Signed-off-by: Guian Gumpac <[email protected]>

* Reverted whitespace change

Signed-off-by: Guian Gumpac <[email protected]>

* Reverted whitespace change

Signed-off-by: Guian Gumpac <[email protected]>

* Create shadowJar as a separate artifact

Signed-off-by: Guian Gumpac <[email protected]>

* Fixed wrong version

Signed-off-by: Guian Gumpac <[email protected]>

* Added jenkins job to publish shadowJar to artifacts bucket

Signed-off-by: Guian Gumpac <[email protected]>

* Changed source and signing platform

Signed-off-by: Guian Gumpac <[email protected]>

---------

Signed-off-by: Guian Gumpac <[email protected]>

* Separated shadowJar from repository directory

Signed-off-by: Guian Gumpac <[email protected]>

* Fixed tar issue with *

Signed-off-by: Guian Gumpac <[email protected]>

* Addressed PR comments

Signed-off-by: Guian Gumpac <[email protected]>

* Update jenkins version and release

Signed-off-by: acarbonetto <[email protected]>

---------

Signed-off-by: Guian Gumpac <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Co-authored-by: acarbonetto <[email protected]>
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