Enforce product_name -> one DT project per EF project#67
Closed
lukpueh wants to merge 1 commit into
Closed
Conversation
Change the DependencyTrackProject uniqueness from (name, parent_uuid) to (ef_project_id, name), which is the invariant the runtime relies on: the upload target is resolved by find_dt_project(ef_project_id, name) via scalar_one_or_none(). Adds an Alembic migration for the constraint swap (reversible) and tests that a duplicate (ef_project_id, name) is rejected while the same name under different EF projects is allowed. Also document the model in DESIGN.md: the workload uniqueness constraints (not scoped by ef_project_id) and the DT (ef_project_id, name) constraint, and expand the Authorization Boundary section to frame one-workload-per-EF-project as a design choice while the actual correctness invariant is that product_name resolves to a single DT project within the authenticated scope. Assisted-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Lukas Puehringer <lukas.puehringer@eclipse-foundation.org>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Change the DependencyTrackProject uniqueness from (name, parent_uuid) to (ef_project_id, name), which is the invariant the runtime relies on: the upload target is resolved by find_dt_project(ef_project_id, name) via scalar_one_or_none(). Adds an Alembic migration for the constraint swap (reversible) and tests that a duplicate (ef_project_id, name) is rejected while the same name under different EF projects is allowed.
Also document the model in DESIGN.md: the workload uniqueness constraints (not scoped by ef_project_id) and the DT (ef_project_id, name) constraint, and expand the Authorization Boundary section to frame one-workload-per-EF-project as a design choice while the actual correctness invariant is that product_name resolves to a single DT project within the authenticated scope.
Assisted-by: Claude Opus 4.8 noreply@anthropic.com