Skip to content

feat: register UpperCamelCase as primary type for input types (skip localBlob so far)#2057

Merged
morri-son merged 11 commits into
open-component-model:mainfrom
morri-son:add-upper-camel-case-defaults
Apr 21, 2026
Merged

feat: register UpperCamelCase as primary type for input types (skip localBlob so far)#2057
morri-son merged 11 commits into
open-component-model:mainfrom
morri-son:add-upper-camel-case-defaults

Conversation

@morri-son

@morri-son morri-son commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

On-behalf-of: Gerald Morrison (SAP) gerald.morrison@sap.com

Summary

Register UpperCamelCase forms as the primary (default) serialization type for all input types, consistent with the existing convention used by access OCIImage/v1, Helm/v1 etc.

Changes:

  • Input types: File/v1 (was file/v1), Dir/v1 (was dir/v1), UTF8/v1 (was utf8/v1), Helm/v1 (was helm/v1)

The localBlob/v1 access type IS NOT touched in the PR., but already prepared (including updating all tests using the new types) in this branch.

Lowercase forms remain registered as backward-compatible aliases so existing component descriptors and constructors continue to work.

Adds named constants (Type, LegacyType) to each spec package following the pattern already established by access type packages. Also adds Type constants for OCIImage, OCIImageLayer, and Helm access types where hardcoded strings were previously used in schema registrations.

Which issue(s) this PR fixes

Usage: Fixes open-component-model/ocm-project#962

Dependencies

Tests for type casing have been split off to PR #2071 to get the CI test not failing.

Related

Verification

  • I have tested the changes locally by running ocm

@morri-son morri-son requested a review from a team as a code owner March 24, 2026 16:14
@github-actions github-actions Bot added kind/feature new feature, enhancement, improvement, extension size/s Small labels Mar 24, 2026
@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request standardizes type identifiers across multiple input and OCI binding modules from lowercase to UpperCamelCase format (e.g., "dir" → "Dir", "file" → "File", "helm" → "Helm"). Concurrently, new LegacyType constants preserve the original lowercase identifiers, and scheme registrations are extended to recognize both current and legacy type variants for backward compatibility.

Changes

Cohort / File(s) Summary
Directory Input
bindings/go/input/dir/spec/v1/spec.go, bindings/go/input/dir/method.go, bindings/go/input/dir/blob_test.go
Renamed Type constant from "dir" to "Dir", added LegacyType = "dir". Extended scheme registration to recognize both versioned and unversioned legacy type aliases. Added test validating UpperCamelCase type resolution.
File Input
bindings/go/input/file/spec/v1/spec.go, bindings/go/input/file/method.go, bindings/go/input/file/blob_test.go
Renamed Type constant from "file" to "File", added LegacyType = "file". Extended scheme registration for legacy alias mappings. Added test verifying UpperCamelCase file type resolution.
UTF8 Input
bindings/go/input/utf8/spec/v1/spec.go, bindings/go/input/utf8/method.go, bindings/go/input/utf8/method_test.go
Renamed Type constant from "utf8" to "UTF8", added LegacyType = "utf8". Extended scheme with versioned and unversioned legacy type registrations. Added test for UpperCamelCase UTF8 type resolution.
Helm Input
bindings/go/helm/spec/input/v1/spec.go, bindings/go/helm/spec/input/scheme.go, bindings/go/helm/input/method_test.go, bindings/go/helm/cmd/main_test.go
Renamed Type constant from "helm" to "Helm", added LegacyType = "helm". Extended input scheme to register legacy type aliases. Updated test assertion for new type name. Added test for scheme resolution.
Helm Access
bindings/go/helm/spec/access/v1/helm.go, bindings/go/helm/spec/access/scheme.go
Added new exported Type constant "Helm". Updated scheme registration to use exported type constant instead of hardcoded string literal.
OCI Access Scheme
bindings/go/oci/spec/access/v1/oci_image.go, bindings/go/oci/spec/access/v1/oci_image_layer.go, bindings/go/oci/spec/access/scheme.go
Added new exported constants OCIImageType = "OCIImage" and OCIImageLayerType = "OCIImageLayer". Updated scheme registrations to use exported constants rather than hardcoded type strings.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/m

Suggested reviewers

  • jakobmoellerdev
  • fabianburth
  • matthiasbruns

Poem

🐰 Hop along with types renamed so bright,
From lowercase whispers to CamelCase light!
Legacy friends still welcome with care,
Schemes now remember what used to be there. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% 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 title clearly identifies the main change: registering UpperCamelCase as primary type for input types, which aligns with the core objective of the PR.
Description check ✅ Passed The description comprehensively documents the changes, including specific input types updated, backward compatibility preserved, new constants added, and related issues/PRs.
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.

