Learn more about these different git repos.
Other Git URLs
(This came up while working with the Python API, but I'm not sure if the solution is going to impact only that one.)
In Packit we hit a race condition, when trying to create the same project from tasks running in parallel. The solution was to check the exception and if it was raised b/c the project already exists, ignore the error. But this is ugly.
Looking at the bigger picture in that code, we also have create_copr_project_if_not_exists(), which first checks if the project already exists, then tries to create it. Which is 2 API calls.
create_copr_project_if_not_exists()
The ask here is to have a new endpoint to project_proxy.add() to not to raise an error, if a project with an identical name and configuration (this is important, if projects are configured differently, the caller should find out about this) already exists, OR
project_proxy.add()
to have a new API which either creates the project if it doesn't exist, or returns the existing project, if it does.
Metadata Update from @praiskup: - Issue tagged with: API, RFE
Metadata Update from @praiskup: - Issue tagged with: packit
This issue has been migrated to GitHub: https://github.com/fedora-copr/copr/issues/2140
Metadata Update from @nikromen: - Issue close_status updated to: MIGRATED - Issue status updated to: Closed (was: Open)
Log in to comment on this ticket.