Stream: dev

Topic: โœ” war file artifact from GitHub Actions


view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 10:45):

If we were to use GitHub Actions to build the war file and upload it as an artifact (to GitHub Actions), where would we add it to the workflow?

In our "build with Maven" step, we do a mvn install rather than a mvn package: https://github.com/IQSS/dataverse/blob/1c356b44f5f190d5da0c2dfd3ef42590accd5db1/.github/workflows/maven_unit_test.yml#L50

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 10:45):

I'm interested in adding this to the Java 17 pull request, if possible.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:24):

The install is necessary because of the SPI module

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:24):

It will build and install the WAR file in the local Maven repo as well

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:25):

Do you want to have the WAR as an artifact independent of any integration tests running?

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:25):

(Or maybe even use it externally to feed an integration test?)

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:26):

If it should be uploaded after unit tests but before integration tests, that step needs to be in the maven_unit_test.yml workflow

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:26):

Otherwise in container_app_push.yml

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:27):

You probably see this line here: https://github.com/poikilotherm/dataverse/blob/1c356b44f5f190d5da0c2dfd3ef42590accd5db1/.github/workflows/maven_unit_test.yml#L70-L70

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:27):

That's were I delete the WAR file from the local Maven repo so it won't be infecting the cache

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:28):

Uploading an artifact should happen just before that step

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:29):

I did notice that "We don't want to cache the WAR file, so delete it" comment. Make sense to have the artifact upload just before.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:29):

... if you want to upload before you know integration / E2E test results

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:29):

well... :sweat_smile:

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:30):

maybe we upload two versions: tested and untested :grimacing:

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:30):

I'm confused though. The war is in ~/.m2/repository/edu/harvard/iq/dataverse rather than target?

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:30):

It probably is in both

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:31):

The install step will copy it from target to .m2

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:34):

Ok, cool. Now I'm wondering to myself why I always type mvn package instead of mvn install. Both seem to create the war file.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:35):

Please be aware that the CI command always uses the parent module

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:35):

This way, the SPI package (or any other future modules we might add) is in the reactor

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:36):

We must use the install target for Maven, as package would invoke that target, but then the submodules would not be around when the main app is being built

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:36):

@Oliver Bertuch do you feel like making a PR into https://github.com/IQSS/dataverse/pull/9764 to push the war file to GitHub Artifacts (or whatever it's called).

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:37):

This is not critical as long as the SPI module did not change, as it can be pulled from Maven Central. But then the workflow breaks for PRs to the SPI module

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:44):

Maybe we could prototype the war upload with this tiny app: https://github.com/IQSS/dataverse-people

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:45):

Or we could go straight to the Java 17 branch :big_smile:

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:45):

:+1: J17

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:45):

Cool. Do you want to make a PR?

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:45):

OK

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:45):

Oh wait

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:45):

PR or push?

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:46):

PR onto J17 branch?

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:46):

I think I'd like to look at it. It's already in QA. So PR please if you don't mind.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:46):

So PR for develop, aye?

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:46):

Oh, I was thinking PR into the Java 17 PR.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:47):

But it's in QA?

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:47):

Is that OK to add?

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:47):

What's driving this is that we'd like to be able to point QA at a Java 17 war artifact.

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:47):

Well, if it's a PR. I'll look at it and communicate with QA about merge it or not. The timing, basically.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:48):

Roger roger

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:48):

Phew. Sorry so complicated.

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:48):

If it was earlier (PR still in progress), I'd say just push directly to the branch.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:48):

Do you want an issue first?

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:51):

Oh! If you want. Might be nice for tracking.

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:51):

Maybe this will be the start of cutting releases with GitHub Actions. :stuck_out_tongue_wink:

view this post on Zulip Don Sizemore (Aug 17 2023 at 11:52):

@Oliver Bertuch I've always been told to do a package so I've always done a package - should I update all the Jenkins jobs (and Ansible, and whatever else) to install instead?

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:52):

Retention days?

view this post on Zulip Don Sizemore (Aug 17 2023 at 11:53):

Oliver Bertuch said:

Retention days?

1, or 2, or 7 or whatever. This is for Kevin's benefit.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:53):

@Don Sizemore that depends on what you are trying to do. If you want to properly build the SPI along with the rest, see that job for the command to use

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:54):

OK I'll make it 7 days.

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:54):

7 sounds fine

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:55):

I'll name the artifact dataverse-java$jdk.war so it's easier to keep them apart if we ever use the matrix again

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:55):

(Same name = overwrite)

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:56):

Sure, sounds fine.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 11:57):

We're aware of https://github.com/actions/upload-artifact#zipped-artifact-downloads rihgt?

view this post on Zulip Don Sizemore (Aug 17 2023 at 11:58):

Oliver Bertuch said:

We're aware of https://github.com/actions/upload-artifact#zipped-artifact-downloads rihgt?

that's minor.

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 11:58):

No worries

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 12:04):

@Philip Durbin here's the PR but there no code change so it won't run now. https://github.com/IQSS/dataverse/pull/9789

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 12:04):

Should I push some small code change to test?

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 12:09):

Yes, please

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 12:09):

Walking the dog. Back soon.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 12:21):

Run is a success: https://github.com/IQSS/dataverse/actions/runs/5890761815?pr=9789
Artifact here: https://github.com/IQSS/dataverse/suites/15187396659/artifacts/867845145

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 12:30):

Perfect. Merged! Thanks, @Oliver Bertuch !! :dataverse_man:

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 12:30):

Wasn't very complicated.

view this post on Zulip Oliver Bertuch (Aug 17 2023 at 12:30):

Will impact build times though - takes ~44s to upload the data

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 13:11):

Meh, it's worth the extra time.

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 13:11):

I just summarized what we did here: https://github.com/IQSS/dataverse/pull/9764#issuecomment-1682261825

view this post on Zulip Philip Durbin ๐Ÿš€ (Aug 17 2023 at 13:11):

Thanks again!

view this post on Zulip Notification Bot (Aug 17 2023 at 13:25):

Philip Durbin has marked this topic as resolved.


Last updated: Nov 01 2025 at 14:11 UTC