Skip to content

Commit fa8128b

Browse files
committed
fix parsing project config missing value
shouldPushRepositories flag was defaulting to false and test case was expecting the default case, so didn't catch this
1 parent 0fedb31 commit fa8128b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/config/projectconfig/project_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const GraphRootName = "graphRoot"
1414

1515
type ZeroProjectConfig struct {
1616
Name string `yaml:"name"`
17-
ShouldPushRepositories bool
17+
ShouldPushRepositories bool `yaml:"shouldPushRepositories"`
1818
Parameters map[string]string
1919
Modules Modules `yaml:"modules"`
2020
}

internal/config/projectconfig/project_config_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ func TestLoadConfig(t *testing.T) {
2424
filePath := file.Name()
2525

2626
want := &projectconfig.ZeroProjectConfig{
27-
Name: "abc",
28-
Modules: eksGoReactSampleModules(),
27+
Name: "abc",
28+
ShouldPushRepositories: true,
29+
Modules: eksGoReactSampleModules(),
2930
}
3031

3132
t.Run("Should load and unmarshal config correctly", func(t *testing.T) {
@@ -34,7 +35,6 @@ func TestLoadConfig(t *testing.T) {
3435
t.Errorf("projectconfig.ZeroProjectConfig.Unmarshal mismatch (-want +got):\n%s", cmp.Diff(want, got))
3536
}
3637
})
37-
3838
}
3939

4040
func eksGoReactSampleModules() projectconfig.Modules {
@@ -51,7 +51,7 @@ func validConfigContent() string {
5151
# Templated zero-project.yml file
5252
name: abc
5353
54-
shouldPushRepositories: false
54+
shouldPushRepositories: true
5555
5656
modules:
5757
aws-eks-stack:

0 commit comments

Comments
 (0)