Skip to content

chore: constructor - update LocalBlob YAML fixtures to UpperCamelCase [2/4]#2324

Merged
morri-son merged 5 commits into
open-component-model:mainfrom
morri-son:feat/localblob-uppercamelcase-constructor
Apr 24, 2026
Merged

chore: constructor - update LocalBlob YAML fixtures to UpperCamelCase [2/4]#2324
morri-son merged 5 commits into
open-component-model:mainfrom
morri-son:feat/localblob-uppercamelcase-constructor

Conversation

@morri-son

@morri-son morri-son commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

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: localBlobtype: LocalBlob
  • construct_source_test.go: YAML fixture type: localBlobtype: LocalBlob

Dependencies

Depends on #2323 being merged and published (descriptor/v2 with LocalBlob as primary type).

Related PRs

Resolves part of ocm-project/ocm-project#962

Aligns with open-component-model#962 UpperCamelCase convention. LocalBlob is now the primary
type for marshaling; localBlob preserved as legacy alias for backward
compatibility. Both descriptor/v2 and descriptor/runtime updated.

Adds scheme resolution tests for all 4 aliases (versioned/unversioned,
primary/legacy), updates marshal/unmarshal assertions, and adds legacy
backward-compat test coverage.

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@morri-son morri-son requested a review from a team as a code owner April 17, 2026 20:14
@netlify

netlify Bot commented Apr 17, 2026

Copy link
Copy Markdown

Deploy Preview for ocm-website ready!

Name Link
🔨 Latest commit 1044230
🔍 Latest deploy log https://app.netlify.com/projects/ocm-website/deploys/69eb55e0cc10a4000719303e
😎 Deploy Preview https://deploy-preview-2324--ocm-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR standardizes the local blob access type identifier from lowercase camel case (localBlob) to uppercase camel case (LocalBlob), adds legacy type aliases for backward compatibility, and updates corresponding schemas and tests across both runtime and v2 descriptor layers.

Changes

Cohort / File(s) Summary
Test YAML Updates
bindings/go/constructor/construct_resource_test.go, bindings/go/constructor/construct_source_test.go
Updated test fixture YAML to use LocalBlob instead of localBlob in access type values, with consistent indentation adjustments.
Runtime Descriptor Type Definitions
bindings/go/descriptor/runtime/local_access.go
Updated LocalBlobAccessType constant from "localBlob" to "LocalBlob"; added LegacyLocalBlobAccessType constant to preserve legacy value; extended schema metadata with enum constraints marking old format as deprecated.
Runtime Schema
bindings/go/descriptor/runtime/schemas/LocalBlob.schema.json
Added oneOf validation with explicit const values for LocalBlob/v1 (canonical) and three deprecated aliases (localBlob/v1, LocalBlob, localBlob).
V2 Descriptor Type Definitions
bindings/go/descriptor/v2/local_access.go
Updated LocalBlobAccessType constant from "localBlob" to "LocalBlob"; added LegacyLocalBlobAccessType constant; extended schema metadata with enum constraints for deprecated formats.
V2 Type Registration
bindings/go/descriptor/v2/scheme.go
Extended MustAddToScheme to register both versioned and unversioned type aliases for LegacyLocalBlobAccessType alongside existing registrations.
V2 Descriptor Tests
bindings/go/descriptor/v2/local_access_test.go, bindings/go/descriptor/v2/helpers_test.go
Updated marshaling expectations to use LocalBlob/v1 format; added separate tests for legacy localBlob/v1 format; renamed tests to clarify legacy vs. current behavior.
V2 Schema
bindings/go/descriptor/v2/schemas/LocalBlob.schema.json
Added oneOf validation with explicit const values for LocalBlob/v1 (canonical) and deprecated aliases, maintaining backward compatibility in schema validation.
V2 Type Resolution Tests
bindings/go/descriptor/v2/scheme_test.go
Added comprehensive test suite validating Scheme.NewObject resolution for both canonical (LocalBlob/v1) and legacy (localBlob/v1) type identifiers in versioned and unversioned forms.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/s

Suggested reviewers

  • jakobmoellerdev
  • Skarlso

Poem

🐰 From localBlob to LocalBlob we go,
With legacy aliases stealing the show,
Schemas revised, tests passing with grace,
Backward compatibility—the rabbit's embrace! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically summarizes the main changes: updating YAML test fixtures in the constructor module to use UpperCamelCase LocalBlob instead of localBlob, with clear context via the part indicator [2/4].
Description check ✅ Passed The PR description is directly related to the changeset, clearly explaining the YAML fixture updates, dependencies, and context within the broader UpperCamelCase migration effort.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@github-actions github-actions Bot added the size/m Medium label Apr 17, 2026
@morri-son morri-son added the kind/chore chore, maintenance, etc. label Apr 17, 2026
@morri-son morri-son changed the title test(constructor): update LocalBlob YAML fixtures to UpperCamelCase chore: test for update LocalBlob YAML fixtures to UpperCamelCase Apr 17, 2026
@morri-son morri-son changed the title chore: test for update LocalBlob YAML fixtures to UpperCamelCase chore: constructor - update LocalBlob YAML fixtures to UpperCamelCase Apr 17, 2026
@morri-son morri-son linked an issue Apr 17, 2026 that may be closed by this pull request
7 tasks
@morri-son morri-son changed the title chore: constructor - update LocalBlob YAML fixtures to UpperCamelCase chore: constructor - update LocalBlob YAML fixtures to UpperCamelCase [2/4] Apr 20, 2026
Only LocalBlob/v1 (UpperCamelCase) should be the non-deprecated
canonical form. All legacy variants — localBlob/v1, LocalBlob,
localBlob — are now marked deprecated in the JSON schemas and
generator markers, aligning with the intent of ocm-project#962.

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
bindings/go/descriptor/v2/scheme_test.go (1)

