diff --git a/changelog/v0.21.29/skip-ci-label-support.yaml b/changelog/v0.21.29/skip-ci-label-support.yaml new file mode 100644 index 00000000..a8f5224e --- /dev/null +++ b/changelog/v0.21.29/skip-ci-label-support.yaml @@ -0,0 +1,5 @@ +changelog: + - type: NEW_FEATURE + description: Allow skipping ci when label is added to changelog. + issueLink: https://github.com/solo-io/gloo-mesh-enterprise/issues/1127 + resolvesIssue: false \ No newline at end of file diff --git a/changelogutils/changelog.go b/changelogutils/changelog.go index fb31b43d..37e42e3a 100644 --- a/changelogutils/changelog.go +++ b/changelogutils/changelog.go @@ -24,8 +24,10 @@ type ChangelogEntry struct { DependencyRepo string `json:"dependencyRepo,omitempty"` DependencyTag string `json:"dependencyTag,omitempty"` ResolvesIssue *bool `json:"resolvesIssue,omitempty"` + SkipCI *bool `json:"skipCI,omitempty"` } +// default true func (c *ChangelogEntry) GetResolvesIssue() bool { if c.ResolvesIssue == nil { return true @@ -33,6 +35,14 @@ func (c *ChangelogEntry) GetResolvesIssue() bool { return *c.ResolvesIssue } +// default false +func (c *ChangelogEntry) GetSkipCI() bool { + if c.SkipCI == nil { + return false + } + return *c.SkipCI +} + type ChangelogFile struct { Entries []*ChangelogEntry `json:"changelog,omitempty"` ReleaseStableApi *bool `json:"releaseStableApi,omitempty"` diff --git a/changelogutils/changelog_test.go b/changelogutils/changelog_test.go index 89c3f20d..a97ae950 100644 --- a/changelogutils/changelog_test.go +++ b/changelogutils/changelog_test.go @@ -76,11 +76,14 @@ var _ = Describe("ChangelogTest", func() { - type: FIX description: foo issueLink: bar - resolvesIssue: false` + resolvesIssue: false + skipCI: true` err := yaml.Unmarshal([]byte(contents), &clf) Expect(err).NotTo(HaveOccurred()) boolValue := new(bool) *boolValue = false + skipCIValue := new(bool) + *skipCIValue = true expected := changelogutils.ChangelogFile{ Entries: []*changelogutils.ChangelogEntry{ { @@ -88,6 +91,7 @@ var _ = Describe("ChangelogTest", func() { Description: "foo", IssueLink: "bar", ResolvesIssue: boolValue, + SkipCI: skipCIValue, }, }, }