@morri-son morri-son marked this pull request as draft March 24, 2026 16:21

@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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
bindings/go/helm/input/method.go (1)

32-33: Add alias-conversion coverage tests for Helm + helm.

These registrations are correct; adding table-driven tests for versioned and unversioned conversions (Helm, helm) will lock in backward compatibility for future refactors.

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

In `@bindings/go/helm/input/method.go` around lines 32 - 33, Add table-driven unit
tests that exercise alias-conversion for both the versioned and unversioned
registrations of the Helm type (i.e., the "Helm" and "helm" aliases) to ensure
backward compatibility; specifically, create tests that register
runtime.NewVersionedType(v1.LegacyType, v1.Version) and
runtime.NewUnversionedType(v1.LegacyType) conversions and assert round-trip
conversions between the alias names and the canonical type, covering both
input->internal and internal->output paths so future refactors cannot break
alias handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bindings/go/descriptor/runtime/local_access.go`:
- Around line 9-13: Restore the deprecated exported constant LocalBlobAccessType
as a compatibility alias pointing to the existing value (e.g., define
LocalBlobAccessType = LegacyLocalBlobAccessType or to the canonical string used
previously), and add a deprecation comment above it; update where constants are
declared (LocalBlobType, LocalBlobAccessTypeVersion, LegacyLocalBlobAccessType)
so LocalBlobAccessType remains available for existing Go imports but marked
deprecated.

In `@bindings/go/descriptor/v2/local_access.go`:
- Around line 9-13: The change removed the exported symbol callers still
reference; restore a backward-compatible alias by adding an exported
LocalBlobAccessType constant that points to LocalBlobAccessTypeVersion (and
annotate it as deprecated in a comment) so existing code using
v2.LocalBlobAccessType continues to compile while new code uses
LocalBlobAccessTypeVersion; refer to the constants LocalBlobAccessTypeVersion
and LegacyLocalBlobAccessType in local_access.go and add LocalBlobAccessType =
LocalBlobAccessTypeVersion.

---

Nitpick comments:
In `@bindings/go/helm/input/method.go`:
- Around line 32-33: Add table-driven unit tests that exercise alias-conversion
for both the versioned and unversioned registrations of the Helm type (i.e., the
"Helm" and "helm" aliases) to ensure backward compatibility; specifically,
create tests that register runtime.NewVersionedType(v1.LegacyType, v1.Version)
and runtime.NewUnversionedType(v1.LegacyType) conversions and assert round-trip
conversions between the alias names and the canonical type, covering both
input->internal and internal->output paths so future refactors cannot break
alias handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 93c8ae74-f7c5-4d2b-a1aa-b5bcbb865c99

📥 Commits

Reviewing files that changed from the base of the PR and between 220c7f9 and b1f0633.

📒 Files selected for processing (17)
  • bindings/go/descriptor/runtime/local_access.go
  • bindings/go/descriptor/v2/local_access.go
  • bindings/go/descriptor/v2/scheme.go
  • bindings/go/helm/access/access.go
  • bindings/go/helm/access/spec/v1/helm.go
  • bindings/go/helm/input/method.go
  • bindings/go/helm/input/spec/v1/spec.go
  • bindings/go/input/dir/method.go
  • bindings/go/input/dir/spec/v1/spec.go
  • bindings/go/input/file/method.go
  • bindings/go/input/file/spec/v1/spec.go
  • bindings/go/input/utf8/method.go
  • bindings/go/input/utf8/spec/v1/spec.go
  • bindings/go/oci/internal/pack/pack.go
  • bindings/go/oci/spec/access/scheme.go
  • bindings/go/oci/spec/access/v1/oci_image.go
  • bindings/go/oci/spec/access/v1/oci_image_layer.go

Comment thread bindings/go/descriptor/runtime/local_access.go
Comment thread bindings/go/descriptor/v2/local_access.go
@github-actions github-actions Bot added the size/m Medium label Mar 24, 2026

@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/helm/input/method_test.go (1)

294-298: Add a legacy-alias scheme assertion in this test.

This covers Helm/v1, but the PR goal also includes backward-compatible lowercase aliases. Please also assert v1.LegacyType resolution (helm/v1) to prevent alias-regression gaps.

Proposed test extension
 func TestScheme_ResolvesUpperCamelCase_Helm(t *testing.T) {
 	obj, err := input.Scheme.NewObject(runtime.NewVersionedType(v1.Type, v1.Version))
 	require.NoError(t, err, "Scheme must resolve UpperCamelCase type Helm/v1")
 	require.IsType(t, &v1.Helm{}, obj, "expected *v1.Helm from Scheme")
+
+	legacyObj, err := input.Scheme.NewObject(runtime.NewVersionedType(v1.LegacyType, v1.Version))
+	require.NoError(t, err, "Scheme must resolve legacy type helm/v1")
+	require.IsType(t, &v1.Helm{}, legacyObj, "expected *v1.Helm from Scheme for legacy type")
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/helm/input/method_test.go` around lines 294 - 298, The test
TestScheme_ResolvesUpperCamelCase_Helm currently asserts resolution for the
UpperCamelCase type Helm/v1 but lacks coverage for the lowercase legacy alias;
add a second assertion that calls input.Scheme.NewObject with
runtime.NewVersionedType(v1.LegacyType, v1.Version) (i.e., "helm"/v1) and verify
it returns no error and an object of type *v1.Helm using require.NoError and
require.IsType, mirroring the existing assertions to prevent alias-regression.
cli/cmd/cmd_test.go (1)

