chore: descriptor - rename in tests: localBlob type to LocalBlob UpperCamelCase [1/4]#2323
Conversation
✅ Deploy Preview for ocm-website ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis pull request expands and refactors test coverage for LocalBlob type handling in the descriptor v2 bindings. New JSON unmarshal test cases verify type mapping behavior for unversioned types, while existing scheme resolution tests are consolidated into a parameterized test pattern. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bindings/go/descriptor/v2/helpers_test.go (1)
53-63: LGTM — legacy raw coverage is a good addition.Nit (optional): you may want a symmetric
TestIsLocalBlob_RawUpperCamelWithoutVersionusing the unversionedLocalBlobalias to exercise the unversioned scheme entry added inscheme.go. Not blocking —scheme_test.goalready covers that resolution path directly.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bindings/go/descriptor/v2/helpers_test.go` around lines 53 - 63, Add a symmetric test named TestIsLocalBlob_RawUpperCamelWithoutVersion that mirrors TestIsLocalBlob_RawLegacy but constructs a runtime.Raw whose runtime.Type.Name uses the unversioned alias (descriptorv2.LocalBlobAccessType) and whose Data JSON uses the unversioned scheme (e.g., "type":"localBlob" or the alias form your scheme expects); call descriptorv2.IsLocalBlob(raw) and assert.True on the result to exercise the unversioned scheme entry (use runtime.Raw, runtime.Type, descriptorv2.LocalBlobAccessType, and descriptorv2.IsLocalBlob to locate where to add the test).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@bindings/go/descriptor/v2/helpers_test.go`:
- Around line 53-63: Add a symmetric test named
TestIsLocalBlob_RawUpperCamelWithoutVersion that mirrors
TestIsLocalBlob_RawLegacy but constructs a runtime.Raw whose runtime.Type.Name
uses the unversioned alias (descriptorv2.LocalBlobAccessType) and whose Data
JSON uses the unversioned scheme (e.g., "type":"localBlob" or the alias form
your scheme expects); call descriptorv2.IsLocalBlob(raw) and assert.True on the
result to exercise the unversioned scheme entry (use runtime.Raw, runtime.Type,
descriptorv2.LocalBlobAccessType, and descriptorv2.IsLocalBlob to locate where
to add the test).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 533c64c4-1b3e-45d1-a9cd-97e2063bc67c
📒 Files selected for processing (8)
bindings/go/descriptor/runtime/local_access.gobindings/go/descriptor/runtime/schemas/LocalBlob.schema.jsonbindings/go/descriptor/v2/helpers_test.gobindings/go/descriptor/v2/local_access.gobindings/go/descriptor/v2/local_access_test.gobindings/go/descriptor/v2/schemas/LocalBlob.schema.jsonbindings/go/descriptor/v2/scheme.gobindings/go/descriptor/v2/scheme_test.go
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bindings/go/descriptor/v2/local_access_test.go (1)
91-91: Nit: use the exported constant for consistency.Line 132 asserts with
descriptorv2.LocalBlobAccessType, but here the literal"LocalBlob"is used. Prefer the constant to keep assertions resilient to future renames and consistent across tests.Proposed change
- assert.Equal(t, "LocalBlob", blob.Type.Name) + assert.Equal(t, descriptorv2.LocalBlobAccessType, blob.Type.Name)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bindings/go/descriptor/v2/local_access_test.go` at line 91, Replace the string literal "LocalBlob" in the assertion for blob.Type.Name with the exported constant descriptorv2.LocalBlobAccessType to match the other test and make the assertion resilient to renames; update the assert.Equal(t, "LocalBlob", blob.Type.Name) to use descriptorv2.LocalBlobAccessType instead.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@bindings/go/descriptor/v2/local_access_test.go`:
- Line 91: Replace the string literal "LocalBlob" in the assertion for
blob.Type.Name with the exported constant descriptorv2.LocalBlobAccessType to
match the other test and make the assertion resilient to renames; update the
assert.Equal(t, "LocalBlob", blob.Type.Name) to use
descriptorv2.LocalBlobAccessType instead.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 596fed42-4b04-484b-98e1-8d2ac7499e97
📒 Files selected for processing (2)
bindings/go/descriptor/v2/local_access_test.gobindings/go/descriptor/v2/scheme_test.go
✅ Files skipped from review due to trivial changes (1)
- bindings/go/descriptor/v2/scheme_test.go
1482ffd to
35949ce
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bindings/go/descriptor/v2/local_access_test.go (1)
91-91: Use the descriptor constant for the expected canonical name.This keeps the assertion aligned with the neighboring tests and avoids duplicating the canonical string literal.
♻️ Proposed cleanup
- assert.Equal(t, "LocalBlob", blob.Type.Name) + assert.Equal(t, descriptorv2.LocalBlobAccessType, blob.Type.Name)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bindings/go/descriptor/v2/local_access_test.go` at line 91, Replace the hard-coded expected string "LocalBlob" in the assertion with the canonical name constant from the descriptor package (i.e., use the descriptor constant instead of a literal); update the assertion comparing blob.Type.Name to reference that constant (replace the literal in the assert.Equal call so it uses the descriptor package's LocalBlob canonical-name constant).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@bindings/go/descriptor/v2/local_access_test.go`:
- Line 91: Replace the hard-coded expected string "LocalBlob" in the assertion
with the canonical name constant from the descriptor package (i.e., use the
descriptor constant instead of a literal); update the assertion comparing
blob.Type.Name to reference that constant (replace the literal in the
assert.Equal call so it uses the descriptor package's LocalBlob canonical-name
constant).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a7764a95-3496-4d70-b979-f6e564f78475
📒 Files selected for processing (8)
bindings/go/descriptor/runtime/local_access.gobindings/go/descriptor/runtime/schemas/LocalBlob.schema.jsonbindings/go/descriptor/v2/helpers_test.gobindings/go/descriptor/v2/local_access.gobindings/go/descriptor/v2/local_access_test.gobindings/go/descriptor/v2/schemas/LocalBlob.schema.jsonbindings/go/descriptor/v2/scheme.gobindings/go/descriptor/v2/scheme_test.go
✅ Files skipped from review due to trivial changes (3)
- bindings/go/descriptor/v2/helpers_test.go
- bindings/go/descriptor/v2/scheme_test.go
- bindings/go/descriptor/v2/schemas/LocalBlob.schema.json
🚧 Files skipped from review as they are similar to previous changes (3)
- bindings/go/descriptor/v2/scheme.go
- bindings/go/descriptor/runtime/schemas/LocalBlob.schema.json
- bindings/go/descriptor/v2/local_access.go
… [2/4] (#2324) ## Summary Updates YAML test fixtures in `bindings/go/constructor/` to use `LocalBlob` (UpperCamelCase) instead of `localBlob`. Part of the localBlob → LocalBlob UpperCamelCase migration for ocm-project/ocm-project#962. ## Changes - `construct_resource_test.go`: YAML fixture `type: localBlob` → `type: LocalBlob` - `construct_source_test.go`: YAML fixture `type: localBlob` → `type: LocalBlob` ## Dependencies Depends on #2323 being merged and published (descriptor/v2 with `LocalBlob` as primary type). ## Related PRs - #2323 — PR 1: descriptor/v2 + descriptor/runtime (constants, scheme, tests) - **This PR** — PR 2: constructor (YAML fixtures) - #2325 — PR 3: cli (test assertions) - #2326 — PR 4: kubernetes/controller (test JSON) Resolves part of ocm-project/ocm-project#962 --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
… [2/4] (open-component-model#2324) ## Summary Updates YAML test fixtures in `bindings/go/constructor/` to use `LocalBlob` (UpperCamelCase) instead of `localBlob`. Part of the localBlob → LocalBlob UpperCamelCase migration for ocm-project/ocm-project#962. ## Changes - `construct_resource_test.go`: YAML fixture `type: localBlob` → `type: LocalBlob` - `construct_source_test.go`: YAML fixture `type: localBlob` → `type: LocalBlob` ## Dependencies Depends on open-component-model#2323 being merged and published (descriptor/v2 with `LocalBlob` as primary type). ## Related PRs - open-component-model#2323 — PR 1: descriptor/v2 + descriptor/runtime (constants, scheme, tests) - **This PR** — PR 2: constructor (YAML fixtures) - open-component-model#2325 — PR 3: cli (test assertions) - open-component-model#2326 — PR 4: kubernetes/controller (test JSON) Resolves part of ocm-project/ocm-project#962 --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> e25a69c
f306bb7 to
daf16ac
Compare
…Case [4/4] (#2326) ## Summary Updates test JSON strings and hardcoded type references in `kubernetes/controller/` to use `LocalBlob/v1` (UpperCamelCase) instead of `localBlob/v1`. Part of the localBlob → LocalBlob UpperCamelCase migration for ocm-project/ocm-project#962. ## Changes - `deployer_controller_test.go`: 9× `{"type":"localBlob/v1"}` → `{"type":"LocalBlob/v1"}` - `deployer_controller_rgd_test.go`: 4× same replacement - `cel/functions/oci_test.go`: replaced hardcoded `runtime.NewVersionedType("localBlob", "v1")` with `runtime.NewVersionedType(v2.LocalBlobAccessType, v2.LocalBlobAccessTypeVersion)` using the exported constant ## Dependencies Depends on #2323 being merged and published (descriptor/v2 with `LocalBlob` as primary type). ## Related PRs - #2323 — PR 1: descriptor/v2 + descriptor/runtime (constants, scheme, tests) - #2324 — PR 2: constructor (YAML fixtures) - #2325 — PR 3: cli (test assertions) - **This PR** — PR 4: kubernetes/controller (test JSON) Resolves part of ocm-project/ocm-project#962 --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Skarlso
left a comment
There was a problem hiding this comment.
This PR doesn't appear to be doing whatever the title says it's doing or the description. :D
after rebasing after merging other related PRs, this PR got a little bit off. It now only contains cleaning up the tests. I updated the description. Pls check again and approve if ok. |
…ts for LocalBlob - Add unversioned unmarshal tests for UpperCamelCase and legacy type strings - Consolidate scheme resolution tests into table-driven TestScheme_ResolvesAllLocalBlobAliases - Consolidate IsLocalBlob tests into table-driven TestIsLocalBlob - Remove stale comment in TestLocalBlob_Constants Combines changes from open-component-model#2323 and open-component-model#2388. Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
d8bac41 to
8f48d0d
Compare
…2325) ## Summary Updates test assertion strings in `cli/cmd/cmd_test.go` from `"localBlob/v1"` to `"LocalBlob/v1"` to match the new primary UpperCamelCase type name. Part of the localBlob → LocalBlob UpperCamelCase migration for ocm-project/ocm-project#962. ## Changes - `cli/cmd/cmd_test.go`: 5 assertion strings updated (`"localBlob/v1"` → `"LocalBlob/v1"`) - Line 829: `r.Equal` assertion - Line 1240: YAML output string - Line 1353: JSON map value - Lines 1777, 1817: `r.Equal` assertions **Not changed:** `--upload-as localBlob` CLI flag (stays lowercase — enum value, not a type name) ## Dependencies Depends on #2323 being merged and published (descriptor/v2 with `LocalBlob` as primary type). ## Related PRs - #2323 — PR 1: descriptor/v2 + descriptor/runtime (constants, scheme, tests) - #2324 — PR 2: constructor (YAML fixtures) - **This PR** — PR 3: cli (test assertions) - #2326 — PR 4: kubernetes/controller (test JSON) Resolves part of ocm-project/ocm-project#962 --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
updated PR description and title as requested
…2331) (#2401) <!-- markdownlint-disable MD041 --> #### What this PR does / why we need it Fixes dependency issues introduced by the automated Renovate dependency update in #2331. Renovate bumped `bindings/go/runtime` to `v0.0.8` and `bindings/go/descriptor/v2` to `v2.0.3-alpha3` in some modules, but left `descriptor/runtime` and `descriptor/normalisation` still pinned to the old `descriptor/v2 v2.0.1-alpha9`. Since `v2.0.3-alpha3` includes the `LocalBlob` UpperCamelCase rename (#2323), modules depending on both `descriptor/runtime` (at `v2.0.1-alpha9`) and `descriptor/v2` (at `v2.0.3-alpha3`) had an incompatible version mismatch. The fix updates `descriptor/runtime` and `descriptor/normalisation` to also require `descriptor/v2 v2.0.3-alpha3`, then propagates the aligned versions to all downstream consumers across the workspace. #### Which issue(s) this PR fixes Related to #2331 --------- Signed-off-by: Frederic Wilhelm <frederic.wilhelm@sap.com> Co-authored-by: ocmbot[bot] <125909804+ocmbot[bot]@users.noreply.github.com>
## Summary - Rename all `localBlob/v1` references to `LocalBlob/v1` across website documentation (6 files) - Fix unversioned `localBlob` → `LocalBlob/v1` in signing concept doc - Add "Legacy alias: `localBlob`" note in the reference doc (consistent with `OCIImageLayer/v1` and `Helm/v1` style) - Remove unnecessary `Helm/v1` deprecation callout (no other type has one) ## What's unchanged (by design) - `--upload-as localBlob` CLI flag — this is an enum value, not a type name - `content_versioned/` legacy docs — intentionally frozen (same approach as #2244) ## Dependencies - **Depends on:** #2244 — this PR is rebased on top of `website-upper-camel-case-types` and should be merged after #2244 ## Related - Part of open-component-model/ocm-project#962 - Related code PRs: #2323 (descriptor), #2324 (constructor), #2325 (cli), #2326 (controller) --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
## Summary - Rename all `localBlob/v1` references to `LocalBlob/v1` across website documentation (6 files) - Fix unversioned `localBlob` → `LocalBlob/v1` in signing concept doc - Add "Legacy alias: `localBlob`" note in the reference doc (consistent with `OCIImageLayer/v1` and `Helm/v1` style) - Remove unnecessary `Helm/v1` deprecation callout (no other type has one) ## What's unchanged (by design) - `--upload-as localBlob` CLI flag — this is an enum value, not a type name - `content_versioned/` legacy docs — intentionally frozen (same approach as #2244) ## Dependencies - **Depends on:** #2244 — this PR is rebased on top of `website-upper-camel-case-types` and should be merged after #2244 ## Related - Part of open-component-model/ocm-project#962 - Related code PRs: #2323 (descriptor), #2324 (constructor), #2325 (cli), #2326 (controller) --------- Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> b742838
Summary
Test-only cleanup for the
localBlob→LocalBlobUpperCamelCase rename. The production code, generated schemas, and original test changes from the initial scope already landed inmainvia rebase.Absorbs #2388 (table-driven
IsLocalBlobrefactor) into this PR.Changes
descriptor/v2/local_access_test.goTestLocalBlob_UnmarshalJSON_UnversionedUpperCamelCase— covers unversioned"LocalBlob"type stringTestLocalBlob_UnmarshalJSON_UnversionedLegacy— covers unversioned"localBlob"type stringTestLocalBlob_Constantsdescriptor/v2/scheme_test.goTestScheme_Resolves*_LocalBlobfunctions into one table-drivenTestScheme_ResolvesAllLocalBlobAliasesdescriptor/v2/helpers_test.go(from #2388)TestIsLocalBlob_*functions into one table-drivenTestIsLocalBlobContext
This is part 1 of the
localBlobrename series (ocm-project/ocm-project#962). Follow-up PRs:Closes #2388.