openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.58k forks source link

[openhab-addons] PR jar build-artifacts are unecessary difficult to use and flaky #14133

Open cmorty opened 1 year ago

cmorty commented 1 year ago

Expected Behavior

The jar-artifacts of a PR should be easily accessible from the PR

Background

I tried my best to understand things. My Jenkins-Assumptions are based on this log.

[INFO] Deploying artifact: https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/addons/bundles/org.openhab.binding.tacmi/4.0.0-SNAPSHOT/org.openhab.binding.tacmi-4.0.0-SNAPSHOT.jar
[INFO] Deploying artifact: https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/addons/bundles/org.openhab.binding.tacmi/4.0.0-SNAPSHOT/org.openhab.binding.tacmi-4.0.0-SNAPSHOT-sources.jar

It is a good practice to add a URL to your built JAR in this pull request description, so it is easier for the community to test your Add-on. If your pull request contains a new binding, it will likely take some time before it is reviewed and processed by maintainers.



## Current Behavior

* The [Github Action](https://github.com/openhab/openhab-addons/blob/main/.github/workflows/ci-build.yml) does not upload any Jars
* The Jenkins Job uploads Jars, however:
  * All builds for an addon, even if they are for different PRs, update the artifact at `openhab.jfrog.io`.
  * Thus, if I understand things right, there is a race condition and you never know whether the artifact belongs to a certain PR
  * To share that artifact one must open the jenkins build log, copy the url or extract it from the PR-Template's link, and paste it into the PR

## Possible Solution

* Automagically add a comment to the PR once the jar is available as artifact
* Add the Build-Job's ID or at least add the PR-ID to the artifact's url. 
  This could also be accomplished by uploading the `jar` as github actions artifact.

My first google-hit that does both was https://github.com/gavv/pull-request-artifacts , but  I didn't really look into it and there might be better solutions.
lsiepel commented 1 year ago

@wborn something for you to look at? Sounds like a very convenient addition