Skip to content

Fix/name collision on import#17

Merged
gallayl merged 4 commits into
developfrom
fix/name-collision-on-import
May 20, 2026
Merged

Fix/name collision on import#17
gallayl merged 4 commits into
developfrom
fix/name-collision-on-import

Conversation

@gallayl
Copy link
Copy Markdown
Contributor

@gallayl gallayl commented May 20, 2026

🎯 Summary

Hardens entity-creation endpoints against client-supplied id collisions:

  • POST /services, /stacks, /github-repositories, /prerequisites now reject duplicate id/name with 409 Conflict and a descriptive message instead of silently overwriting state or surfacing a generic store error.
  • POST /stacks/import gains an assertNoImportConflicts pre-flight that collects every colliding stack.name, service.id, repository.id, and prerequisite.id and returns a single 409. This prevents the existing rollback path from being entered for avoidable collisions (which would have deleted the pre-existing colliding records).
  • Multi-step create flows (/services, /stacks, /prerequisites) roll back the records they have already inserted when a later step fails, so a failed create no longer leaves orphan rows.

🧪 Tests

  • Duplicate-id 409 + check-result rollback specs for POST /prerequisites.
  • Duplicate stack.name and cross-stack duplicate service.id specs for POST /stacks/import.

@gallayl gallayl merged commit 8ed66f9 into develop May 20, 2026
9 checks passed
@gallayl gallayl deleted the fix/name-collision-on-import branch May 20, 2026 09:47
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.

1 participant