Skip to content

Conversation

@SUMITKC1
Copy link

🔧 Problem

The current project update logic restores mainline states one-by-one, causing redundant API calls and rate-limit issues for large projects.

✅ Solution

  • Replaced per-release update with a batch update using /projects/<id>/releases
  • Moved update_project_release_relationships_batch() directly into create_project.py
  • Removed sw360_patch.py and the patch logic from script_base.py
  • Updated print formatting to follow project standards (print_text, print_red)

📦 Files Affected

  • create_project.py
  • script_base.py (removed patch injection)
  • Removed: sw360_patch.py

This fully aligns with the feedback in #122 and @gernot-h's review comments.

cc: @gernot-h 🚀

Refactor: Move batch update logic into create_project.py and align with code standards
@gernot-h
Copy link
Collaborator

@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.

@gernot-h
Copy link
Collaborator

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.

@gernot-h
Copy link
Collaborator

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.

@tngraf
Copy link
Collaborator

tngraf commented Apr 15, 2025

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants