Conversation
Refactor: Move batch update logic into create_project.py and align with code standards
|
@SUMITKC1, your function update_project_release_relationships_batch shouldn't be needed. If you check the existing code, you'll notice that we don't directly call the SW360 REST API functions in CaPyCli, but instead use functions in the sw360python library. And as mentioned in the initial comment of #122, I already contributed sw360python support for the batch update in that library which you can just use, see https://github.com/sw360/sw360python/blob/master/ChangeLog.md#v190. |
|
And please just update the branch in this PR and let's continue working here. So if you want to remove the commit, please don't close this one and create a new PR to avoid flooding the maintainer with notifcations about new PRs. |
|
By the way, please never use generic commit messages like "Update create_project.py", but descriptive commit messages, see the numerous web resources about how to write good Git commit messages and check the history of this project for the used conventions. |
|
@SUMITKC1 Please also describe, how you tested your fix with a real SW360 instance. Was it a SW360 with the new UI or with the old UI. Please provide the version information of your SW360 instance. |
🔧 Problem
The current
project updatelogic restores mainline states one-by-one, causing redundant API calls and rate-limit issues for large projects.✅ Solution
/projects/<id>/releasesupdate_project_release_relationships_batch()directly intocreate_project.pysw360_patch.pyand the patch logic fromscript_base.pyprint_text,print_red)📦 Files Affected
create_project.pyscript_base.py(removed patch injection)sw360_patch.pyThis fully aligns with the feedback in #122 and @gernot-h's review comments.
cc: @gernot-h 🚀