-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Labels
needs-kindIndicates an issue or PR lacks a `kind/foo` label and requires one.Indicates an issue or PR lacks a `kind/foo` label and requires one.needs-priorityIndicates an issue or PR lacks a `priority/foo` label and requires one.Indicates an issue or PR lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
Description
Bug Description
In migration/v19/model/application.go, the Dependency.BeforeCreate() method has two issues in its cycle detection logic:
1. Incorrect GORM Column Name
The query uses struct field name "ToID" instead of the expected database column name "to_id". This causes the query to silently miss rows and fail to detect cycles properly.
2. Slice Accumulation Bug
The nextDeps slice is never reset between iterations, causing stale/duplicated results to accumulate across loop iterations.
Location
- File:
migration/v19/model/application.go - Method:
Dependency.BeforeCreate()(lines ~93-111)
Fix Required
- Change query to use DB column name:
db.Where("to_id IN ?", nextAppsIDs).Find(&nextDeps) - Reset slice each iteration:
nextDeps = nextDeps[:0]before the query
References
- Identified in PR: ✨ Identity associated to application by role. #911
- Comment: ✨ Identity associated to application by role. #911 (comment)
- Requested by: @jortel
Metadata
Metadata
Assignees
Labels
needs-kindIndicates an issue or PR lacks a `kind/foo` label and requires one.Indicates an issue or PR lacks a `kind/foo` label and requires one.needs-priorityIndicates an issue or PR lacks a `priority/foo` label and requires one.Indicates an issue or PR lacks a `priority/foo` label and requires one.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.
Type
Projects
Status
🆕 New