diff --git a/Makefile b/Makefile index 62e6440..5f83de7 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ # BIN_NAME := chart-releaser -BIN_VERSION := 0.1.1 +BIN_VERSION := 0.1.2 IMG_NAME := chartreleaser/chart-releaser GIT_COMMIT ?= $(shell git rev-parse --short HEAD 2> /dev/null || true) diff --git a/example/.chartreleaser.yaml b/example/.chartreleaser.yml similarity index 92% rename from example/.chartreleaser.yaml rename to example/.chartreleaser.yml index 1344b17..272a07e 100644 --- a/example/.chartreleaser.yaml +++ b/example/.chartreleaser.yml @@ -14,5 +14,5 @@ release: extras: - path: something.txt updates: - - search: foo - replace: bar + - search: bar + replace: foo diff --git a/pkg/templates/templates.go b/pkg/templates/templates.go index 157bc27..4568585 100644 --- a/pkg/templates/templates.go +++ b/pkg/templates/templates.go @@ -46,9 +46,13 @@ var ConfigHeaderComment = heredoc.Doc(` `) // DefaultUpdateCommitMessage is the default template for a commit message used when -// updating a file. +// updating the Chart file. var DefaultUpdateCommitMessage = `[{{ .Chart.Name }}] bump chart to {{ .Chart.NewVersion }} for new application release ({{ .App.NewVersion }})` +// DefaultExtrasCommitMessage is the default template for a commit message used when +// updating a file specified in the `extras` config. +var DefaultExtrasCommitMessage = `[{{ .Chart.Name }}] update {{ .CurrentFile.Path }} for new application release ({{ .App.NewVersion }})` + // DefaultPullRequestTitle is a template for the default title used when opening a pull // request for the updates generated by chart-releaser. // diff --git a/pkg/v1/cfg/config.go b/pkg/v1/cfg/config.go index 4eada54..318f068 100644 --- a/pkg/v1/cfg/config.go +++ b/pkg/v1/cfg/config.go @@ -203,6 +203,7 @@ func (c *CommitConfig) validate() error { // operations. type CommitTemplateConfig struct { Update string `yaml:"update,omitempty"` + Extras string `yaml:"extras,omitempty"` } // validate the CommitTemplateConfig is correct. diff --git a/pkg/v1/ctx/context.go b/pkg/v1/ctx/context.go index 27eb4a6..feae35c 100644 --- a/pkg/v1/ctx/context.go +++ b/pkg/v1/ctx/context.go @@ -99,7 +99,8 @@ type Repository struct { type Release struct { PRTitle string PRBody string - UpdateCommitMsg string + ChartCommitMsg string + ExtrasCommitMsg string Matches []*regexp.Regexp Ignores []*regexp.Regexp } @@ -125,6 +126,11 @@ type Context struct { Repository Repository Release Release + // CurrentFile holds a reference to a extras file that is currently being + // worked on when publishing changes. This allows template rendering to + // access information about the file, e.g. .CurrentFile.Path + CurrentFile File + AllowDirty bool DryRun bool ShowDiff bool diff --git a/pkg/v1/stages/chart/chart.go b/pkg/v1/stages/chart/chart.go index 0025fe5..ee47c89 100644 --- a/pkg/v1/stages/chart/chart.go +++ b/pkg/v1/stages/chart/chart.go @@ -5,9 +5,8 @@ import ( "path/filepath" "strings" - "github.com/edaniszewski/chart-releaser/pkg/client" - "github.com/apex/log" + "github.com/edaniszewski/chart-releaser/pkg/client" version "github.com/edaniszewski/chart-releaser/pkg/semver" "github.com/edaniszewski/chart-releaser/pkg/strategies" context "github.com/edaniszewski/chart-releaser/pkg/v1/ctx" diff --git a/pkg/v1/stages/chart/chart_test.go b/pkg/v1/stages/chart/chart_test.go index cb8b695..c958470 100644 --- a/pkg/v1/stages/chart/chart_test.go +++ b/pkg/v1/stages/chart/chart_test.go @@ -60,7 +60,7 @@ appVersion: 0.2.3 assert.Equal(t, "", context.Git.Base) assert.Equal(t, "", context.Git.Ref) assert.Equal(t, "", context.Git.Tag) - assert.Equal(t, "", context.Release.UpdateCommitMsg) + assert.Equal(t, "", context.Release.ChartCommitMsg) assert.Equal(t, "", context.Release.PRBody) assert.Equal(t, "", context.Release.PRTitle) assert.Equal(t, "", context.Repository.Name) diff --git a/pkg/v1/stages/config/config.go b/pkg/v1/stages/config/config.go index 39036cd..69e3223 100644 --- a/pkg/v1/stages/config/config.go +++ b/pkg/v1/stages/config/config.go @@ -124,13 +124,22 @@ func loadPublishStrategy(ctx *context.Context) error { func loadTemplateStrings(ctx *context.Context) error { if ctx.Config.Commit.Templates == nil { - ctx.Release.UpdateCommitMsg = templates.DefaultUpdateCommitMessage - log.WithField("default", ctx.Release.UpdateCommitMsg).Debug("using default commit message for updating files") + ctx.Release.ChartCommitMsg = templates.DefaultUpdateCommitMessage + log.WithField("default", ctx.Release.ChartCommitMsg).Debug("using default commit message for updating Chart") + + ctx.Release.ExtrasCommitMsg = templates.DefaultExtrasCommitMessage + log.WithField("default", ctx.Release.ExtrasCommitMsg).Debug("using default commit message for updating extra files") } else { - ctx.Release.UpdateCommitMsg = ctx.Config.Commit.Templates.Update - if ctx.Release.UpdateCommitMsg == "" { - ctx.Release.UpdateCommitMsg = templates.DefaultUpdateCommitMessage - log.WithField("default", ctx.Release.UpdateCommitMsg).Debug("using default commit message for updating files") + ctx.Release.ChartCommitMsg = ctx.Config.Commit.Templates.Update + if ctx.Release.ChartCommitMsg == "" { + ctx.Release.ChartCommitMsg = templates.DefaultUpdateCommitMessage + log.WithField("default", ctx.Release.ChartCommitMsg).Debug("using default commit message for updating Chart") + } + + ctx.Release.ExtrasCommitMsg = ctx.Config.Commit.Templates.Extras + if ctx.Release.ExtrasCommitMsg == "" { + ctx.Release.ExtrasCommitMsg = templates.DefaultExtrasCommitMessage + log.WithField("default", ctx.Release.ExtrasCommitMsg).Debug("using default commit message for updating extra files") } } diff --git a/pkg/v1/stages/config/config_test.go b/pkg/v1/stages/config/config_test.go index 3802250..d7660ff 100644 --- a/pkg/v1/stages/config/config_test.go +++ b/pkg/v1/stages/config/config_test.go @@ -80,7 +80,7 @@ func TestStage_Run(t *testing.T) { // Release assert.Equal(t, "Bump {{ .Chart.Name }} Chart from {{ .Chart.PreviousVersion }} to {{ .Chart.NewVersion }}", context.Release.PRTitle) assert.Equal(t, "Bumps the {{ .Chart.Name }} Helm Chart from {{ .Chart.PreviousVersion }} to {{ .Chart.NewVersion }}.\n\n{{ if .Files }}The following files have also been updated:\n{{ range .Files }}- {{ .Path }}\n{{ end }}{{ end }}\n---\n*This PR was generated with [chart-releaser](https://github.com/edaniszewski/chart-releaser)*\n", context.Release.PRBody) - assert.Equal(t, "[{{ .Chart.Name }}] bump chart to {{ .Chart.NewVersion }} for new application release ({{ .App.NewVersion }})", context.Release.UpdateCommitMsg) + assert.Equal(t, "[{{ .Chart.Name }}] bump chart to {{ .Chart.NewVersion }} for new application release ({{ .App.NewVersion }})", context.Release.ChartCommitMsg) // Other assert.Equal(t, "", context.Token) @@ -250,7 +250,7 @@ func TestLoadTemplateStringsDefaultsForCommit(t *testing.T) { err := loadTemplateStrings(context) assert.NoError(t, err) - assert.Equal(t, templates.DefaultUpdateCommitMessage, context.Release.UpdateCommitMsg) + assert.Equal(t, templates.DefaultUpdateCommitMessage, context.Release.ChartCommitMsg) assert.Equal(t, "", context.Release.PRTitle) assert.Equal(t, "", context.Release.PRBody) assert.Equal(t, "master", context.Git.Ref) @@ -279,7 +279,7 @@ func TestLoadTemplateStringsCustomForCommit(t *testing.T) { err := loadTemplateStrings(context) assert.NoError(t, err) - assert.Equal(t, "test update", context.Release.UpdateCommitMsg) + assert.Equal(t, "test update", context.Release.ChartCommitMsg) assert.Equal(t, "", context.Release.PRTitle) assert.Equal(t, "", context.Release.PRBody) assert.Equal(t, "test-branch", context.Git.Ref) @@ -301,7 +301,7 @@ func TestLoadTemplateStringsDefaultsForPR(t *testing.T) { err := loadTemplateStrings(context) assert.NoError(t, err) - assert.Equal(t, templates.DefaultUpdateCommitMessage, context.Release.UpdateCommitMsg) + assert.Equal(t, templates.DefaultUpdateCommitMessage, context.Release.ChartCommitMsg) assert.Equal(t, templates.DefaultPullRequestTitle, context.Release.PRTitle) assert.Equal(t, templates.DefaultPullRequestBody, context.Release.PRBody) assert.Equal(t, templates.DefaultBranchName, context.Git.Ref) @@ -332,7 +332,7 @@ func TestLoadTemplateStringsCustomForPR(t *testing.T) { err := loadTemplateStrings(context) assert.NoError(t, err) - assert.Equal(t, "test update", context.Release.UpdateCommitMsg) + assert.Equal(t, "test update", context.Release.ChartCommitMsg) assert.Equal(t, "title-template", context.Release.PRTitle) assert.Equal(t, "body-template", context.Release.PRBody) assert.Equal(t, "branch-template", context.Git.Ref) diff --git a/pkg/v1/stages/extras/extras.go b/pkg/v1/stages/extras/extras.go index 7250737..9c7813a 100644 --- a/pkg/v1/stages/extras/extras.go +++ b/pkg/v1/stages/extras/extras.go @@ -6,9 +6,8 @@ import ( "strings" "text/template" - "github.com/edaniszewski/chart-releaser/pkg/client" - "github.com/apex/log" + "github.com/edaniszewski/chart-releaser/pkg/client" context "github.com/edaniszewski/chart-releaser/pkg/v1/ctx" ) diff --git a/pkg/v1/stages/publish/publish.go b/pkg/v1/stages/publish/publish.go index fe520b0..b5641b0 100644 --- a/pkg/v1/stages/publish/publish.go +++ b/pkg/v1/stages/publish/publish.go @@ -5,10 +5,9 @@ import ( "errors" "text/template" - "github.com/edaniszewski/chart-releaser/pkg/client" - "github.com/apex/log" "github.com/davecgh/go-spew/spew" + "github.com/edaniszewski/chart-releaser/pkg/client" "github.com/edaniszewski/chart-releaser/pkg/strategies" "github.com/edaniszewski/chart-releaser/pkg/templates" context "github.com/edaniszewski/chart-releaser/pkg/v1/ctx" @@ -48,7 +47,7 @@ func (Stage) Run(ctx *context.Context) error { return err } - ctx.Release.UpdateCommitMsg, err = utils.RenderTemplate(ctx, "update-commit", ctx.Release.UpdateCommitMsg) + ctx.Release.ChartCommitMsg, err = utils.RenderTemplate(ctx, "update-commit", ctx.Release.ChartCommitMsg) if err != nil { return err } @@ -129,7 +128,7 @@ func publishCommit(ctx *context.Context) error { // Update the Chart if ctx.Chart.File.HasChanges() { - if err := ctx.Client.UpdateFile(ctx.Context, opts, ctx.Chart.File.Path, ctx.Release.UpdateCommitMsg, ctx.Chart.File.NewContents); err != nil { + if err := ctx.Client.UpdateFile(ctx.Context, opts, ctx.Chart.File.Path, ctx.Release.ChartCommitMsg, ctx.Chart.File.NewContents); err != nil { return err } } else { @@ -137,9 +136,16 @@ func publishCommit(ctx *context.Context) error { return ErrNoChartChanges } + // Update each of the extra files which have changes. for _, f := range ctx.Files { if f.HasChanges() { - if err := ctx.Client.UpdateFile(ctx.Context, opts, f.Path, ctx.Release.UpdateCommitMsg, f.NewContents); err != nil { + ctx.CurrentFile = f + + extrasCommitMsg, err := utils.RenderTemplate(ctx, f.Path, ctx.Release.ExtrasCommitMsg) + if err != nil { + return err + } + if err := ctx.Client.UpdateFile(ctx.Context, opts, f.Path, extrasCommitMsg, f.NewContents); err != nil { return err } } else { diff --git a/pkg/v1/stages/publish/publish_test.go b/pkg/v1/stages/publish/publish_test.go index fe91bf1..2d119ca 100644 --- a/pkg/v1/stages/publish/publish_test.go +++ b/pkg/v1/stages/publish/publish_test.go @@ -29,9 +29,9 @@ func TestStage_Run_StrategyCommit(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", }, Chart: ctx.Chart{ File: ctx.File{ @@ -48,7 +48,7 @@ func TestStage_Run_StrategyCommit(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } @@ -61,9 +61,9 @@ func TestStage_Run_StrategyPR(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", }, Chart: ctx.Chart{ File: ctx.File{ @@ -80,7 +80,7 @@ func TestStage_Run_StrategyPR(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } @@ -93,9 +93,9 @@ func TestStage_Run_StrategyPRDefaultTemplates(t *testing.T) { Base: "master", }, Release: ctx.Release{ - UpdateCommitMsg: templates.DefaultUpdateCommitMessage, - PRTitle: templates.DefaultPullRequestTitle, - PRBody: templates.DefaultPullRequestBody, + ChartCommitMsg: templates.DefaultUpdateCommitMessage, + PRTitle: templates.DefaultPullRequestTitle, + PRBody: templates.DefaultPullRequestBody, }, Chart: ctx.Chart{ Name: "test-chart", @@ -131,7 +131,7 @@ func TestStage_Run_StrategyPRDefaultTemplates(t *testing.T) { assert.Equal(t, "chartreleaser/test-chart/1.2.3", context.Git.Ref) assert.Equal(t, "master", context.Git.Base) - assert.Equal(t, "[test-chart] bump chart to 1.2.3 for new application release (1.0.0)", context.Release.UpdateCommitMsg) + assert.Equal(t, "[test-chart] bump chart to 1.2.3 for new application release (1.0.0)", context.Release.ChartCommitMsg) assert.Equal(t, "Bump test-chart Chart from 1.2.2 to 1.2.3", context.Release.PRTitle) assert.Equal(t, heredoc.Doc(` Bumps the test-chart Helm Chart from 1.2.2 to 1.2.3. @@ -154,9 +154,9 @@ func TestStage_Run_DryRun(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", }, PublishStrategy: strategies.PublishCommit, } @@ -166,7 +166,7 @@ func TestStage_Run_DryRun(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } @@ -178,9 +178,9 @@ func TestStage_RunPublishStrategyError(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", }, PublishStrategy: strategies.PublishStrategy("invalid"), } @@ -190,7 +190,7 @@ func TestStage_RunPublishStrategyError(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } @@ -203,9 +203,9 @@ func TestStage_RunNoTagMatch(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", Matches: []*regexp.Regexp{ regexp.MustCompile(`(\.[0-9])+`), }, @@ -217,7 +217,7 @@ func TestStage_RunNoTagMatch(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } @@ -232,9 +232,9 @@ func TestStage_RunNoTagMatchDryRun(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", Matches: []*regexp.Regexp{ regexp.MustCompile(`(\.[0-9])+`), }, @@ -253,7 +253,7 @@ func TestStage_RunNoTagMatchDryRun(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } @@ -266,9 +266,9 @@ func TestStage_RunTagIgnoreMatch(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", Ignores: []*regexp.Regexp{ regexp.MustCompile(`dev(.)*`), }, @@ -280,7 +280,7 @@ func TestStage_RunTagIgnoreMatch(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } @@ -295,9 +295,9 @@ func TestStage_RunTagIgnoreMatchDryRun(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "pr-body", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "pr-body", Ignores: []*regexp.Regexp{ regexp.MustCompile(`dev(.)*`), }, @@ -316,7 +316,7 @@ func TestStage_RunTagIgnoreMatchDryRun(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "pr-body", context.Release.PRBody) } diff --git a/pkg/v1/stages/render/render.go b/pkg/v1/stages/render/render.go index 2f191d3..1f86f0f 100644 --- a/pkg/v1/stages/render/render.go +++ b/pkg/v1/stages/render/render.go @@ -32,7 +32,7 @@ func (Stage) Run(ctx *context.Context) error { return err } - ctx.Release.UpdateCommitMsg, err = utils.RenderTemplate(ctx, "update-commit", ctx.Release.UpdateCommitMsg) + ctx.Release.ChartCommitMsg, err = utils.RenderTemplate(ctx, "update-commit", ctx.Release.ChartCommitMsg) if err != nil { return err } diff --git a/pkg/v1/stages/render/render_test.go b/pkg/v1/stages/render/render_test.go index 4cb4423..3547a30 100644 --- a/pkg/v1/stages/render/render_test.go +++ b/pkg/v1/stages/render/render_test.go @@ -27,7 +27,7 @@ func TestStage_RunGitRefError(t *testing.T) { assert.Equal(t, "", context.Git.Ref) assert.Equal(t, "", context.Git.Base) - assert.Equal(t, "", context.Release.UpdateCommitMsg) + assert.Equal(t, "", context.Release.ChartCommitMsg) assert.Equal(t, "", context.Release.PRTitle) assert.Equal(t, "", context.Release.PRBody) } @@ -45,7 +45,7 @@ func TestStage_RunGitBaseError(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "", context.Git.Base) - assert.Equal(t, "", context.Release.UpdateCommitMsg) + assert.Equal(t, "", context.Release.ChartCommitMsg) assert.Equal(t, "", context.Release.PRTitle) assert.Equal(t, "", context.Release.PRBody) } @@ -57,7 +57,7 @@ func TestStage_RunReleaseUpdateMsgError(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "{{end}}", + ChartCommitMsg: "{{end}}", }, } @@ -66,7 +66,7 @@ func TestStage_RunReleaseUpdateMsgError(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "", context.Release.UpdateCommitMsg) + assert.Equal(t, "", context.Release.ChartCommitMsg) assert.Equal(t, "", context.Release.PRTitle) assert.Equal(t, "", context.Release.PRBody) } @@ -78,8 +78,8 @@ func TestStage_RunReleasePRTitleError(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "{{end}}", + ChartCommitMsg: "update-msg", + PRTitle: "{{end}}", }, } @@ -88,7 +88,7 @@ func TestStage_RunReleasePRTitleError(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "", context.Release.PRTitle) assert.Equal(t, "", context.Release.PRBody) } @@ -100,9 +100,9 @@ func TestStage_RunReleasePRBodyError(t *testing.T) { Base: "base-branch", }, Release: ctx.Release{ - UpdateCommitMsg: "update-msg", - PRTitle: "pr-title", - PRBody: "{{end}}", + ChartCommitMsg: "update-msg", + PRTitle: "pr-title", + PRBody: "{{end}}", }, } @@ -111,7 +111,7 @@ func TestStage_RunReleasePRBodyError(t *testing.T) { assert.Equal(t, "ref-branch", context.Git.Ref) assert.Equal(t, "base-branch", context.Git.Base) - assert.Equal(t, "update-msg", context.Release.UpdateCommitMsg) + assert.Equal(t, "update-msg", context.Release.ChartCommitMsg) assert.Equal(t, "pr-title", context.Release.PRTitle) assert.Equal(t, "", context.Release.PRBody) }