From 313fb2e3a190af64dc2216921b8ae4ffd7db2da7 Mon Sep 17 00:00:00 2001 From: Akash Kumar Date: Thu, 27 Nov 2025 19:25:54 +0530 Subject: [PATCH 1/7] fix: cat type_metadata validaiton --- .secrets.baseline | 4 ++-- cloudinfo/catalog_types.go | 1 + cloudinfo/projects.go | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.secrets.baseline b/.secrets.baseline index 1482989c..bd9a3a9b 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|package-lock.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2025-11-14T12:04:12Z", + "generated_at": "2025-11-27T13:49:44Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -118,7 +118,7 @@ "hashed_secret": "03e60e3e0d9675b19754e2a81bbb48a26af858e7", "is_secret": false, "is_verified": false, - "line_number": 943, + "line_number": 946, "type": "Secret Keyword", "verified_result": null } diff --git a/cloudinfo/catalog_types.go b/cloudinfo/catalog_types.go index a22f4cb5..2ed34c75 100644 --- a/cloudinfo/catalog_types.go +++ b/cloudinfo/catalog_types.go @@ -51,6 +51,7 @@ type CatalogJson struct { Configuration []struct { Key string `json:"key"` Type string `json:"type"` + TypeMetadata string `json:"type_metadata"` Description string `json:"description"` DefaultValue interface{} `json:"default_value"` Required bool `json:"required"` diff --git a/cloudinfo/projects.go b/cloudinfo/projects.go index e8817d03..c8df1ff7 100644 --- a/cloudinfo/projects.go +++ b/cloudinfo/projects.go @@ -510,7 +510,7 @@ func (infoSvc *CloudInfoService) GetConfigAndDependenciesStates(configDetails *C return states, nil } -// IsDeployable checks if a config and all its members are deployable. If any one memeber is deployable, return true. +// IsDeployable checks if a config and all its members are deployable. If any one member is deployable, return true. // trackStackInputs tracks inputs that should not be overridden. // This function initializes a map of inputs that should be preserved in the stack configuration. func trackStackInputs(stackConfig *ConfigDetails) map[string]map[string]interface{} { @@ -874,9 +874,12 @@ func validateCatalogInputsInStackDefinition(stackJson Stack, catalogConfig Catal if catalogInput.Key == stackInput.Name { found = true expectedType := convertGoTypeToExpectedType(stackInput.Type) - if !isValidType(catalogInput.Type, expectedType) { + if catalogInput.Type != "" && !isValidType(catalogInput.Type, expectedType) { typeMismatches = append(typeMismatches, fmt.Sprintf("catalog configuration type mismatch in product '%s', flavor '%s': %s expected type: %s, got: %s", productName, flavorName, catalogInput.Key, expectedType, catalogInput.Type)) } + if catalogInput.TypeMetadata != "" && !isValidType(catalogInput.TypeMetadata, expectedType) { + typeMismatches = append(typeMismatches, fmt.Sprintf("catalog configuration type_metadata mismatch in product '%s', flavor '%s': %s expected type: %s, got: %s", productName, flavorName, catalogInput.Key, expectedType, catalogInput.TypeMetadata)) + } // Check if the default value type matches the expected type if catalogInput.DefaultValue != nil { defaultValueType := reflect.TypeOf(catalogInput.DefaultValue).String() From 0b9c945f3018b684f4e90a1bf46780999e9c6d88 Mon Sep 17 00:00:00 2001 From: Akash Kumar Date: Thu, 27 Nov 2025 21:00:39 +0530 Subject: [PATCH 2/7] updated tests --- cloudinfo/projects_test.go | 2 +- ...ides_type_and_type_metadata_mismatch.json} | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) rename cloudinfo/testdata/{ibm_catalog_with_config_overrides_type_mismatch.json => ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json} (80%) diff --git a/cloudinfo/projects_test.go b/cloudinfo/projects_test.go index 3dcc924a..2113d6c3 100644 --- a/cloudinfo/projects_test.go +++ b/cloudinfo/projects_test.go @@ -1008,7 +1008,7 @@ func (suite *ProjectsServiceTestSuite) TestCreateStackFromConfigFile() { ConfigID: "54321", }, stackConfigPath: "testdata/stack_definition_stack_inputs_extended.json", - catalogJsonPath: "testdata/ibm_catalog_with_config_overrides_type_mismatch.json", + catalogJsonPath: "testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json", expectedConfig: nil, expectedError: fmt.Errorf("catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input1 expected type: string, got: array\n" + "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input2 expected type: int, got: string\n" + diff --git a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json similarity index 80% rename from cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json rename to cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json index e9ed233a..d24d1cec 100644 --- a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json +++ b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json @@ -89,6 +89,29 @@ "default_value": false, "required": true, "display_name": "Input 4" + }, + { + "key": "input5", + "type_metadata": "string", + "description": "Description for input5", + "default_value": "default_value_5", + "required": false, + "display_name": "Input 5" + }, + { + "key": "input6", + "type_metadata": "string", + "description": "Description for input6", + "default_value": "", + "required": false, + "display_name": "Input 6" + }, + { + "key": "input7", + "description": "Description for input7", + "default_value": "some_value", + "required": false, + "display_name": "Input 7" } ], "outputs": [ From 2fbdabce4e6d5f42ae425413fd0d1e1516f5c557 Mon Sep 17 00:00:00 2001 From: Akash Kumar Date: Mon, 1 Dec 2025 13:53:20 +0530 Subject: [PATCH 3/7] fix tedst failure --- cloudinfo/projects_test.go | 4 +++- ...rides_type_and_type_metadata_mismatch.json | 4 ++-- ...tack_definition_stack_inputs_extended.json | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/cloudinfo/projects_test.go b/cloudinfo/projects_test.go index 2113d6c3..f517010e 100644 --- a/cloudinfo/projects_test.go +++ b/cloudinfo/projects_test.go @@ -1013,7 +1013,9 @@ func (suite *ProjectsServiceTestSuite) TestCreateStackFromConfigFile() { expectedError: fmt.Errorf("catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input1 expected type: string, got: array\n" + "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input2 expected type: int, got: string\n" + "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input3 expected type: array, got: bool\n" + - "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input4 expected type: bool, got: array"), + "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input4 expected type: bool, got: array\n" + + "catalog configuration type_metadata mismatch in product 'Product Name', flavor 'Flavor Name': input5 expected type: string, got: int\n" + + "catalog configuration type_metadata mismatch in product 'Product Name', flavor 'Flavor Name': input6 expected type: string, got: bool"), }, { // This is checking the type of the actual default value diff --git a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json index d24d1cec..5cf29b77 100644 --- a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json +++ b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json @@ -92,7 +92,7 @@ }, { "key": "input5", - "type_metadata": "string", + "type_metadata": "int", "description": "Description for input5", "default_value": "default_value_5", "required": false, @@ -100,7 +100,7 @@ }, { "key": "input6", - "type_metadata": "string", + "type_metadata": "bool", "description": "Description for input6", "default_value": "", "required": false, diff --git a/cloudinfo/testdata/stack_definition_stack_inputs_extended.json b/cloudinfo/testdata/stack_definition_stack_inputs_extended.json index 612941ec..8470deb8 100644 --- a/cloudinfo/testdata/stack_definition_stack_inputs_extended.json +++ b/cloudinfo/testdata/stack_definition_stack_inputs_extended.json @@ -27,6 +27,27 @@ "type": "bool", "hidden": false, "default": false + }, + { + "name": "input5", + "required": false, + "type": "string", + "hidden": false, + "default": "stack_value_5" + }, + { + "name": "input6", + "required": false, + "type": "string", + "hidden": false, + "default": "stack_value_6" + }, + { + "name": "input7", + "required": false, + "type": "string", + "hidden": false, + "default": "stack_value_7" } ], "outputs": [ From 1220d92d5046677c867e05b33738ccf6c9a868ed Mon Sep 17 00:00:00 2001 From: Akash Kumar Date: Mon, 1 Dec 2025 23:50:11 +0530 Subject: [PATCH 4/7] added new test for type_metadata --- cloudinfo/projects_test.go | 16 +++- ..._with_config_overrides_type_mismatch.json} | 25 +---- .../ibm_catalog_with_type_metadata_only.json | 96 +++++++++++++++++++ ...tack_definition_stack_inputs_extended.json | 21 ---- ...ck_definition_with_type_metadata_only.json | 43 +++++++++ 5 files changed, 153 insertions(+), 48 deletions(-) rename cloudinfo/testdata/{ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json => ibm_catalog_with_config_overrides_type_mismatch.json} (80%) create mode 100644 cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json create mode 100644 cloudinfo/testdata/stack_definition_with_type_metadata_only.json diff --git a/cloudinfo/projects_test.go b/cloudinfo/projects_test.go index f517010e..e7eb007c 100644 --- a/cloudinfo/projects_test.go +++ b/cloudinfo/projects_test.go @@ -1008,13 +1008,23 @@ func (suite *ProjectsServiceTestSuite) TestCreateStackFromConfigFile() { ConfigID: "54321", }, stackConfigPath: "testdata/stack_definition_stack_inputs_extended.json", - catalogJsonPath: "testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json", + catalogJsonPath: "testdata/ibm_catalog_with_config_overrides_type_mismatch.json", expectedConfig: nil, expectedError: fmt.Errorf("catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input1 expected type: string, got: array\n" + "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input2 expected type: int, got: string\n" + "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input3 expected type: array, got: bool\n" + - "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input4 expected type: bool, got: array\n" + - "catalog configuration type_metadata mismatch in product 'Product Name', flavor 'Flavor Name': input5 expected type: string, got: int\n" + + "catalog configuration type mismatch in product 'Product Name', flavor 'Flavor Name': input4 expected type: bool, got: array"), + }, + { + name: "catalog input type_metadata mismatch, should return an error", + stackConfig: &ConfigDetails{ + ProjectID: "mockProjectID", + ConfigID: "54321", + }, + stackConfigPath: "testdata/stack_definition_with_type_metadata_only.json", + catalogJsonPath: "testdata/ibm_catalog_with_type_metadata_only.json", + expectedConfig: nil, + expectedError: fmt.Errorf("catalog configuration type_metadata mismatch in product 'Product Name', flavor 'Flavor Name': input5 expected type: string, got: int\n" + "catalog configuration type_metadata mismatch in product 'Product Name', flavor 'Flavor Name': input6 expected type: string, got: bool"), }, { diff --git a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json similarity index 80% rename from cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json rename to cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json index 5cf29b77..6037f051 100644 --- a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_and_type_metadata_mismatch.json +++ b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json @@ -89,29 +89,6 @@ "default_value": false, "required": true, "display_name": "Input 4" - }, - { - "key": "input5", - "type_metadata": "int", - "description": "Description for input5", - "default_value": "default_value_5", - "required": false, - "display_name": "Input 5" - }, - { - "key": "input6", - "type_metadata": "bool", - "description": "Description for input6", - "default_value": "", - "required": false, - "display_name": "Input 6" - }, - { - "key": "input7", - "description": "Description for input7", - "default_value": "some_value", - "required": false, - "display_name": "Input 7" } ], "outputs": [ @@ -125,4 +102,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json b/cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json new file mode 100644 index 00000000..38faf874 --- /dev/null +++ b/cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json @@ -0,0 +1,96 @@ +{ + "products": [ + { + "label": "Product Label", + "name": "Product Name", + "product_kind": "Product Kind", + "tags": ["tag1", "tag2"], + "keywords": ["keyword1", "keyword2"], + "short_description": "Short description", + "long_description": "Long description", + "offering_docs_url": "http://example.com/docs", + "offering_icon_url": "http://example.com/icon", + "provider_name": "Provider Name", + "features": [ + { + "title": "Feature Title", + "description": "Feature Description" + } + ], + "support_details": "Support details", + "flavors": [ + { + "label": "Flavor Label", + "name": "Flavor Name", + "working_directory": "Working Directory", + "compliance": { + "authority": "Authority", + "profiles": [ + { + "profile_name": "Profile Name", + "profile_version": "Profile Version" + } + ] + }, + "iam_permissions": [ + { + "service_name": "Service Name", + "role_crns": ["crn1", "crn2"] + } + ], + "architecture": { + "features": [ + { + "title": "Architecture Feature Title", + "description": "Architecture Feature Description" + } + ], + "diagrams": [ + { + "diagram": { + "url": "http://example.com/diagram", + "caption": "Diagram Caption", + "type": "Diagram Type", + "thumbnail_url": "http://example.com/thumbnail" + }, + "description": "Diagram Description" + } + ] + }, + "configuration": [ + { + "key": "input5", + "type_metadata": "int", + "description": "Description for input5", + "default_value": "default_value_5", + "required": false, + "display_name": "Input 5" + }, + { + "key": "input6", + "type_metadata": "bool", + "description": "Description for input6", + "default_value": "", + "required": false, + "display_name": "Input 6" + }, + { + "key": "input7", + "description": "Description for input7", + "default_value": "some_value", + "required": false, + "display_name": "Input 7" + } + ], + "outputs": [ + { + "key": "output1", + "description": "Description for output1" + } + ], + "install_type": "Install Type" + } + ] + } + ] +} \ No newline at end of file diff --git a/cloudinfo/testdata/stack_definition_stack_inputs_extended.json b/cloudinfo/testdata/stack_definition_stack_inputs_extended.json index 8470deb8..612941ec 100644 --- a/cloudinfo/testdata/stack_definition_stack_inputs_extended.json +++ b/cloudinfo/testdata/stack_definition_stack_inputs_extended.json @@ -27,27 +27,6 @@ "type": "bool", "hidden": false, "default": false - }, - { - "name": "input5", - "required": false, - "type": "string", - "hidden": false, - "default": "stack_value_5" - }, - { - "name": "input6", - "required": false, - "type": "string", - "hidden": false, - "default": "stack_value_6" - }, - { - "name": "input7", - "required": false, - "type": "string", - "hidden": false, - "default": "stack_value_7" } ], "outputs": [ diff --git a/cloudinfo/testdata/stack_definition_with_type_metadata_only.json b/cloudinfo/testdata/stack_definition_with_type_metadata_only.json new file mode 100644 index 00000000..fba6b1bc --- /dev/null +++ b/cloudinfo/testdata/stack_definition_with_type_metadata_only.json @@ -0,0 +1,43 @@ +{ + "inputs": [ + { + "name": "input5", + "required": false, + "type": "string", + "hidden": false, + "default": "stack_value_5" + }, + { + "name": "input6", + "required": false, + "type": "string", + "hidden": false, + "default": "stack_value_6" + }, + { + "name": "input7", + "required": false, + "type": "string", + "hidden": false, + "default": "stack_value_7" + } + ], + "outputs": [ + { + "name": "output1", + "value": "ref:../members/member1/outputs/output1" + } + ], + "members": [ + { + "inputs": [ + { + "name": "input5", + "value": "ref:../../inputs/input5" + } + ], + "name": "member1", + "version_locator": "version1" + } + ] +} \ No newline at end of file From 363ac281e793caca20b12c1af9387ba7dff5ccfb Mon Sep 17 00:00:00 2001 From: Akash Kumar Date: Mon, 1 Dec 2025 23:55:24 +0530 Subject: [PATCH 5/7] fix EOF --- .../ibm_catalog_with_config_overrides_type_mismatch.json | 2 +- cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json | 2 +- .../testdata/stack_definition_with_type_metadata_only.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json index 6037f051..e9ed233a 100644 --- a/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json +++ b/cloudinfo/testdata/ibm_catalog_with_config_overrides_type_mismatch.json @@ -102,4 +102,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json b/cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json index 38faf874..2dc82783 100644 --- a/cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json +++ b/cloudinfo/testdata/ibm_catalog_with_type_metadata_only.json @@ -93,4 +93,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/cloudinfo/testdata/stack_definition_with_type_metadata_only.json b/cloudinfo/testdata/stack_definition_with_type_metadata_only.json index fba6b1bc..a31289e3 100644 --- a/cloudinfo/testdata/stack_definition_with_type_metadata_only.json +++ b/cloudinfo/testdata/stack_definition_with_type_metadata_only.json @@ -40,4 +40,4 @@ "version_locator": "version1" } ] -} \ No newline at end of file +} From ef59d77fa957ab8fcae57a66f9e79477a46b963c Mon Sep 17 00:00:00 2001 From: Akash Kumar Date: Tue, 2 Dec 2025 18:58:34 +0530 Subject: [PATCH 6/7] addressed review comments --- --all-files | 94 +++++++++++++++++++ .secrets.baseline | 4 +- cloudinfo/projects.go | 6 +- cloudinfo/projects_types.go | 13 +-- ...ck_definition_with_type_metadata_only.json | 6 +- run | 94 +++++++++++++++++++ 6 files changed, 205 insertions(+), 12 deletions(-) create mode 100644 --all-files create mode 100644 run diff --git a/--all-files b/--all-files new file mode 100644 index 00000000..62e02ee1 --- /dev/null +++ b/--all-files @@ -0,0 +1,94 @@ +Check git submodule up to date............................................Passed +License Checker...........................................................Passed +check yaml................................................................Passed +check json................................................................Passed +fix end of files..........................................................Passed +trim trailing whitespace..................................................Passed +check for merge conflicts.................................................Passed +detect private key........................................................Passed +mixed line ending.........................................................Passed +Lint Dockerfiles......................................(no files to check)Skipped +Go Security Checker.......................................................Passed +Trivy scan................................................................Passed +Terraform fmt.............................................................Passed +Terraform validate....................................(no files to check)Skipped +Terraform validate with tflint............................................Passed +Terraform validate with trivy.............................................Passed +Checkov...................................................................Passed +Forbid binaries.......................................(no files to check)Skipped +Test shell scripts with shellcheck........................................Passed +go fmt....................................................................Passed +Detect secrets............................................................Failed +- hook id: detect-secrets +- exit code: 1 + +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. + +ruff (legacy alias)...................................(no files to check)Skipped +ruff format...........................................(no files to check)Skipped +golangci-lint.............................................................Passed +Add examples section to README............................................Passed +Add terraform docs section to README......................................Passed +Add overview section to README............................................Passed +Validate catalogValidationValues.json.template file.......................Passed +Add module repository to go.mod.......................(no files to check)Skipped +Validate ibm_catalog.json file............................................Passed +helmlint..................................................................Passed +Validate ibm_catalog.json schema......................(no files to check)Skipped +typos (warning only)......................................................Passed +- hook id: typos +- duration: 0.19s + +common/git.go:484:5: error: Chek should be Check +common/git.go:505:63: error: verbage should be verbiage +docs/projects/addons/dependency-permutation-testing.md:267:66: error: observ should be observe +cloudinfo/catalog.go:158:55: error: programatic should be programmatic +cloudinfo/catalog.go:830:196: error: inital should be initial +testschematic/schematics.go:89:59: error: propery should be property, properly +testschematic/example_test.go:15:39: error: contructor should be constructor +testschematic/tests.go:59:40: error: considerd should be considered +testschematic/tests.go:315:39: error: considerd should be considered +testschematic/tests.go:369:53: error: repostory should be repository +testprojects/tests.go:36:2: error: UNKOWN should be UNKNOWN +testprojects/tests.go:359:13: error: Struc should be Struct +testprojects/tests.go:361:39: error: Struc should be Struct +testprojects/tests.go:362:68: error: Struc should be Struct +testprojects/tests.go:1027:10: error: Configration should be Configuration +testprojects/tests.go:1027:57: error: Configration should be Configuration +testhelper/example_test.go:44:39: error: contructor should be constructor +testhelper/example_test.go:87:39: error: contructor should be constructor +testhelper/example_test.go:185:39: error: contructor should be constructor +testschematic/mock_test.go:482:5645: error: applyable should be applicable +testhelper/terraform.go:46:37: error: occured should be occurred +testhelper/terraform.go:51:36: error: occured should be occurred +testhelper/tests.go:162:37: error: procceding should be proceeding +testhelper/tests.go:189:60: error: containg should be containing +testhelper/tests.go:719:27: error: funtion should be function +testschematic/test_options.go:22:113: error: wihtin should be within +testschematic/test_options.go:44:23: error: contaning should be containing +testschematic/test_options.go:189:57: error: varialbe should be variable +testprojects/test_options.go:61:5: error: Configration should be Configuration +testprojects/test_options.go:63:2: error: Configration should be Configuration +cloudinfo/region.go:171:19: error: priorty should be priority +cloudinfo/region.go:337:89: error: occurances should be occurrences +testhelper/test_options.go:29:23: error: contaning should be containing + diff --git a/.secrets.baseline b/.secrets.baseline index 344a11c8..b1c8ac1a 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|package-lock.json|^.secrets.baseline$", "lines": null }, - "generated_at": "2025-11-28T15:02:26Z", + "generated_at": "2025-12-02T13:23:17Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -118,7 +118,7 @@ "hashed_secret": "03e60e3e0d9675b19754e2a81bbb48a26af858e7", "is_secret": false, "is_verified": false, - "line_number": 946, + "line_number": 950, "type": "Secret Keyword", "verified_result": null } diff --git a/cloudinfo/projects.go b/cloudinfo/projects.go index c8df1ff7..f0be40f2 100644 --- a/cloudinfo/projects.go +++ b/cloudinfo/projects.go @@ -873,7 +873,11 @@ func validateCatalogInputsInStackDefinition(stackJson Stack, catalogConfig Catal for _, stackInput := range stackJson.Inputs { if catalogInput.Key == stackInput.Name { found = true - expectedType := convertGoTypeToExpectedType(stackInput.Type) + expectedType := stackInput.Type + if expectedType == "" { + expectedType = stackInput.TypeMetadata + } + expectedType = convertGoTypeToExpectedType(expectedType) if catalogInput.Type != "" && !isValidType(catalogInput.Type, expectedType) { typeMismatches = append(typeMismatches, fmt.Sprintf("catalog configuration type mismatch in product '%s', flavor '%s': %s expected type: %s, got: %s", productName, flavorName, catalogInput.Key, expectedType, catalogInput.Type)) } diff --git a/cloudinfo/projects_types.go b/cloudinfo/projects_types.go index c78689c6..25f00c27 100644 --- a/cloudinfo/projects_types.go +++ b/cloudinfo/projects_types.go @@ -7,12 +7,13 @@ import ( type Stack struct { Inputs []struct { - Name string `json:"name"` - Description string `json:"description"` - Required bool `json:"required"` - Type string `json:"type"` - Hidden bool `json:"hidden"` - Default interface{} `json:"default"` + Name string `json:"name"` + Description string `json:"description"` + Required bool `json:"required"` + Type string `json:"type"` + TypeMetadata string `json:"type_metadata"` + Hidden bool `json:"hidden"` + Default interface{} `json:"default"` } `json:"inputs"` Outputs []struct { Name string `json:"name"` diff --git a/cloudinfo/testdata/stack_definition_with_type_metadata_only.json b/cloudinfo/testdata/stack_definition_with_type_metadata_only.json index a31289e3..4ece5693 100644 --- a/cloudinfo/testdata/stack_definition_with_type_metadata_only.json +++ b/cloudinfo/testdata/stack_definition_with_type_metadata_only.json @@ -3,21 +3,21 @@ { "name": "input5", "required": false, - "type": "string", + "type_metadata": "string", "hidden": false, "default": "stack_value_5" }, { "name": "input6", "required": false, - "type": "string", + "type_metadata": "string", "hidden": false, "default": "stack_value_6" }, { "name": "input7", "required": false, - "type": "string", + "type_metadata": "string", "hidden": false, "default": "stack_value_7" } diff --git a/run b/run new file mode 100644 index 00000000..62e02ee1 --- /dev/null +++ b/run @@ -0,0 +1,94 @@ +Check git submodule up to date............................................Passed +License Checker...........................................................Passed +check yaml................................................................Passed +check json................................................................Passed +fix end of files..........................................................Passed +trim trailing whitespace..................................................Passed +check for merge conflicts.................................................Passed +detect private key........................................................Passed +mixed line ending.........................................................Passed +Lint Dockerfiles......................................(no files to check)Skipped +Go Security Checker.......................................................Passed +Trivy scan................................................................Passed +Terraform fmt.............................................................Passed +Terraform validate....................................(no files to check)Skipped +Terraform validate with tflint............................................Passed +Terraform validate with trivy.............................................Passed +Checkov...................................................................Passed +Forbid binaries.......................................(no files to check)Skipped +Test shell scripts with shellcheck........................................Passed +go fmt....................................................................Passed +Detect secrets............................................................Failed +- hook id: detect-secrets +- exit code: 1 + +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. +Your baseline file (.secrets.baseline) is unstaged. +`git add .secrets.baseline` to fix this. + +ruff (legacy alias)...................................(no files to check)Skipped +ruff format...........................................(no files to check)Skipped +golangci-lint.............................................................Passed +Add examples section to README............................................Passed +Add terraform docs section to README......................................Passed +Add overview section to README............................................Passed +Validate catalogValidationValues.json.template file.......................Passed +Add module repository to go.mod.......................(no files to check)Skipped +Validate ibm_catalog.json file............................................Passed +helmlint..................................................................Passed +Validate ibm_catalog.json schema......................(no files to check)Skipped +typos (warning only)......................................................Passed +- hook id: typos +- duration: 0.19s + +common/git.go:484:5: error: Chek should be Check +common/git.go:505:63: error: verbage should be verbiage +docs/projects/addons/dependency-permutation-testing.md:267:66: error: observ should be observe +cloudinfo/catalog.go:158:55: error: programatic should be programmatic +cloudinfo/catalog.go:830:196: error: inital should be initial +testschematic/schematics.go:89:59: error: propery should be property, properly +testschematic/example_test.go:15:39: error: contructor should be constructor +testschematic/tests.go:59:40: error: considerd should be considered +testschematic/tests.go:315:39: error: considerd should be considered +testschematic/tests.go:369:53: error: repostory should be repository +testprojects/tests.go:36:2: error: UNKOWN should be UNKNOWN +testprojects/tests.go:359:13: error: Struc should be Struct +testprojects/tests.go:361:39: error: Struc should be Struct +testprojects/tests.go:362:68: error: Struc should be Struct +testprojects/tests.go:1027:10: error: Configration should be Configuration +testprojects/tests.go:1027:57: error: Configration should be Configuration +testhelper/example_test.go:44:39: error: contructor should be constructor +testhelper/example_test.go:87:39: error: contructor should be constructor +testhelper/example_test.go:185:39: error: contructor should be constructor +testschematic/mock_test.go:482:5645: error: applyable should be applicable +testhelper/terraform.go:46:37: error: occured should be occurred +testhelper/terraform.go:51:36: error: occured should be occurred +testhelper/tests.go:162:37: error: procceding should be proceeding +testhelper/tests.go:189:60: error: containg should be containing +testhelper/tests.go:719:27: error: funtion should be function +testschematic/test_options.go:22:113: error: wihtin should be within +testschematic/test_options.go:44:23: error: contaning should be containing +testschematic/test_options.go:189:57: error: varialbe should be variable +testprojects/test_options.go:61:5: error: Configration should be Configuration +testprojects/test_options.go:63:2: error: Configration should be Configuration +cloudinfo/region.go:171:19: error: priorty should be priority +cloudinfo/region.go:337:89: error: occurances should be occurrences +testhelper/test_options.go:29:23: error: contaning should be containing + From c3dba9076471ebaed5d3290341744fd4ac5f4469 Mon Sep 17 00:00:00 2001 From: Akash Kumar Date: Tue, 2 Dec 2025 19:04:05 +0530 Subject: [PATCH 7/7] removed files --- --all-files | 94 ----------------------------------------------------- run | 94 ----------------------------------------------------- 2 files changed, 188 deletions(-) delete mode 100644 --all-files delete mode 100644 run diff --git a/--all-files b/--all-files deleted file mode 100644 index 62e02ee1..00000000 --- a/--all-files +++ /dev/null @@ -1,94 +0,0 @@ -Check git submodule up to date............................................Passed -License Checker...........................................................Passed -check yaml................................................................Passed -check json................................................................Passed -fix end of files..........................................................Passed -trim trailing whitespace..................................................Passed -check for merge conflicts.................................................Passed -detect private key........................................................Passed -mixed line ending.........................................................Passed -Lint Dockerfiles......................................(no files to check)Skipped -Go Security Checker.......................................................Passed -Trivy scan................................................................Passed -Terraform fmt.............................................................Passed -Terraform validate....................................(no files to check)Skipped -Terraform validate with tflint............................................Passed -Terraform validate with trivy.............................................Passed -Checkov...................................................................Passed -Forbid binaries.......................................(no files to check)Skipped -Test shell scripts with shellcheck........................................Passed -go fmt....................................................................Passed -Detect secrets............................................................Failed -- hook id: detect-secrets -- exit code: 1 - -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. - -ruff (legacy alias)...................................(no files to check)Skipped -ruff format...........................................(no files to check)Skipped -golangci-lint.............................................................Passed -Add examples section to README............................................Passed -Add terraform docs section to README......................................Passed -Add overview section to README............................................Passed -Validate catalogValidationValues.json.template file.......................Passed -Add module repository to go.mod.......................(no files to check)Skipped -Validate ibm_catalog.json file............................................Passed -helmlint..................................................................Passed -Validate ibm_catalog.json schema......................(no files to check)Skipped -typos (warning only)......................................................Passed -- hook id: typos -- duration: 0.19s - -common/git.go:484:5: error: Chek should be Check -common/git.go:505:63: error: verbage should be verbiage -docs/projects/addons/dependency-permutation-testing.md:267:66: error: observ should be observe -cloudinfo/catalog.go:158:55: error: programatic should be programmatic -cloudinfo/catalog.go:830:196: error: inital should be initial -testschematic/schematics.go:89:59: error: propery should be property, properly -testschematic/example_test.go:15:39: error: contructor should be constructor -testschematic/tests.go:59:40: error: considerd should be considered -testschematic/tests.go:315:39: error: considerd should be considered -testschematic/tests.go:369:53: error: repostory should be repository -testprojects/tests.go:36:2: error: UNKOWN should be UNKNOWN -testprojects/tests.go:359:13: error: Struc should be Struct -testprojects/tests.go:361:39: error: Struc should be Struct -testprojects/tests.go:362:68: error: Struc should be Struct -testprojects/tests.go:1027:10: error: Configration should be Configuration -testprojects/tests.go:1027:57: error: Configration should be Configuration -testhelper/example_test.go:44:39: error: contructor should be constructor -testhelper/example_test.go:87:39: error: contructor should be constructor -testhelper/example_test.go:185:39: error: contructor should be constructor -testschematic/mock_test.go:482:5645: error: applyable should be applicable -testhelper/terraform.go:46:37: error: occured should be occurred -testhelper/terraform.go:51:36: error: occured should be occurred -testhelper/tests.go:162:37: error: procceding should be proceeding -testhelper/tests.go:189:60: error: containg should be containing -testhelper/tests.go:719:27: error: funtion should be function -testschematic/test_options.go:22:113: error: wihtin should be within -testschematic/test_options.go:44:23: error: contaning should be containing -testschematic/test_options.go:189:57: error: varialbe should be variable -testprojects/test_options.go:61:5: error: Configration should be Configuration -testprojects/test_options.go:63:2: error: Configration should be Configuration -cloudinfo/region.go:171:19: error: priorty should be priority -cloudinfo/region.go:337:89: error: occurances should be occurrences -testhelper/test_options.go:29:23: error: contaning should be containing - diff --git a/run b/run deleted file mode 100644 index 62e02ee1..00000000 --- a/run +++ /dev/null @@ -1,94 +0,0 @@ -Check git submodule up to date............................................Passed -License Checker...........................................................Passed -check yaml................................................................Passed -check json................................................................Passed -fix end of files..........................................................Passed -trim trailing whitespace..................................................Passed -check for merge conflicts.................................................Passed -detect private key........................................................Passed -mixed line ending.........................................................Passed -Lint Dockerfiles......................................(no files to check)Skipped -Go Security Checker.......................................................Passed -Trivy scan................................................................Passed -Terraform fmt.............................................................Passed -Terraform validate....................................(no files to check)Skipped -Terraform validate with tflint............................................Passed -Terraform validate with trivy.............................................Passed -Checkov...................................................................Passed -Forbid binaries.......................................(no files to check)Skipped -Test shell scripts with shellcheck........................................Passed -go fmt....................................................................Passed -Detect secrets............................................................Failed -- hook id: detect-secrets -- exit code: 1 - -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. -Your baseline file (.secrets.baseline) is unstaged. -`git add .secrets.baseline` to fix this. - -ruff (legacy alias)...................................(no files to check)Skipped -ruff format...........................................(no files to check)Skipped -golangci-lint.............................................................Passed -Add examples section to README............................................Passed -Add terraform docs section to README......................................Passed -Add overview section to README............................................Passed -Validate catalogValidationValues.json.template file.......................Passed -Add module repository to go.mod.......................(no files to check)Skipped -Validate ibm_catalog.json file............................................Passed -helmlint..................................................................Passed -Validate ibm_catalog.json schema......................(no files to check)Skipped -typos (warning only)......................................................Passed -- hook id: typos -- duration: 0.19s - -common/git.go:484:5: error: Chek should be Check -common/git.go:505:63: error: verbage should be verbiage -docs/projects/addons/dependency-permutation-testing.md:267:66: error: observ should be observe -cloudinfo/catalog.go:158:55: error: programatic should be programmatic -cloudinfo/catalog.go:830:196: error: inital should be initial -testschematic/schematics.go:89:59: error: propery should be property, properly -testschematic/example_test.go:15:39: error: contructor should be constructor -testschematic/tests.go:59:40: error: considerd should be considered -testschematic/tests.go:315:39: error: considerd should be considered -testschematic/tests.go:369:53: error: repostory should be repository -testprojects/tests.go:36:2: error: UNKOWN should be UNKNOWN -testprojects/tests.go:359:13: error: Struc should be Struct -testprojects/tests.go:361:39: error: Struc should be Struct -testprojects/tests.go:362:68: error: Struc should be Struct -testprojects/tests.go:1027:10: error: Configration should be Configuration -testprojects/tests.go:1027:57: error: Configration should be Configuration -testhelper/example_test.go:44:39: error: contructor should be constructor -testhelper/example_test.go:87:39: error: contructor should be constructor -testhelper/example_test.go:185:39: error: contructor should be constructor -testschematic/mock_test.go:482:5645: error: applyable should be applicable -testhelper/terraform.go:46:37: error: occured should be occurred -testhelper/terraform.go:51:36: error: occured should be occurred -testhelper/tests.go:162:37: error: procceding should be proceeding -testhelper/tests.go:189:60: error: containg should be containing -testhelper/tests.go:719:27: error: funtion should be function -testschematic/test_options.go:22:113: error: wihtin should be within -testschematic/test_options.go:44:23: error: contaning should be containing -testschematic/test_options.go:189:57: error: varialbe should be variable -testprojects/test_options.go:61:5: error: Configration should be Configuration -testprojects/test_options.go:63:2: error: Configration should be Configuration -cloudinfo/region.go:171:19: error: priorty should be priority -cloudinfo/region.go:337:89: error: occurances should be occurrences -testhelper/test_options.go:29:23: error: contaning should be containing -