feat: register UpperCamelCase as primary type for input types (skip localBlob so far)#2057
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe 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 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 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.
Actionable comments posted: 2
🧹 Nitpick comments (1)
bindings/go/helm/input/method.go (1)
32-33: Add alias-conversion coverage tests forHelm+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
📒 Files selected for processing (17)
bindings/go/descriptor/runtime/local_access.gobindings/go/descriptor/v2/local_access.gobindings/go/descriptor/v2/scheme.gobindings/go/helm/access/access.gobindings/go/helm/access/spec/v1/helm.gobindings/go/helm/input/method.gobindings/go/helm/input/spec/v1/spec.gobindings/go/input/dir/method.gobindings/go/input/dir/spec/v1/spec.gobindings/go/input/file/method.gobindings/go/input/file/spec/v1/spec.gobindings/go/input/utf8/method.gobindings/go/input/utf8/spec/v1/spec.gobindings/go/oci/internal/pack/pack.gobindings/go/oci/spec/access/scheme.gobindings/go/oci/spec/access/v1/oci_image.gobindings/go/oci/spec/access/v1/oci_image_layer.go
There was a problem hiding this comment.
🧹 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 assertv1.LegacyTyperesolution (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 theLocalBlob/v1test 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 forLocalBlob/v1.You already validate scheme resolution for UpperCamelCase; adding a direct
json.Unmarshalcase 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
📒 Files selected for processing (10)
bindings/go/descriptor/runtime/local_access.gobindings/go/descriptor/v2/helpers_test.gobindings/go/descriptor/v2/local_access.gobindings/go/descriptor/v2/local_access_test.gobindings/go/descriptor/v2/scheme.gobindings/go/helm/input/method_test.gobindings/go/input/dir/blob_test.gobindings/go/input/file/blob_test.gobindings/go/input/utf8/method_test.gocli/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
frewilhelm
left a comment
There was a problem hiding this comment.
did you run task test and task test/integration with go work enabled?
|
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) |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
bindings/go/helm/input/method_test.gobindings/go/input/dir/blob_test.gobindings/go/input/file/blob_test.gobindings/go/input/utf8/method_test.go
✅ Files skipped from review due to trivial changes (1)
- bindings/go/input/file/blob_test.go
There was a problem hiding this comment.
🧹 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 inocm add cvwith a less direct error. Arequire.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
📒 Files selected for processing (4)
bindings/go/constructor/construct.gobindings/go/constructor/construct_resource_test.gobindings/go/plugin/manager/registries/digestprocessor/registry.gocli/cmd/type_casing_test.go
a73c06e to
091f4cc
Compare
|
put to draft, will reopen after the release |
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>
Created open-component-model/ocm#1881 in OCM v1 |
✅ Deploy Preview for ocm-website canceled.
|
…#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>
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>
8c172c9 to
32b0573
Compare
…e-defaults Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
Signed-off-by: Gerald Morrison (SAP) <gerald.morrison@sap.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bindings/go/helm/spec/input/v1/spec.go (1)
16-17: Enum ordering inconsistent with the new primary type.Since
Typeis now"Helm"(primary) with"helm"preserved only as the legacy alias, consider flipping the enum order to matchbindings/go/helm/spec/access/v1/helm.go(which usesHelm/v1,helm/v1andHelm,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
📒 Files selected for processing (18)
bindings/go/helm/cmd/main_test.gobindings/go/helm/input/method_test.gobindings/go/helm/spec/access/scheme.gobindings/go/helm/spec/access/v1/helm.gobindings/go/helm/spec/input/scheme.gobindings/go/helm/spec/input/v1/spec.gobindings/go/input/dir/blob_test.gobindings/go/input/dir/method.gobindings/go/input/dir/spec/v1/spec.gobindings/go/input/file/blob_test.gobindings/go/input/file/method.gobindings/go/input/file/spec/v1/spec.gobindings/go/input/utf8/method.gobindings/go/input/utf8/method_test.gobindings/go/input/utf8/spec/v1/spec.gobindings/go/oci/spec/access/scheme.gobindings/go/oci/spec/access/v1/oci_image.gobindings/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
…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
…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>
## 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>
## 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
… [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>
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:
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
ocm