eclipse-archived / antenna

SW360 Antenna project
Other
22 stars 19 forks source link

Introduce WORK_IN_PROGRESS clearing state #619

Closed KorSin closed 3 years ago

KorSin commented 3 years ago

Resolves #608

A release can now have a WORK_IN_PROGRESS clearing state. This updates or creates the release on SW360 but does not upload any attachment.

Signed-off-by: Korbinian Singhammer external.Korbinian.Singhammer2@bosch.io

Please provide a summary of your changes here.

  • Which issue is this pull request belonging to? (Refer to issue here)
  • How is it solving the issue?
  • Did you add or update any new dependencies that are required for your change?

Request Reviewer

You can add desired reviewers here with an @mention. @neubs-bsi @oheger-bosch

Type of Change

Mention one of the following:
bug fix | new feature | improvements | documentation update | CI | Other

Type of change: new feature

How Has This Been Tested?

If you have added any changes that require additional tests, or changes in tests, you should implement them and describe them here.
All test that passed before your contribution should pass after it as well.

Checklist

Must:

Optional: (delete if not applicable)

KorSin commented 3 years ago

@neubs-bsi, @oheger-bosch In terms of automated tests I am satisfied with the changes. However, manually testing the changes with an SW360 instance leaves me a bit confused. If I update a not cleared release with the WORK_IN_PROGRESS state, this state is succesfully set in SW360 and no attachment upload is performed. Afterwards however, if I want to update release information, e.g., download url or clearing state to OSM_APPROVED, these changes are not visible in SW360. Do you have an idea what is wrong, or is this somehow an expected SW360 behavior?

neubs-bsi commented 3 years ago

@KorSin have you set sw360updateReleases to true in the updaters properties file? By default it is false.

KorSin commented 3 years ago

Yes, it is set to true.

oheger-bosch commented 3 years ago

Do updates of attributes work if you set the clearing state directly to OSM_APPROVED? And can you update properties multiple times while the state is WORK_IN_PROGRESS?

KorSin commented 3 years ago

No, both things do not work. However, I can still add attributes that were not filled out before.

oheger-bosch commented 3 years ago

Hm, then this sounds like another problem with updates, but not related to this PR. I would propose adding a new ticket to track this.

KorSin commented 3 years ago

Hmm, going through the procedure with a debugger, it seems the problem lies rather on the antenna side: During an update, the method getOrCreateRelease is called. If the release is found in SW360, the data is merged and the update is performed afterwards, see here. It seems that this merging overwrites the local release with the data from SW360 and then updates it which would make the update redundant. Am I missing something?

oheger-bosch commented 3 years ago

Can it be that the merge is just done in the wrong direction? The properties of the local release should override the ones of the release in SW360, and not the way around.

KorSin commented 3 years ago

It seems to be the current case. Maybe the intention was to not override the most important fields like the name or version. Changing the priority should not be difficult, but I am unsure whether to do this in this PR.

oheger-bosch commented 3 years ago

No, better having a separate ticket and PR. So, I think this one can be merged - maybe except for this typo?

neubs-bsi commented 3 years ago

The ticket already exists. https://github.com/eclipse/antenna/issues/588 @KorSin you can mention your discoveries there.

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

84.2% 84.2% Coverage
0.0% 0.0% Duplication

warning The version of Java (1.8.0_272) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11. Read more here