From 5f1849106c79b36c89bf791e009be712d43436c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Mon, 9 Jun 2025 11:22:27 +0200 Subject: [PATCH 1/5] fix: crash when running in repo without any tags (#190) Recent changes in v0.5.1 introduced a bug that caused releaser-pleaser to crash when running in a repository that contained no tags at all. This fixes the issue by checking if there is a tag before using it in the logger. Bug was introduced in #174. --- releaserpleaser.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/releaserpleaser.go b/releaserpleaser.go index 3c316ae..409d8bb 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -327,7 +327,11 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { } func (rp *ReleaserPleaser) analyzedCommitsSince(ctx context.Context, since *git.Tag) ([]commitparser.AnalyzedCommit, error) { - logger := rp.logger.With("method", "analyzedCommitsSince", "tag.hash", since.Hash, "tag.name", since.Name) + logger := rp.logger.With("method", "analyzedCommitsSince") + + if since != nil { + logger = rp.logger.With("tag.hash", since.Hash, "tag.name", since.Name) + } commits, err := rp.forge.CommitsSince(ctx, since) if err != nil { From e6e9779e875532092627aef86166d2a3aaacc299 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 11 Jun 2025 16:54:03 +0000 Subject: [PATCH 2/5] deps: update module gitlab.com/gitlab-org/api/client-go to v0.130.0 (#191) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index e8038f4..bfa4d54 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.12 - gitlab.com/gitlab-org/api/client-go v0.129.0 + gitlab.com/gitlab-org/api/client-go v0.130.0 ) require ( diff --git a/go.sum b/go.sum index 3c37570..631c2d9 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY= github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.129.0 h1:o9KLn6fezmxBQWYnQrnilwyuOjlx4206KP0bUn3HuBE= -gitlab.com/gitlab-org/api/client-go v0.129.0/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM= +gitlab.com/gitlab-org/api/client-go v0.130.0 h1:vFyEiJ3a9KvXKUDAyU560WPZws078fPI+4SA2Kl78Rs= +gitlab.com/gitlab-org/api/client-go v0.130.0/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM= go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o= go.abhg.dev/goldmark/toc v0.11.0/go.mod h1:XMFIoI1Sm6dwF9vKzVDOYE/g1o5BmKXghLG8q/wJNww= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= From 983162d26efb6c2b510dcea50a3f22e01b8a5a0b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 03:44:02 +0000 Subject: [PATCH 3/5] deps: update module gitlab.com/gitlab-org/api/client-go to v0.130.1 (#192) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index bfa4d54..341b585 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.12 - gitlab.com/gitlab-org/api/client-go v0.130.0 + gitlab.com/gitlab-org/api/client-go v0.130.1 ) require ( diff --git a/go.sum b/go.sum index 631c2d9..518418d 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY= github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.130.0 h1:vFyEiJ3a9KvXKUDAyU560WPZws078fPI+4SA2Kl78Rs= -gitlab.com/gitlab-org/api/client-go v0.130.0/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM= +gitlab.com/gitlab-org/api/client-go v0.130.1 h1:1xF5C5Zq3sFeNg3PzS2z63oqrxifne3n/OnbI7nptRc= +gitlab.com/gitlab-org/api/client-go v0.130.1/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM= go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o= go.abhg.dev/goldmark/toc v0.11.0/go.mod h1:XMFIoI1Sm6dwF9vKzVDOYE/g1o5BmKXghLG8q/wJNww= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= From 50b2762dca9fcfc52a961fd3b0a1c7d800e9f548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 13:03:04 +0200 Subject: [PATCH 4/5] fix: missing push when files were changed (#193) The whole check to avoid pushes when they were only rebases was broken and compared the wrong things. Unfortunately this worked for nearly all unit tests, except for one were I used the wrong assertion. This fixed the check by comparing the right things and inverting the assertion in the unit test to make sure things do not break again in the future. Bug was introduced in #114. --- internal/git/git.go | 4 ++-- internal/git/git_test.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/git/git.go b/internal/git/git.go index 136a828..d1db11b 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -233,7 +233,7 @@ func (r *Repository) hasChangesWithRemote(ctx context.Context, mainBranchRef, lo return false, nil } - remoteDiff, err := commitOnRemotePRBranch.PatchContext(ctx, currentRemotePRMergeBase) + remoteDiff, err := currentRemotePRMergeBase.PatchContext(ctx, commitOnRemotePRBranch) if err != nil { return false, err } @@ -248,7 +248,7 @@ func (r *Repository) hasChangesWithRemote(ctx context.Context, mainBranchRef, lo return false, err } - return remoteDiff.String() == localDiff.String(), nil + return remoteDiff.String() != localDiff.String(), nil } func (r *Repository) commitFromRef(refName plumbing.ReferenceName) (*object.Commit, error) { diff --git a/internal/git/git_test.go b/internal/git/git_test.go index 3d05538..bf300df 100644 --- a/internal/git/git_test.go +++ b/internal/git/git_test.go @@ -147,15 +147,17 @@ func TestRepository_HasChangesWithRemote(t *testing.T) { OnBranch(mainBranchRef), AsNewBranch(remotePRBranchRef), WithFile("VERSION", "v1.1.0"), + WithFile("CHANGELOG.md", "Foo"), ), WithCommit( - "chore: release v1.2.0", + "chore: release v1.1.0", OnBranch(mainBranchRef), AsNewBranch(localPRBranchRef), - WithFile("VERSION", "v1.2.0"), + WithFile("VERSION", "v1.1.0"), + WithFile("CHANGELOG.md", "FooBar"), ), ), - want: false, + want: true, wantErr: assert.NoError, }, } From 21dd200fe1040ada5d67cdc68b854ca4bc5dcad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 11:04:25 +0000 Subject: [PATCH 5/5] chore(main): release v0.6.0 --- CHANGELOG.md | 11 +++++++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc4b81..4f55a1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [v0.6.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.6.0) + +### Features + +- real user as commit author (#187) +- avoid pushing release branch only for rebasing (#114) + +### Bug Fixes + +- crash when running in repo without any tags (#190) + ## [v0.5.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.5.1) ### Bug Fixes diff --git a/action.yml b/action.yml index a1c5de1..07be63f 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: docker://ghcr.io/apricote/releaser-pleaser:v0.5.1 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.6.0 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index cbde7ad..ac7a890 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -30,7 +30,7 @@ releaser-pleaser: # There is no way to run a pipeline when the MR description is updated :( - if: $CI_COMMIT_BRANCH == "$[[ inputs.branch ]]" image: - name: ghcr.io/apricote/releaser-pleaser:v0.5.1 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.6.0 # x-releaser-pleaser-version entrypoint: [ "" ] variables: GITLAB_TOKEN: $[[ inputs.token ]]