From 1acce2ec64c66fa09ab4692ca5fc54fcf6b42c5a Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Fri, 22 Nov 2024 07:19:57 -0700 Subject: [PATCH 1/2] tooling/templatize: fix some typos Signed-off-by: Steve Kuznetsov --- tooling/templatize/pkg/config/config.go | 4 ++-- tooling/templatize/pkg/ev2/mapping_test.go | 4 ++-- tooling/templatize/pkg/ev2/pipeline.go | 4 ++-- tooling/templatize/pkg/ev2/utils.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tooling/templatize/pkg/config/config.go b/tooling/templatize/pkg/config/config.go index 003c45e75..ee92704b0 100644 --- a/tooling/templatize/pkg/config/config.go +++ b/tooling/templatize/pkg/config/config.go @@ -231,13 +231,13 @@ func (cp *configProviderImpl) GetRegionOverrides(cloud, deployEnv, region string func (cp *configProviderImpl) loadConfig(configReplacements *ConfigReplacements) (VariableOverrides, error) { // TODO validate that field names are unique regardless of casing // parse, execute and unmarshal the config file as a template to generate the final config file - bytes, err := PreprocessFile(cp.config, configReplacements.AsMap()) + rawContent, err := PreprocessFile(cp.config, configReplacements.AsMap()) if err != nil { return nil, err } currentVariableOverrides := NewVariableOverrides() - if err := yaml.Unmarshal(bytes, currentVariableOverrides); err == nil { + if err := yaml.Unmarshal(rawContent, currentVariableOverrides); err == nil { return currentVariableOverrides, nil } else { return nil, err diff --git a/tooling/templatize/pkg/ev2/mapping_test.go b/tooling/templatize/pkg/ev2/mapping_test.go index d507d1dfb..de7240431 100644 --- a/tooling/templatize/pkg/ev2/mapping_test.go +++ b/tooling/templatize/pkg/ev2/mapping_test.go @@ -27,7 +27,7 @@ func TestMapping(t *testing.T) { "__PARENT_NESTED__": "parent.nested", "__PARENT_DEEPER_DEEPEST__": "parent.deeper.deepest", } - expecetedReplace := map[string]interface{}{ + expectedReplace := map[string]interface{}{ "key1": "__KEY1__", "key2": "__KEY2__", "key3": "__KEY3__", @@ -40,7 +40,7 @@ func TestMapping(t *testing.T) { if diff := cmp.Diff(expectedFlattened, flattened); diff != "" { t.Errorf("got incorrect flattened: %v", diff) } - if diff := cmp.Diff(expecetedReplace, replace); diff != "" { + if diff := cmp.Diff(expectedReplace, replace); diff != "" { t.Errorf("got incorrect replace: %v", diff) } } diff --git a/tooling/templatize/pkg/ev2/pipeline.go b/tooling/templatize/pkg/ev2/pipeline.go index 0e2b40da7..1b5e854d5 100644 --- a/tooling/templatize/pkg/ev2/pipeline.go +++ b/tooling/templatize/pkg/ev2/pipeline.go @@ -51,11 +51,11 @@ func PrecompilePipelineForEV2(pipelineFilePath string, vars config.Variables) (s } func processPipelineForEV2(p *pipeline.Pipeline, vars config.Variables) error { - _, scopeBindedVars := EV2Mapping(vars, []string{}) + _, scopeBoundVars := EV2Mapping(vars, []string{}) for _, rg := range p.ResourceGroups { for _, step := range rg.Steps { if step.Parameters != "" { - newParameterFilePath, err := precompileFileAndStore(step.Parameters, scopeBindedVars) + newParameterFilePath, err := precompileFileAndStore(step.Parameters, scopeBoundVars) if err != nil { return err } diff --git a/tooling/templatize/pkg/ev2/utils.go b/tooling/templatize/pkg/ev2/utils.go index 6b6eb2c35..76814efe8 100644 --- a/tooling/templatize/pkg/ev2/utils.go +++ b/tooling/templatize/pkg/ev2/utils.go @@ -72,7 +72,7 @@ func PreprocessFileForEV2SystemVars(configProvider config.ConfigProvider, cloud, return config.PreprocessFile(templateFile, vars) } -// PreprocessFileForEV2ScopeBinding processes an arbitrary gotemplate fileand replaces all config.yaml references +// PreprocessFileForEV2ScopeBinding processes an arbitrary gotemplate file and replaces all config.yaml references // with __VAR__ scope binding find/replace references. // This function is useful to process bicepparam files so that they can be used within EV2 together // with scopebinding. From e64ca83722e9da86785577ef34041cb4c76d92db Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Fri, 22 Nov 2024 11:27:41 -0700 Subject: [PATCH 2/2] .github: clarify what the github runner thinks the head is Signed-off-by: Steve Kuznetsov --- .github/workflows/aro-hcp-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/aro-hcp-cd.yml b/.github/workflows/aro-hcp-cd.yml index 38b20c635..4f0e2b69b 100644 --- a/.github/workflows/aro-hcp-cd.yml +++ b/.github/workflows/aro-hcp-cd.yml @@ -48,7 +48,7 @@ steps: - name: Fail if PR submitted from fork if: ${{ github.event.pull_request.head.repo.full_name != 'Azure/ARO-HCP' }} - run: core.setFailed('Expected source repository to be Azure/ARO-HCP, re-create PR as a branch of Azure/ARO-HCP') + run: core.setFailed('Expected source repository to be Azure/ARO-HCP, not ${{ github.event.pull_request.head.repo.full_name }}, re-create PR as a branch of Azure/ARO-HCP') deploy_global_rg: name: 'Deploy global resources'