Skip to content

Enforce product_name -> one DT project per EF project#67

Closed
lukpueh wants to merge 1 commit into
eclipse-csi:mainfrom
lukpueh:harden-db-constraints
Closed

Enforce product_name -> one DT project per EF project#67
lukpueh wants to merge 1 commit into
eclipse-csi:mainfrom
lukpueh:harden-db-constraints

Conversation

@lukpueh

@lukpueh lukpueh commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown

@lukpueh lukpueh closed this Jul 16, 2026
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