[AI] OSAC-4213: InstanceType: empty name allowed — latent primary-key corruption - #468
Conversation
|
AI Session Costs
|
|
@osac-jira-ai-issue-solver[bot]: This pull request references OSAC-4213 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.1.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
🤖 Finished Review · ✅ Success · Started 7:32 AM UTC · Completed 7:45 AM UTC Commit: |
|
Looks good to me Previous runReviewFindingsLow
Previous run (2)Looks good to me Labels: PR adds a database constraint to prevent empty primary keys in instance_types — this is a bug fix for a latent data integrity issue |
|
In comment, @fullsend-ai-review[bot] said:
I was unable to produce code changes to address this comment after multiple attempts. |
|
In comment, @fullsend-ai-review[bot] said:
I was unable to produce code changes to address this comment after multiple attempts. |
|
CI failures addressed in 40ce53d. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: osac-jira-ai-issue-solver[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🤖 Finished Review · ✅ Success · Started 10:29 AM UTC · Completed 10:42 AM UTC Commit: |
…uption Co-authored-by: Ygal Blum <yblum@redhat.com>
40ce53d to
e0c985b
Compare
|
🤖 Finished Review · ✅ Success · Started 11:06 AM UTC · Completed 11:20 AM UTC Commit: |
Resolves OSAC-4213
Summary
CHECK (name <> '')constraint to theinstance_typestable via new migration 102, matching the pattern already used bydisk_images(migration 99) andbare_metal_instance_types(migration 88)Context
The
instance_typestable uses name-as-primary-key (id = metadata.name), so an empty name would produce an empty primary key. While the proto-level validation (Metadata.name min_len: 1) prevents this via the normal API path, the database itself had no defense-in-depth constraint. This migration closes that gap.The archived table is intentionally excluded from the constraint, consistent with
disk_imagesscope.Test plan
INSERT INTO instance_typeswith an empty name is rejected withinstance_types_name_not_emptyviolationINSERT INTO instance_typeswith a valid name succeedsginkgo run -r internalto confirm no regressions🤖 Generated with Claude Code