Page MenuHomePhabricator

Publish both shaded and unshaded artifacts from analytics refinery
Open, NormalPublic

Description

Shaded jars are useful as an end artifact, but are problematic to reuse as a dependency. So we should publish both shaded and unshaded artifacts.

Currently for some modules in analytics/refinery expose shaded jars as the main artifact. We can either publish an unshaded jar as the main artifact and publish the shaded one with a classifier, or the opposite.

The usual expectation is that the main artifact from a module will be a standard jar. A shaded jar make sense as a main artifact when the module is a pure entry point (just a main class, only code that make no sense to reuse). It is a good practice to have a dedicated module for an entry point (which might or might not make sense in this project).

In case like this project, where entry points and supporting classes are in the same module, the usual is to have the standard jar as the main artifact, and publish a shaded jar with a classifier (which is what I implemented).

It is possible to publish the shaded jar without classifier and publish the unshaded jar with a classifier. This would break the principle of least surprise (at least for people familiar with maven). It would also require quite a bit more configuration.

So if adding a classifier to the shaded jar is an issue (lot of surrounding code to update), I can try to implement something else.

Event Timeline

Gehel created this task.Mar 9 2019, 8:37 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 9 2019, 8:37 PM

Change 495141 had a related patch set uploaded (by Gehel; owner: Gehel):
[analytics/refinery/source@master] Publish both shaded and unshaded artifacts.

https://gerrit.wikimedia.org/r/495141

Change 495475 had a related patch set uploaded (by Gehel; owner: Gehel):
[analytics/refinery/source@master] Publish both shaded and unshaded artifacts.

https://gerrit.wikimedia.org/r/495475

Cool thank you!!!

I think adding '-shaded' classifier to the shaded jar makes the most sense, but it will require changes elsewhere to use the new jar filename. Our production jobs should always use the versioned jar names anyway, so I believe that we'll only need to switch to the new '-shaded' jar names when we upgrade the jars jobs use. We can also tweak the Jenkins analytics/refinery/source release job to symlink the versionless current jars in analytics/refinery/ artifacts/ to the -shaded ones, so those continue to work like they do now.

Milimetric triaged this task as High priority.Mar 18 2019, 3:47 PM
Milimetric lowered the priority of this task from High to Normal.
Milimetric moved this task from Incoming to Ops Week on the Analytics board.