Compare commits

..

5 commits

Author SHA1 Message Date
21dd200fe1 chore(main): release v0.6.0 2025-06-14 11:04:25 +00:00
50b2762dca
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.
2025-06-14 13:03:04 +02:00
renovate[bot]
983162d26e
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>
2025-06-12 03:44:02 +00:00
renovate[bot]
e6e9779e87
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>
2025-06-11 16:54:03 +00:00
5f1849106c
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.
2025-06-09 11:22:27 +02:00
6 changed files with 19 additions and 9 deletions

View file

@ -7,6 +7,10 @@
- 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

2
go.mod
View file

@ -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.1
)
require (

4
go.sum
View file

@ -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.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=

View file

@ -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) {

View file

@ -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,
},
}

View file

@ -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 {