12-42: LGTM — good coverage across canonical/legacy and versioned/unversioned forms.

The four tests concisely validate all four permutations of Scheme.NewObject resolution for LocalBlob. Assertions use require.IsType on the concrete pointer, which is the right check here.

Optional: these tests are structurally identical and could be collapsed into a single table-driven test keyed by runtime.Type → expected type, but the current form reads fine and is easy to diff with the alias-registration changes in scheme.go.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/descriptor/v2/scheme_test.go` around lines 12 - 42, The tests
already cover all permutations (versioned/legacy/unversioned) for LocalBlob
resolution using descriptorv2.Scheme.NewObject and the
runtime.NewVersionedType/runtime.NewUnversionedType helpers; no changes
required—leave TestScheme_ResolvesUpperCamelCase_LocalBlob,
TestScheme_ResolvesLegacy_LocalBlob, TestScheme_ResolvesUnversioned_LocalBlob,
and TestScheme_ResolvesUnversionedLegacy_LocalBlob as-is (optionally you may
collapse them into a single table-driven test keyed by runtime.Type mapping to
the expected *descriptorv2.LocalBlob, but that's not required).
bindings/go/descriptor/v2/local_access_test.go (2)

46-98: Consider table-driving the two near-identical unmarshal tests.

TestLocalBlob_UnmarshalJSON_LegacyType and TestLocalBlob_UnmarshalJSON_UpperCamelCase differ only in the input type string and the expected blob.Type.Name. A small table-driven test would remove ~40 lines of duplication and make it trivial to add future aliases. Non-blocking — current form is clear.

🤖 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` around lines 46 - 98, The two
near-duplicate tests TestLocalBlob_UnmarshalJSON_LegacyType and
TestLocalBlob_UnmarshalJSON_UpperCamelCase should be combined into a small
table-driven test: create a slice of cases with fields like name, inputType (the
"type" string used in jsonData), and expectedTypeName; for each case use
t.Run(case.name, func(t *testing.T) { build jsonData with case.inputType,
unmarshal into a descriptorv2.LocalBlob, then run the same assertions
(require.NoError, assert.Equal for blob.Type.Name == case.expectedTypeName,
blob.Type.Version == descriptorv2.LocalBlobAccessTypeVersion, LocalReference,
MediaType, ReferenceName, and GlobalAccess checks) }); keep using the same
variable names (blob, descriptorv2.LocalBlob) and reuse existing constants like
descriptorv2.LocalBlobAccessTypeVersion and
descriptorv2.LegacyLocalBlobAccessType in the case table to cover aliases.

91-91: Use the LocalBlobAccessType constant instead of the hardcoded "LocalBlob" literal.

Elsewhere in this file (e.g., Line 64, Line 113) the test asserts against descriptorv2.LegacyLocalBlobAccessType rather than a string literal. For symmetry and to keep the test resilient to future constant renames, use the constant here too.