829-829: Consider centralizing the LocalBlob/v1 test literal.

The same literal appears in multiple places; deriving it from constants would reduce drift in future renames.

♻️ Optional refactor sketch
+expectedLocalBlobType := descriptor.LocalBlobAccessType + "/" + descriptor.LocalBlobAccessTypeVersion
...
- r.Equal("LocalBlob/v1", desc.Component.Resources[0].Access.GetType().String(), "expected resource access type to match")
+ r.Equal(expectedLocalBlobType, desc.Component.Resources[0].Access.GetType().String(), "expected resource access type to match")

Also applies to: 1240-1240, 1353-1353, 1777-1777, 1817-1817

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

In `@cli/cmd/cmd_test.go` at line 829, Replace repeated string literal
"LocalBlob/v1" used in the test assertions with a single shared constant; update
the r.Equal assertions that compare
desc.Component.Resources[0].Access.GetType().String() (and the other occurrences
at the noted locations) to use that constant (e.g., ExpectedLocalBlobType or
TestLocalBlobType) so future renames only require changing the constant; if a
canonical constant already exists in the codebase prefer importing/using that
symbol instead of creating a new one.
bindings/go/descriptor/v2/local_access_test.go (1)

101-105: Add direct JSON unmarshal coverage for LocalBlob/v1.

You already validate scheme resolution for UpperCamelCase; adding a direct json.Unmarshal case for "type":"LocalBlob/v1" would close the remaining gap.

✅ Suggested test addition
+func TestLocalBlob_UnmarshalJSON_UpperCamelCase(t *testing.T) {
+	jsonData := `{
+		"type": "LocalBlob/v1",
+		"localReference": "sha256:abc123",
+		"mediaType": "application/octet-stream"
+	}`
+
+	var blob descriptorv2.LocalBlob
+	err := json.Unmarshal([]byte(jsonData), &blob)
+
+	require.NoError(t, err)
+	assert.Equal(t, descriptorv2.LocalBlobAccessType, blob.Type.Name)
+	assert.Equal(t, descriptorv2.LocalBlobAccessTypeVersion, blob.Type.Version)
+}
🤖 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 101 - 105, Add a
new unit test (e.g., TestScheme_Unmarshal_LocalBlob_v1) that constructs a JSON
payload with "type":"LocalBlob/v1" (and minimal required fields), performs a
direct json.Unmarshal of that payload into the runtime/object representation
used by your bindings, and asserts the resulting concrete type is
*descriptorv2.LocalBlob; this mirrors
TestScheme_ResolvesUpperCamelCase_LocalBlob but exercises the plain JSON
unmarshal path to ensure "LocalBlob/v1" deserializes to descriptorv2.LocalBlob.
🤖 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 101-105: Add a new unit test (e.g.,
TestScheme_Unmarshal_LocalBlob_v1) that constructs a JSON payload with
"type":"LocalBlob/v1" (and minimal required fields), performs a direct
json.Unmarshal of that payload into the runtime/object representation used by
your bindings, and asserts the resulting concrete type is
*descriptorv2.LocalBlob; this mirrors
TestScheme_ResolvesUpperCamelCase_LocalBlob but exercises the plain JSON
unmarshal path to ensure "LocalBlob/v1" deserializes to descriptorv2.LocalBlob.

