Skip to content

fix(sku): reject empty SKU ID on create and replace#2253

Open
wminckler wants to merge 1 commit into
NVIDIA:mainfrom
wminckler:sku-bug
Open

fix(sku): reject empty SKU ID on create and replace#2253
wminckler wants to merge 1 commit into
NVIDIA:mainfrom
wminckler:sku-bug

Conversation

@wminckler
Copy link
Copy Markdown
Contributor

A SKU could be created with an empty id (the proto id field defaults to "" when omitted, and nothing validated it), which Postgres accepts as a valid primary key. Duplicate-content detection would then match that row and report "Specified SKU matches SKU with ID: " with an empty id.

Reject empty ids in db::sku::create and db::sku::replace so the empty-id row can never be inserted, and replace fails fast with a clear message instead of a cryptic RowNotFound.

Description

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Related Issues (Optional)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

A SKU could be created with an empty id (the proto id field defaults to
"" when omitted, and nothing validated it), which Postgres accepts as a
valid primary key. Duplicate-content detection would then match that row
and report "Specified SKU matches SKU with ID: " with an empty id.

Reject empty ids in db::sku::create and db::sku::replace so the empty-id
row can never be inserted, and replace fails fast with a clear message
instead of a cryptic RowNotFound.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wminckler wminckler requested a review from a team as a code owner June 5, 2026 18:06
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 61a3a3e7-7ea4-4f8b-9d51-21409f130db6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

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