fix(helm-repository): strip trailing slash from OCI repository and registry URL - #2964
Conversation
Submitting an OCI helm repository URL with a trailing slash (e.g. `oci://docker.io/`) is rejected by the backend, which requires an empty URL path. Strip trailing slash(es) client-side before submit so users don't hit that error for a purely cosmetic typo.
|
View your CI Pipeline Execution ↗ for commit 95dcf03
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Extract the trailing-slash stripping into a shared stripUrlTrailingSlash util (query string/fragment aware, per review feedback on the helm repository fix), reuse it for container registries, and cover both the create and edit flow for each modal.
|
Addressed both points from the cubic review:
Also extended the same fix to container registries ( |
HelmRepositoryRequest.url is typed as optional (string | undefined) in the generated API client, so passing it directly to stripUrlTrailingSlash(url: string) failed the build's type check. Guard for the undefined case, same as already done in the container registry modal.
|
Fixed the CI build failure: `HelmRepositoryRequest.url` is typed as optional (`string | undefined`) in the generated API client, so passing it straight into `stripUrlTrailingSlash(url: string)` failed `nx run console:build`'s type check (the container registry modal already guarded for this correctly, the helm one didn't). Guarded it the same way. Verified locally with `nx run console:build:development` and the full `domains-organizations-feature` test suite (318 tests) — both pass now. This also explains why testing on the PR preview showed no trailing-slash stripping for HTTPS repos: the build never succeeded, so no new preview was ever deployed from this branch. Should be fixed once this commit's CI run goes green. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #2964 +/- ##
===========================================
- Coverage 49.52% 49.29% -0.23%
===========================================
Files 1286 1289 +3
Lines 27799 27978 +179
Branches 8300 8277 -23
===========================================
+ Hits 13767 13792 +25
- Misses 11740 11893 +153
- Partials 2292 2293 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🎉 This PR is included in version 1.354.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
oci://docker.io/no longer gets rejected by the backend (which requires an empty URL path for OCI repositories)Screenshots / Recordings
N/A (form submission logic only, no visual change)
Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
feat(service): add new Terraform service) - required for semantic-release🤖 Generated with Claude Code
Summary by cubic
Normalizes Helm repository and container registry URLs before submission so values like
oci://docker.io/andhttps://my-registry.example.com/are accepted instead of rejected for having a non-empty path. Applies to create and edit flows, preserves query strings and fragments, and leaves omitted URLs unchanged.stripUrlTrailingSlashhelper for both modals.Written for commit 95dcf03. Summary will update on new commits.