In `@bindings/go/helm/input/method_test.go`:
- Around line 294-298: The test TestScheme_ResolvesUpperCamelCase_Helm currently
asserts resolution for the UpperCamelCase type Helm/v1 but lacks coverage for
the lowercase legacy alias; add a second assertion that calls
input.Scheme.NewObject with runtime.NewVersionedType(v1.LegacyType, v1.Version)
(i.e., "helm"/v1) and verify it returns no error and an object of type *v1.Helm
using require.NoError and require.IsType, mirroring the existing assertions to
prevent alias-regression.

In `@cli/cmd/cmd_test.go`:
- Line 829: Replace repeated string literal "LocalBlob/v1" used in the test
assertions with a single shared constant; update the r.Equal assertions that
compare desc.Component.Resources[0].Access.GetType().String() (and the other
occurrences at the noted locations) to use that constant (e.g.,
ExpectedLocalBlobType or TestLocalBlobType) so future renames only require
changing the constant; if a canonical constant already exists in the codebase
prefer importing/using that symbol instead of creating a new one.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f55fdb04-02f6-4a55-bf4a-f74d7ae19566

📥 Commits

Reviewing files that changed from the base of the PR and between b1f0633 and 1f560d3.

📒 Files selected for processing (10)
  • bindings/go/descriptor/runtime/local_access.go
  • 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/scheme.go
  • bindings/go/helm/input/method_test.go
  • bindings/go/input/dir/blob_test.go
  • bindings/go/input/file/blob_test.go
  • bindings/go/input/utf8/method_test.go
  • cli/cmd/cmd_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • bindings/go/descriptor/v2/scheme.go
  • bindings/go/descriptor/runtime/local_access.go

@morri-son morri-son added kind/chore chore, maintenance, etc. and removed kind/feature new feature, enhancement, improvement, extension labels Mar 24, 2026
@github-actions github-actions Bot added the kind/feature new feature, enhancement, improvement, extension label Mar 24, 2026
@morri-son morri-son marked this pull request as ready for review March 25, 2026 12:20
frewilhelm
frewilhelm previously approved these changes Mar 25, 2026

@frewilhelm frewilhelm 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.

did you run task test and task test/integration with go work enabled?

@jakobmoellerdev

Copy link
Copy Markdown
Member

this needs to be accompanied with a proper change on legacy OCM as well because most of these new typings are only not present here because theyre not in legacy OCM (to preserve backwards compatibility)

