From ade7fecdf640529ed3f8b4838dc8af7c1952b862 Mon Sep 17 00:00:00 2001 From: walter Date: Sat, 18 Nov 2023 09:31:15 -0600 Subject: [PATCH 1/2] final bugfix i hope --- calculate.go | 14 +++++++------- calculate_test.go | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/calculate.go b/calculate.go index 052113b..e8d2f8b 100644 --- a/calculate.go +++ b/calculate.go @@ -90,13 +90,13 @@ func (me *Calculation) CalculateNewTagsRaw(ctx context.Context) *CalculationOutp nvt = BumpPatch(mmrt) } - if me.MyMostRecentBuild == 0 { - validMmrt = false - - // force patch is ignored if this is a merge - } else if me.ForcePatch && !me.IsMerge { - nvt = BumpPatch(mmrt) - validMmrt = false + if !me.IsMerge { + if me.MyMostRecentBuild == 0 { + validMmrt = false + } else if me.ForcePatch { + nvt = BumpPatch(mmrt) + validMmrt = false + } } // if mmrt is invalid, then we need to reserve a new mmrt (which is the same as nvt) diff --git a/calculate_test.go b/calculate_test.go index 68774e4..776482d 100644 --- a/calculate_test.go +++ b/calculate_test.go @@ -287,6 +287,25 @@ func TestNewCalculationAndCalculateNewTags(t *testing.T) { MergeTags: []string{}, }, }, + { + name: "if is merge, build is 0, skip is false - tag mmrt", + calculation: &simver.Calculation{ + ForcePatch: false, + IsMerge: true, + MostRecentLiveTag: "v0.18.0", + MyMostRecentBuild: 0.000000, + MyMostRecentTag: "v0.18.1", + NextValidTag: "v0.19.0", + PR: 14.000000, + Skip: false, + }, + output: &simver.CalculationOutput{ + BaseTags: []string{}, + HeadTags: []string{}, + RootTags: []string{}, + MergeTags: []string{"v0.18.1"}, + }, + }, } ctx := context.Background() From 04c787edbc1bfc731b9627b01c198c1d35921b26 Mon Sep 17 00:00:00 2001 From: walter Date: Sat, 18 Nov 2023 09:33:33 -0600 Subject: [PATCH 2/2] update default build num --- .github/workflows/simver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/simver.yaml b/.github/workflows/simver.yaml index 3301ec6..836d766 100644 --- a/.github/workflows/simver.yaml +++ b/.github/workflows/simver.yaml @@ -30,7 +30,7 @@ }, { name: install simver, - run: "go install github.com/walteh/simver/cmd/simver_github_actions@v0.5.0", + run: "go install github.com/walteh/simver/cmd/simver_github_actions@v0.7.0-pr5+1", }, { name: run simver,