EDM-4144: Clarify OCI reference terminology#689
Conversation
WalkthroughThis PR adds a shared OCI reference validator that rejects tags and digests, applies it to catalog and repository image fields, and updates the related form labels and ARIA text to match the new terminology. ChangesOCI Reference Validation and Terminology Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed: one or more packages not found in the registry. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/ui-components/src/components/Catalog/AddCatalogItemWizard/utils.ts`:
- Around line 516-523: The protocol-stripping regex in uriHasNoTagOrDigest only
matches lowercase schemes; update the regex to be case-insensitive so it strips
protocols like HTTP:// or HTTPS:// as well. Locate the uriHasNoTagOrDigest
function and change the pattern used to remove the protocol to use a
case-insensitive match (e.g., add the 'i' flag to the existing regex) so
path/imageName extraction remains correct for uppercase or mixed-case schemes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: e91dc34b-69cd-4b15-8833-2d510f770434
⛔ Files ignored due to path filters (1)
libs/i18n/locales/en/translation.jsonis excluded by!libs/i18n/locales/en/translation.json
📒 Files selected for processing (3)
libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsxlibs/ui-components/src/components/Catalog/AddCatalogItemWizard/utils.tslibs/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx
jkilzi
left a comment
There was a problem hiding this comment.
Nice cleanup. The terminology change from "URI" to "OCI reference" is more accurate, and the refactoring of the validation schema is a clear improvement.
A few observations:
uriHasNoTagOrDigestextraction — good; the named function makes the logic independently testable.- Parameterised required message — giving each call site its own error string ("Container image reference is required" vs "OCI reference is required") is the right call.
aria-labelfix inCreateRepositoryForm— the field previously hadaria-label={t('Artifact URI')}and now correctly usest('Image name'). If there are any Cypress/Playwright selectors or snapshot tests that target the old label, they'll need updating.
Made-with: Cursor
b1dd277 to
0f4af8c
Compare
|
Rebased and fixed conflicts in |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsx`:
- Around line 129-135: The placeholder for the OCI reference field still shows a
download URL example, which conflicts with the new OCI-style label. Update the
TextField in TypeConfigStep to use an OCI reference example placeholder
consistent with the field name, and keep the change localized to the `OCI
reference` input so users are guided toward a valid OCI image reference format.
In `@libs/ui-components/src/components/Catalog/AddCatalogItemWizard/utils.ts`:
- Around line 516-531: The uriHasNoTagOrDigest helper is too permissive because
it strips scheme:// and only inspects the last path segment, allowing full URLs
like https://example.com/image.qcow2 to pass. Update the validation used by
imageReferenceWithoutVersionSchema for both containerUri and artifacts[].uri to
reject non-OCI URL shapes entirely, and validate the full reference string
instead of normalizing away the scheme before checking for tag/digest.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 89a58c06-e8a0-4f61-bd09-ad4e8696a299
⛔ Files ignored due to path filters (1)
libs/i18n/locales/en/translation.jsonis excluded by!libs/i18n/locales/en/translation.json
📒 Files selected for processing (3)
libs/ui-components/src/components/Catalog/AddCatalogItemWizard/steps/TypeConfigStep.tsxlibs/ui-components/src/components/Catalog/AddCatalogItemWizard/utils.tslibs/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx
Affected Areas
All functional changes are localized to libs/ui-components/ (shared UI used across platforms):
AddCatalogItemWizard)CreateRepository)The UI changes rely on libs/i18n/ localized terminology (e.g., “OCI reference” and “OCI reference is required”) for user-facing labels and validation messages, but no platform-specific app code, auth proxy, container build logic, E2E tests, or CI configuration is implicated.
Summary
This PR clarifies OCI reference terminology in the shared UI by replacing “Artifact URI”/generic “URI” wording with the more precise “OCI reference”, including both visible labels and accessibility/validation text.
Changes by Component
Catalog Configuration (
libs/ui-components/src/components/Catalog/AddCatalogItemWizard/)imageReferenceWithoutVersionSchema/uriHasNoTagOrDigestapproach::) and digest (@)Repository Management (
libs/ui-components/src/components/Repository/CreateRepository/)aria-labelfrom “Artifact URI” to “Image name” (matching the visible label).Impact