@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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bindings/go/helm/input/method_test.go`:
- Around line 294-298: Extend the TestScheme_ResolvesUpperCamelCase_Helm test to
also assert that the legacy lowercase alias resolves: call
input.Scheme.NewObject with runtime.NewVersionedType(v1.LegacyType, v1.Version),
require.NoError on the result, and require.IsType that the returned obj is a
*v1.Helm; update TestScheme_ResolvesUpperCamelCase_Helm (which currently uses
runtime.NewVersionedType(v1.Type, v1.Version) and input.Scheme.NewObject) to
include this companion assertion to ensure lowercase alias compatibility.

In `@bindings/go/input/dir/blob_test.go`:
- Around line 498-502: Extend the test TestScheme_ResolvesUpperCamelCase_Dir to
also assert that calling dir.Scheme.NewObject with
runtime.NewVersionedType(v1.LegacyType, v1.Version) returns a *v1.Dir and no
error; specifically invoke
dir.Scheme.NewObject(runtime.NewVersionedType(v1.LegacyType, v1.Version)),
require.NoError on the call, and require.IsType(t, &v1.Dir{}, obj) to validate
the lowercase legacy alias resolves to the same type.

In `@bindings/go/input/utf8/method_test.go`:
- Around line 390-394: Extend TestScheme_ResolvesUpperCamelCase_UTF8 to also
assert the legacy alias resolves: call
utf8.Scheme.NewObject(runtime.NewVersionedType(v1.LegacyType, v1.Version)),
require.NoError on that call, and require.IsType(t, &v1.UTF8{}, objLegacy) (or
similar variable) to ensure the legacy v1 alias maps to *v1.UTF8; the function
name to update is TestScheme_ResolvesUpperCamelCase_UTF8 and the unique symbols
are runtime.NewVersionedType and v1.LegacyType / v1.Version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8425d5e2-e371-4f42-87d6-f7292b5ca766

📥 Commits

Reviewing files that changed from the base of the PR and between b1f0633 and 6cbb58d.

📒 Files selected for processing (4)
  • bindings/go/helm/input/method_test.go
  • bindings/go/input/dir/blob_test.go
  • bindings/go/input/file/blob_test.go
  • bindings/go/input/utf8/method_test.go
✅ Files skipped from review due to trivial changes (1)
  • bindings/go/input/file/blob_test.go

Comment thread bindings/go/helm/input/method_test.go
Comment thread bindings/go/input/dir/blob_test.go
Comment thread bindings/go/input/utf8/method_test.go

@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 (2)
cli/cmd/type_casing_test.go (2)

194-195: Add an explicit precondition check for Helm testdata path.

filepath.Abs(...) only validates path formatting, not existence. If the fixture moves, failure will occur later in ocm add cv with a less direct error. A require.DirExists (or equivalent) here would make failures immediate and clearer.

Also applies to: 221-223

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

In `@cli/cmd/type_casing_test.go` around lines 194 - 195, Add an explicit
directory existence assertion after resolving the absolute path so test failures
are immediate and clear: after computing chartDir with filepath.Abs in the test
(the chartDir, err := filepath.Abs(...) / require.NoError(t, err) block), call
require.DirExists(t, chartDir) (or equivalent) to ensure the Helm testdata
directory actually exists; repeat the same check for the other instance
referenced around the second occurrence (lines 221-223).

291-300: Avoid brittle success checks based on log text.

At Line 295, asserting "transfer completed successfully" via substring is fragile and can break on message wording changes while behavior is still correct. Exit status plus the target CTF assertions already provide strong success validation.

Suggested simplification
-			// Verify transfer logs contain success
-			transferEntries, err := transferLogs.List()
-			r.NoError(err)
-			found := false
-			for _, entry := range transferEntries {
-				if strings.Contains(fmt.Sprint(entry), "transfer completed successfully") {
-					found = true
-					break
-				}
-			}
-			r.True(found, "expected transfer success log for input type %s", tc.inputType)
+			// Exit status + target CTF verification below are sufficient.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cli/cmd/type_casing_test.go` around lines 291 - 300, Remove the brittle
substring-based success assertion that searches transferEntries for "transfer
completed successfully": delete or replace the loop over transferEntries (the
transferEntries, err := transferLogs.List() call and the subsequent for-loop
that sets found) and the r.True(found, "expected transfer success log for input
type %s", tc.inputType) assertion; instead rely on the existing exit status and
the target CTF assertions already present in the test to validate success. Keep
transferLogs.List() only if its results are used elsewhere; otherwise remove the
unused variable to avoid dead code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cli/cmd/type_casing_test.go`:
- Around line 194-195: Add an explicit directory existence assertion after
resolving the absolute path so test failures are immediate and clear: after
computing chartDir with filepath.Abs in the test (the chartDir, err :=
filepath.Abs(...) / require.NoError(t, err) block), call require.DirExists(t,
chartDir) (or equivalent) to ensure the Helm testdata directory actually exists;
repeat the same check for the other instance referenced around the second
occurrence (lines 221-223).
- Around line 291-300: Remove the brittle substring-based success assertion that
searches transferEntries for "transfer completed successfully": delete or
replace the loop over transferEntries (the transferEntries, err :=
transferLogs.List() call and the subsequent for-loop that sets found) and the
r.True(found, "expected transfer success log for input type %s", tc.inputType)
assertion; instead rely on the existing exit status and the target CTF
assertions already present in the test to validate success. Keep
transferLogs.List() only if its results are used elsewhere; otherwise remove the
unused variable to avoid dead code.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5020dc7d-5cfc-49ec-a955-aa3dcd28f6c3

📥 Commits

Reviewing files that changed from the base of the PR and between 6cbb58d and a73c06e.

📒 Files selected for processing (4)
  • bindings/go/constructor/construct.go
  • bindings/go/constructor/construct_resource_test.go
  • bindings/go/plugin/manager/registries/digestprocessor/registry.go
  • cli/cmd/type_casing_test.go

@morri-son morri-son force-pushed the add-upper-camel-case-defaults branch from a73c06e to 091f4cc Compare March 25, 2026 17:00
@morri-son morri-son marked this pull request as draft March 25, 2026 17:23
@morri-son

Copy link
Copy Markdown
Contributor Author

put to draft, will reopen after the release

morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Mar 25, 2026
Tests add+transfer for all input types (file, dir, utf8, helm) in both
lowercase and UpperCamelCase forms. Helm chart is created inline in
t.TempDir() to avoid cross-module testdata references.

Note: UpperCamelCase tests (File/v1, Dir/v1, UTF8/v1, Helm/v1) will
pass once the bindings changes from PR open-component-model#2057 are merged and cli/go.mod
is updated to reference the new bindings versions.

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@morri-son

Copy link
Copy Markdown
Contributor Author

@jakobmoellerdev

this needs to be accompanied with a proper change on legacy OCM as well because most of these new typings are only not present here because theyre not in legacy OCM (to preserve backwards compatibility)

Created open-component-model/ocm#1881 in OCM v1

@netlify

netlify Bot commented Apr 10, 2026

Copy link
Copy Markdown

Deploy Preview for ocm-website canceled.

Name Link
🔨 Latest commit 6db55c6
🔍 Latest deploy log https://app.netlify.com/projects/ocm-website/deploys/69e7773beef60000086cb3df

@github-actions github-actions Bot removed size/m Medium size/l Large labels Apr 10, 2026
@morri-son morri-son changed the title feat: register UpperCamelCase as primary type for input types and LocalBlob feat: register UpperCamelCase as primary type for input types (skip localBlob so far) Apr 10, 2026
morri-son added a commit to open-component-model/ocm that referenced this pull request Apr 21, 2026
…#1920)

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>

<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

Completes the UpperCamelCase type alias registration started in #1881.
That PR covered helm, localBlob, ociBlob (access) and dir, file, helm,
utf8 (input) but missed several access methods and input types.

This PR adds UpperCamelCase aliases for all remaining types:

**Access methods:**
- `gitHub` → alias `GitHub` / `GitHub/v1`
- `npm` → alias `NPM` / `NPM/v1`
- `wget` → alias `Wget` / `Wget/v1`
- `git` → alias `Git` / `Git/v1alpha1`
- `maven` → alias `Maven` / `Maven/v1`

**Input types (CLI):**
- `git` → alias `Git`
- `maven` → alias `Maven`
- `npm` → alias `NPM`
- `wget` → alias `Wget`

No behavior change: all existing lowercase type strings continue to
work. The new aliases ensure components authored with the new
`open-component-model` monorepo bindings (which emit UpperCamelCase as
primary) can be read by this legacy CLI.

Note: `NPM` follows the acronym convention used by `OCIImage`, `UTF8`,
etc.

**Documentation:**
UpperCamelCase aliases are registered with empty usage text, so they are
excluded from `--help` output and generated reference docs. A preamble
note was added to the input type documentation stating that
UpperCamelCase type names are aliases — check the corresponding
lowercase entry for full documentation.

#### Related
- open-component-model/ocm-project#962
- open-component-model/open-component-model#2057
- ocm-spec PR: open-component-model/ocm-spec#141
- Predecessor: #1881

---------

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

Register UpperCamelCase forms as the primary (default) serialization type
for all input types and the LocalBlob access type, consistent with the
existing convention used by OCIImage/v1, Helm/v1 (access), etc.

Changes:
- Input types: File/v1 (was file/v1), Dir/v1 (was dir/v1),
  UTF8/v1 (was utf8/v1), Helm/v1 (was helm/v1)
- LocalBlob access type: LocalBlob/v1 (was localBlob/v1)

Lowercase forms remain registered as backward-compatible aliases so
existing component descriptors and constructors continue to work.

Adds named constants (Type, LegacyType) to each spec package following
the pattern already established by access type packages. Also adds Type
constants for OCIImage, OCIImageLayer, and Helm access types where
hardcoded strings were previously used in scheme registrations.

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
…ase type defaults

- Rename LocalBlobAccessType → LocalBlobType (primary) / LegacyLocalBlobAccessType (legacy) in 9 test files
- Update cli/cmd_test.go golden assertions from localBlob/v1 → LocalBlob/v1
- Update TestLocalBlob_Constants and TestLocalBlob_Struct to reflect new primary type name
- Add TestScheme_ResolvesUpperCamelCase_* tests for File/v1, Dir/v1, UTF8/v1, Helm/v1, LocalBlob/v1

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Align LocalBlob constant naming with the Input type pattern:
- LocalBlobAccessType = "LocalBlob" (primary, was LocalBlobType)
- LegacyLocalBlobAccessType = "localBlob" (legacy, unchanged)

This matches the established convention of Type/LegacyType used in
input/file, input/dir, input/utf8, and helm/input packages, where
the primary constant keeps its descriptive name and the legacy
constant is prefixed with Legacy.

Also restores LocalBlobAccessType in the integration test
(oci/integration) which was referencing the now-removed symbol.

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Revert all localBlob/LocalBlob type changes back to original state:
- LocalBlobAccessType stays = "localBlob" (primary, unchanged)
- No LegacyLocalBlobAccessType constant
- No LocalBlob/v1 alias in scheme registration
- Test assertions restored to expect "localBlob/v1"

The CLI produces "localBlob/v1" through code paths not controlled by
the descriptor package alone, making a clean UpperCamelCase migration
infeasible without a larger refactor. Input type changes (File, Dir,
UTF8, Helm) are unaffected.

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Table-driven tests verifying both lowercase and UpperCamelCase type
names work correctly for all input types (file, dir, utf8, helm) and
access types (helm) through the full add cv -> transfer cv flow.

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
…essor fix

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Update Scheme reference in tests to use helminputspec.Scheme after
helm restructuring in open-component-model#2130. Add legacy type resolution test.

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@morri-son morri-son force-pushed the add-upper-camel-case-defaults branch from 8c172c9 to 32b0573 Compare April 21, 2026 11:39
…e-defaults

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Skarlso
Skarlso previously approved these changes Apr 21, 2026
Comment thread bindings/go/helm/spec/access/v1/helm.go
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 (1)
bindings/go/helm/spec/input/v1/spec.go (1)

16-17: Enum ordering inconsistent with the new primary type.

Since Type is now "Helm" (primary) with "helm" preserved only as the legacy alias, consider flipping the enum order to match bindings/go/helm/spec/access/v1/helm.go (which uses Helm/v1,helm/v1 and Helm,helm). Leading with the primary form makes generated JSON schemas advertise the canonical identifier first.

Proposed tweak
-	// +ocm:jsonschema-gen:enum=helm/v1,Helm/v1
-	// +ocm:jsonschema-gen:enum:deprecated=helm,Helm
+	// +ocm:jsonschema-gen:enum=Helm/v1,helm/v1
+	// +ocm:jsonschema-gen:enum:deprecated=Helm,helm
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@bindings/go/helm/spec/input/v1/spec.go` around lines 16 - 17, The enum
annotation ordering is reversed: update the schema tags in
bindings/go/helm/spec/input/v1/spec.go so the canonical primary identifiers come
first (match bindings/go/helm/spec/access/v1/helm.go); change the first enum
line to use Helm/v1,helm/v1 and the second to Helm,helm (i.e., swap the current
“helm/v1,Helm/v1” and “helm,Helm” entries) so the Type enum advertises the
canonical "Helm" forms first.
🤖 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/helm/spec/input/v1/spec.go`:
- Around line 16-17: The enum annotation ordering is reversed: update the schema
tags in bindings/go/helm/spec/input/v1/spec.go so the canonical primary
identifiers come first (match bindings/go/helm/spec/access/v1/helm.go); change
the first enum line to use Helm/v1,helm/v1 and the second to Helm,helm (i.e.,
swap the current “helm/v1,Helm/v1” and “helm,Helm” entries) so the Type enum
advertises the canonical "Helm" forms first.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5dba06d6-ffbc-4343-924d-02fb6e175b74

📥 Commits

Reviewing files that changed from the base of the PR and between ee983da and 6db55c6.

📒 Files selected for processing (18)
  • bindings/go/helm/cmd/main_test.go
  • bindings/go/helm/input/method_test.go
  • bindings/go/helm/spec/access/scheme.go
  • bindings/go/helm/spec/access/v1/helm.go
  • bindings/go/helm/spec/input/scheme.go
  • bindings/go/helm/spec/input/v1/spec.go
  • bindings/go/input/dir/blob_test.go
  • bindings/go/input/dir/method.go
  • bindings/go/input/dir/spec/v1/spec.go
  • bindings/go/input/file/blob_test.go
  • bindings/go/input/file/method.go
  • bindings/go/input/file/spec/v1/spec.go
  • bindings/go/input/utf8/method.go
  • bindings/go/input/utf8/method_test.go
  • bindings/go/input/utf8/spec/v1/spec.go
  • bindings/go/oci/spec/access/scheme.go
  • bindings/go/oci/spec/access/v1/oci_image.go
  • bindings/go/oci/spec/access/v1/oci_image_layer.go
✅ Files skipped from review due to trivial changes (4)
  • bindings/go/helm/cmd/main_test.go
  • bindings/go/input/utf8/method_test.go
  • bindings/go/oci/spec/access/v1/oci_image.go
  • bindings/go/oci/spec/access/scheme.go
🚧 Files skipped from review as they are similar to previous changes (7)
  • bindings/go/input/dir/blob_test.go
  • bindings/go/input/file/blob_test.go
  • bindings/go/input/file/spec/v1/spec.go
  • bindings/go/input/dir/spec/v1/spec.go
  • bindings/go/oci/spec/access/v1/oci_image_layer.go
  • bindings/go/input/file/method.go
  • bindings/go/input/utf8/method.go

@morri-son morri-son requested a review from frewilhelm April 21, 2026 13:18
@morri-son morri-son merged commit 7756429 into open-component-model:main Apr 21, 2026
37 checks passed
ocmbot2 Bot pushed a commit to morri-son/open-component-model that referenced this pull request Apr 21, 2026
…ocalBlob so far) (open-component-model#2057)

On-behalf-of: Gerald Morrison (SAP) <gerald.morrison@sap.com>

<!-- markdownlint-disable MD041 -->
## Summary
Register UpperCamelCase forms as the primary (default) serialization
type for all input types, consistent with the existing convention used
by access OCIImage/v1, Helm/v1 etc.

## Changes:
- Input types: File/v1 (was file/v1), Dir/v1 (was dir/v1), UTF8/v1 (was
utf8/v1), Helm/v1 (was helm/v1)

**The localBlob/v1 access type IS NOT touched in the PR.**, but already
prepared (including updating all tests using the new types) in [this
branch](https://github.com/morri-son/open-component-model/tree/align-type-notation-for-acces-and-input).

Lowercase forms remain registered as backward-compatible aliases so
existing component descriptors and constructors continue to work.

Adds named constants (Type, LegacyType) to each spec package following
the pattern already established by access type packages. Also adds Type
constants for OCIImage, OCIImageLayer, and Helm access types where
hardcoded strings were previously used in schema registrations.

## Which issue(s) this PR fixes
Usage: Fixes
open-component-model/ocm-project#962

## Dependencies
Tests for type casing have been split off to PR
open-component-model#2071
to get the CI test not failing.

## Related
- ocm-spec: open-component-model/ocm-spec#141
- ocm v1: open-component-model/ocm#1881
- ocm-website:
open-component-model#2244

## Verification

- [x] I have tested the changes locally by running `ocm`

---------

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> 7756429
morri-son pushed a commit to morri-son/open-component-model that referenced this pull request Apr 23, 2026
…el case support

Update cli/go.mod to use latest published versions of OCM binding modules
that include upper camel case input type registration (File/v1, Dir/v1,
UTF8/v1, Helm/v1) from PR open-component-model#2057.

- input/file: v0.0.3 -> v0.0.4
- input/dir: v0.0.2 -> v0.0.3
- input/utf8: pseudoversion bumped to 0cbfd4b
- helm: pseudoversion bumped to b2d0588
- descriptor/normalisation, descriptor/runtime, signing, transfer,
  transform, rsa: bumped to latest pseudoversions

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
@morri-son morri-son deleted the add-upper-camel-case-defaults branch April 23, 2026 12:45
morri-son added a commit that referenced this pull request Apr 24, 2026
## Summary

- Update input type names (`Dir/v1`, `File/v1`, `Helm/v1`, `UTF8/v1`)
and access type names (`OCIImage`, `OCIImageLayer`) across website
documentation to use UpperCamelCase as the canonical form
- Lowercase forms are documented as backward-compatible aliases
- 13 files changed across `content/docs/` and `content_templates/`

## What's unchanged (by design)

- `localBlob` references — deferred to a later PR
- `helmChart` — this is an artifact type, not an access/input type
- `ociArtifactDigest/v1` — algorithm name, not a type alias
- `--upload-as ociArtifact` CLI flag values — CLI flag semantics
unchanged
- `content_versioned/version-legacy/` — historical docs left as-is

## Related

- Tracks: open-component-model/ocm-project#962
- Depends on: #2057 (bindings UpperCamelCase defaults)
- Companion: open-component-model/ocm-spec#141 (spec docs)

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 24, 2026
## Summary

- Update input type names (`Dir/v1`, `File/v1`, `Helm/v1`, `UTF8/v1`)
and access type names (`OCIImage`, `OCIImageLayer`) across website
documentation to use UpperCamelCase as the canonical form
- Lowercase forms are documented as backward-compatible aliases
- 13 files changed across `content/docs/` and `content_templates/`

## What's unchanged (by design)

- `localBlob` references — deferred to a later PR
- `helmChart` — this is an artifact type, not an access/input type
- `ociArtifactDigest/v1` — algorithm name, not a type alias
- `--upload-as ociArtifact` CLI flag values — CLI flag semantics
unchanged
- `content_versioned/version-legacy/` — historical docs left as-is

## Related

- Tracks: open-component-model/ocm-project#962
- Depends on: #2057 (bindings UpperCamelCase defaults)
- Companion: open-component-model/ocm-spec#141 (spec docs)

Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Co-authored-by: Gerald Morrison (SAP) <gerald.morrison@sap.com> 2e601ca
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/chore chore, maintenance, etc. kind/feature new feature, enhancement, improvement, extension size/s Small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

align type notation for access and input

6 participants