-
Notifications
You must be signed in to change notification settings - Fork 7
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
avoid "Restoring original project mainline states" during "project update" #122
base: main
Are you sure you want to change the base?
Conversation
If args.copy_from is set, data of new project is already available, no need to get_project() again.
6c3ac3d
to
a7f7d70
Compare
a7f7d70
to
1df7aaa
Compare
Instead of storing all release states before project update and restoring it in a big loop afterwards, SW360 REST API also allows to pass full release information during release update. We however don't keep the release states set in SW360, but use the states provided in the SBOM.
1df7aaa
to
3f8d543
Compare
Hm,
Sorry, this is like the parameter |
My method |
Yes, this was by intention and I tried to describe this in my initial comment and that's exactly the point I wanted to discuss with you. ;) Probably I don't completely get your use case. My assumption was that the SBOM you'll use in --copy-from would be created by CaPyCli from the original project and then be modified as needed by the user - and I also added code to "project createbom" so that created SBOMs now also contain the release-project relation, so that all data is preserved. I can see your point, but on the other hand, I considered it quite unintuitive, if you pass an SBOM to overwrite the releases during the copy process, that the actual release data would be used from SBOM, but the meta data from the existing project. In general, I wonder if it's a good idea to have --copy-from take an SBOM to modify releases at the same time. Perhaps it would be clearer to have a "just copy" operation, followed by "project update" to modify the releases as needed? And the latter should probably than consider current state plus the information in the SBOM, with clearly described priority, but that's also some work to get the implementation right... |
@tngraf and me agreed that I will restore the functionality to retain project mainline states and project relations from SW360, but also that the data in the SBOM will have priority if included. Main intended use case here is to run "project --create --copy-from" with an SBOM created fresh by "capycli getdependencies" or from another scanner which doesn't have the project mainline states included. However, if the SBOM contains these details, we shall use it. |
This changes the release state handling during "project update". Instead of storing project release states from SW360 and restoring it release by release at the end, we pass on full release data to REST API endpoint for updating linked releases.
As an SBOM has to be provided during "project update" or "project create --copy_from" anyways, we take the release states stored in the SBOM instead of keeping the state in SW360.
Note that this requires also the change from sw360/sw360python#41 for correct "project update" support.
Fixes #121