♻️ 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
hardcoded string literal "LocalBlob" in the assertion on blob.Type.Name with the
package constant descriptorv2.LocalBlobAccessType (i.e., change assert.Equal(t,
"LocalBlob", blob.Type.Name) to assert.Equal(t,
descriptorv2.LocalBlobAccessType, blob.Type.Name)) so the test uses the
canonical constant (consistent with other assertions that use
descriptorv2.LegacyLocalBlobAccessType).
🤖 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`:
- Around line 46-98: The two near-duplicate tests
TestLocalBlob_UnmarshalJSON_LegacyType and
TestLocalBlob_UnmarshalJSON_UpperCamelCase should be combined into a small
table-driven test: create a slice of cases with fields like name, inputType (the
"type" string used in jsonData), and expectedTypeName; for each case use
t.Run(case.name, func(t *testing.T) { build jsonData with case.inputType,
unmarshal into a descriptorv2.LocalBlob, then run the same assertions
(require.NoError, assert.Equal for blob.Type.Name == case.expectedTypeName,
blob.Type.Version == descriptorv2.LocalBlobAccessTypeVersion, LocalReference,
MediaType, ReferenceName, and GlobalAccess checks) }); keep using the same
variable names (blob, descriptorv2.LocalBlob) and reuse existing constants like
descriptorv2.LocalBlobAccessTypeVersion and
descriptorv2.LegacyLocalBlobAccessType in the case table to cover aliases.
- Line 91: Replace the hardcoded string literal "LocalBlob" in the assertion on
blob.Type.Name with the package constant descriptorv2.LocalBlobAccessType (i.e.,
change assert.Equal(t, "LocalBlob", blob.Type.Name) to assert.Equal(t,
descriptorv2.LocalBlobAccessType, blob.Type.Name)) so the test uses the
canonical constant (consistent with other assertions that use
descriptorv2.LegacyLocalBlobAccessType).

In `@bindings/go/descriptor/v2/scheme_test.go`:
- Around line 12-42: The tests already cover all permutations
(versioned/legacy/unversioned) for LocalBlob resolution using
descriptorv2.Scheme.NewObject and the
runtime.NewVersionedType/runtime.NewUnversionedType helpers; no changes
required—leave TestScheme_ResolvesUpperCamelCase_LocalBlob,
TestScheme_ResolvesLegacy_LocalBlob, TestScheme_ResolvesUnversioned_LocalBlob,
and TestScheme_ResolvesUnversionedLegacy_LocalBlob as-is (optionally you may
collapse them into a single table-driven test keyed by runtime.Type mapping to
the expected *descriptorv2.LocalBlob, but that's not required).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 48bfe57b-8cc3-4d00-ac38-5a3f3070d67d

📥 Commits

Reviewing files that changed from the base of the PR and between 5b3b774 and 7a78337.

📒 Files selected for processing (10)
  • bindings/go/constructor/construct_resource_test.go
  • bindings/go/constructor/construct_source_test.go
  • bindings/go/descriptor/runtime/local_access.go
  • bindings/go/descriptor/runtime/schemas/LocalBlob.schema.json
  • bindings/go/descriptor/v2/helpers_test.go
  • bindings/go/descriptor/v2/local_access.go
  • bindings/go/descriptor/v2/local_access_test.go
  • bindings/go/descriptor/v2/schemas/LocalBlob.schema.json
  • bindings/go/descriptor/v2/scheme.go
  • bindings/go/descriptor/v2/scheme_test.go

@morri-son morri-son enabled auto-merge (squash) April 24, 2026 08:12
Comment thread bindings/go/descriptor/v2/scheme_test.go
Comment thread bindings/go/descriptor/v2/helpers_test.go

@piotrjanik piotrjanik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, 2 nits

@morri-son morri-son merged commit e25a69c into open-component-model:main Apr 24, 2026
27 checks passed
ocmbot2 Bot pushed a commit to morri-son/open-component-model that referenced this pull request Apr 24, 2026
… [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
morri-son added a commit that referenced this pull request Apr 24, 2026
…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>
morri-son added a commit that referenced this pull request Apr 28, 2026
…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>
morri-son added a commit that referenced this pull request Apr 28, 2026
… [1/4] (#2323)

## Summary

Renames `localBlob` → `LocalBlob` (UpperCamelCase) as the primary type
name, preserving `localBlob` as a legacy alias for backward
compatibility.

This is the first of 4 PRs completing the `localBlob` portion of
ocm-project/ocm-project#962. Follows the exact pattern established in
#2057 for File, Dir, UTF8, and Helm input types.

## Changes

**Production code:**
- `descriptor/v2/local_access.go` — `LocalBlobAccessType = "LocalBlob"`,
new `LegacyLocalBlobAccessType = "localBlob"`, added
`+ocm:jsonschema-gen:enum` markers
- `descriptor/v2/scheme.go` — 4 aliases: `LocalBlob/v1` (primary),
`LocalBlob`, `localBlob/v1` (legacy), `localBlob`
- `descriptor/runtime/local_access.go` — same constant + marker changes

**Tests:**
- `descriptor/v2/local_access_test.go` — marshal asserts
`"LocalBlob/v1"`, added `_UpperCamelCase` unmarshal test, renamed
existing unmarshal to `_LegacyType`
- `descriptor/v2/scheme_test.go` — **NEW**: 4 scheme resolution tests
(all alias variants: versioned/unversioned × primary/legacy)
- `descriptor/v2/helpers_test.go` — added `TestIsLocalBlob_RawLegacy`,
updated Raw data JSON

**Generated:**
- Both `schemas/LocalBlob.schema.json` now have enum constraints:
`LocalBlob/v1`, `localBlob/v1`, `LocalBlob` (deprecated), `localBlob`
(deprecated)

## Follow-up PRs (after this merges + publishes)

These are independent of each other and can merge in parallel:

- #2324 — PR 2 (constructor): update YAML `type: localBlob` → `type:
LocalBlob` in test fixtures
- #2325 — PR 3 (cli): update 5× `"localBlob/v1"` → `"LocalBlob/v1"`
string assertions
- #2326 — PR 4 (kubernetes/controller): update 13× JSON type strings +
use constants in CEL test

Resolves the localBlob portion 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>
morri-son added a commit that referenced this pull request Apr 29, 2026
## 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>
ocmbot Bot pushed a commit that referenced this pull request Apr 29, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/chore chore, maintenance, etc. size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

align type notation for access and input

4 participants