Commit graph

40 commits

Author SHA1 Message Date
fcf7906149
test: add e2e tests with local Forgejo instance (#201)
* feat(forge): add new forge for forgejo

We only support repositories hosted on Forgejo instances, but not
Forgejo Actions or Woodpecker as CI solutions for now.

* test(e2e): introduce e2e test framework with local forgejo
2025-09-13 12:00:54 +02:00
renovate[bot]
16ba2c6b09
deps: update module github.com/google/go-github/v72 to v74 (#241)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-24 16:46:16 +02:00
e6503da93a
refactor(cmd): use factories instead of global cobra command structs (#238)
This enables us to create new commands for e2e tests.
2025-08-24 14:44:05 +00:00
d259921215
fix(github): duplicate release pr when process is stopped at wrong moment (#236)
In a timing issue, the release pull request may be created but the
releaser-pleaser labels not added. On the next run releaser-pleaser
then creates a second release pull request. We try to reduce the chance
of this happening by checking the context cancellation at the top, and
if its not cancelled we run both API requests without passing along any
cancellations from the parent context.

Closes #215
2025-08-23 23:00:52 +02:00
48b1894cac
feat: highlight breaking changes in release notes (#234)
Add a `**BREAKING**` prefix to any entries in the changelog that are
marked as breaking changes.

Closes #225
2025-08-23 22:40:28 +02:00
f1aa1a2ef4
refactor: let updaters define the files they want to run on (#233)
This change reverses the responsibility for which files the updaters are
run on. Now each updater can specify the list of files and wether the
files should be created when they do not exist yet. This simplifies the
handling of each update in releaserpleaser.go, as we can just iterate
over all updaters and call it for each file of that updater.

Also update the flags to allow users to easily define which updaters
should run.
2025-08-23 22:14:34 +02:00
Mattis Krämer
1e9e0aa5d9
feat: add updater for package.json (#213) 2025-08-23 22:05:52 +02:00
Zadkiel AHARONIAN
bcca36e856
fix(gitlab): support fast-forward merges (#210)
This change allows detecting that the releaser-pleaser PR is well merged. 

As of today, it fails with "ERR failed to create pending releases: pull request is missing the merge commit".
2025-07-11 11:23:21 +02: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
81a855f5ab
feat: avoid pushing release branch only for rebasing (#114)
Right now releaser-pleaser pushes the branch even if it is only for a "rebase",
this wastes CI resources. Instead, it should only push when there are changes
to the files it owns.

- **Old**: Push when there is a diff origin/release-pr..release-pr
- **New**: Push when the these two diffs are not the same:
  
      origin/main..release-pr
      $(git merge-base origin/main origin/release-pr)..release-pr

Closes #92
2025-06-09 10:52:09 +02:00
175d6d0633
feat: real user as commit author (#187)
Previously all commits were authored and committed by

    releaser-pleaser <>

This looked weird when looking at the commit. We now check with the
Forge API for details on the currently authenticated user, and use that
name and email as the commit author. The commit committer stays the same
for now.

In GitHub, the default `$GITHUB_TOKEN` does not allow access to the
required endpoint, so for github the user `github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>` is hardcoded
when the request fails.
2025-06-09 08:06:56 +00:00
1779356543
deps: replace xanzy/go-gitlab with official client (#182) 2025-06-07 16:42:29 +00:00
renovate[bot]
e3ecd8993c
chore: update golangci-lint to v2 and fix breakage (#184)
deps: update golangci/golangci-lint-action action to v8

Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>
2025-06-07 16:39:18 +00:00
renovate[bot]
49855aa700
deps: update module github.com/google/go-github/v66 to v72 (#185)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-07 18:39:05 +02:00
dd166ec446
feat(github): mark pre-releases correctly (#110)
In theory every forge can support this, but right now only GitHub allows
one to define a release as "pre-release".

Closes #45
2024-11-15 18:49:50 +01:00
ef1d92cff0
refactor: interface for versioning strategy (#109) 2024-11-15 17:43:40 +00:00
11f8403241
fix: create CHANGELOG.md if it does not exist (#108)
During a previous refactoring (#15) the Changelog generation logic stopped creating the file if it did not exist. This makes sure that the file actually gets created. This is primarily required while onboarding new repositories.

Closes #85
2024-11-15 18:07:59 +01:00
0ae2d909bc
fix: use commits with slightly invalid messages in release notes (#105)
Fixes a bug where commits with messages that do not strictly conform to
conventional commits spec would be ignored. This could easily happen
while parsing footers like "Closes #xx" which would start the footer
section, while continuing with the body afterwards.

This solution has two downsides:

- these warnings are not surfaced to the user.
- If a `BREAKING CHANGE` footer exists after the parsing issue it is ignored

Co-authored-by: jo <ljonas@riseup.net>
2024-11-15 17:25:15 +01:00
renovate[bot]
faf28fd314
deps: update module github.com/google/go-github/v65 to v66 (#103)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-15 15:10:52 +01:00
3caa7364ee
fix(gitlab): release not created when release pr was squashed (#86)
When the release pull request was squashed on GitLab, the release
creation fails with error

    Error: failed to create pending releases: pull request is missing the merge commit

This fixes the problem by checking both `MergeCommitSHA` and
`SquashCommitSHA` and using whichever is set.
2024-10-17 17:22:03 +00:00
89dc9e3fe8
feat(gitlab): support self-managed instances (#75)
Support self-managed gitlab instances by reading the GitLab CI environment
variables.
2024-09-25 12:41:11 +02:00
2621c48d75
feat(changelog): omit version heading in forge release notes
The forge ui usually shows the release name right above the description,
so this removes an unecessary duplicate bit of information.

In addition this also cleans up the changelog interface a bit and moves
functionality where it belongs. Prepares a bit for custom changelogs in
the future.

Closes #32
2024-09-22 14:00:30 +02:00
renovate[bot]
937b885696
deps: update module github.com/google/go-github/v63 to v65 (#69)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-21 13:40:15 +02:00
ee83cec049
fix(gitlab): use project path wherever possible (#54)
Turns out that all we need is the path, and not the project id. The path
is way more user friendly, and we can easily get it from a CI variable
or combine it from the namespace & project name.
2024-09-08 21:07:03 +02:00
634eac3b76
fix(parser): invalid handling of empty lines (#53)
GitLab generates commit messages of the pattern "scope: message\n" if no
body is present. This throws up the conventional commits parser we use,
and results in the error message "missing a blank line".

We now `strings.TrimSpace()` the commit message to avoid this problem.
2024-09-08 21:05:18 +02:00
2fba5414e5
fix(gitlab): hardcoded project id (#51)
The GitLab project ID was still hardcoded to my playground project on
GitLab.com.

This commit instead reads from the predefined GitLab CI/CD variable for
the projects ID (`CI_PROJECT_ID`).
2024-09-08 20:03:19 +02:00
48d9ede0a2
feat: add support for GitLab repositories (#49) 2024-09-07 21:54:25 +02:00
5ea41654a7
fix(parser): continue on unparsable commit message (#48)
We should not fail the whole process if a single commit message is
unparsable.

Instead we now log the issue and ignore the commit.
2024-09-07 21:51:15 +02:00
2010ac1143
refactor(github): add pagination helper (#47) 2024-09-07 21:36:17 +02:00
af505c94c6
refactor: labels as structs with descriptions (#46) 2024-09-07 21:33:28 +02:00
b9dd0f986c
feat(cli): show release PR url in log messages (#44)
Makes navigating to the PR way easier when looking at the logs.

This requires a new `Forge.PullRequestURL()` method that needs to be
implemented for all forges.
2024-09-06 23:27:48 +02:00
2effe5e72d
feat: edit commit message after merging through PR (#43)
Closes #5
2024-09-06 23:17:06 +02:00
36a0b90bcd
refactor: releasepr markdown handling (#42) 2024-09-01 14:19:13 +02:00
0750bd6b46
feat: format markdown in changelog entry (#41) 2024-08-31 22:23:01 +02:00
4cb22eae10
refactor: replace markdown renderer (#40)
The new renderer is actually published as a module and can be extended
through the usual goldmark extensions.
2024-08-31 16:49:07 +02:00
a0a064d387
refactor: move things to packages (#39) 2024-08-31 15:23:21 +02:00
d5fd606577
chore: enable some more linters (#16) 2024-08-23 22:35:06 +02:00
0c93645b21 refactor: smaller fixes 2024-08-20 17:37:46 +02:00
fe871a0213 feat(releasepr): release PRs can be updated
- PR Description
- Read prefix+suffix from PR description and put into changelog
- Keep those overrides on PR description changes
- Add pending level to new PRs
2024-08-04 20:22:15 +02:00
74ea8fba17 chore: working releasable commits 2024-07-12 14:51:24 +02:00