Skip to content

Fix sync_ce_project crash with duplicate zone rows#2227

Draft
marceloamaral wants to merge 3 commits into
mainfrom
fix/sync-ce-project-zone-conflict
Draft

Fix sync_ce_project crash with duplicate zone rows#2227
marceloamaral wants to merge 3 commits into
mainfrom
fix/sync-ce-project-zone-conflict

Conversation

@marceloamaral

Copy link
Copy Markdown
Contributor

Summary

  • update_or_create raised MultipleObjectsReturned in production when the DB had multiple CodeEngineProject rows with the same project_id but different zone values (legacy per-zone project configuration)
  • Now deletes all existing rows for a project_id and recreates a single clean row without zone
  • Zone field is deprecated and no longer used by any code path

Test plan

  • Added 4 unit tests covering: create, update, duplicate removal, missing fields
  • Pylint 10/10, black clean

update_or_create raised MultipleObjectsReturned when production had
multiple CodeEngineProject rows with the same project_id but different
zones. Now deletes all existing rows for that project_id and recreates
a single clean row without zone.
@marceloamaral marceloamaral requested a review from a team as a code owner June 11, 2026 00:55
@Tansito

Tansito commented Jun 11, 2026

Copy link
Copy Markdown
Member

we decided to do an update instead to a delete to have more control by now, tomorrow we will try to find the correct fix to this situation

@Tansito Tansito marked this pull request as draft June 11, 2026 01:55
@Tansito Tansito self-requested a review June 11, 2026 01:57
@Tansito

Tansito commented Jun 11, 2026

Copy link
Copy Markdown
Member

Moved to draft as I think we can deploy this in staging without this fix as this fix is only required in this specific script. So we can just remove it by now and tomorrow we can look at this calmly.

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.

2 participants