From 693ca21e320bef7525a605e8ab109cb2a0c506f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 30 Aug 2024 19:27:42 +0200 Subject: [PATCH 001/260] refactor: load existing release pr earlier (#36) We need information from the release pr for the following steps, as the user can override various behaviours by commenting/labeling the release pr. --- releaserpleaser.go | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/releaserpleaser.go b/releaserpleaser.go index 5dfcf12..a901377 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -143,6 +143,27 @@ func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *Release func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger := rp.logger.With("method", "runReconcileReleasePR") + rpBranch := fmt.Sprintf(PullRequestBranchFormat, rp.targetBranch) + rpBranchRef := plumbing.NewBranchReferenceName(rpBranch) + + pr, err := rp.forge.PullRequestForBranch(ctx, rpBranch) + if err != nil { + return err + } + + var releaseOverrides ReleaseOverrides + + if pr != nil { + logger = logger.With("pr.id", pr.ID, "pr.title", pr.Title) + logger.InfoContext(ctx, "found existing release pull request") + + releaseOverrides, err = pr.GetOverrides() + if err != nil { + return err + } + + } + releases, err := rp.forge.LatestTags(ctx) if err != nil { return err @@ -172,22 +193,6 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger.InfoContext(ctx, "Analyzed commits", "length", len(analyzedCommits)) - rpBranch := fmt.Sprintf(PullRequestBranchFormat, rp.targetBranch) - rpBranchRef := plumbing.NewBranchReferenceName(rpBranch) - // Check Forge for open PR - // Get any modifications from open PR - // Clone Repo - // Run Updaters + Changelog - // Upsert PR - pr, err := rp.forge.PullRequestForBranch(ctx, rpBranch) - if err != nil { - return err - } - - if pr != nil { - logger.InfoContext(ctx, "found existing release pull request", "pr.id", pr.ID, "pr.title", pr.Title) - } - if len(analyzedCommits) == 0 { if pr != nil { logger.InfoContext(ctx, "closing existing pull requests, no commits available", "pr.id", pr.ID, "pr.title", pr.Title) @@ -202,14 +207,6 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { return nil } - var releaseOverrides ReleaseOverrides - if pr != nil { - releaseOverrides, err = pr.GetOverrides() - if err != nil { - return err - } - } - versionBump := VersionBumpFromCommits(analyzedCommits) // TODO: Set version in release pr nextVersion, err := rp.nextVersion(releases, versionBump, releaseOverrides.NextVersionType) From 971b6e6ef758099e174063ad5d1155e9217fe661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 30 Aug 2024 19:44:51 +0200 Subject: [PATCH 002/260] feat: less repetitive entries for for prerelease changelogs (#37) Right now we always show all new releasable commits since the last _stable_ release. If a project publishes multiple pre-releases in a row, they all repeat the same lines with a few new additions. On the other hand, when we cut a stable release, we do want to show all changes since the last stable release, as we can not expect users to read the changelog of pre-releases. As a compromise, the code now looks at the type of release that is being created, and decides based on that if we will look at STABLE..HEAD (stable release) or LATEST..HEAD (pre-release). Close #33 --- releasepr.go | 16 +++++++++++++--- releaserpleaser.go | 10 +++++++++- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/releasepr.go b/releasepr.go index a6744c4..e177010 100644 --- a/releasepr.go +++ b/releasepr.go @@ -59,9 +59,8 @@ func NewReleasePullRequest(head, branch, version, changelogEntry string) (*Relea } type ReleaseOverrides struct { - Prefix string - Suffix string - // TODO: Doing the changelog for normal releases after previews requires to know about this while fetching the commits + Prefix string + Suffix string NextVersionType NextVersionType } @@ -92,6 +91,17 @@ func (n NextVersionType) String() string { } } +func (n NextVersionType) IsPrerelease() bool { + switch n { + case NextVersionTypeRC, NextVersionTypeBeta, NextVersionTypeAlpha: + return true + case NextVersionTypeUndefined, NextVersionTypeNormal: + return false + default: + return false + } +} + // Label is the string identifier of a pull/merge request label on the forge. type Label string diff --git a/releaserpleaser.go b/releaserpleaser.go index a901377..f0bf6cd 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -178,7 +178,15 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger.InfoContext(ctx, "no latest tag found") } - releasableCommits, err := rp.forge.CommitsSince(ctx, releases.Stable) + // By default, we want to show everything that has happened since the last stable release + lastReleaseCommit := releases.Stable + if releaseOverrides.NextVersionType.IsPrerelease() { + // if the new release will be a prerelease, + // only show changes since the latest release (stable or prerelease) + lastReleaseCommit = releases.Latest + } + + releasableCommits, err := rp.forge.CommitsSince(ctx, lastReleaseCommit) if err != nil { return err } From 44184a77f96c8c3a66a0a6c553f97c9bd17b20f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 30 Aug 2024 19:47:12 +0200 Subject: [PATCH 003/260] refactor: remove unwanted log --- cmd/rp/cmd/root.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/rp/cmd/root.go b/cmd/rp/cmd/root.go index be92187..dd4f9a7 100644 --- a/cmd/rp/cmd/root.go +++ b/cmd/rp/cmd/root.go @@ -1,7 +1,6 @@ package cmd import ( - "fmt" "log/slog" "os" "runtime/debug" @@ -24,7 +23,6 @@ func version() string { buildInfo, ok := debug.ReadBuildInfo() if ok { - fmt.Println(buildInfo.String()) for _, setting := range buildInfo.Settings { switch setting.Key { case "vcs.revision": From a0a064d387b33e96ae70e8c1aaff4591ca2e0019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 31 Aug 2024 15:23:21 +0200 Subject: [PATCH 004/260] refactor: move things to packages (#39) --- cmd/rp/cmd/run.go | 25 +- git.go | 52 ---- git_test.go | 1 - go.mod | 2 +- .../changelog/changelog.go | 14 +- .../changelog/changelog.md.tpl | 0 .../changelog/changelog_test.go | 35 +-- internal/commitparser/commitparser.go | 17 ++ .../conventionalcommits.go | 42 +--- .../conventionalcommits_test.go | 43 ++-- internal/forge/forge.go | 61 +++++ forge.go => internal/forge/github/github.go | 202 +++++----------- internal/forge/gitlab/gitlab.go | 31 +++ internal/git/git.go | 227 ++++++++++++++++++ internal/pointer/pointer.go | 5 + internal/releasepr/label.go | 1 + .../releasepr/releasepr.go | 70 ++---- .../releasepr/releasepr.md.tpl | 0 .../releasepr/releasepr_test.go | 2 +- internal/testutils/git.go | 126 ---------- internal/updater/changelog.go | 32 +++ internal/updater/changelog_test.go | 60 +++++ internal/updater/generic.go | 17 ++ internal/updater/generic_test.go | 53 ++++ internal/updater/updater.go | 19 ++ internal/updater/updater_test.go | 26 ++ .../versioning/semver.go | 39 ++- .../versioning/semver_test.go | 214 +++++++++-------- internal/versioning/versioning.go | 56 +++++ releaserpleaser.go | 167 +++---------- updater.go | 47 ---- updater_test.go | 129 ---------- 32 files changed, 923 insertions(+), 892 deletions(-) delete mode 100644 git.go delete mode 100644 git_test.go rename changelog.go => internal/changelog/changelog.go (73%) rename changelog.md.tpl => internal/changelog/changelog.md.tpl (100%) rename changelog_test.go => internal/changelog/changelog_test.go (79%) create mode 100644 internal/commitparser/commitparser.go rename commits.go => internal/commitparser/conventionalcommits/conventionalcommits.go (61%) rename commits_test.go => internal/commitparser/conventionalcommits/conventionalcommits_test.go (62%) create mode 100644 internal/forge/forge.go rename forge.go => internal/forge/github/github.go (66%) create mode 100644 internal/forge/gitlab/gitlab.go create mode 100644 internal/git/git.go create mode 100644 internal/pointer/pointer.go create mode 100644 internal/releasepr/label.go rename releasepr.go => internal/releasepr/releasepr.go (81%) rename releasepr.md.tpl => internal/releasepr/releasepr.md.tpl (100%) rename releasepr_test.go => internal/releasepr/releasepr_test.go (99%) delete mode 100644 internal/testutils/git.go create mode 100644 internal/updater/changelog.go create mode 100644 internal/updater/changelog_test.go create mode 100644 internal/updater/generic.go create mode 100644 internal/updater/generic_test.go create mode 100644 internal/updater/updater.go create mode 100644 internal/updater/updater_test.go rename versioning.go => internal/versioning/semver.go (68%) rename versioning_test.go => internal/versioning/semver_test.go (55%) create mode 100644 internal/versioning/versioning.go delete mode 100644 updater.go delete mode 100644 updater_test.go diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index 7d5862b..de10927 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -6,6 +6,11 @@ import ( "github.com/spf13/cobra" rp "github.com/apricote/releaser-pleaser" + "github.com/apricote/releaser-pleaser/internal/commitparser/conventionalcommits" + "github.com/apricote/releaser-pleaser/internal/forge" + "github.com/apricote/releaser-pleaser/internal/forge/github" + "github.com/apricote/releaser-pleaser/internal/updater" + "github.com/apricote/releaser-pleaser/internal/versioning" ) var runCmd = &cobra.Command{ @@ -41,9 +46,9 @@ func run(cmd *cobra.Command, _ []string) error { "repo", flagRepo, ) - var forge rp.Forge + var f forge.Forge - forgeOptions := rp.ForgeOptions{ + forgeOptions := forge.Options{ Repository: flagRepo, BaseBranch: flagBranch, } @@ -53,23 +58,23 @@ func run(cmd *cobra.Command, _ []string) error { // f = rp.NewGitLab(forgeOptions) case "github": logger.DebugContext(ctx, "using forge GitHub") - forge = rp.NewGitHub(logger, &rp.GitHubOptions{ - ForgeOptions: forgeOptions, - Owner: flagOwner, - Repo: flagRepo, + f = github.New(logger, &github.Options{ + Options: forgeOptions, + Owner: flagOwner, + Repo: flagRepo, }) } extraFiles := parseExtraFiles(flagExtraFiles) releaserPleaser := rp.New( - forge, + f, logger, flagBranch, - rp.NewConventionalCommitsParser(), - rp.SemVerNextVersion, + conventionalcommits.NewParser(), + versioning.SemVerNextVersion, extraFiles, - []rp.Updater{&rp.GenericUpdater{}}, + []updater.NewUpdater{updater.Generic}, ) return releaserPleaser.Run(ctx) diff --git a/git.go b/git.go deleted file mode 100644 index 9131570..0000000 --- a/git.go +++ /dev/null @@ -1,52 +0,0 @@ -package rp - -import ( - "context" - "fmt" - "os" - "time" - - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/plumbing/transport" -) - -const ( - GitRemoteName = "origin" -) - -type Tag struct { - Hash string - Name string -} - -func CloneRepo(ctx context.Context, cloneURL, branch string, auth transport.AuthMethod) (*git.Repository, error) { - dir, err := os.MkdirTemp("", "releaser-pleaser.*") - if err != nil { - return nil, fmt.Errorf("failed to create temporary directory for repo clone: %w", err) - } - - // TODO: Log tmpdir - fmt.Printf("Clone tmpdir: %s\n", dir) - repo, err := git.PlainCloneContext(ctx, dir, false, &git.CloneOptions{ - URL: cloneURL, - RemoteName: GitRemoteName, - ReferenceName: plumbing.NewBranchReferenceName(branch), - SingleBranch: false, - Auth: auth, - }) - if err != nil { - return nil, fmt.Errorf("failed to clone repository: %w", err) - } - - return repo, nil -} - -func GitSignature() *object.Signature { - return &object.Signature{ - Name: "releaser-pleaser", - Email: "", - When: time.Now(), - } -} diff --git a/git_test.go b/git_test.go deleted file mode 100644 index 0c37ea1..0000000 --- a/git_test.go +++ /dev/null @@ -1 +0,0 @@ -package rp diff --git a/go.mod b/go.mod index 76b6fcb..9add194 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.23.0 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-billy/v5 v5.5.0 github.com/go-git/go-git/v5 v5.12.0 github.com/google/go-github/v63 v63.0.0 github.com/leodido/go-conventionalcommits v0.12.0 @@ -22,6 +21,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect + github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/changelog.go b/internal/changelog/changelog.go similarity index 73% rename from changelog.go rename to internal/changelog/changelog.go index 286faf4..1d0fd67 100644 --- a/changelog.go +++ b/internal/changelog/changelog.go @@ -1,15 +1,12 @@ -package rp +package changelog import ( "bytes" _ "embed" "html/template" "log" -) -const ( - ChangelogFile = "CHANGELOG.md" - ChangelogHeader = "# Changelog" + "github.com/apricote/releaser-pleaser/internal/commitparser" ) var ( @@ -27,9 +24,9 @@ func init() { } } -func NewChangelogEntry(commits []AnalyzedCommit, version, link, prefix, suffix string) (string, error) { - features := make([]AnalyzedCommit, 0) - fixes := make([]AnalyzedCommit, 0) +func NewChangelogEntry(commits []commitparser.AnalyzedCommit, version, link, prefix, suffix string) (string, error) { + features := make([]commitparser.AnalyzedCommit, 0) + fixes := make([]commitparser.AnalyzedCommit, 0) for _, commit := range commits { switch commit.Type { @@ -54,5 +51,4 @@ func NewChangelogEntry(commits []AnalyzedCommit, version, link, prefix, suffix s } return changelog.String(), nil - } diff --git a/changelog.md.tpl b/internal/changelog/changelog.md.tpl similarity index 100% rename from changelog.md.tpl rename to internal/changelog/changelog.md.tpl diff --git a/changelog_test.go b/internal/changelog/changelog_test.go similarity index 79% rename from changelog_test.go rename to internal/changelog/changelog_test.go index 3fabff8..384e30f 100644 --- a/changelog_test.go +++ b/internal/changelog/changelog_test.go @@ -1,9 +1,12 @@ -package rp +package changelog import ( "testing" "github.com/stretchr/testify/assert" + + "github.com/apricote/releaser-pleaser/internal/commitparser" + "github.com/apricote/releaser-pleaser/internal/git" ) func ptr[T any](input T) *T { @@ -12,7 +15,7 @@ func ptr[T any](input T) *T { func Test_NewChangelogEntry(t *testing.T) { type args struct { - analyzedCommits []AnalyzedCommit + analyzedCommits []commitparser.AnalyzedCommit version string link string prefix string @@ -27,7 +30,7 @@ func Test_NewChangelogEntry(t *testing.T) { { name: "empty", args: args{ - analyzedCommits: []AnalyzedCommit{}, + analyzedCommits: []commitparser.AnalyzedCommit{}, version: "1.0.0", link: "https://example.com/1.0.0", }, @@ -37,9 +40,9 @@ func Test_NewChangelogEntry(t *testing.T) { { name: "single feature", args: args{ - analyzedCommits: []AnalyzedCommit{ + analyzedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{}, + Commit: git.Commit{}, Type: "feat", Description: "Foobar!", }, @@ -53,9 +56,9 @@ func Test_NewChangelogEntry(t *testing.T) { { name: "single fix", args: args{ - analyzedCommits: []AnalyzedCommit{ + analyzedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{}, + Commit: git.Commit{}, Type: "fix", Description: "Foobar!", }, @@ -69,25 +72,25 @@ func Test_NewChangelogEntry(t *testing.T) { { name: "multiple commits with scopes", args: args{ - analyzedCommits: []AnalyzedCommit{ + analyzedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{}, + Commit: git.Commit{}, Type: "feat", Description: "Blabla!", }, { - Commit: Commit{}, + Commit: git.Commit{}, Type: "feat", Description: "So awesome!", Scope: ptr("awesome"), }, { - Commit: Commit{}, + Commit: git.Commit{}, Type: "fix", Description: "Foobar!", }, { - Commit: Commit{}, + Commit: git.Commit{}, Type: "fix", Description: "So sad!", Scope: ptr("sad"), @@ -112,9 +115,9 @@ func Test_NewChangelogEntry(t *testing.T) { { name: "prefix", args: args{ - analyzedCommits: []AnalyzedCommit{ + analyzedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{}, + Commit: git.Commit{}, Type: "fix", Description: "Foobar!", }, @@ -135,9 +138,9 @@ func Test_NewChangelogEntry(t *testing.T) { { name: "suffix", args: args{ - analyzedCommits: []AnalyzedCommit{ + analyzedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{}, + Commit: git.Commit{}, Type: "fix", Description: "Foobar!", }, diff --git a/internal/commitparser/commitparser.go b/internal/commitparser/commitparser.go new file mode 100644 index 0000000..484d733 --- /dev/null +++ b/internal/commitparser/commitparser.go @@ -0,0 +1,17 @@ +package commitparser + +import ( + "github.com/apricote/releaser-pleaser/internal/git" +) + +type CommitParser interface { + Analyze(commits []git.Commit) ([]AnalyzedCommit, error) +} + +type AnalyzedCommit struct { + git.Commit + Type string + Description string + Scope *string + BreakingChange bool +} diff --git a/commits.go b/internal/commitparser/conventionalcommits/conventionalcommits.go similarity index 61% rename from commits.go rename to internal/commitparser/conventionalcommits/conventionalcommits.go index f0c64e9..665a02d 100644 --- a/commits.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits.go @@ -1,54 +1,32 @@ -package rp +package conventionalcommits import ( "fmt" "github.com/leodido/go-conventionalcommits" "github.com/leodido/go-conventionalcommits/parser" + + "github.com/apricote/releaser-pleaser/internal/commitparser" + "github.com/apricote/releaser-pleaser/internal/git" ) -type Commit struct { - Hash string - Message string - - PullRequest *PullRequest -} - -type PullRequest struct { - ID int - Title string - Description string -} - -type AnalyzedCommit struct { - Commit - Type string - Description string - Scope *string - BreakingChange bool -} - -type CommitParser interface { - Analyze(commits []Commit) ([]AnalyzedCommit, error) -} - -type ConventionalCommitsParser struct { +type Parser struct { machine conventionalcommits.Machine } -func NewConventionalCommitsParser() *ConventionalCommitsParser { +func NewParser() *Parser { parserMachine := parser.NewMachine( parser.WithBestEffort(), parser.WithTypes(conventionalcommits.TypesConventional), ) - return &ConventionalCommitsParser{ + return &Parser{ machine: parserMachine, } } -func (c *ConventionalCommitsParser) Analyze(commits []Commit) ([]AnalyzedCommit, error) { - analyzedCommits := make([]AnalyzedCommit, 0, len(commits)) +func (c *Parser) Analyze(commits []git.Commit) ([]commitparser.AnalyzedCommit, error) { + analyzedCommits := make([]commitparser.AnalyzedCommit, 0, len(commits)) for _, commit := range commits { msg, err := c.machine.Parse([]byte(commit.Message)) @@ -63,7 +41,7 @@ func (c *ConventionalCommitsParser) Analyze(commits []Commit) ([]AnalyzedCommit, commitVersionBump := conventionalCommit.VersionBump(conventionalcommits.DefaultStrategy) if commitVersionBump > conventionalcommits.UnknownVersion { // We only care about releasable commits - analyzedCommits = append(analyzedCommits, AnalyzedCommit{ + analyzedCommits = append(analyzedCommits, commitparser.AnalyzedCommit{ Commit: commit, Type: conventionalCommit.Type, Description: conventionalCommit.Description, diff --git a/commits_test.go b/internal/commitparser/conventionalcommits/conventionalcommits_test.go similarity index 62% rename from commits_test.go rename to internal/commitparser/conventionalcommits/conventionalcommits_test.go index e58a718..837035b 100644 --- a/commits_test.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits_test.go @@ -1,27 +1,30 @@ -package rp +package conventionalcommits import ( "testing" "github.com/stretchr/testify/assert" + + "github.com/apricote/releaser-pleaser/internal/commitparser" + "github.com/apricote/releaser-pleaser/internal/git" ) func TestAnalyzeCommits(t *testing.T) { tests := []struct { name string - commits []Commit - expectedCommits []AnalyzedCommit + commits []git.Commit + expectedCommits []commitparser.AnalyzedCommit wantErr assert.ErrorAssertionFunc }{ { name: "empty commits", - commits: []Commit{}, - expectedCommits: []AnalyzedCommit{}, + commits: []git.Commit{}, + expectedCommits: []commitparser.AnalyzedCommit{}, wantErr: assert.NoError, }, { name: "malformed commit message", - commits: []Commit{ + commits: []git.Commit{ { Message: "aksdjaklsdjka", }, @@ -31,17 +34,17 @@ func TestAnalyzeCommits(t *testing.T) { }, { name: "drops unreleasable", - commits: []Commit{ + commits: []git.Commit{ { Message: "chore: foobar", }, }, - expectedCommits: []AnalyzedCommit{}, + expectedCommits: []commitparser.AnalyzedCommit{}, wantErr: assert.NoError, }, { name: "highest bump (patch)", - commits: []Commit{ + commits: []git.Commit{ { Message: "chore: foobar", }, @@ -49,9 +52,9 @@ func TestAnalyzeCommits(t *testing.T) { Message: "fix: blabla", }, }, - expectedCommits: []AnalyzedCommit{ + expectedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{Message: "fix: blabla"}, + Commit: git.Commit{Message: "fix: blabla"}, Type: "fix", Description: "blabla", }, @@ -60,7 +63,7 @@ func TestAnalyzeCommits(t *testing.T) { }, { name: "highest bump (minor)", - commits: []Commit{ + commits: []git.Commit{ { Message: "fix: blabla", }, @@ -68,14 +71,14 @@ func TestAnalyzeCommits(t *testing.T) { Message: "feat: foobar", }, }, - expectedCommits: []AnalyzedCommit{ + expectedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{Message: "fix: blabla"}, + Commit: git.Commit{Message: "fix: blabla"}, Type: "fix", Description: "blabla", }, { - Commit: Commit{Message: "feat: foobar"}, + Commit: git.Commit{Message: "feat: foobar"}, Type: "feat", Description: "foobar", }, @@ -85,7 +88,7 @@ func TestAnalyzeCommits(t *testing.T) { { name: "highest bump (major)", - commits: []Commit{ + commits: []git.Commit{ { Message: "fix: blabla", }, @@ -93,14 +96,14 @@ func TestAnalyzeCommits(t *testing.T) { Message: "feat!: foobar", }, }, - expectedCommits: []AnalyzedCommit{ + expectedCommits: []commitparser.AnalyzedCommit{ { - Commit: Commit{Message: "fix: blabla"}, + Commit: git.Commit{Message: "fix: blabla"}, Type: "fix", Description: "blabla", }, { - Commit: Commit{Message: "feat!: foobar"}, + Commit: git.Commit{Message: "feat!: foobar"}, Type: "feat", Description: "foobar", BreakingChange: true, @@ -111,7 +114,7 @@ func TestAnalyzeCommits(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - analyzedCommits, err := NewConventionalCommitsParser().Analyze(tt.commits) + analyzedCommits, err := NewParser().Analyze(tt.commits) if !tt.wantErr(t, err) { return } diff --git a/internal/forge/forge.go b/internal/forge/forge.go new file mode 100644 index 0000000..a5f418d --- /dev/null +++ b/internal/forge/forge.go @@ -0,0 +1,61 @@ +package forge + +import ( + "context" + + "github.com/go-git/go-git/v5/plumbing/transport" + + "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/releasepr" +) + +type Forge interface { + RepoURL() string + CloneURL() string + ReleaseURL(version string) string + + GitAuth() transport.AuthMethod + + // LatestTags returns the last stable tag created on the main branch. If there is a more recent pre-release tag, + // that is also returned. If no tag is found, it returns nil. + LatestTags(context.Context) (git.Releases, error) + + // CommitsSince returns all commits to main branch after the Tag. The tag can be `nil`, in which case this + // function should return all commits. + CommitsSince(context.Context, *git.Tag) ([]git.Commit, error) + + // EnsureLabelsExist verifies that all desired labels are available on the repository. If labels are missing, they + // are created them. + EnsureLabelsExist(context.Context, []releasepr.Label) error + + // PullRequestForBranch returns the open pull request between the branch and Options.BaseBranch. If no open PR + // exists, it returns nil. + PullRequestForBranch(context.Context, string) (*releasepr.ReleasePullRequest, error) + + // CreatePullRequest opens a new pull/merge request for the ReleasePullRequest. + CreatePullRequest(context.Context, *releasepr.ReleasePullRequest) error + + // UpdatePullRequest updates the pull/merge request identified through the ID of + // the ReleasePullRequest to the current description and title. + UpdatePullRequest(context.Context, *releasepr.ReleasePullRequest) error + + // SetPullRequestLabels updates the pull/merge request identified through the ID of + // the ReleasePullRequest to the current labels. + SetPullRequestLabels(ctx context.Context, pr *releasepr.ReleasePullRequest, remove, add []releasepr.Label) error + + // ClosePullRequest closes the pull/merge request identified through the ID of + // the ReleasePullRequest, as it is no longer required. + ClosePullRequest(context.Context, *releasepr.ReleasePullRequest) error + + // PendingReleases returns a list of ReleasePullRequest. The list should contain all pull/merge requests that are + // merged and have the matching label. + PendingReleases(context.Context, releasepr.Label) ([]*releasepr.ReleasePullRequest, error) + + // CreateRelease creates a release on the Forge, pointing at the commit with the passed in details. + CreateRelease(ctx context.Context, commit git.Commit, title, changelog string, prerelease, latest bool) error +} + +type Options struct { + Repository string + BaseBranch string +} diff --git a/forge.go b/internal/forge/github/github.go similarity index 66% rename from forge.go rename to internal/forge/github/github.go index 1086564..46f203a 100644 --- a/forge.go +++ b/internal/forge/github/github.go @@ -1,4 +1,4 @@ -package rp +package github import ( "context" @@ -13,75 +13,27 @@ import ( "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" "github.com/google/go-github/v63/github" + + "github.com/apricote/releaser-pleaser/internal/forge" + "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/pointer" + "github.com/apricote/releaser-pleaser/internal/releasepr" ) const ( - GitHubPerPageMax = 100 - GitHubPRStateOpen = "open" - GitHubPRStateClosed = "closed" - GitHubEnvAPIToken = "GITHUB_TOKEN" // nolint:gosec // Not actually a hardcoded credential - GitHubEnvUsername = "GITHUB_USER" - GitHubEnvRepository = "GITHUB_REPOSITORY" - GitHubLabelColor = "dedede" + PerPageMax = 100 + PRStateOpen = "open" + PRStateClosed = "closed" + EnvAPIToken = "GITHUB_TOKEN" // nolint:gosec // Not actually a hardcoded credential + EnvUsername = "GITHUB_USER" + EnvRepository = "GITHUB_REPOSITORY" + LabelColor = "dedede" ) -type Forge interface { - RepoURL() string - CloneURL() string - ReleaseURL(version string) string - - GitAuth() transport.AuthMethod - - // LatestTags returns the last stable tag created on the main branch. If there is a more recent pre-release tag, - // that is also returned. If no tag is found, it returns nil. - LatestTags(context.Context) (Releases, error) - - // CommitsSince returns all commits to main branch after the Tag. The tag can be `nil`, in which case this - // function should return all commits. - CommitsSince(context.Context, *Tag) ([]Commit, error) - - // EnsureLabelsExist verifies that all desired labels are available on the repository. If labels are missing, they - // are created them. - EnsureLabelsExist(context.Context, []Label) error - - // PullRequestForBranch returns the open pull request between the branch and ForgeOptions.BaseBranch. If no open PR - // exists, it returns nil. - PullRequestForBranch(context.Context, string) (*ReleasePullRequest, error) - - // CreatePullRequest opens a new pull/merge request for the ReleasePullRequest. - CreatePullRequest(context.Context, *ReleasePullRequest) error - - // UpdatePullRequest updates the pull/merge request identified through the ID of - // the ReleasePullRequest to the current description and title. - UpdatePullRequest(context.Context, *ReleasePullRequest) error - - // SetPullRequestLabels updates the pull/merge request identified through the ID of - // the ReleasePullRequest to the current labels. - SetPullRequestLabels(ctx context.Context, pr *ReleasePullRequest, remove, add []Label) error - - // ClosePullRequest closes the pull/merge request identified through the ID of - // the ReleasePullRequest, as it is no longer required. - ClosePullRequest(context.Context, *ReleasePullRequest) error - - // PendingReleases returns a list of ReleasePullRequest. The list should contain all pull/merge requests that are - // merged and have the matching label. - PendingReleases(context.Context, Label) ([]*ReleasePullRequest, error) - - // CreateRelease creates a release on the Forge, pointing at the commit with the passed in details. - CreateRelease(ctx context.Context, commit Commit, title, changelog string, prerelease, latest bool) error -} - -type ForgeOptions struct { - Repository string - BaseBranch string -} - -var _ Forge = &GitHub{} - -// var _ Forge = &GitLab{} +var _ forge.Forge = &GitHub{} type GitHub struct { - options *GitHubOptions + options *Options client *github.Client log *slog.Logger @@ -106,24 +58,24 @@ func (g *GitHub) GitAuth() transport.AuthMethod { } } -func (g *GitHub) LatestTags(ctx context.Context) (Releases, error) { +func (g *GitHub) LatestTags(ctx context.Context) (git.Releases, error) { g.log.DebugContext(ctx, "listing all tags in github repository") page := 1 - var releases Releases + var releases git.Releases for { tags, resp, err := g.client.Repositories.ListTags( ctx, g.options.Owner, g.options.Repo, - &github.ListOptions{Page: page, PerPage: GitHubPerPageMax}, + &github.ListOptions{Page: page, PerPage: PerPageMax}, ) if err != nil { - return Releases{}, err + return git.Releases{}, err } for _, ghTag := range tags { - tag := &Tag{ + tag := &git.Tag{ Hash: ghTag.GetCommit().GetSHA(), Name: ghTag.GetName(), } @@ -160,7 +112,7 @@ func (g *GitHub) LatestTags(ctx context.Context) (Releases, error) { return releases, nil } -func (g *GitHub) CommitsSince(ctx context.Context, tag *Tag) ([]Commit, error) { +func (g *GitHub) CommitsSince(ctx context.Context, tag *git.Tag) ([]git.Commit, error) { var repositoryCommits []*github.RepositoryCommit var err error if tag != nil { @@ -173,9 +125,9 @@ func (g *GitHub) CommitsSince(ctx context.Context, tag *Tag) ([]Commit, error) { return nil, err } - var commits = make([]Commit, 0, len(repositoryCommits)) + var commits = make([]git.Commit, 0, len(repositoryCommits)) for _, ghCommit := range repositoryCommits { - commit := Commit{ + commit := git.Commit{ Hash: ghCommit.GetSHA(), Message: ghCommit.GetCommit().GetMessage(), } @@ -190,7 +142,7 @@ func (g *GitHub) CommitsSince(ctx context.Context, tag *Tag) ([]Commit, error) { return commits, nil } -func (g *GitHub) commitsSinceTag(ctx context.Context, tag *Tag) ([]*github.RepositoryCommit, error) { +func (g *GitHub) commitsSinceTag(ctx context.Context, tag *git.Tag) ([]*github.RepositoryCommit, error) { head := g.options.BaseBranch log := g.log.With("base", tag.Hash, "head", head) log.Debug("comparing commits", "base", tag.Hash, "head", head) @@ -204,7 +156,7 @@ func (g *GitHub) commitsSinceTag(ctx context.Context, tag *Tag) ([]*github.Repos ctx, g.options.Owner, g.options.Repo, tag.Hash, head, &github.ListOptions{ Page: page, - PerPage: GitHubPerPageMax, + PerPage: PerPageMax, }) if err != nil { return nil, err @@ -244,7 +196,7 @@ func (g *GitHub) commitsSinceInit(ctx context.Context) ([]*github.RepositoryComm SHA: head, ListOptions: github.ListOptions{ Page: page, - PerPage: GitHubPerPageMax, + PerPage: PerPageMax, }, }) if err != nil { @@ -254,7 +206,7 @@ func (g *GitHub) commitsSinceInit(ctx context.Context) ([]*github.RepositoryComm if repositoryCommits == nil && resp.LastPage > 0 { // Pre-initialize slice on first request log.Debug("found commits", "pages", resp.LastPage) - repositoryCommits = make([]*github.RepositoryCommit, 0, resp.LastPage*GitHubPerPageMax) + repositoryCommits = make([]*github.RepositoryCommit, 0, resp.LastPage*PerPageMax) } repositoryCommits = append(repositoryCommits, commits...) @@ -269,7 +221,7 @@ func (g *GitHub) commitsSinceInit(ctx context.Context) ([]*github.RepositoryComm return repositoryCommits, nil } -func (g *GitHub) prForCommit(ctx context.Context, commit Commit) (*PullRequest, error) { +func (g *GitHub) prForCommit(ctx context.Context, commit git.Commit) (*git.PullRequest, error) { // We naively look up the associated PR for each commit through the "List pull requests associated with a commit" // endpoint. This requires len(commits) requests. // Using the "List pull requests" endpoint might be faster, as it allows us to fetch 100 arbitrary PRs per request, @@ -285,7 +237,7 @@ func (g *GitHub) prForCommit(ctx context.Context, commit Commit) (*PullRequest, ctx, g.options.Owner, g.options.Repo, commit.Hash, &github.ListOptions{ Page: page, - PerPage: GitHubPerPageMax, + PerPage: PerPageMax, }) if err != nil { return nil, err @@ -314,7 +266,7 @@ func (g *GitHub) prForCommit(ctx context.Context, commit Commit) (*PullRequest, return gitHubPRToPullRequest(pullrequest), nil } -func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []Label) error { +func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label) error { existingLabels := make([]string, 0, len(labels)) page := 1 @@ -325,7 +277,7 @@ func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []Label) error { ctx, g.options.Owner, g.options.Repo, &github.ListOptions{ Page: page, - PerPage: GitHubPerPageMax, + PerPage: PerPageMax, }) if err != nil { return err @@ -347,8 +299,8 @@ func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []Label) error { _, _, err := g.client.Issues.CreateLabel( ctx, g.options.Owner, g.options.Repo, &github.Label{ - Name: Pointer(string(label)), - Color: Pointer(GitHubLabelColor), + Name: pointer.Pointer(string(label)), + Color: pointer.Pointer(LabelColor), }, ) if err != nil { @@ -360,13 +312,13 @@ func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []Label) error { return nil } -func (g *GitHub) PullRequestForBranch(ctx context.Context, branch string) (*ReleasePullRequest, error) { +func (g *GitHub) PullRequestForBranch(ctx context.Context, branch string) (*releasepr.ReleasePullRequest, error) { page := 1 for { prs, resp, err := g.client.PullRequests.ListPullRequestsWithCommit(ctx, g.options.Owner, g.options.Repo, branch, &github.ListOptions{ Page: page, - PerPage: GitHubPerPageMax, + PerPage: PerPageMax, }) if err != nil { var ghErr *github.ErrorResponse @@ -379,7 +331,7 @@ func (g *GitHub) PullRequestForBranch(ctx context.Context, branch string) (*Rele } for _, pr := range prs { - if pr.GetBase().GetRef() == g.options.BaseBranch && pr.GetHead().GetRef() == branch && pr.GetState() == GitHubPRStateOpen { + if pr.GetBase().GetRef() == g.options.BaseBranch && pr.GetHead().GetRef() == branch && pr.GetState() == PRStateOpen { return gitHubPRToReleasePullRequest(pr), nil } } @@ -393,7 +345,7 @@ func (g *GitHub) PullRequestForBranch(ctx context.Context, branch string) (*Rele return nil, nil } -func (g *GitHub) CreatePullRequest(ctx context.Context, pr *ReleasePullRequest) error { +func (g *GitHub) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { ghPR, _, err := g.client.PullRequests.Create( ctx, g.options.Owner, g.options.Repo, &github.NewPullRequest{ @@ -410,7 +362,7 @@ func (g *GitHub) CreatePullRequest(ctx context.Context, pr *ReleasePullRequest) // TODO: String ID? pr.ID = ghPR.GetNumber() - err = g.SetPullRequestLabels(ctx, pr, []Label{}, pr.Labels) + err = g.SetPullRequestLabels(ctx, pr, []releasepr.Label{}, pr.Labels) if err != nil { return err } @@ -418,7 +370,7 @@ func (g *GitHub) CreatePullRequest(ctx context.Context, pr *ReleasePullRequest) return nil } -func (g *GitHub) UpdatePullRequest(ctx context.Context, pr *ReleasePullRequest) error { +func (g *GitHub) UpdatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { _, _, err := g.client.PullRequests.Edit( ctx, g.options.Owner, g.options.Repo, pr.ID, &github.PullRequest{ @@ -433,7 +385,7 @@ func (g *GitHub) UpdatePullRequest(ctx context.Context, pr *ReleasePullRequest) return nil } -func (g *GitHub) SetPullRequestLabels(ctx context.Context, pr *ReleasePullRequest, remove, add []Label) error { +func (g *GitHub) SetPullRequestLabels(ctx context.Context, pr *releasepr.ReleasePullRequest, remove, add []releasepr.Label) error { for _, label := range remove { _, err := g.client.Issues.RemoveLabelForIssue( ctx, g.options.Owner, g.options.Repo, @@ -460,11 +412,11 @@ func (g *GitHub) SetPullRequestLabels(ctx context.Context, pr *ReleasePullReques return nil } -func (g *GitHub) ClosePullRequest(ctx context.Context, pr *ReleasePullRequest) error { +func (g *GitHub) ClosePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { _, _, err := g.client.PullRequests.Edit( ctx, g.options.Owner, g.options.Repo, pr.ID, &github.PullRequest{ - State: Pointer(GitHubPRStateClosed), + State: pointer.Pointer(PRStateClosed), }, ) if err != nil { @@ -474,20 +426,20 @@ func (g *GitHub) ClosePullRequest(ctx context.Context, pr *ReleasePullRequest) e return nil } -func (g *GitHub) PendingReleases(ctx context.Context, pendingLabel Label) ([]*ReleasePullRequest, error) { +func (g *GitHub) PendingReleases(ctx context.Context, pendingLabel releasepr.Label) ([]*releasepr.ReleasePullRequest, error) { page := 1 - var prs []*ReleasePullRequest + var prs []*releasepr.ReleasePullRequest for { ghPRs, resp, err := g.client.PullRequests.List( ctx, g.options.Owner, g.options.Repo, &github.PullRequestListOptions{ - State: GitHubPRStateClosed, + State: PRStateClosed, Base: g.options.BaseBranch, ListOptions: github.ListOptions{ Page: page, - PerPage: GitHubPerPageMax, + PerPage: PerPageMax, }, }) if err != nil { @@ -497,7 +449,7 @@ func (g *GitHub) PendingReleases(ctx context.Context, pendingLabel Label) ([]*Re if prs == nil && resp.LastPage > 0 { // Pre-initialize slice on first request g.log.Debug("found pending releases", "pages", resp.LastPage) - prs = make([]*ReleasePullRequest, 0, (resp.LastPage-1)*GitHubPerPageMax) + prs = make([]*releasepr.ReleasePullRequest, 0, (resp.LastPage-1)*PerPageMax) } for _, pr := range ghPRs { @@ -526,7 +478,7 @@ func (g *GitHub) PendingReleases(ctx context.Context, pendingLabel Label) ([]*Re return prs, nil } -func (g *GitHub) CreateRelease(ctx context.Context, commit Commit, title, changelog string, preRelease, latest bool) error { +func (g *GitHub) CreateRelease(ctx context.Context, commit git.Commit, title, changelog string, preRelease, latest bool) error { makeLatest := "" if latest { makeLatest = "true" @@ -551,29 +503,29 @@ func (g *GitHub) CreateRelease(ctx context.Context, commit Commit, title, change return nil } -func gitHubPRToPullRequest(pr *github.PullRequest) *PullRequest { - return &PullRequest{ +func gitHubPRToPullRequest(pr *github.PullRequest) *git.PullRequest { + return &git.PullRequest{ ID: pr.GetNumber(), Title: pr.GetTitle(), Description: pr.GetBody(), } } -func gitHubPRToReleasePullRequest(pr *github.PullRequest) *ReleasePullRequest { - labels := make([]Label, 0, len(pr.Labels)) +func gitHubPRToReleasePullRequest(pr *github.PullRequest) *releasepr.ReleasePullRequest { + labels := make([]releasepr.Label, 0, len(pr.Labels)) for _, label := range pr.Labels { - labelName := Label(label.GetName()) - if slices.Contains(KnownLabels, Label(label.GetName())) { + labelName := releasepr.Label(label.GetName()) + if slices.Contains(releasepr.KnownLabels, releasepr.Label(label.GetName())) { labels = append(labels, labelName) } } - var releaseCommit *Commit + var releaseCommit *git.Commit if pr.MergeCommitSHA != nil { - releaseCommit = &Commit{Hash: pr.GetMergeCommitSHA()} + releaseCommit = &git.Commit{Hash: pr.GetMergeCommitSHA()} } - return &ReleasePullRequest{ + return &releasepr.ReleasePullRequest{ ID: pr.GetNumber(), Title: pr.GetTitle(), Description: pr.GetBody(), @@ -584,16 +536,16 @@ func gitHubPRToReleasePullRequest(pr *github.PullRequest) *ReleasePullRequest { } } -func (g *GitHubOptions) autodiscover() { - if apiToken := os.Getenv(GitHubEnvAPIToken); apiToken != "" { +func (g *Options) autodiscover() { + if apiToken := os.Getenv(EnvAPIToken); apiToken != "" { g.APIToken = apiToken } // TODO: Check if there is a better solution for cloning/pushing locally - if username := os.Getenv(GitHubEnvUsername); username != "" { + if username := os.Getenv(EnvUsername); username != "" { g.Username = username } - if envRepository := os.Getenv(GitHubEnvRepository); envRepository != "" { + if envRepository := os.Getenv(EnvRepository); envRepository != "" { // GITHUB_REPOSITORY=apricote/releaser-pleaser parts := strings.Split(envRepository, "/") if len(parts) == 2 { @@ -604,8 +556,8 @@ func (g *GitHubOptions) autodiscover() { } } -type GitHubOptions struct { - ForgeOptions +type Options struct { + forge.Options Owner string Repo string @@ -614,7 +566,7 @@ type GitHubOptions struct { Username string } -func NewGitHub(log *slog.Logger, options *GitHubOptions) *GitHub { +func New(log *slog.Logger, options *Options) *GitHub { options.autodiscover() client := github.NewClient(nil) @@ -631,29 +583,3 @@ func NewGitHub(log *slog.Logger, options *GitHubOptions) *GitHub { return gh } - -type GitLab struct { - options ForgeOptions -} - -func (g *GitLab) autodiscover() { - // Read settings from GitLab-CI env vars -} - -func NewGitLab(options ForgeOptions) *GitLab { - gl := &GitLab{ - options: options, - } - - gl.autodiscover() - - return gl -} - -func (g *GitLab) RepoURL() string { - return fmt.Sprintf("https://gitlab.com/%s", g.options.Repository) -} - -func Pointer[T any](value T) *T { - return &value -} diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go new file mode 100644 index 0000000..98a4252 --- /dev/null +++ b/internal/forge/gitlab/gitlab.go @@ -0,0 +1,31 @@ +package gitlab + +import ( + "fmt" + + "github.com/apricote/releaser-pleaser/internal/forge" +) + +// var _ forge.Forge = &GitLab{} + +type GitLab struct { + options forge.Options +} + +func (g *GitLab) autodiscover() { + // Read settings from GitLab-CI env vars +} + +func New(options forge.Options) *GitLab { + gl := &GitLab{ + options: options, + } + + gl.autodiscover() + + return gl +} + +func (g *GitLab) RepoURL() string { + return fmt.Sprintf("https://gitlab.com/%s", g.options.Repository) +} diff --git a/internal/git/git.go b/internal/git/git.go new file mode 100644 index 0000000..09fd5c9 --- /dev/null +++ b/internal/git/git.go @@ -0,0 +1,227 @@ +package git + +import ( + "context" + "fmt" + "io" + "log/slog" + "os" + "time" + + "github.com/go-git/go-git/v5" + "github.com/go-git/go-git/v5/config" + "github.com/go-git/go-git/v5/plumbing" + "github.com/go-git/go-git/v5/plumbing/object" + "github.com/go-git/go-git/v5/plumbing/transport" + + "github.com/apricote/releaser-pleaser/internal/updater" +) + +const ( + remoteName = "origin" +) + +type Commit struct { + Hash string + Message string + + PullRequest *PullRequest +} + +type PullRequest struct { + ID int + Title string + Description string +} + +type Tag struct { + Hash string + Name string +} + +type Releases struct { + Latest *Tag + Stable *Tag +} + +func CloneRepo(ctx context.Context, logger *slog.Logger, cloneURL, branch string, auth transport.AuthMethod) (*Repository, error) { + dir, err := os.MkdirTemp("", "releaser-pleaser.*") + if err != nil { + return nil, fmt.Errorf("failed to create temporary directory for repo clone: %w", err) + } + + repo, err := git.PlainCloneContext(ctx, dir, false, &git.CloneOptions{ + URL: cloneURL, + RemoteName: remoteName, + ReferenceName: plumbing.NewBranchReferenceName(branch), + SingleBranch: false, + Auth: auth, + }) + if err != nil { + return nil, fmt.Errorf("failed to clone repository: %w", err) + } + + return &Repository{r: repo, logger: logger, auth: auth}, nil +} + +type Repository struct { + r *git.Repository + logger *slog.Logger + auth transport.AuthMethod +} + +func (r *Repository) DeleteBranch(ctx context.Context, branch string) error { + if b, _ := r.r.Branch(branch); b != nil { + r.logger.DebugContext(ctx, "deleting local branch", "branch.name", branch) + if err := r.r.DeleteBranch(branch); err != nil { + return err + } + } + + return nil +} + +func (r *Repository) Checkout(_ context.Context, branch string) error { + worktree, err := r.r.Worktree() + if err != nil { + return err + } + + if err = worktree.Checkout(&git.CheckoutOptions{ + Branch: plumbing.NewBranchReferenceName(branch), + Create: true, + }); err != nil { + return fmt.Errorf("failed to check out branch: %w", err) + } + + return nil +} + +func (r *Repository) UpdateFile(_ context.Context, path string, updaters []updater.Updater) error { + worktree, err := r.r.Worktree() + if err != nil { + return err + } + + file, err := worktree.Filesystem.OpenFile(path, os.O_RDWR, 0) + if err != nil { + return err + } + defer file.Close() + + content, err := io.ReadAll(file) + if err != nil { + return err + } + + updatedContent := string(content) + + for _, update := range updaters { + updatedContent, err = update(updatedContent) + if err != nil { + return fmt.Errorf("failed to run updater on file %s", path) + } + } + + err = file.Truncate(0) + if err != nil { + return fmt.Errorf("failed to replace file content: %w", err) + } + _, err = file.Seek(0, 0) + if err != nil { + return fmt.Errorf("failed to replace file content: %w", err) + } + _, err = file.Write([]byte(updatedContent)) + if err != nil { + return fmt.Errorf("failed to replace file content: %w", err) + } + + _, err = worktree.Add(path) + if err != nil { + return fmt.Errorf("failed to add updated file to git worktree: %w", err) + } + + return nil +} + +func (r *Repository) Commit(_ context.Context, message string) (Commit, error) { + worktree, err := r.r.Worktree() + if err != nil { + return Commit{}, err + } + + releaseCommitHash, err := worktree.Commit(message, &git.CommitOptions{ + Author: signature(), + Committer: signature(), + }) + if err != nil { + return Commit{}, fmt.Errorf("failed to commit changes: %w", err) + } + + return Commit{ + Hash: releaseCommitHash.String(), + Message: message, + }, nil +} + +func (r *Repository) HasChangesWithRemote(ctx context.Context, branch string) (bool, error) { + remoteRef, err := r.r.Reference(plumbing.NewRemoteReferenceName(remoteName, branch), false) + if err != nil { + if err.Error() == "reference not found" { + // No remote branch means that there are changes + return true, nil + } + + return false, err + } + + remoteCommit, err := r.r.CommitObject(remoteRef.Hash()) + if err != nil { + return false, err + } + + localRef, err := r.r.Reference(plumbing.NewBranchReferenceName(branch), false) + if err != nil { + return false, err + } + + localCommit, err := r.r.CommitObject(localRef.Hash()) + if err != nil { + return false, err + } + + diff, err := localCommit.PatchContext(ctx, remoteCommit) + if err != nil { + return false, err + } + + hasChanges := len(diff.FilePatches()) > 0 + + return hasChanges, nil +} + +func (r *Repository) ForcePush(ctx context.Context, branch string) error { + pushRefSpec := config.RefSpec(fmt.Sprintf( + "+%s:%s", + plumbing.NewBranchReferenceName(branch), + // This needs to be the local branch name, not the remotes/origin ref + // See https://stackoverflow.com/a/75727620 + plumbing.NewBranchReferenceName(branch), + )) + + r.logger.DebugContext(ctx, "pushing branch", "branch.name", branch, "refspec", pushRefSpec.String()) + return r.r.PushContext(ctx, &git.PushOptions{ + RemoteName: remoteName, + RefSpecs: []config.RefSpec{pushRefSpec}, + Force: true, + Auth: r.auth, + }) +} + +func signature() *object.Signature { + return &object.Signature{ + Name: "releaser-pleaser", + Email: "", + When: time.Now(), + } +} diff --git a/internal/pointer/pointer.go b/internal/pointer/pointer.go new file mode 100644 index 0000000..1c62f74 --- /dev/null +++ b/internal/pointer/pointer.go @@ -0,0 +1,5 @@ +package pointer + +func Pointer[T any](value T) *T { + return &value +} diff --git a/internal/releasepr/label.go b/internal/releasepr/label.go new file mode 100644 index 0000000..518eb87 --- /dev/null +++ b/internal/releasepr/label.go @@ -0,0 +1 @@ +package releasepr diff --git a/releasepr.go b/internal/releasepr/releasepr.go similarity index 81% rename from releasepr.go rename to internal/releasepr/releasepr.go index e177010..5bf3649 100644 --- a/releasepr.go +++ b/internal/releasepr/releasepr.go @@ -1,4 +1,4 @@ -package rp +package releasepr import ( "bytes" @@ -12,8 +12,10 @@ import ( "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/text" + "github.com/apricote/releaser-pleaser/internal/git" "github.com/apricote/releaser-pleaser/internal/markdown" - east "github.com/apricote/releaser-pleaser/internal/markdown/extensions/ast" + ast2 "github.com/apricote/releaser-pleaser/internal/markdown/extensions/ast" + "github.com/apricote/releaser-pleaser/internal/versioning" ) var ( @@ -33,7 +35,7 @@ func init() { // ReleasePullRequest // -// TODO: Reuse [PullRequest] +// TODO: Reuse [git.PullRequest] type ReleasePullRequest struct { ID int Title string @@ -41,9 +43,12 @@ type ReleasePullRequest struct { Labels []Label Head string - ReleaseCommit *Commit + ReleaseCommit *git.Commit } +// Label is the string identifier of a pull/merge request label on the forge. +type Label string + func NewReleasePullRequest(head, branch, version, changelogEntry string) (*ReleasePullRequest, error) { rp := &ReleasePullRequest{ Head: head, @@ -61,50 +66,9 @@ func NewReleasePullRequest(head, branch, version, changelogEntry string) (*Relea type ReleaseOverrides struct { Prefix string Suffix string - NextVersionType NextVersionType + NextVersionType versioning.NextVersionType } -type NextVersionType int - -const ( - NextVersionTypeUndefined NextVersionType = iota - NextVersionTypeNormal - NextVersionTypeRC - NextVersionTypeBeta - NextVersionTypeAlpha -) - -func (n NextVersionType) String() string { - switch n { - case NextVersionTypeUndefined: - return "undefined" - case NextVersionTypeNormal: - return "normal" - case NextVersionTypeRC: - return "rc" - case NextVersionTypeBeta: - return "beta" - case NextVersionTypeAlpha: - return "alpha" - default: - return "" - } -} - -func (n NextVersionType) IsPrerelease() bool { - switch n { - case NextVersionTypeRC, NextVersionTypeBeta, NextVersionTypeAlpha: - return true - case NextVersionTypeUndefined, NextVersionTypeNormal: - return false - default: - return false - } -} - -// Label is the string identifier of a pull/merge request label on the forge. -type Label string - const ( LabelNextVersionTypeNormal Label = "rp-next-version::normal" LabelNextVersionTypeRC Label = "rp-next-version::rc" @@ -158,13 +122,13 @@ func (pr *ReleasePullRequest) parseVersioningFlags(overrides ReleaseOverrides) R switch label { // Versioning case LabelNextVersionTypeNormal: - overrides.NextVersionType = NextVersionTypeNormal + overrides.NextVersionType = versioning.NextVersionTypeNormal case LabelNextVersionTypeRC: - overrides.NextVersionType = NextVersionTypeRC + overrides.NextVersionType = versioning.NextVersionTypeRC case LabelNextVersionTypeBeta: - overrides.NextVersionType = NextVersionTypeBeta + overrides.NextVersionType = versioning.NextVersionTypeBeta case LabelNextVersionTypeAlpha: - overrides.NextVersionType = NextVersionTypeAlpha + overrides.NextVersionType = versioning.NextVersionTypeAlpha case LabelReleasePending, LabelReleaseTagged: // These labels have no effect on the versioning. break @@ -213,18 +177,18 @@ func (pr *ReleasePullRequest) ChangelogText() (string, error) { gm := markdown.New() descriptionAST := gm.Parser().Parse(text.NewReader(source)) - var section *east.Section + var section *ast2.Section err := ast.Walk(descriptionAST, func(n ast.Node, entering bool) (ast.WalkStatus, error) { if !entering { return ast.WalkContinue, nil } - if n.Type() != ast.TypeBlock || n.Kind() != east.KindSection { + if n.Type() != ast.TypeBlock || n.Kind() != ast2.KindSection { return ast.WalkContinue, nil } - anySection, ok := n.(*east.Section) + anySection, ok := n.(*ast2.Section) if !ok { return ast.WalkStop, fmt.Errorf("node has unexpected type: %T", n) } diff --git a/releasepr.md.tpl b/internal/releasepr/releasepr.md.tpl similarity index 100% rename from releasepr.md.tpl rename to internal/releasepr/releasepr.md.tpl diff --git a/releasepr_test.go b/internal/releasepr/releasepr_test.go similarity index 99% rename from releasepr_test.go rename to internal/releasepr/releasepr_test.go index b1ffbb2..92f338d 100644 --- a/releasepr_test.go +++ b/internal/releasepr/releasepr_test.go @@ -1,4 +1,4 @@ -package rp +package releasepr import ( "testing" diff --git a/internal/testutils/git.go b/internal/testutils/git.go deleted file mode 100644 index f5721b6..0000000 --- a/internal/testutils/git.go +++ /dev/null @@ -1,126 +0,0 @@ -package testutils - -import ( - "testing" - "time" - - "github.com/go-git/go-billy/v5/memfs" - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/storage/memory" - "github.com/stretchr/testify/require" -) - -var author = &object.Signature{ - Name: "releaser-pleaser", - When: time.Date(2020, 01, 01, 01, 01, 01, 01, time.UTC), -} - -type CommitOption func(*commitOptions) - -type commitOptions struct { - cleanFiles bool - files []commitFile - tags []string -} - -type commitFile struct { - path string - content string -} - -type Commit func(*testing.T, *git.Repository) error - -type Repo func(*testing.T) *git.Repository - -func WithCommit(message string, options ...CommitOption) Commit { - return func(t *testing.T, repo *git.Repository) error { - t.Helper() - - require.NotEmpty(t, message, "commit message is required") - - opts := &commitOptions{} - for _, opt := range options { - opt(opts) - } - - wt, err := repo.Worktree() - require.NoError(t, err) - - // Yeet all files - if opts.cleanFiles { - files, err := wt.Filesystem.ReadDir(".") - require.NoError(t, err, "failed to get current files") - - for _, fileInfo := range files { - err = wt.Filesystem.Remove(fileInfo.Name()) - require.NoError(t, err, "failed to remove file %q", fileInfo.Name()) - } - } - - // Create new files - for _, fileInfo := range opts.files { - file, err := wt.Filesystem.Create(fileInfo.path) - require.NoError(t, err, "failed to create file %q", fileInfo.path) - - _, err = file.Write([]byte(fileInfo.content)) - file.Close() - require.NoError(t, err, "failed to write content to file %q", fileInfo.path) - } - - // Commit - commitHash, err := wt.Commit(message, &git.CommitOptions{ - All: true, - AllowEmptyCommits: true, - Author: author, - Committer: author, - }) - require.NoError(t, err, "failed to commit") - - // Create tags - for _, tagName := range opts.tags { - _, err = repo.CreateTag(tagName, commitHash, nil) - require.NoError(t, err, "failed to create tag %q", tagName) - } - - return nil - } -} - -func WithFile(path, content string) CommitOption { - return func(opts *commitOptions) { - opts.files = append(opts.files, commitFile{path: path, content: content}) - } -} - -func WithCleanFiles() CommitOption { - return func(opts *commitOptions) { - opts.cleanFiles = true - } -} - -func WithTag(name string) CommitOption { - return func(opts *commitOptions) { - opts.tags = append(opts.tags, name) - } -} - -func WithTestRepo(commits ...Commit) Repo { - return func(t *testing.T) *git.Repository { - t.Helper() - - repo, err := git.Init(memory.NewStorage(), memfs.New()) - require.NoError(t, err, "failed to create in-memory repository") - - // Make initial commit - err = WithCommit("chore: init")(t, repo) - require.NoError(t, err, "failed to create init commit") - - for i, commit := range commits { - err = commit(t, repo) - require.NoError(t, err, "failed to create commit %d", i) - } - - return repo - } -} diff --git a/internal/updater/changelog.go b/internal/updater/changelog.go new file mode 100644 index 0000000..8bdb9f6 --- /dev/null +++ b/internal/updater/changelog.go @@ -0,0 +1,32 @@ +package updater + +import ( + "fmt" + "regexp" +) + +const ( + ChangelogHeader = "# Changelog" + ChangelogFile = "CHANGELOG.md" +) + +var ( + ChangelogUpdaterHeaderRegex = regexp.MustCompile(`^# Changelog\n`) +) + +func Changelog(info ReleaseInfo) Updater { + return func(content string) (string, error) { + headerIndex := ChangelogUpdaterHeaderRegex.FindStringIndex(content) + if headerIndex == nil && len(content) != 0 { + return "", fmt.Errorf("unexpected format of CHANGELOG.md, header does not match") + } + if headerIndex != nil { + // Remove the header from the content + content = content[headerIndex[1]:] + } + + content = ChangelogHeader + "\n\n" + info.ChangelogEntry + content + + return content, nil + } +} diff --git a/internal/updater/changelog_test.go b/internal/updater/changelog_test.go new file mode 100644 index 0000000..917cd14 --- /dev/null +++ b/internal/updater/changelog_test.go @@ -0,0 +1,60 @@ +package updater + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestChangelogUpdater_UpdateContent(t *testing.T) { + tests := []updaterTestCase{ + { + name: "empty file", + content: "", + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n"}, + want: "# Changelog\n\n## v1.0.0\n", + wantErr: assert.NoError, + }, + { + name: "well-formatted changelog", + content: `# Changelog + +## v0.0.1 + +- Bazzle + +## v0.1.0 + +### Bazuuum +`, + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, + want: `# Changelog + +## v1.0.0 + +- Version 1, juhu. + +## v0.0.1 + +- Bazzle + +## v0.1.0 + +### Bazuuum +`, + wantErr: assert.NoError, + }, + { + name: "error on invalid header", + content: "What even is this file?", + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, + want: "", + wantErr: assert.Error, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + runUpdaterTest(t, Changelog, tt) + }) + } +} diff --git a/internal/updater/generic.go b/internal/updater/generic.go new file mode 100644 index 0000000..b8d73b0 --- /dev/null +++ b/internal/updater/generic.go @@ -0,0 +1,17 @@ +package updater + +import ( + "regexp" + "strings" +) + +var GenericUpdaterSemVerRegex = regexp.MustCompile(`\d+\.\d+\.\d+(-[\w.]+)?(.*x-releaser-pleaser-version)`) + +func Generic(info ReleaseInfo) Updater { + return func(content string) (string, error) { + // We strip the "v" prefix to avoid adding/removing it from the users input. + version := strings.TrimPrefix(info.Version, "v") + + return GenericUpdaterSemVerRegex.ReplaceAllString(content, version+"${2}"), nil + } +} diff --git a/internal/updater/generic_test.go b/internal/updater/generic_test.go new file mode 100644 index 0000000..e0a8d1d --- /dev/null +++ b/internal/updater/generic_test.go @@ -0,0 +1,53 @@ +package updater + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestGenericUpdater_UpdateContent(t *testing.T) { + tests := []updaterTestCase{ + { + name: "single line", + content: "v1.0.0 // x-releaser-pleaser-version", + info: ReleaseInfo{ + Version: "v1.2.0", + }, + want: "v1.2.0 // x-releaser-pleaser-version", + wantErr: assert.NoError, + }, + { + name: "multiline line", + content: "Foooo\n\v1.2.0\nv1.0.0 // x-releaser-pleaser-version\n", + info: ReleaseInfo{ + Version: "v1.2.0", + }, + want: "Foooo\n\v1.2.0\nv1.2.0 // x-releaser-pleaser-version\n", + wantErr: assert.NoError, + }, + { + name: "invalid existing version", + content: "1.0 // x-releaser-pleaser-version", + info: ReleaseInfo{ + Version: "v1.2.0", + }, + want: "1.0 // x-releaser-pleaser-version", + wantErr: assert.NoError, + }, + { + name: "complicated line", + content: "version: v1.2.0-alpha.1 => Awesome, isnt it? x-releaser-pleaser-version foobar", + info: ReleaseInfo{ + Version: "v1.2.0", + }, + want: "version: v1.2.0 => Awesome, isnt it? x-releaser-pleaser-version foobar", + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + runUpdaterTest(t, Generic, tt) + }) + } +} diff --git a/internal/updater/updater.go b/internal/updater/updater.go new file mode 100644 index 0000000..fb773b4 --- /dev/null +++ b/internal/updater/updater.go @@ -0,0 +1,19 @@ +package updater + +type ReleaseInfo struct { + Version string + ChangelogEntry string +} + +type Updater func(string) (string, error) + +type NewUpdater func(ReleaseInfo) Updater + +func WithInfo(info ReleaseInfo, constructors ...NewUpdater) []Updater { + updaters := make([]Updater, 0, len(constructors)) + for _, constructor := range constructors { + updaters = append(updaters, constructor(info)) + } + + return updaters +} diff --git a/internal/updater/updater_test.go b/internal/updater/updater_test.go new file mode 100644 index 0000000..0c0c40e --- /dev/null +++ b/internal/updater/updater_test.go @@ -0,0 +1,26 @@ +package updater + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +type updaterTestCase struct { + name string + content string + info ReleaseInfo + want string + wantErr assert.ErrorAssertionFunc +} + +func runUpdaterTest(t *testing.T, constructor NewUpdater, tt updaterTestCase) { + t.Helper() + + got, err := constructor(tt.info)(tt.content) + if !tt.wantErr(t, err, fmt.Sprintf("Updater(%v, %v)", tt.content, tt.info)) { + return + } + assert.Equalf(t, tt.want, got, "Updater(%v, %v)", tt.content, tt.info) +} diff --git a/versioning.go b/internal/versioning/semver.go similarity index 68% rename from versioning.go rename to internal/versioning/semver.go index d18d480..49dc019 100644 --- a/versioning.go +++ b/internal/versioning/semver.go @@ -1,23 +1,18 @@ -package rp +package versioning import ( "fmt" "strings" "github.com/blang/semver/v4" - "github.com/leodido/go-conventionalcommits" + + "github.com/apricote/releaser-pleaser/internal/commitparser" + "github.com/apricote/releaser-pleaser/internal/git" ) -type Releases struct { - Latest *Tag - Stable *Tag -} +var _ Strategy = SemVerNextVersion -type VersioningStrategy = func(Releases, conventionalcommits.VersionBump, NextVersionType) (string, error) - -var _ VersioningStrategy = SemVerNextVersion - -func SemVerNextVersion(r Releases, versionBump conventionalcommits.VersionBump, nextVersionType NextVersionType) (string, error) { +func SemVerNextVersion(r git.Releases, versionBump VersionBump, nextVersionType NextVersionType) (string, error) { latest, err := parseSemverWithDefault(r.Latest) if err != nil { return "", fmt.Errorf("failed to parse latest version: %w", err) @@ -36,13 +31,13 @@ func SemVerNextVersion(r Releases, versionBump conventionalcommits.VersionBump, } switch versionBump { - case conventionalcommits.UnknownVersion: + case UnknownVersion: return "", fmt.Errorf("invalid latest bump (unknown)") - case conventionalcommits.PatchVersion: + case PatchVersion: err = next.IncrementPatch() - case conventionalcommits.MinorVersion: + case MinorVersion: err = next.IncrementMinor() - case conventionalcommits.MajorVersion: + case MajorVersion: err = next.IncrementMajor() } if err != nil { @@ -68,18 +63,18 @@ func SemVerNextVersion(r Releases, versionBump conventionalcommits.VersionBump, return "v" + next.String(), nil } -func VersionBumpFromCommits(commits []AnalyzedCommit) conventionalcommits.VersionBump { - bump := conventionalcommits.UnknownVersion +func BumpFromCommits(commits []commitparser.AnalyzedCommit) VersionBump { + bump := UnknownVersion for _, commit := range commits { - entryBump := conventionalcommits.UnknownVersion + entryBump := UnknownVersion switch { case commit.BreakingChange: - entryBump = conventionalcommits.MajorVersion + entryBump = MajorVersion case commit.Type == "feat": - entryBump = conventionalcommits.MinorVersion + entryBump = MinorVersion case commit.Type == "fix": - entryBump = conventionalcommits.PatchVersion + entryBump = PatchVersion } if entryBump > bump { @@ -97,7 +92,7 @@ func setPRVersion(version *semver.Version, prType string, count uint64) { } } -func parseSemverWithDefault(tag *Tag) (semver.Version, error) { +func parseSemverWithDefault(tag *git.Tag) (semver.Version, error) { version := "v0.0.0" if tag != nil { version = tag.Name diff --git a/versioning_test.go b/internal/versioning/semver_test.go similarity index 55% rename from versioning_test.go rename to internal/versioning/semver_test.go index b6a0995..db22c88 100644 --- a/versioning_test.go +++ b/internal/versioning/semver_test.go @@ -1,17 +1,19 @@ -package rp +package versioning import ( "fmt" "testing" - "github.com/leodido/go-conventionalcommits" "github.com/stretchr/testify/assert" + + "github.com/apricote/releaser-pleaser/internal/commitparser" + "github.com/apricote/releaser-pleaser/internal/git" ) func TestReleases_NextVersion(t *testing.T) { type args struct { - releases Releases - versionBump conventionalcommits.VersionBump + releases git.Releases + versionBump VersionBump nextVersionType NextVersionType } tests := []struct { @@ -23,11 +25,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "simple bump (major)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MajorVersion, + versionBump: MajorVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v2.0.0", @@ -36,11 +38,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "simple bump (minor)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MinorVersion, + versionBump: MinorVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v1.2.0", @@ -49,11 +51,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "simple bump (patch)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v1.1.2", @@ -62,11 +64,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "normal to prerelease (major)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MajorVersion, + versionBump: MajorVersion, nextVersionType: NextVersionTypeRC, }, want: "v2.0.0-rc.0", @@ -75,11 +77,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "normal to prerelease (minor)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MinorVersion, + versionBump: MinorVersion, nextVersionType: NextVersionTypeRC, }, want: "v1.2.0-rc.0", @@ -88,11 +90,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "normal to prerelease (patch)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeRC, }, want: "v1.1.2-rc.0", @@ -101,11 +103,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease bump (major)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v2.0.0-rc.0"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v2.0.0-rc.0"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MajorVersion, + versionBump: MajorVersion, nextVersionType: NextVersionTypeRC, }, want: "v2.0.0-rc.1", @@ -114,11 +116,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease bump (minor)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.2.0-rc.0"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.2.0-rc.0"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MinorVersion, + versionBump: MinorVersion, nextVersionType: NextVersionTypeRC, }, want: "v1.2.0-rc.1", @@ -127,11 +129,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease bump (patch)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.2-rc.0"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.2-rc.0"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeRC, }, want: "v1.1.2-rc.1", @@ -140,11 +142,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease different bump (major)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.2.0-rc.0"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.2.0-rc.0"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MajorVersion, + versionBump: MajorVersion, nextVersionType: NextVersionTypeRC, }, want: "v2.0.0-rc.1", @@ -153,11 +155,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease different bump (minor)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.2-rc.0"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.2-rc.0"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.MinorVersion, + versionBump: MinorVersion, nextVersionType: NextVersionTypeRC, }, want: "v1.2.0-rc.1", @@ -166,11 +168,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease to prerelease", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1-alpha.2"}, - Stable: &Tag{Name: "v1.1.0"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1-alpha.2"}, + Stable: &git.Tag{Name: "v1.1.0"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeRC, }, want: "v1.1.1-rc.0", @@ -179,11 +181,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease to normal (explicit)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1-alpha.2"}, - Stable: &Tag{Name: "v1.1.0"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1-alpha.2"}, + Stable: &git.Tag{Name: "v1.1.0"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeNormal, }, want: "v1.1.1", @@ -192,11 +194,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "prerelease to normal (implicit)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1-alpha.2"}, - Stable: &Tag{Name: "v1.1.0"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1-alpha.2"}, + Stable: &git.Tag{Name: "v1.1.0"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v1.1.1", @@ -205,11 +207,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "nil tag (major)", args: args{ - releases: Releases{ + releases: git.Releases{ Latest: nil, Stable: nil, }, - versionBump: conventionalcommits.MajorVersion, + versionBump: MajorVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v1.0.0", @@ -218,11 +220,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "nil tag (minor)", args: args{ - releases: Releases{ + releases: git.Releases{ Latest: nil, Stable: nil, }, - versionBump: conventionalcommits.MinorVersion, + versionBump: MinorVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v0.1.0", @@ -231,11 +233,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "nil tag (patch)", args: args{ - releases: Releases{ + releases: git.Releases{ Latest: nil, Stable: nil, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v0.0.1", @@ -244,11 +246,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "nil stable release (major)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1-rc.0"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1-rc.0"}, Stable: nil, }, - versionBump: conventionalcommits.MajorVersion, + versionBump: MajorVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v2.0.0", @@ -257,11 +259,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "nil stable release (minor)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1-rc.0"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1-rc.0"}, Stable: nil, }, - versionBump: conventionalcommits.MinorVersion, + versionBump: MinorVersion, nextVersionType: NextVersionTypeUndefined, }, want: "v1.2.0", @@ -270,11 +272,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "nil stable release (patch)", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1-rc.0"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1-rc.0"}, Stable: nil, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeUndefined, }, // TODO: Is this actually correct our should it be v1.1.1? @@ -284,11 +286,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "error on invalid tag semver", args: args{ - releases: Releases{ - Latest: &Tag{Name: "foodazzle"}, - Stable: &Tag{Name: "foodazzle"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "foodazzle"}, + Stable: &git.Tag{Name: "foodazzle"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeRC, }, want: "", @@ -297,11 +299,11 @@ func TestReleases_NextVersion(t *testing.T) { { name: "error on invalid tag prerelease", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1-rc.foo"}, - Stable: &Tag{Name: "v1.1.1-rc.foo"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1-rc.foo"}, + Stable: &git.Tag{Name: "v1.1.1-rc.foo"}, }, - versionBump: conventionalcommits.PatchVersion, + versionBump: PatchVersion, nextVersionType: NextVersionTypeRC, }, want: "", @@ -310,12 +312,12 @@ func TestReleases_NextVersion(t *testing.T) { { name: "error on invalid bump", args: args{ - releases: Releases{ - Latest: &Tag{Name: "v1.1.1"}, - Stable: &Tag{Name: "v1.1.1"}, + releases: git.Releases{ + Latest: &git.Tag{Name: "v1.1.1"}, + Stable: &git.Tag{Name: "v1.1.1"}, }, - versionBump: conventionalcommits.UnknownVersion, + versionBump: UnknownVersion, nextVersionType: NextVersionTypeUndefined, }, want: "", @@ -336,53 +338,53 @@ func TestReleases_NextVersion(t *testing.T) { func TestVersionBumpFromCommits(t *testing.T) { tests := []struct { name string - analyzedCommits []AnalyzedCommit - want conventionalcommits.VersionBump + analyzedCommits []commitparser.AnalyzedCommit + want VersionBump }{ { name: "no entries (unknown)", - analyzedCommits: []AnalyzedCommit{}, - want: conventionalcommits.UnknownVersion, + analyzedCommits: []commitparser.AnalyzedCommit{}, + want: UnknownVersion, }, { name: "non-release type (unknown)", - analyzedCommits: []AnalyzedCommit{{Type: "docs"}}, - want: conventionalcommits.UnknownVersion, + analyzedCommits: []commitparser.AnalyzedCommit{{Type: "docs"}}, + want: UnknownVersion, }, { name: "single breaking (major)", - analyzedCommits: []AnalyzedCommit{{BreakingChange: true}}, - want: conventionalcommits.MajorVersion, + analyzedCommits: []commitparser.AnalyzedCommit{{BreakingChange: true}}, + want: MajorVersion, }, { name: "single feat (minor)", - analyzedCommits: []AnalyzedCommit{{Type: "feat"}}, - want: conventionalcommits.MinorVersion, + analyzedCommits: []commitparser.AnalyzedCommit{{Type: "feat"}}, + want: MinorVersion, }, { name: "single fix (patch)", - analyzedCommits: []AnalyzedCommit{{Type: "fix"}}, - want: conventionalcommits.PatchVersion, + analyzedCommits: []commitparser.AnalyzedCommit{{Type: "fix"}}, + want: PatchVersion, }, { name: "multiple entries (major)", - analyzedCommits: []AnalyzedCommit{{Type: "fix"}, {BreakingChange: true}}, - want: conventionalcommits.MajorVersion, + analyzedCommits: []commitparser.AnalyzedCommit{{Type: "fix"}, {BreakingChange: true}}, + want: MajorVersion, }, { name: "multiple entries (minor)", - analyzedCommits: []AnalyzedCommit{{Type: "fix"}, {Type: "feat"}}, - want: conventionalcommits.MinorVersion, + analyzedCommits: []commitparser.AnalyzedCommit{{Type: "fix"}, {Type: "feat"}}, + want: MinorVersion, }, { name: "multiple entries (patch)", - analyzedCommits: []AnalyzedCommit{{Type: "docs"}, {Type: "fix"}}, - want: conventionalcommits.PatchVersion, + analyzedCommits: []commitparser.AnalyzedCommit{{Type: "docs"}, {Type: "fix"}}, + want: PatchVersion, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - assert.Equalf(t, tt.want, VersionBumpFromCommits(tt.analyzedCommits), "VersionBumpFromCommits(%v)", tt.analyzedCommits) + assert.Equalf(t, tt.want, BumpFromCommits(tt.analyzedCommits), "BumpFromCommits(%v)", tt.analyzedCommits) }) } } diff --git a/internal/versioning/versioning.go b/internal/versioning/versioning.go new file mode 100644 index 0000000..3bf8138 --- /dev/null +++ b/internal/versioning/versioning.go @@ -0,0 +1,56 @@ +package versioning + +import ( + "github.com/leodido/go-conventionalcommits" + + "github.com/apricote/releaser-pleaser/internal/git" +) + +type Strategy = func(git.Releases, VersionBump, NextVersionType) (string, error) + +type VersionBump conventionalcommits.VersionBump + +const ( + UnknownVersion VersionBump = iota + PatchVersion + MinorVersion + MajorVersion +) + +type NextVersionType int + +const ( + NextVersionTypeUndefined NextVersionType = iota + NextVersionTypeNormal + NextVersionTypeRC + NextVersionTypeBeta + NextVersionTypeAlpha +) + +func (n NextVersionType) String() string { + switch n { + case NextVersionTypeUndefined: + return "undefined" + case NextVersionTypeNormal: + return "normal" + case NextVersionTypeRC: + return "rc" + case NextVersionTypeBeta: + return "beta" + case NextVersionTypeAlpha: + return "alpha" + default: + return "" + } +} + +func (n NextVersionType) IsPrerelease() bool { + switch n { + case NextVersionTypeRC, NextVersionTypeBeta, NextVersionTypeAlpha: + return true + case NextVersionTypeUndefined, NextVersionTypeNormal: + return false + default: + return false + } +} diff --git a/releaserpleaser.go b/releaserpleaser.go index f0bf6cd..54064a4 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -3,13 +3,15 @@ package rp import ( "context" "fmt" - "io" "log/slog" - "os" - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/plumbing" + "github.com/apricote/releaser-pleaser/internal/changelog" + "github.com/apricote/releaser-pleaser/internal/commitparser" + "github.com/apricote/releaser-pleaser/internal/forge" + "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/releasepr" + "github.com/apricote/releaser-pleaser/internal/updater" + "github.com/apricote/releaser-pleaser/internal/versioning" ) const ( @@ -17,16 +19,16 @@ const ( ) type ReleaserPleaser struct { - forge Forge + forge forge.Forge logger *slog.Logger targetBranch string - commitParser CommitParser - nextVersion VersioningStrategy + commitParser commitparser.CommitParser + nextVersion versioning.Strategy extraFiles []string - updaters []Updater + updaters []updater.NewUpdater } -func New(forge Forge, logger *slog.Logger, targetBranch string, commitParser CommitParser, versioningStrategy VersioningStrategy, extraFiles []string, updaters []Updater) *ReleaserPleaser { +func New(forge forge.Forge, logger *slog.Logger, targetBranch string, commitParser commitparser.CommitParser, versioningStrategy versioning.Strategy, extraFiles []string, updaters []updater.NewUpdater) *ReleaserPleaser { return &ReleaserPleaser{ forge: forge, logger: logger, @@ -40,7 +42,8 @@ func New(forge Forge, logger *slog.Logger, targetBranch string, commitParser Com func (rp *ReleaserPleaser) EnsureLabels(ctx context.Context) error { // TODO: Wrap Error - return rp.forge.EnsureLabelsExist(ctx, KnownLabels) + + return rp.forge.EnsureLabelsExist(ctx, releasepr.KnownLabels) } func (rp *ReleaserPleaser) Run(ctx context.Context) error { @@ -75,7 +78,7 @@ func (rp *ReleaserPleaser) runCreatePendingReleases(ctx context.Context) error { logger := rp.logger.With("method", "runCreatePendingReleases") logger.InfoContext(ctx, "checking for pending releases") - prs, err := rp.forge.PendingReleases(ctx, LabelReleasePending) + prs, err := rp.forge.PendingReleases(ctx, releasepr.LabelReleasePending) if err != nil { return err } @@ -97,7 +100,7 @@ func (rp *ReleaserPleaser) runCreatePendingReleases(ctx context.Context) error { return nil } -func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *ReleasePullRequest) error { +func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *releasepr.ReleasePullRequest) error { logger := rp.logger.With( "method", "createPendingRelease", "pr.id", pr.ID, @@ -129,7 +132,7 @@ func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *Release logger.DebugContext(ctx, "created release", "release.title", version, "release.url", rp.forge.ReleaseURL(version)) logger.DebugContext(ctx, "updating pr labels") - err = rp.forge.SetPullRequestLabels(ctx, pr, []Label{LabelReleasePending}, []Label{LabelReleaseTagged}) + err = rp.forge.SetPullRequestLabels(ctx, pr, []releasepr.Label{releasepr.LabelReleasePending}, []releasepr.Label{releasepr.LabelReleaseTagged}) if err != nil { return err } @@ -144,14 +147,13 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger := rp.logger.With("method", "runReconcileReleasePR") rpBranch := fmt.Sprintf(PullRequestBranchFormat, rp.targetBranch) - rpBranchRef := plumbing.NewBranchReferenceName(rpBranch) pr, err := rp.forge.PullRequestForBranch(ctx, rpBranch) if err != nil { return err } - var releaseOverrides ReleaseOverrides + var releaseOverrides releasepr.ReleaseOverrides if pr != nil { logger = logger.With("pr.id", pr.ID, "pr.title", pr.Title) @@ -215,7 +217,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { return nil } - versionBump := VersionBumpFromCommits(analyzedCommits) + versionBump := versioning.BumpFromCommits(analyzedCommits) // TODO: Set version in release pr nextVersion, err := rp.nextVersion(releases, versionBump, releaseOverrides.NextVersionType) if err != nil { @@ -224,161 +226,68 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger.InfoContext(ctx, "next version", "version", nextVersion) logger.DebugContext(ctx, "cloning repository", "clone.url", rp.forge.CloneURL()) - repo, err := CloneRepo(ctx, rp.forge.CloneURL(), rp.targetBranch, rp.forge.GitAuth()) + repo, err := git.CloneRepo(ctx, logger, rp.forge.CloneURL(), rp.targetBranch, rp.forge.GitAuth()) if err != nil { return fmt.Errorf("failed to clone repository: %w", err) } - worktree, err := repo.Worktree() - if err != nil { + + if err = repo.DeleteBranch(ctx, rpBranch); err != nil { return err } - if branch, _ := repo.Branch(rpBranch); branch != nil { - logger.DebugContext(ctx, "deleting previous releaser-pleaser branch locally", "branch.name", rpBranch) - if err = repo.DeleteBranch(rpBranch); err != nil { - return err - } + if err = repo.Checkout(ctx, rpBranch); err != nil { + return err } - if err = worktree.Checkout(&git.CheckoutOptions{ - Branch: rpBranchRef, - Create: true, - }); err != nil { - return fmt.Errorf("failed to check out branch: %w", err) - } - - changelogEntry, err := NewChangelogEntry(analyzedCommits, nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) + changelogEntry, err := changelog.NewChangelogEntry(analyzedCommits, nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) if err != nil { return fmt.Errorf("failed to build changelog entry: %w", err) } // Info for updaters - info := ReleaseInfo{Version: nextVersion, ChangelogEntry: changelogEntry} + info := updater.ReleaseInfo{Version: nextVersion, ChangelogEntry: changelogEntry} - updateFile := func(path string, updaters []Updater) error { - file, err := worktree.Filesystem.OpenFile(path, os.O_RDWR, 0) - if err != nil { - return err - } - defer file.Close() - - content, err := io.ReadAll(file) - if err != nil { - return err - } - - updatedContent := string(content) - - for _, updater := range updaters { - updatedContent, err = updater.UpdateContent(updatedContent, info) - if err != nil { - return fmt.Errorf("failed to run updater %T on file %s", updater, path) - } - } - - err = file.Truncate(0) - if err != nil { - return fmt.Errorf("failed to replace file content: %w", err) - } - _, err = file.Seek(0, 0) - if err != nil { - return fmt.Errorf("failed to replace file content: %w", err) - } - _, err = file.Write([]byte(updatedContent)) - if err != nil { - return fmt.Errorf("failed to replace file content: %w", err) - } - - _, err = worktree.Add(path) - if err != nil { - return fmt.Errorf("failed to add updated file to git worktree: %w", err) - } - - return nil - } - - err = updateFile(ChangelogFile, []Updater{&ChangelogUpdater{}}) + err = repo.UpdateFile(ctx, updater.ChangelogFile, updater.WithInfo(info, updater.Changelog)) if err != nil { return fmt.Errorf("failed to update changelog file: %w", err) } for _, path := range rp.extraFiles { - _, err = worktree.Filesystem.Stat(path) - if err != nil { - // TODO: Check for non existing file or dirs - return fmt.Errorf("failed to run file updater because the file %s does not exist: %w", path, err) - } - - err = updateFile(path, rp.updaters) + // TODO: Check for missing files + err = repo.UpdateFile(ctx, path, updater.WithInfo(info, rp.updaters...)) if err != nil { return fmt.Errorf("failed to run file updater: %w", err) } } releaseCommitMessage := fmt.Sprintf("chore(%s): release %s", rp.targetBranch, nextVersion) - releaseCommitHash, err := worktree.Commit(releaseCommitMessage, &git.CommitOptions{ - Author: GitSignature(), - Committer: GitSignature(), - }) + releaseCommit, err := repo.Commit(ctx, releaseCommitMessage) if err != nil { return fmt.Errorf("failed to commit changes: %w", err) } - logger.InfoContext(ctx, "created release commit", "commit.hash", releaseCommitHash.String(), "commit.message", releaseCommitMessage) - - newReleasePRChanges := true + logger.InfoContext(ctx, "created release commit", "commit.hash", releaseCommit.Hash, "commit.message", releaseCommit.Message) // Check if anything changed in comparison to the remote branch (if exists) - if remoteRef, err := repo.Reference(plumbing.NewRemoteReferenceName(GitRemoteName, rpBranch), false); err != nil { - if err.Error() != "reference not found" { - // "reference not found" is expected and we should always push - return err - } - } else { - remoteCommit, err := repo.CommitObject(remoteRef.Hash()) - if err != nil { - return err - } - - localCommit, err := repo.CommitObject(releaseCommitHash) - if err != nil { - return err - } - - diff, err := localCommit.PatchContext(ctx, remoteCommit) - if err != nil { - return err - } - - newReleasePRChanges = len(diff.FilePatches()) > 0 + newReleasePRChanges, err := repo.HasChangesWithRemote(ctx, rpBranch) + if err != nil { + return err } if newReleasePRChanges { - pushRefSpec := config.RefSpec(fmt.Sprintf( - "+%s:%s", - rpBranchRef, - // This needs to be the local branch name, not the remotes/origin ref - // See https://stackoverflow.com/a/75727620 - rpBranchRef, - )) - logger.DebugContext(ctx, "pushing branch", "commit.hash", releaseCommitHash.String(), "branch.name", rpBranch, "refspec", pushRefSpec.String()) - if err = repo.PushContext(ctx, &git.PushOptions{ - RemoteName: GitRemoteName, - RefSpecs: []config.RefSpec{pushRefSpec}, - Force: true, - Auth: rp.forge.GitAuth(), - }); err != nil { + err = repo.ForcePush(ctx, rpBranch) + if err != nil { return fmt.Errorf("failed to push branch: %w", err) } - logger.InfoContext(ctx, "pushed branch", "commit.hash", releaseCommitHash.String(), "branch.name", rpBranch, "refspec", pushRefSpec.String()) + logger.InfoContext(ctx, "pushed branch", "commit.hash", releaseCommit.Hash, "branch.name", rpBranch) } else { logger.InfoContext(ctx, "file content is already up-to-date in remote branch, skipping push") } // Open/Update PR if pr == nil { - pr, err = NewReleasePullRequest(rpBranch, rp.targetBranch, nextVersion, changelogEntry) + pr, err = releasepr.NewReleasePullRequest(rpBranch, rp.targetBranch, nextVersion, changelogEntry) if err != nil { return err } diff --git a/updater.go b/updater.go deleted file mode 100644 index 3aaedae..0000000 --- a/updater.go +++ /dev/null @@ -1,47 +0,0 @@ -package rp - -import ( - "fmt" - "regexp" - "strings" -) - -var ( - GenericUpdaterSemVerRegex = regexp.MustCompile(`\d+\.\d+\.\d+(-[\w.]+)?(.*x-releaser-pleaser-version)`) - ChangelogUpdaterHeaderRegex = regexp.MustCompile(`^# Changelog\n`) -) - -type ReleaseInfo struct { - Version string - ChangelogEntry string -} - -type Updater interface { - UpdateContent(content string, info ReleaseInfo) (string, error) -} - -type GenericUpdater struct{} - -func (u *GenericUpdater) UpdateContent(content string, info ReleaseInfo) (string, error) { - // We strip the "v" prefix to avoid adding/removing it from the users input. - version := strings.TrimPrefix(info.Version, "v") - - return GenericUpdaterSemVerRegex.ReplaceAllString(content, version+"${2}"), nil -} - -type ChangelogUpdater struct{} - -func (u *ChangelogUpdater) UpdateContent(content string, info ReleaseInfo) (string, error) { - headerIndex := ChangelogUpdaterHeaderRegex.FindStringIndex(content) - if headerIndex == nil && len(content) != 0 { - return "", fmt.Errorf("unexpected format of CHANGELOG.md, header does not match") - } - if headerIndex != nil { - // Remove the header from the content - content = content[headerIndex[1]:] - } - - content = ChangelogHeader + "\n\n" + info.ChangelogEntry + content - - return content, nil -} diff --git a/updater_test.go b/updater_test.go deleted file mode 100644 index c0e1419..0000000 --- a/updater_test.go +++ /dev/null @@ -1,129 +0,0 @@ -package rp - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" -) - -type updaterTestCase struct { - name string - content string - info ReleaseInfo - want string - wantErr assert.ErrorAssertionFunc -} - -func runUpdaterTest(t *testing.T, updater Updater, tt updaterTestCase) { - t.Helper() - - got, err := updater.UpdateContent(tt.content, tt.info) - if !tt.wantErr(t, err, fmt.Sprintf("UpdateContent(%v, %v)", tt.content, tt.info)) { - return - } - assert.Equalf(t, tt.want, got, "UpdateContent(%v, %v)", tt.content, tt.info) -} - -func TestGenericUpdater_UpdateContent(t *testing.T) { - updater := &GenericUpdater{} - - tests := []updaterTestCase{ - { - name: "single line", - content: "v1.0.0 // x-releaser-pleaser-version", - info: ReleaseInfo{ - Version: "v1.2.0", - }, - want: "v1.2.0 // x-releaser-pleaser-version", - wantErr: assert.NoError, - }, - { - name: "multiline line", - content: "Foooo\n\v1.2.0\nv1.0.0 // x-releaser-pleaser-version\n", - info: ReleaseInfo{ - Version: "v1.2.0", - }, - want: "Foooo\n\v1.2.0\nv1.2.0 // x-releaser-pleaser-version\n", - wantErr: assert.NoError, - }, - { - name: "invalid existing version", - content: "1.0 // x-releaser-pleaser-version", - info: ReleaseInfo{ - Version: "v1.2.0", - }, - want: "1.0 // x-releaser-pleaser-version", - wantErr: assert.NoError, - }, - { - name: "complicated line", - content: "version: v1.2.0-alpha.1 => Awesome, isnt it? x-releaser-pleaser-version foobar", - info: ReleaseInfo{ - Version: "v1.2.0", - }, - want: "version: v1.2.0 => Awesome, isnt it? x-releaser-pleaser-version foobar", - wantErr: assert.NoError, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - runUpdaterTest(t, updater, tt) - }) - } -} - -func TestChangelogUpdater_UpdateContent(t *testing.T) { - updater := &ChangelogUpdater{} - - tests := []updaterTestCase{ - { - name: "empty file", - content: "", - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n"}, - want: "# Changelog\n\n## v1.0.0\n", - wantErr: assert.NoError, - }, - { - name: "well-formatted changelog", - content: `# Changelog - -## v0.0.1 - -- Bazzle - -## v0.1.0 - -### Bazuuum -`, - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, - want: `# Changelog - -## v1.0.0 - -- Version 1, juhu. - -## v0.0.1 - -- Bazzle - -## v0.1.0 - -### Bazuuum -`, - wantErr: assert.NoError, - }, - { - name: "error on invalid header", - content: "What even is this file?", - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, - want: "", - wantErr: assert.Error, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - runUpdaterTest(t, updater, tt) - }) - } -} From 4cb22eae1039f39fbba86d940649e455cafc51f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 31 Aug 2024 16:49:07 +0200 Subject: [PATCH 005/260] refactor: replace markdown renderer (#40) The new renderer is actually published as a module and can be extended through the usual goldmark extensions. --- go.mod | 1 + go.sum | 4 + internal/markdown/extensions/section.go | 42 + internal/markdown/goldmark.go | 6 +- internal/markdown/renderer/markdown/LICENSE | 21 - internal/markdown/renderer/markdown/README.md | 4 - .../markdown/renderer/markdown/renderer.go | 836 ------------------ .../markdown/renderer/markdown/section.go | 35 - 8 files changed, 49 insertions(+), 900 deletions(-) delete mode 100644 internal/markdown/renderer/markdown/LICENSE delete mode 100644 internal/markdown/renderer/markdown/README.md delete mode 100644 internal/markdown/renderer/markdown/renderer.go delete mode 100644 internal/markdown/renderer/markdown/section.go diff --git a/go.mod b/go.mod index 9add194..7e7b81f 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 + github.com/teekennedy/goldmark-markdown v0.3.0 github.com/yuin/goldmark v1.7.4 ) diff --git a/go.sum b/go.sum index b5f7d57..65568ec 100644 --- a/go.sum +++ b/go.sum @@ -67,6 +67,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY= +github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -87,6 +89,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= +github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= diff --git a/internal/markdown/extensions/section.go b/internal/markdown/extensions/section.go index dcca37d..c8fdcb7 100644 --- a/internal/markdown/extensions/section.go +++ b/internal/markdown/extensions/section.go @@ -1,11 +1,13 @@ package extensions import ( + "fmt" "regexp" "github.com/yuin/goldmark" gast "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/renderer" "github.com/yuin/goldmark/text" "github.com/yuin/goldmark/util" @@ -76,6 +78,43 @@ func (s *sectionParser) Trigger() []byte { return []byte(sectionTrigger) } +type SectionMarkdownRenderer struct{} + +func NewSectionMarkdownRenderer() renderer.NodeRenderer { + return &SectionMarkdownRenderer{} +} + +func (s SectionMarkdownRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { + reg.Register(ast.KindSection, s.renderSection) +} + +func (s SectionMarkdownRenderer) renderSection(w util.BufWriter, _ []byte, node gast.Node, enter bool) (gast.WalkStatus, error) { + n := node.(*ast.Section) + + if enter { + // Add blank previous line if applicable + if node.PreviousSibling() != nil && node.HasBlankPreviousLines() { + if _, err := w.WriteRune('\n'); err != nil { + return gast.WalkStop, err + } + } + + if _, err := fmt.Fprintf(w, SectionStartFormat, n.Name); err != nil { + return gast.WalkStop, fmt.Errorf(": %w", err) + } + } else { + if _, err := fmt.Fprintf(w, SectionEndFormat, n.Name); err != nil { + return gast.WalkStop, fmt.Errorf(": %w", err) + } + + if _, err := w.WriteRune('\n'); err != nil { + return gast.WalkStop, err + } + } + + return gast.WalkContinue, nil +} + type section struct{} // Section is an extension that allow you to use group content under a shared parent ast node. @@ -85,4 +124,7 @@ func (e *section) Extend(m goldmark.Markdown) { m.Parser().AddOptions(parser.WithBlockParsers( util.Prioritized(NewSectionParser(), 0), )) + m.Renderer().AddOptions(renderer.WithNodeRenderers( + util.Prioritized(NewSectionMarkdownRenderer(), 500), + )) } diff --git a/internal/markdown/goldmark.go b/internal/markdown/goldmark.go index b78f089..252ef92 100644 --- a/internal/markdown/goldmark.go +++ b/internal/markdown/goldmark.go @@ -1,17 +1,15 @@ package markdown import ( + markdown "github.com/teekennedy/goldmark-markdown" "github.com/yuin/goldmark" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/util" "github.com/apricote/releaser-pleaser/internal/markdown/extensions" - "github.com/apricote/releaser-pleaser/internal/markdown/renderer/markdown" ) func New() goldmark.Markdown { return goldmark.New( goldmark.WithExtensions(extensions.Section), - goldmark.WithRenderer(renderer.NewRenderer(renderer.WithNodeRenderers(util.Prioritized(markdown.NewRenderer(), 1)))), + goldmark.WithRenderer(markdown.NewRenderer()), ) } diff --git a/internal/markdown/renderer/markdown/LICENSE b/internal/markdown/renderer/markdown/LICENSE deleted file mode 100644 index 0edc41c..0000000 --- a/internal/markdown/renderer/markdown/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Rolf Lewis - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/internal/markdown/renderer/markdown/README.md b/internal/markdown/renderer/markdown/README.md deleted file mode 100644 index c84792a..0000000 --- a/internal/markdown/renderer/markdown/README.md +++ /dev/null @@ -1,4 +0,0 @@ -This directory is a vendored copy of https://github.com/RolfLewis/goldmark-down/blob/main/markdown.go. -The original repository is set to a `main` package which can not be imported. - -It is under the MIT license. \ No newline at end of file diff --git a/internal/markdown/renderer/markdown/renderer.go b/internal/markdown/renderer/markdown/renderer.go deleted file mode 100644 index 69b2883..0000000 --- a/internal/markdown/renderer/markdown/renderer.go +++ /dev/null @@ -1,836 +0,0 @@ -package markdown - -import ( - "bytes" - "fmt" - "io" - "strconv" - "strings" - - "github.com/yuin/goldmark/ast" - exast "github.com/yuin/goldmark/extension/ast" - "github.com/yuin/goldmark/renderer" - "github.com/yuin/goldmark/text" - "github.com/yuin/goldmark/util" - - rpexast "github.com/apricote/releaser-pleaser/internal/markdown/extensions/ast" -) - -type blockState struct { - node ast.Node - fresh bool -} - -type listState struct { - marker byte - ordered bool - index int -} - -type Renderer struct { - listStack []listState - openBlocks []blockState - prefixStack []string - prefix []byte - atNewline bool -} - -// NewRenderer returns a new Renderer with given options. -func NewRenderer() renderer.NodeRenderer { - r := &Renderer{} - - return r -} - -func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer) { - // default registrations - // blocks - reg.Register(ast.KindDocument, r.renderDocument) - reg.Register(ast.KindHeading, r.renderHeading) - reg.Register(ast.KindBlockquote, r.renderBlockquote) - reg.Register(ast.KindCodeBlock, r.renderCodeBlock) - reg.Register(ast.KindFencedCodeBlock, r.renderFencedCodeBlock) - reg.Register(ast.KindHTMLBlock, r.renderHTMLBlock) - reg.Register(ast.KindList, r.renderList) - reg.Register(ast.KindListItem, r.renderListItem) - reg.Register(ast.KindParagraph, r.renderParagraph) - reg.Register(ast.KindTextBlock, r.renderTextBlock) - reg.Register(ast.KindThematicBreak, r.renderThematicBreak) - - // inlines - reg.Register(ast.KindAutoLink, r.renderAutoLink) - reg.Register(ast.KindCodeSpan, r.renderCodeSpan) - reg.Register(ast.KindEmphasis, r.renderEmphasis) - reg.Register(ast.KindImage, r.renderImage) - reg.Register(ast.KindLink, r.renderLink) - reg.Register(ast.KindRawHTML, r.renderRawHTML) - reg.Register(ast.KindText, r.renderText) - reg.Register(ast.KindString, r.renderString) - - // GFM Extensions - // Tables - reg.Register(exast.KindTable, r.renderTable) - reg.Register(exast.KindTableHeader, r.renderTableHeader) - reg.Register(exast.KindTableRow, r.renderTableRow) - reg.Register(exast.KindTableCell, r.renderTableCell) - // Strikethrough - reg.Register(exast.KindStrikethrough, r.renderStrikethrough) - // Checkbox - reg.Register(exast.KindTaskCheckBox, r.renderTaskCheckBox) - - // releaser-pleaser Extensions - // Section - reg.Register(rpexast.KindSection, r.renderSection) -} - -func (r *Renderer) write(w io.Writer, buf []byte) (int, error) { - written := 0 - for len(buf) > 0 { - if r.atNewline { - if err := r.beginLine(w); err != nil { - return 0, fmt.Errorf(": %w", err) - } - } - - atNewline := false - newline := bytes.IndexByte(buf, '\n') - if newline == -1 { - newline = len(buf) - 1 - } else { - atNewline = true - } - - n, err := w.Write(buf[:newline+1]) - written += n - r.atNewline = n > 0 && atNewline && n == newline+1 - if len(r.openBlocks) != 0 { - r.openBlocks[len(r.openBlocks)-1].fresh = false - } - if err != nil { - return written, fmt.Errorf(": %w", err) - } - buf = buf[n:] - } - return written, nil -} - -func (r *Renderer) beginLine(w io.Writer) error { - if len(r.openBlocks) != 0 { - current := r.openBlocks[len(r.openBlocks)-1] - if current.node.Kind() == ast.KindParagraph && !current.fresh { - return nil - } - } - - n, err := w.Write(r.prefix) - if n != 0 { - r.atNewline = r.prefix[len(r.prefix)-1] == '\n' - } - if err != nil { - return fmt.Errorf(": %w", err) - } - return nil -} - -func (r *Renderer) writeLines(w util.BufWriter, source []byte, lines *text.Segments) error { - for i := 0; i < lines.Len(); i++ { - line := lines.At(i) - if _, err := r.write(w, line.Value(source)); err != nil { - return fmt.Errorf(": %w", err) - } - } - return nil -} - -func (r *Renderer) writeByte(w io.Writer, c byte) error { - if _, err := r.write(w, []byte{c}); err != nil { - return fmt.Errorf(": %w", err) - } - return nil -} - -// WriteString writes a string to an io.Writer, ensuring that appropriate indentation and prefixes are added at the -// beginning of each line. -func (r *Renderer) writeString(w io.Writer, s string) (int, error) { - n, err := r.write(w, []byte(s)) - if err != nil { - return n, fmt.Errorf(": %w", err) - } - return n, nil -} - -// PushIndent adds the specified amount of indentation to the current line prefix. -func (r *Renderer) pushIndent(amount int) { - r.pushPrefix(strings.Repeat(" ", amount)) -} - -// PushPrefix adds the specified string to the current line prefix. -func (r *Renderer) pushPrefix(prefix string) { - r.prefixStack = append(r.prefixStack, prefix) - r.prefix = append(r.prefix, []byte(prefix)...) -} - -// PopPrefix removes the last piece added by a call to PushIndent or PushPrefix from the current line prefix. -func (r *Renderer) popPrefix() { - r.prefix = r.prefix[:len(r.prefix)-len(r.prefixStack[len(r.prefixStack)-1])] - r.prefixStack = r.prefixStack[:len(r.prefixStack)-1] -} - -// OpenBlock ensures that each block begins on a new line, and that blank lines are inserted before blocks as -// indicated by node.HasPreviousBlankLines. -func (r *Renderer) openBlock(w util.BufWriter, _ []byte, node ast.Node) error { - r.openBlocks = append(r.openBlocks, blockState{ - node: node, - fresh: true, - }) - - hasBlankPreviousLines := node.HasBlankPreviousLines() - - // FIXME: standard goldmark table parser doesn't recognize Blank Previous Lines so we'll always add one - if node.Kind() == exast.KindTable { - hasBlankPreviousLines = true - } - - // Work around the fact that the first child of a node notices the same set of preceding blank lines as its parent. - if p := node.Parent(); p != nil && p.FirstChild() == node { - if p.Kind() == ast.KindDocument || p.Kind() == ast.KindListItem || p.HasBlankPreviousLines() { - hasBlankPreviousLines = false - } - } - - if hasBlankPreviousLines { - if err := r.writeByte(w, '\n'); err != nil { - return fmt.Errorf(": %w", err) - } - } - - r.openBlocks[len(r.openBlocks)-1].fresh = true - - return nil -} - -// CloseBlock marks the current block as closed. -func (r *Renderer) closeBlock(w io.Writer) error { - if !r.atNewline { - if err := r.writeByte(w, '\n'); err != nil { - return fmt.Errorf(": %w", err) - } - } - - r.openBlocks = r.openBlocks[:len(r.openBlocks)-1] - return nil -} - -// RenderDocument renders an *ast.Document node to the given BufWriter. -func (r *Renderer) renderDocument(_ util.BufWriter, _ []byte, _ ast.Node, _ bool) (ast.WalkStatus, error) { - r.listStack, r.prefixStack, r.prefix, r.atNewline = nil, nil, nil, false - return ast.WalkContinue, nil -} - -// RenderHeading renders an *ast.Heading node to the given BufWriter. -func (r *Renderer) renderHeading(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if _, err := r.writeString(w, strings.Repeat("#", node.(*ast.Heading).Level)); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if err := r.writeByte(w, ' '); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } else { - if err := r.writeByte(w, '\n'); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderBlockquote renders an *ast.Blockquote node to the given BufWriter. -func (r *Renderer) renderBlockquote(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if _, err := r.writeString(w, "> "); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - r.pushPrefix("> ") - } else { - r.popPrefix() - - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderCodeBlock renders an *ast.CodeBlock node to the given BufWriter. -func (r *Renderer) renderCodeBlock(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - r.popPrefix() - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil - } - - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - // // Each line of a code block needs to be aligned at the same offset, and a code block must start with at least four - // // spaces. To achieve this, we unconditionally add four spaces to the first line of the code block and indent the - // // rest as necessary. - // if _, err := r.writeString(w, " "); err != nil { - // return ast.WalkStop, fmt.Errorf(": %w", err) - // } - - r.pushIndent(4) - if err := r.writeLines(w, source, node.Lines()); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - return ast.WalkContinue, nil -} - -// RenderFencedCodeBlock renders an *ast.FencedCodeBlock node to the given BufWriter. -func (r *Renderer) renderFencedCodeBlock(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil - } - - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - code := node.(*ast.FencedCodeBlock) - - // Write the start of the fenced code block. - fence := []byte("```") - if _, err := r.write(w, fence); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - language := code.Language(source) - if _, err := r.write(w, language); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - if err := r.writeByte(w, '\n'); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - // Write the contents of the fenced code block. - if err := r.writeLines(w, source, node.Lines()); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - // Write the end of the fenced code block. - if err := r.beginLine(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - if _, err := r.write(w, fence); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - if err := r.writeByte(w, '\n'); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - return ast.WalkContinue, nil -} - -// RenderHTMLBlock renders an *ast.HTMLBlock node to the given BufWriter. -func (r *Renderer) renderHTMLBlock(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil - } - - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - // Write the contents of the HTML block. - if err := r.writeLines(w, source, node.Lines()); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - // Write the closure line, if any. - html := node.(*ast.HTMLBlock) - if html.HasClosure() { - if _, err := r.write(w, html.ClosureLine.Value(source)); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderList renders an *ast.List node to the given BufWriter. -func (r *Renderer) renderList(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - list := node.(*ast.List) - r.listStack = append(r.listStack, listState{ - marker: list.Marker, - ordered: list.IsOrdered(), - index: list.Start, - }) - } else { - r.listStack = r.listStack[:len(r.listStack)-1] - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderListItem renders an *ast.ListItem node to the given BufWriter. -func (r *Renderer) renderListItem(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - markerWidth := 2 // marker + space - - state := &r.listStack[len(r.listStack)-1] - if state.ordered { - width, err := r.writeString(w, strconv.FormatInt(int64(state.index), 10)) - if err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - state.index++ - markerWidth += width // marker, space, and digits - } - - if _, err := r.write(w, []byte{state.marker, ' '}); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - r.pushIndent(markerWidth) - } else { - r.popPrefix() - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderParagraph renders an *ast.Paragraph node to the given BufWriter. -func (r *Renderer) renderParagraph(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - // A paragraph that follows another paragraph or a blockquote must be preceded by a blank line. - if !node.HasBlankPreviousLines() { - if prev := node.PreviousSibling(); prev != nil && (prev.Kind() == ast.KindParagraph || prev.Kind() == ast.KindBlockquote) { - if err := r.writeByte(w, '\n'); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - } - - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } else { - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderTextBlock renders an *ast.TextBlock node to the given BufWriter. -func (r *Renderer) renderTextBlock(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } else { - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderThematicBreak renders an *ast.ThematicBreak node to the given BufWriter. -func (r *Renderer) renderThematicBreak(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil - } - - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - // TODO: this prints an extra no line - if _, err := r.writeString(w, "--------"); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - return ast.WalkContinue, nil -} - -// RenderAutoLink renders an *ast.AutoLink node to the given BufWriter. -func (r *Renderer) renderAutoLink(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - return ast.WalkContinue, nil - } - - if err := r.writeByte(w, '<'); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - if _, err := r.write(w, node.(*ast.AutoLink).Label(source)); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - if err := r.writeByte(w, '>'); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - return ast.WalkContinue, nil -} - -func (r *Renderer) shouldPadCodeSpan(source []byte, node *ast.CodeSpan) bool { - c := node.FirstChild() - if c == nil { - return false - } - - segment := c.(*ast.Text).Segment - text := segment.Value(source) - - var firstChar byte - if len(text) > 0 { - firstChar = text[0] - } - - allWhitespace := true - for { - if util.FirstNonSpacePosition(text) != -1 { - allWhitespace = false - break - } - c = c.NextSibling() - if c == nil { - break - } - segment = c.(*ast.Text).Segment - text = segment.Value(source) - } - if allWhitespace { - return false - } - - var lastChar byte - if len(text) > 0 { - lastChar = text[len(text)-1] - } - - return firstChar == '`' || firstChar == ' ' || lastChar == '`' || lastChar == ' ' -} - -// RenderCodeSpan renders an *ast.CodeSpan node to the given BufWriter. -func (r *Renderer) renderCodeSpan(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - return ast.WalkContinue, nil - } - - code := node.(*ast.CodeSpan) - delimiter := []byte{'`'} - pad := r.shouldPadCodeSpan(source, code) - - if _, err := r.write(w, delimiter); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - if pad { - if err := r.writeByte(w, ' '); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - for c := node.FirstChild(); c != nil; c = c.NextSibling() { - text := c.(*ast.Text).Segment - if _, err := r.write(w, text.Value(source)); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - if pad { - if err := r.writeByte(w, ' '); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - if _, err := r.write(w, delimiter); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - return ast.WalkSkipChildren, nil -} - -// RenderEmphasis renders an *ast.Emphasis node to the given BufWriter. -func (r *Renderer) renderEmphasis(w util.BufWriter, _ []byte, node ast.Node, _ bool) (ast.WalkStatus, error) { - em := node.(*ast.Emphasis) - if _, err := r.writeString(w, strings.Repeat("*", em.Level)); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil -} - -func (r *Renderer) escapeLinkDest(dest []byte) []byte { - requiresEscaping := false - for _, c := range dest { - if c <= 32 || c == '(' || c == ')' || c == 127 { - requiresEscaping = true - break - } - } - if !requiresEscaping { - return dest - } - - escaped := make([]byte, 0, len(dest)+2) - escaped = append(escaped, '<') - for _, c := range dest { - if c == '<' || c == '>' { - escaped = append(escaped, '\\') - } - escaped = append(escaped, c) - } - escaped = append(escaped, '>') - return escaped -} - -func (r *Renderer) linkTitleDelimiter(title []byte) byte { - for i, c := range title { - if c == '"' && (i == 0 || title[i-1] != '\\') { - return '\'' - } - } - return '"' -} - -func (r *Renderer) renderLinkOrImage(w util.BufWriter, open string, dest, title []byte, enter bool) error { - if enter { - if _, err := r.writeString(w, open); err != nil { - return fmt.Errorf(": %w", err) - } - } else { - if _, err := r.writeString(w, "]("); err != nil { - return fmt.Errorf(": %w", err) - } - - if _, err := r.write(w, r.escapeLinkDest(dest)); err != nil { - return fmt.Errorf(": %w", err) - } - if len(title) != 0 { - delimiter := r.linkTitleDelimiter(title) - if _, err := fmt.Fprintf(w, ` %c%s%c`, delimiter, string(title), delimiter); err != nil { - return fmt.Errorf(": %w", err) - } - } - - if err := r.writeByte(w, ')'); err != nil { - return fmt.Errorf(": %w", err) - } - } - return nil -} - -// RenderImage renders an *ast.Image node to the given BufWriter. -func (r *Renderer) renderImage(w util.BufWriter, _ []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - img := node.(*ast.Image) - if err := r.renderLinkOrImage(w, "![", img.Destination, img.Title, enter); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil -} - -// RenderLink renders an *ast.Link node to the given BufWriter. -func (r *Renderer) renderLink(w util.BufWriter, _ []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - link := node.(*ast.Link) - if err := r.renderLinkOrImage(w, "[", link.Destination, link.Title, enter); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil -} - -// RenderRawHTML renders an *ast.RawHTML node to the given BufWriter. -func (r *Renderer) renderRawHTML(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - return ast.WalkSkipChildren, nil - } - - raw := node.(*ast.RawHTML) - for i := 0; i < raw.Segments.Len(); i++ { - segment := raw.Segments.At(i) - if _, err := r.write(w, segment.Value(source)); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkSkipChildren, nil -} - -// RenderText renders an *ast.Text node to the given BufWriter. -func (r *Renderer) renderText(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - return ast.WalkContinue, nil - } - - text := node.(*ast.Text) - value := text.Segment.Value(source) - - if _, err := r.write(w, value); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - switch { - case text.HardLineBreak(): - if _, err := r.writeString(w, "\\\n"); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - case text.SoftLineBreak(): - if err := r.writeByte(w, '\n'); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -// RenderString renders an *ast.String node to the given BufWriter. -func (r *Renderer) renderString(w util.BufWriter, _ []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - return ast.WalkContinue, nil - } - - str := node.(*ast.String) - if _, err := r.write(w, str.Value); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - return ast.WalkContinue, nil -} - -func (r *Renderer) renderTable(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } else { - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -func (r *Renderer) renderTableHeader(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if _, err := r.writeString(w, "| "); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } else { - if _, err := r.writeString(w, " |\n|"); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - for x := 0; x < node.ChildCount(); x++ { // use as column count - if _, err := r.writeString(w, " --- |"); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -func (r *Renderer) renderTableRow(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if _, err := r.writeString(w, "| "); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } else { - if _, err := r.writeString(w, " |"); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} - -func (r *Renderer) renderTableCell(w util.BufWriter, _ []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if !enter { - if node.NextSibling() != nil { - if _, err := r.writeString(w, " | "); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - } - - return ast.WalkContinue, nil -} - -func (r *Renderer) renderStrikethrough(w util.BufWriter, _ []byte, _ ast.Node, _ bool) (ast.WalkStatus, error) { - if _, err := r.writeString(w, "~~"); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - return ast.WalkContinue, nil -} - -func (r *Renderer) renderTaskCheckBox(w util.BufWriter, _ []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - if enter { - var fill byte = ' ' - if task := node.(*exast.TaskCheckBox); task.IsChecked { - fill = 'x' - } - - if _, err := r.write(w, []byte{'[', fill, ']', ' '}); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} diff --git a/internal/markdown/renderer/markdown/section.go b/internal/markdown/renderer/markdown/section.go deleted file mode 100644 index 612ea06..0000000 --- a/internal/markdown/renderer/markdown/section.go +++ /dev/null @@ -1,35 +0,0 @@ -package markdown - -import ( - "fmt" - - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/util" - - "github.com/apricote/releaser-pleaser/internal/markdown/extensions" - rpexast "github.com/apricote/releaser-pleaser/internal/markdown/extensions/ast" -) - -func (r *Renderer) renderSection(w util.BufWriter, source []byte, node ast.Node, enter bool) (ast.WalkStatus, error) { - n := node.(*rpexast.Section) - - if enter { - if err := r.openBlock(w, source, node); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if _, err := r.writeString(w, fmt.Sprintf(extensions.SectionStartFormat, n.Name)+"\n"); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } else { - if _, err := r.writeString(w, "\n"+fmt.Sprintf(extensions.SectionEndFormat, n.Name)); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - - if err := r.closeBlock(w); err != nil { - return ast.WalkStop, fmt.Errorf(": %w", err) - } - } - - return ast.WalkContinue, nil -} From 0750bd6b46683b966d44375a08218081f0a124a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 31 Aug 2024 22:23:01 +0200 Subject: [PATCH 006/260] feat: format markdown in changelog entry (#41) --- internal/changelog/changelog.go | 12 +++++++++-- internal/changelog/changelog.md.tpl | 2 +- internal/changelog/changelog_test.go | 12 +++++++---- internal/markdown/goldmark.go | 21 +++++++++++++++++++ internal/markdown/prettier.go | 31 ++++++++++++++++++++++++++++ releaserpleaser.go | 2 +- 6 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 internal/markdown/prettier.go diff --git a/internal/changelog/changelog.go b/internal/changelog/changelog.go index 1d0fd67..6004829 100644 --- a/internal/changelog/changelog.go +++ b/internal/changelog/changelog.go @@ -5,8 +5,10 @@ import ( _ "embed" "html/template" "log" + "log/slog" "github.com/apricote/releaser-pleaser/internal/commitparser" + "github.com/apricote/releaser-pleaser/internal/markdown" ) var ( @@ -24,7 +26,7 @@ func init() { } } -func NewChangelogEntry(commits []commitparser.AnalyzedCommit, version, link, prefix, suffix string) (string, error) { +func NewChangelogEntry(logger *slog.Logger, commits []commitparser.AnalyzedCommit, version, link, prefix, suffix string) (string, error) { features := make([]commitparser.AnalyzedCommit, 0) fixes := make([]commitparser.AnalyzedCommit, 0) @@ -50,5 +52,11 @@ func NewChangelogEntry(commits []commitparser.AnalyzedCommit, version, link, pre return "", err } - return changelog.String(), nil + formatted, err := markdown.Format(changelog.String()) + if err != nil { + logger.Warn("failed to format changelog entry, using unformatted", "error", err) + return changelog.String(), nil + } + + return formatted, nil } diff --git a/internal/changelog/changelog.md.tpl b/internal/changelog/changelog.md.tpl index 85482e1..1f7dd42 100644 --- a/internal/changelog/changelog.md.tpl +++ b/internal/changelog/changelog.md.tpl @@ -19,4 +19,4 @@ {{- if .Suffix }} {{ .Suffix }} -{{ end -}} +{{ end }} diff --git a/internal/changelog/changelog_test.go b/internal/changelog/changelog_test.go index 384e30f..e6582c7 100644 --- a/internal/changelog/changelog_test.go +++ b/internal/changelog/changelog_test.go @@ -1,6 +1,7 @@ package changelog import ( + "log/slog" "testing" "github.com/stretchr/testify/assert" @@ -34,7 +35,7 @@ func Test_NewChangelogEntry(t *testing.T) { version: "1.0.0", link: "https://example.com/1.0.0", }, - want: "## [1.0.0](https://example.com/1.0.0)", + want: "## [1.0.0](https://example.com/1.0.0)\n", wantErr: assert.NoError, }, { @@ -50,7 +51,7 @@ func Test_NewChangelogEntry(t *testing.T) { version: "1.0.0", link: "https://example.com/1.0.0", }, - want: "## [1.0.0](https://example.com/1.0.0)\n### Features\n\n- Foobar!\n", + want: "## [1.0.0](https://example.com/1.0.0)\n\n### Features\n\n- Foobar!\n", wantErr: assert.NoError, }, { @@ -66,7 +67,7 @@ func Test_NewChangelogEntry(t *testing.T) { version: "1.0.0", link: "https://example.com/1.0.0", }, - want: "## [1.0.0](https://example.com/1.0.0)\n### Bug Fixes\n\n- Foobar!\n", + want: "## [1.0.0](https://example.com/1.0.0)\n\n### Bug Fixes\n\n- Foobar!\n", wantErr: assert.NoError, }, { @@ -100,6 +101,7 @@ func Test_NewChangelogEntry(t *testing.T) { link: "https://example.com/1.0.0", }, want: `## [1.0.0](https://example.com/1.0.0) + ### Features - Blabla! @@ -127,6 +129,7 @@ func Test_NewChangelogEntry(t *testing.T) { prefix: "### Breaking Changes", }, want: `## [1.0.0](https://example.com/1.0.0) + ### Breaking Changes ### Bug Fixes @@ -150,6 +153,7 @@ func Test_NewChangelogEntry(t *testing.T) { suffix: "### Compatibility\n\nThis version is compatible with flux-compensator v2.2 - v2.9.", }, want: `## [1.0.0](https://example.com/1.0.0) + ### Bug Fixes - Foobar! @@ -164,7 +168,7 @@ This version is compatible with flux-compensator v2.2 - v2.9. for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := NewChangelogEntry(tt.args.analyzedCommits, tt.args.version, tt.args.link, tt.args.prefix, tt.args.suffix) + got, err := NewChangelogEntry(slog.Default(), tt.args.analyzedCommits, tt.args.version, tt.args.link, tt.args.prefix, tt.args.suffix) if !tt.wantErr(t, err) { return } diff --git a/internal/markdown/goldmark.go b/internal/markdown/goldmark.go index 252ef92..456fc55 100644 --- a/internal/markdown/goldmark.go +++ b/internal/markdown/goldmark.go @@ -1,8 +1,12 @@ package markdown import ( + "bytes" + markdown "github.com/teekennedy/goldmark-markdown" "github.com/yuin/goldmark" + "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/util" "github.com/apricote/releaser-pleaser/internal/markdown/extensions" ) @@ -10,6 +14,23 @@ import ( func New() goldmark.Markdown { return goldmark.New( goldmark.WithExtensions(extensions.Section), + goldmark.WithParserOptions(parser.WithASTTransformers( + util.Prioritized(&newLineTransformer{}, 1), + )), goldmark.WithRenderer(markdown.NewRenderer()), ) } + +// Format the Markdown document in a style mimicking Prettier. This is done for compatibility with other tools +// users might have installed in their IDE. This does not guarantee that the output matches Prettier exactly. +func Format(input string) (string, error) { + var buf bytes.Buffer + buf.Grow(len(input)) + + err := New().Convert([]byte(input), &buf) + if err != nil { + return "", err + } + + return buf.String(), nil +} diff --git a/internal/markdown/prettier.go b/internal/markdown/prettier.go new file mode 100644 index 0000000..914f1a9 --- /dev/null +++ b/internal/markdown/prettier.go @@ -0,0 +1,31 @@ +package markdown + +import ( + "github.com/yuin/goldmark/ast" + "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/text" +) + +type newLineTransformer struct{} + +var _ parser.ASTTransformer = (*newLineTransformer)(nil) // interface compliance + +func (t *newLineTransformer) Transform(doc *ast.Document, _ text.Reader, _ parser.Context) { + // No error can happen as they can only come from the walker function + _ = ast.Walk(doc, func(node ast.Node, entering bool) (ast.WalkStatus, error) { + if !entering || node.Type() != ast.TypeBlock { + return ast.WalkContinue, nil + } + + switch node.Kind() { + case ast.KindListItem: + // Do not add empty lines between every list item + break + default: + // Add empty lines between every other block + node.SetBlankPreviousLines(true) + } + + return ast.WalkContinue, nil + }) +} diff --git a/releaserpleaser.go b/releaserpleaser.go index 54064a4..6e500f6 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -239,7 +239,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { return err } - changelogEntry, err := changelog.NewChangelogEntry(analyzedCommits, nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) + changelogEntry, err := changelog.NewChangelogEntry(logger, analyzedCommits, nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) if err != nil { return fmt.Errorf("failed to build changelog entry: %w", err) } From 36a0b90bcde26d3eab1b446acb4023ded470460d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 1 Sep 2024 14:19:13 +0200 Subject: [PATCH 007/260] refactor: releasepr markdown handling (#42) --- internal/markdown/extensions/ast/section.go | 7 +- internal/markdown/extensions/section.go | 14 +- internal/markdown/goldmark.go | 83 +++++++ internal/markdown/goldmark_test.go | 252 ++++++++++++++++++++ internal/releasepr/releasepr.go | 83 +------ internal/releasepr/releasepr_test.go | 110 +++++++++ 6 files changed, 466 insertions(+), 83 deletions(-) create mode 100644 internal/markdown/goldmark_test.go diff --git a/internal/markdown/extensions/ast/section.go b/internal/markdown/extensions/ast/section.go index 43937c3..b336f9d 100644 --- a/internal/markdown/extensions/ast/section.go +++ b/internal/markdown/extensions/ast/section.go @@ -7,7 +7,8 @@ import ( // A Section struct represents a section of elements. type Section struct { gast.BaseBlock - Name string + Name string + Hidden bool } // Dump implements Node.Dump. @@ -26,6 +27,10 @@ func (n *Section) Kind() gast.NodeKind { return KindSection } +func (n *Section) HideInOutput() { + n.Hidden = true +} + // NewSection returns a new Section node. func NewSection(name string) *Section { return &Section{Name: name} diff --git a/internal/markdown/extensions/section.go b/internal/markdown/extensions/section.go index c8fdcb7..31e0b4d 100644 --- a/internal/markdown/extensions/section.go +++ b/internal/markdown/extensions/section.go @@ -21,8 +21,8 @@ var ( const ( sectionTrigger = "" - SectionEndFormat = "" + SectionStartFormat = "\n" + SectionEndFormat = "\n" ) type sectionParser struct{} @@ -91,6 +91,10 @@ func (s SectionMarkdownRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegi func (s SectionMarkdownRenderer) renderSection(w util.BufWriter, _ []byte, node gast.Node, enter bool) (gast.WalkStatus, error) { n := node.(*ast.Section) + if n.Hidden { + return gast.WalkContinue, nil + } + if enter { // Add blank previous line if applicable if node.PreviousSibling() != nil && node.HasBlankPreviousLines() { @@ -107,12 +111,10 @@ func (s SectionMarkdownRenderer) renderSection(w util.BufWriter, _ []byte, node return gast.WalkStop, fmt.Errorf(": %w", err) } - if _, err := w.WriteRune('\n'); err != nil { - return gast.WalkStop, err - } } - return gast.WalkContinue, nil + // Somehow the goldmark-markdown renderer does not flush this properly on its own + return gast.WalkContinue, w.Flush() } type section struct{} diff --git a/internal/markdown/goldmark.go b/internal/markdown/goldmark.go index 456fc55..16c7ce4 100644 --- a/internal/markdown/goldmark.go +++ b/internal/markdown/goldmark.go @@ -2,13 +2,17 @@ package markdown import ( "bytes" + "strings" markdown "github.com/teekennedy/goldmark-markdown" "github.com/yuin/goldmark" + gast "github.com/yuin/goldmark/ast" "github.com/yuin/goldmark/parser" + "github.com/yuin/goldmark/text" "github.com/yuin/goldmark/util" "github.com/apricote/releaser-pleaser/internal/markdown/extensions" + "github.com/apricote/releaser-pleaser/internal/markdown/extensions/ast" ) func New() goldmark.Markdown { @@ -34,3 +38,82 @@ func Format(input string) (string, error) { return buf.String(), nil } + +func GetCodeBlockText(source []byte, language string, output *string) gast.Walker { + return func(n gast.Node, entering bool) (gast.WalkStatus, error) { + if !entering { + return gast.WalkContinue, nil + } + + if n.Kind() != gast.KindFencedCodeBlock { + return gast.WalkContinue, nil + } + + codeBlock := n.(*gast.FencedCodeBlock) + + if string(codeBlock.Language(source)) != language { + return gast.WalkContinue, nil + } + + *output = textFromLines(source, codeBlock) + // Stop looking after we find the first result + return gast.WalkStop, nil + } +} + +func GetSectionText(source []byte, name string, output *string) gast.Walker { + return func(n gast.Node, entering bool) (gast.WalkStatus, error) { + if !entering { + return gast.WalkContinue, nil + } + + if n.Kind() != ast.KindSection { + return gast.WalkContinue, nil + } + + section := n.(*ast.Section) + + if section.Name != name { + return gast.WalkContinue, nil + } + + // Do not show section markings in output, we only care about the content + section.HideInOutput() + + // Found the right section + outputBuffer := new(bytes.Buffer) + err := New().Renderer().Render(outputBuffer, source, section) + if err != nil { + return gast.WalkStop, err + } + + *output = outputBuffer.String() + // Stop looking after we find the first result + return gast.WalkStop, nil + } +} + +func textFromLines(source []byte, n gast.Node) string { + content := make([]byte, 0) + + l := n.Lines().Len() + for i := 0; i < l; i++ { + line := n.Lines().At(i) + content = append(content, line.Value(source)...) + } + + return strings.TrimSpace(string(content)) +} + +func WalkAST(source []byte, walkers ...gast.Walker) (err error) { + doc := New().Parser().Parse(text.NewReader(source)) + + for _, walker := range walkers { + err = gast.Walk(doc, walker) + if err != nil { + return err + } + } + + return nil +} diff --git a/internal/markdown/goldmark_test.go b/internal/markdown/goldmark_test.go new file mode 100644 index 0000000..3002994 --- /dev/null +++ b/internal/markdown/goldmark_test.go @@ -0,0 +1,252 @@ +package markdown + +import ( + "errors" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/yuin/goldmark/ast" +) + +func TestFormat(t *testing.T) { + tests := []struct { + name string + input string + want string + wantErr assert.ErrorAssertionFunc + }{ + { + name: "heading spacing", + input: "# Foo\n## Bar\n### Baz", + want: "# Foo\n\n## Bar\n\n### Baz\n", + wantErr: assert.NoError, + }, + { + name: "no empty lines for list items", + input: "# Foo\n- 1\n- 2\n", + want: "# Foo\n\n- 1\n- 2\n", + wantErr: assert.NoError, + }, + { + name: "sections", + input: "# Foo\n\n- 1\n- 2\n\n", + want: "# Foo\n\n\n- 1\n- 2\n\n\n", + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := Format(tt.input) + if !tt.wantErr(t, err) { + return + } + assert.Equal(t, tt.want, got) + }) + } +} + +func TestGetCodeBlockText(t *testing.T) { + type args struct { + source []byte + language string + } + tests := []struct { + name string + args args + want string + wantErr assert.ErrorAssertionFunc + }{ + { + name: "no code block", + args: args{ + source: []byte("# Foo"), + language: "missing", + }, + want: "", + wantErr: assert.NoError, + }, + { + name: "code block", + args: args{ + source: []byte("```test\nContent\n```"), + language: "test", + }, + want: "Content", + wantErr: assert.NoError, + }, + { + name: "code block with other language", + args: args{ + source: []byte("```unknown\nContent\n```"), + language: "test", + }, + want: "", + wantErr: assert.NoError, + }, + { + name: "multiple code blocks with different languages", + args: args{ + source: []byte("```unknown\nContent\n```\n\n```test\n1337\n```"), + language: "test", + }, + want: "1337", + wantErr: assert.NoError, + }, + { + name: "multiple code blocks with same language returns first one", + args: args{ + source: []byte("```test\nContent\n```\n\n```test\n1337\n```"), + language: "test", + }, + want: "Content", + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var got string + + err := WalkAST(tt.args.source, + GetCodeBlockText(tt.args.source, tt.args.language, &got), + ) + if !tt.wantErr(t, err) { + return + } + + assert.Equal(t, tt.want, got) + }) + } +} + +func TestGetSectionText(t *testing.T) { + type args struct { + source []byte + name string + } + tests := []struct { + name string + args args + want string + wantErr assert.ErrorAssertionFunc + }{ + { + name: "no section", + args: args{ + source: []byte("# Foo"), + name: "missing", + }, + want: "", + wantErr: assert.NoError, + }, + { + name: "section", + args: args{ + source: []byte("\nContent\n"), + name: "test", + }, + want: "Content\n", + wantErr: assert.NoError, + }, + { + name: "section with other name", + args: args{ + source: []byte("\nContent\n"), + name: "test", + }, + want: "", + wantErr: assert.NoError, + }, + { + name: "multiple sections with different names", + args: args{ + source: []byte("\nContent\n\n\n\n1337\n"), + name: "test", + }, + want: "1337\n", + wantErr: assert.NoError, + }, + { + name: "multiple sections with same name returns first one", + args: args{ + source: []byte("\nContent\n\n\n\n1337\n"), + name: "test", + }, + want: "Content\n", + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + var got string + + err := WalkAST(tt.args.source, + GetSectionText(tt.args.source, tt.args.name, &got), + ) + if !tt.wantErr(t, err) { + return + } + + assert.Equal(t, tt.want, got) + }) + } +} + +func TestWalkAST(t *testing.T) { + type args struct { + source []byte + walkers []ast.Walker + } + tests := []struct { + name string + args args + wantErr assert.ErrorAssertionFunc + }{ + { + name: "empty walker", + args: args{ + source: []byte("# Foo"), + walkers: []ast.Walker{ + func(_ ast.Node, _ bool) (ast.WalkStatus, error) { + return ast.WalkStop, nil + }, + }, + }, + wantErr: assert.NoError, + }, + { + name: "returns walker error", + args: args{ + source: []byte("# Foo"), + walkers: []ast.Walker{ + func(_ ast.Node, _ bool) (ast.WalkStatus, error) { + return ast.WalkStop, errors.New("test") + }, + }, + }, + wantErr: assert.Error, + }, + { + name: "runs all walkers", + args: args{ + source: []byte("# Foo"), + walkers: []ast.Walker{ + func(_ ast.Node, _ bool) (ast.WalkStatus, error) { + return ast.WalkStop, nil + }, + func(_ ast.Node, _ bool) (ast.WalkStatus, error) { + return ast.WalkStop, errors.New("test") + }, + }, + }, + wantErr: assert.Error, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := WalkAST(tt.args.source, tt.args.walkers...) + if !tt.wantErr(t, err) { + return + } + }) + } +} diff --git a/internal/releasepr/releasepr.go b/internal/releasepr/releasepr.go index 5bf3649..c19451e 100644 --- a/internal/releasepr/releasepr.go +++ b/internal/releasepr/releasepr.go @@ -6,15 +6,10 @@ import ( "fmt" "log" "regexp" - "strings" "text/template" - "github.com/yuin/goldmark/ast" - "github.com/yuin/goldmark/text" - "github.com/apricote/releaser-pleaser/internal/git" "github.com/apricote/releaser-pleaser/internal/markdown" - ast2 "github.com/apricote/releaser-pleaser/internal/markdown/extensions/ast" "github.com/apricote/releaser-pleaser/internal/versioning" ) @@ -140,31 +135,11 @@ func (pr *ReleasePullRequest) parseVersioningFlags(overrides ReleaseOverrides) R func (pr *ReleasePullRequest) parseDescription(overrides ReleaseOverrides) (ReleaseOverrides, error) { source := []byte(pr.Description) - descriptionAST := markdown.New().Parser().Parse(text.NewReader(source)) - err := ast.Walk(descriptionAST, func(n ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - return ast.WalkContinue, nil - } - - if n.Type() != ast.TypeBlock || n.Kind() != ast.KindFencedCodeBlock { - return ast.WalkContinue, nil - } - - codeBlock, ok := n.(*ast.FencedCodeBlock) - if !ok { - return ast.WalkStop, fmt.Errorf("node has unexpected type: %T", n) - } - - switch string(codeBlock.Language(source)) { - case DescriptionLanguagePrefix: - overrides.Prefix = textFromLines(source, codeBlock) - case DescriptionLanguageSuffix: - overrides.Suffix = textFromLines(source, codeBlock) - } - - return ast.WalkContinue, nil - }) + err := markdown.WalkAST(source, + markdown.GetCodeBlockText(source, DescriptionLanguagePrefix, &overrides.Prefix), + markdown.GetCodeBlockText(source, DescriptionLanguageSuffix, &overrides.Suffix), + ) if err != nil { return ReleaseOverrides{}, err } @@ -174,59 +149,15 @@ func (pr *ReleasePullRequest) parseDescription(overrides ReleaseOverrides) (Rele func (pr *ReleasePullRequest) ChangelogText() (string, error) { source := []byte(pr.Description) - gm := markdown.New() - descriptionAST := gm.Parser().Parse(text.NewReader(source)) - var section *ast2.Section - - err := ast.Walk(descriptionAST, func(n ast.Node, entering bool) (ast.WalkStatus, error) { - if !entering { - return ast.WalkContinue, nil - } - - if n.Type() != ast.TypeBlock || n.Kind() != ast2.KindSection { - return ast.WalkContinue, nil - } - - anySection, ok := n.(*ast2.Section) - if !ok { - return ast.WalkStop, fmt.Errorf("node has unexpected type: %T", n) - } - - if anySection.Name != MarkdownSectionChangelog { - return ast.WalkContinue, nil - } - - section = anySection - return ast.WalkStop, nil - }) + var sectionText string + err := markdown.WalkAST(source, markdown.GetSectionText(source, MarkdownSectionChangelog, §ionText)) if err != nil { return "", err } - if section == nil { - return "", nil - } + return sectionText, nil - outputBuffer := new(bytes.Buffer) - err = gm.Renderer().Render(outputBuffer, source, section) - if err != nil { - return "", err - } - - return outputBuffer.String(), nil -} - -func textFromLines(source []byte, n ast.Node) string { - content := make([]byte, 0) - - l := n.Lines().Len() - for i := 0; i < l; i++ { - line := n.Lines().At(i) - content = append(content, line.Value(source)...) - } - - return strings.TrimSpace(string(content)) } func (pr *ReleasePullRequest) SetTitle(branch, version string) { diff --git a/internal/releasepr/releasepr_test.go b/internal/releasepr/releasepr_test.go index 92f338d..64295de 100644 --- a/internal/releasepr/releasepr_test.go +++ b/internal/releasepr/releasepr_test.go @@ -1,11 +1,121 @@ package releasepr import ( + "fmt" "testing" "github.com/stretchr/testify/assert" + + "github.com/apricote/releaser-pleaser/internal/versioning" ) +func TestReleasePullRequest_GetOverrides(t *testing.T) { + tests := []struct { + name string + pr ReleasePullRequest + want ReleaseOverrides + wantErr assert.ErrorAssertionFunc + }{ + { + name: "empty", + pr: ReleasePullRequest{}, + want: ReleaseOverrides{}, + wantErr: assert.NoError, + }, + { + // TODO: Test for multiple version flags + name: "single version flag", + pr: ReleasePullRequest{ + Labels: []Label{LabelNextVersionTypeAlpha}, + }, + want: ReleaseOverrides{ + NextVersionType: versioning.NextVersionTypeAlpha, + }, + wantErr: assert.NoError, + }, + { + name: "prefix in description", + pr: ReleasePullRequest{ + Description: "```rp-prefix\n## Foo\n\n- Cool thing\n```", + }, + want: ReleaseOverrides{Prefix: "## Foo\n\n- Cool thing"}, + wantErr: assert.NoError, + }, + { + name: "suffix in description", + pr: ReleasePullRequest{ + Description: "```rp-suffix\n## Compatibility\n\nNo compatibility guarantees.\n```", + }, + want: ReleaseOverrides{Suffix: "## Compatibility\n\nNo compatibility guarantees."}, + wantErr: assert.NoError, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := tt.pr.GetOverrides() + if !tt.wantErr(t, err, fmt.Sprintf("GetOverrides()")) { + return + } + assert.Equalf(t, tt.want, got, "GetOverrides()") + }) + } +} + +func TestReleasePullRequest_ChangelogText(t *testing.T) { + tests := []struct { + name string + description string + want string + wantErr assert.ErrorAssertionFunc + }{ + { + name: "no section", + description: "# Foo\n", + want: "", + wantErr: assert.NoError, + }, + { + name: "with section", + description: `# Foobar + + +This is the changelog + +## Awesome + +### New + +#### Changes + + +Suffix Things +`, + want: `This is the changelog + +## Awesome + +### New + +#### Changes +`, + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + pr := &ReleasePullRequest{ + Description: tt.description, + } + got, err := pr.ChangelogText() + if !tt.wantErr(t, err, fmt.Sprintf("ChangelogText()")) { + return + } + assert.Equalf(t, tt.want, got, "ChangelogText()") + }) + } +} + func TestReleasePullRequest_SetTitle(t *testing.T) { type args struct { branch string From 2effe5e72da3f0b3c713a282d63f86fa60f64f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 6 Sep 2024 23:17:06 +0200 Subject: [PATCH 008/260] feat: edit commit message after merging through PR (#43) Closes #5 --- .../release-notes-rp-commits-release-pr.png | 3 + docs/guides/release-notes-rp-commits.png | 3 + docs/guides/release-notes.md | 29 ++- docs/reference/pr-options.md | 31 ++- internal/forge/github/github.go | 4 +- internal/markdown/goldmark.go | 5 +- internal/markdown/goldmark_test.go | 42 +-- internal/releasepr/releasepr.go | 13 +- internal/releasepr/releasepr_test.go | 19 +- prbody.go | 57 +++++ prbody_test.go | 242 ++++++++++++++++++ releaserpleaser.go | 12 +- 12 files changed, 420 insertions(+), 40 deletions(-) create mode 100644 docs/guides/release-notes-rp-commits-release-pr.png create mode 100644 docs/guides/release-notes-rp-commits.png create mode 100644 prbody.go create mode 100644 prbody_test.go diff --git a/docs/guides/release-notes-rp-commits-release-pr.png b/docs/guides/release-notes-rp-commits-release-pr.png new file mode 100644 index 0000000..0dc60e0 --- /dev/null +++ b/docs/guides/release-notes-rp-commits-release-pr.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c28226eaa769033a45ca801f1e0655178faf86e7ddd764f470ae79d72c4b3c2 +size 62031 diff --git a/docs/guides/release-notes-rp-commits.png b/docs/guides/release-notes-rp-commits.png new file mode 100644 index 0000000..d91ea5f --- /dev/null +++ b/docs/guides/release-notes-rp-commits.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04ca48b3250862d282dd54e14c08f9273ada0a49d2300364601799c56b1f6d11 +size 72105 diff --git a/docs/guides/release-notes.md b/docs/guides/release-notes.md index b4602c9..d994294 100644 --- a/docs/guides/release-notes.md +++ b/docs/guides/release-notes.md @@ -4,7 +4,34 @@ You can customize the generated Release Notes in two ways: ## For a single commit / pull request -This feature is still being worked on. Check out [#5](https://github.com/apricote/releaser-pleaser/issues/5) for the current status. +### Editing the Release Notes + +After merging a non-release pull request, you can still modify how it appears in the Release Notes. + +To do this, add a code block named `rp-commits` in the pull request description. When this block is present, `releaser-pleaser` will use its content for generating Release Notes instead of the commit message. If the code block contains multiple lines, each line will be treated as if it came from separate pull requests. This is useful for pull requests that introduce multiple features or fix several bugs. + +You can update the description at any time after merging the pull request but before merging the release pull request. `releaser-pleaser` will then re-run and update the suggested Release Notes accordingly. + +> ```rp-commits +> feat(api): add movie endpoints +> feat(api): add cinema endpoints +> fix(db): invalid schema for actor model +> ``` + +Using GitHub as an example, the pull request you are trying to change the Release Notes for should look like this: + +![Screenshot of a pull request page on GitHub. Currently editing the description of the pull request and adding the rp-commits snippet from above.](release-notes-rp-commits.png) + +In turn, `releaser-pleaser` updates the release pull request like this: + +![Screenshot of a release pull request on GitHub. It shows the release notes with the three commits from the rp-commits example.](release-notes-rp-commits-release-pr.png) + +### Removing the pull request from the Release Notes + +If you add an empty code block, the pull request will be removed from the Release Notes. + +> ```rp-commits +> ``` ## For the release diff --git a/docs/reference/pr-options.md b/docs/reference/pr-options.md index 11402bc..266bd08 100644 --- a/docs/reference/pr-options.md +++ b/docs/reference/pr-options.md @@ -28,6 +28,20 @@ Adding more than one of these labels is not allowed and the behaviour if multipl Any text in code blocks with these languages is being added to the start or end of the Release Notes and Changelog. Learn more in the [Release Notes](../guides/release-notes.md) guide. +**Examples**: + + ```rp-prefix + #### Awesome new feature! + + This text is at the start of the release notes. + ``` + + ```rp-suffix + #### Version Compatibility + + And this at the end. + ``` + ### Status **Labels**: @@ -43,4 +57,19 @@ Users should not set these labels themselves. Not created by `releaser-pleaser`. -Normal pull requests do not support any options right now. +### Release Notes + +**Code Blocks**: + +- `rp-commits` + +If specified, `releaser-pleaser` will consider each line in the code block as a commit message and add all of them to the Release Notes. Learn more in the [Release Notes](../guides/release-notes.md) guide. + +The types of commits (`feat`, `fix`, ...) are also considered for the next version. + +**Examples**: + + ```rp-commits + feat(api): add movie endpoints + fix(db): invalid schema for actor model + ``` diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index 46f203a..e7f6f97 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -526,9 +526,7 @@ func gitHubPRToReleasePullRequest(pr *github.PullRequest) *releasepr.ReleasePull } return &releasepr.ReleasePullRequest{ - ID: pr.GetNumber(), - Title: pr.GetTitle(), - Description: pr.GetBody(), + PullRequest: *gitHubPRToPullRequest(pr), Labels: labels, Head: pr.GetHead().GetRef(), diff --git a/internal/markdown/goldmark.go b/internal/markdown/goldmark.go index 16c7ce4..c2aecb8 100644 --- a/internal/markdown/goldmark.go +++ b/internal/markdown/goldmark.go @@ -39,7 +39,7 @@ func Format(input string) (string, error) { return buf.String(), nil } -func GetCodeBlockText(source []byte, language string, output *string) gast.Walker { +func GetCodeBlockText(source []byte, language string, output *string, found *bool) gast.Walker { return func(n gast.Node, entering bool) (gast.WalkStatus, error) { if !entering { return gast.WalkContinue, nil @@ -56,6 +56,9 @@ func GetCodeBlockText(source []byte, language string, output *string) gast.Walke } *output = textFromLines(source, codeBlock) + if found != nil { + *found = true + } // Stop looking after we find the first result return gast.WalkStop, nil } diff --git a/internal/markdown/goldmark_test.go b/internal/markdown/goldmark_test.go index 3002994..9c44b43 100644 --- a/internal/markdown/goldmark_test.go +++ b/internal/markdown/goldmark_test.go @@ -51,10 +51,11 @@ func TestGetCodeBlockText(t *testing.T) { language string } tests := []struct { - name string - args args - want string - wantErr assert.ErrorAssertionFunc + name string + args args + wantText string + wantFound bool + wantErr assert.ErrorAssertionFunc }{ { name: "no code block", @@ -62,8 +63,9 @@ func TestGetCodeBlockText(t *testing.T) { source: []byte("# Foo"), language: "missing", }, - want: "", - wantErr: assert.NoError, + wantText: "", + wantFound: false, + wantErr: assert.NoError, }, { name: "code block", @@ -71,8 +73,9 @@ func TestGetCodeBlockText(t *testing.T) { source: []byte("```test\nContent\n```"), language: "test", }, - want: "Content", - wantErr: assert.NoError, + wantText: "Content", + wantFound: true, + wantErr: assert.NoError, }, { name: "code block with other language", @@ -80,8 +83,9 @@ func TestGetCodeBlockText(t *testing.T) { source: []byte("```unknown\nContent\n```"), language: "test", }, - want: "", - wantErr: assert.NoError, + wantText: "", + wantFound: false, + wantErr: assert.NoError, }, { name: "multiple code blocks with different languages", @@ -89,8 +93,9 @@ func TestGetCodeBlockText(t *testing.T) { source: []byte("```unknown\nContent\n```\n\n```test\n1337\n```"), language: "test", }, - want: "1337", - wantErr: assert.NoError, + wantText: "1337", + wantFound: true, + wantErr: assert.NoError, }, { name: "multiple code blocks with same language returns first one", @@ -98,22 +103,25 @@ func TestGetCodeBlockText(t *testing.T) { source: []byte("```test\nContent\n```\n\n```test\n1337\n```"), language: "test", }, - want: "Content", - wantErr: assert.NoError, + wantText: "Content", + wantFound: true, + wantErr: assert.NoError, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - var got string + var gotText string + var gotFound bool err := WalkAST(tt.args.source, - GetCodeBlockText(tt.args.source, tt.args.language, &got), + GetCodeBlockText(tt.args.source, tt.args.language, &gotText, &gotFound), ) if !tt.wantErr(t, err) { return } - assert.Equal(t, tt.want, got) + assert.Equal(t, tt.wantText, gotText) + assert.Equal(t, tt.wantFound, gotFound) }) } } diff --git a/internal/releasepr/releasepr.go b/internal/releasepr/releasepr.go index c19451e..505b3c0 100644 --- a/internal/releasepr/releasepr.go +++ b/internal/releasepr/releasepr.go @@ -28,14 +28,9 @@ func init() { } } -// ReleasePullRequest -// -// TODO: Reuse [git.PullRequest] type ReleasePullRequest struct { - ID int - Title string - Description string - Labels []Label + git.PullRequest + Labels []Label Head string ReleaseCommit *git.Commit @@ -137,8 +132,8 @@ func (pr *ReleasePullRequest) parseDescription(overrides ReleaseOverrides) (Rele source := []byte(pr.Description) err := markdown.WalkAST(source, - markdown.GetCodeBlockText(source, DescriptionLanguagePrefix, &overrides.Prefix), - markdown.GetCodeBlockText(source, DescriptionLanguageSuffix, &overrides.Suffix), + markdown.GetCodeBlockText(source, DescriptionLanguagePrefix, &overrides.Prefix, nil), + markdown.GetCodeBlockText(source, DescriptionLanguageSuffix, &overrides.Suffix, nil), ) if err != nil { return ReleaseOverrides{}, err diff --git a/internal/releasepr/releasepr_test.go b/internal/releasepr/releasepr_test.go index 64295de..09beaae 100644 --- a/internal/releasepr/releasepr_test.go +++ b/internal/releasepr/releasepr_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/assert" + "github.com/apricote/releaser-pleaser/internal/git" "github.com/apricote/releaser-pleaser/internal/versioning" ) @@ -36,7 +37,9 @@ func TestReleasePullRequest_GetOverrides(t *testing.T) { { name: "prefix in description", pr: ReleasePullRequest{ - Description: "```rp-prefix\n## Foo\n\n- Cool thing\n```", + PullRequest: git.PullRequest{ + Description: "```rp-prefix\n## Foo\n\n- Cool thing\n```", + }, }, want: ReleaseOverrides{Prefix: "## Foo\n\n- Cool thing"}, wantErr: assert.NoError, @@ -44,7 +47,9 @@ func TestReleasePullRequest_GetOverrides(t *testing.T) { { name: "suffix in description", pr: ReleasePullRequest{ - Description: "```rp-suffix\n## Compatibility\n\nNo compatibility guarantees.\n```", + PullRequest: git.PullRequest{ + Description: "```rp-suffix\n## Compatibility\n\nNo compatibility guarantees.\n```", + }, }, want: ReleaseOverrides{Suffix: "## Compatibility\n\nNo compatibility guarantees."}, wantErr: assert.NoError, @@ -105,7 +110,9 @@ Suffix Things for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { pr := &ReleasePullRequest{ - Description: tt.description, + PullRequest: git.PullRequest{ + Description: tt.description, + }, } got, err := pr.ChangelogText() if !tt.wantErr(t, err, fmt.Sprintf("ChangelogText()")) { @@ -129,7 +136,11 @@ func TestReleasePullRequest_SetTitle(t *testing.T) { }{ { name: "simple update", - pr: &ReleasePullRequest{Title: "foo: bar"}, + pr: &ReleasePullRequest{ + PullRequest: git.PullRequest{ + Title: "foo: bar", + }, + }, args: args{ branch: "main", version: "v1.0.0", diff --git a/prbody.go b/prbody.go new file mode 100644 index 0000000..46388d6 --- /dev/null +++ b/prbody.go @@ -0,0 +1,57 @@ +package rp + +import ( + "strings" + + "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/markdown" +) + +func parsePRBodyForCommitOverrides(commits []git.Commit) ([]git.Commit, error) { + result := make([]git.Commit, 0, len(commits)) + + for _, commit := range commits { + singleResult, err := parseSinglePRBodyForCommitOverrides(commit) + if err != nil { + return nil, err + } + + result = append(result, singleResult...) + } + + return result, nil +} + +func parseSinglePRBodyForCommitOverrides(commit git.Commit) ([]git.Commit, error) { + if commit.PullRequest == nil { + return []git.Commit{commit}, nil + } + + source := []byte(commit.PullRequest.Description) + var overridesText string + var found bool + err := markdown.WalkAST(source, markdown.GetCodeBlockText(source, "rp-commits", &overridesText, &found)) + if err != nil { + return nil, err + } + + if !found { + return []git.Commit{commit}, nil + } + + lines := strings.Split(overridesText, "\n") + result := make([]git.Commit, 0, len(lines)) + for _, line := range lines { + // Only consider lines with text + line = strings.TrimSpace(line) + if line == "" { + continue + } + + newCommit := commit + newCommit.Message = line + result = append(result, newCommit) + } + + return result, nil +} diff --git a/prbody_test.go b/prbody_test.go new file mode 100644 index 0000000..dd86336 --- /dev/null +++ b/prbody_test.go @@ -0,0 +1,242 @@ +package rp + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/apricote/releaser-pleaser/internal/git" +) + +func Test_parsePRBodyForCommitOverrides(t *testing.T) { + tests := []struct { + name string + commits []git.Commit + want []git.Commit + wantErr assert.ErrorAssertionFunc + }{ + { + name: "no commits", + commits: []git.Commit{}, + want: []git.Commit{}, + wantErr: assert.NoError, + }, + { + name: "single commit", + commits: []git.Commit{ + { + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n", + }, + }, + }, + want: []git.Commit{ + { + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n", + }, + }, + }, + wantErr: assert.NoError, + }, + { + name: "multiple commits", + commits: []git.Commit{ + { + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\nfeat: shiny\nfix: boom\n```\n", + }, + }, + { + Hash: "456", + Message: "654", + PullRequest: &git.PullRequest{ + ID: 2, + Title: "Bar", + Description: "# Foobazzle\n\n", + }, + }, + }, + want: []git.Commit{ + { + Hash: "123", + Message: "feat: shiny", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\nfeat: shiny\nfix: boom\n```\n", + }, + }, + { + Hash: "123", + Message: "fix: boom", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\nfeat: shiny\nfix: boom\n```\n", + }, + }, + { + Hash: "456", + Message: "654", + PullRequest: &git.PullRequest{ + ID: 2, + Title: "Bar", + Description: "# Foobazzle\n\n", + }, + }, + }, + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := parsePRBodyForCommitOverrides(tt.commits) + if !tt.wantErr(t, err) { + return + } + assert.Equal(t, tt.want, got) + }) + } +} + +func Test_parseSinglePRBodyForCommitOverrides(t *testing.T) { + tests := []struct { + name string + commit git.Commit + want []git.Commit + wantErr assert.ErrorAssertionFunc + }{ + { + name: "same commit if no PR is available", + commit: git.Commit{ + Hash: "123", + Message: "321", + PullRequest: nil, + }, + want: []git.Commit{ + { + Hash: "123", + Message: "321", + }, + }, + wantErr: assert.NoError, + }, + { + name: "same commit if no overrides are defined", + commit: git.Commit{ + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n", + }, + }, + want: []git.Commit{ + { + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n", + }, + }, + }, + wantErr: assert.NoError, + }, + { + name: "no commit if override is defined but empty", + commit: git.Commit{ + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "```rp-commits\n```\n", + }, + }, + want: []git.Commit{}, + wantErr: assert.NoError, + }, + { + name: "commit messages from override", + commit: git.Commit{ + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\nfeat: shiny\nfix: boom\n```\n", + }, + }, + want: []git.Commit{ + { + Hash: "123", + Message: "feat: shiny", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\nfeat: shiny\nfix: boom\n```\n", + }, + }, + { + Hash: "123", + Message: "fix: boom", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\nfeat: shiny\nfix: boom\n```\n", + }, + }, + }, + wantErr: assert.NoError, + }, + { + name: "ignore empty lines", + commit: git.Commit{ + Hash: "123", + Message: "321", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\n\n \nfeat: shiny\n\n```\n", + }, + }, + want: []git.Commit{ + { + Hash: "123", + Message: "feat: shiny", + PullRequest: &git.PullRequest{ + ID: 1, + Title: "Foo", + Description: "# Cool new thingy\n\n```rp-commits\n\n \nfeat: shiny\n\n```\n", + }, + }, + }, + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got, err := parseSinglePRBodyForCommitOverrides(tt.commit) + if !tt.wantErr(t, err) { + return + } + assert.Equal(t, tt.want, got) + }) + } +} diff --git a/releaserpleaser.go b/releaserpleaser.go index 6e500f6..a846c16 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -188,15 +188,19 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { lastReleaseCommit = releases.Latest } - releasableCommits, err := rp.forge.CommitsSince(ctx, lastReleaseCommit) + commits, err := rp.forge.CommitsSince(ctx, lastReleaseCommit) if err != nil { return err } - logger.InfoContext(ctx, "Found releasable commits", "length", len(releasableCommits)) + commits, err = parsePRBodyForCommitOverrides(commits) + if err != nil { + return err + } - // TODO: Handle commit overrides - analyzedCommits, err := rp.commitParser.Analyze(releasableCommits) + logger.InfoContext(ctx, "Found releasable commits", "length", len(commits)) + + analyzedCommits, err := rp.commitParser.Analyze(commits) if err != nil { return err } From b9dd0f986ce5d56a39b5d29332b3bec631093c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 6 Sep 2024 23:27:48 +0200 Subject: [PATCH 009/260] 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. --- internal/forge/forge.go | 1 + internal/forge/github/github.go | 4 ++++ releaserpleaser.go | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/forge/forge.go b/internal/forge/forge.go index a5f418d..0bd119a 100644 --- a/internal/forge/forge.go +++ b/internal/forge/forge.go @@ -13,6 +13,7 @@ type Forge interface { RepoURL() string CloneURL() string ReleaseURL(version string) string + PullRequestURL(id int) string GitAuth() transport.AuthMethod diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index e7f6f97..d96fc9d 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -51,6 +51,10 @@ func (g *GitHub) ReleaseURL(version string) string { return fmt.Sprintf("https://github.com/%s/%s/releases/tag/%s", g.options.Owner, g.options.Repo, version) } +func (g *GitHub) PullRequestURL(id int) string { + return fmt.Sprintf("https://github.com/%s/%s/pull/%d", g.options.Owner, g.options.Repo, id) +} + func (g *GitHub) GitAuth() transport.AuthMethod { return &http.BasicAuth{ Username: g.options.Username, diff --git a/releaserpleaser.go b/releaserpleaser.go index a846c16..a69ef9e 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -300,7 +300,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { if err != nil { return err } - logger.InfoContext(ctx, "opened pull request", "pr.title", pr.Title, "pr.id", pr.ID) + logger.InfoContext(ctx, "opened pull request", "pr.title", pr.Title, "pr.id", pr.ID, "pr.url", rp.forge.PullRequestURL(pr.ID)) } else { pr.SetTitle(rp.targetBranch, nextVersion) @@ -317,7 +317,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { if err != nil { return err } - logger.InfoContext(ctx, "updated pull request", "pr.title", pr.Title, "pr.id", pr.ID) + logger.InfoContext(ctx, "updated pull request", "pr.title", pr.Title, "pr.id", pr.ID, "pr.url", rp.forge.PullRequestURL(pr.ID)) } return nil From 0a199e693f648e3a8d7c6962d8b23e8473be2d92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 6 Sep 2024 23:46:04 +0200 Subject: [PATCH 010/260] chore(main): release v0.3.0 (#38) Co-authored-by: releaser-pleaser <> --- CHANGELOG.md | 19 +++++++++++++++++++ action.yml | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e26396b..eb47b20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [v0.3.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.3.0) + +### :sparkles: Highlights + +#### Cleaner pre-release Release Notes + +From now on if you create multiple pre-releases in a row, the release notes will only include changes since the last pre-release. Once you decide to create a stable release, the release notes will be in comparison to the last stable release. + +#### Edit pull request after merging. + +You can now edit the message for a pull request after merging by adding a \```rp-commits code block into the pull request body. Learn more in the [Release Notes Guide](https://apricote.github.io/releaser-pleaser/guides/release-notes.html#editing-the-release-notes). + +### Features + +- less repetitive entries for prerelease changelogs #37 +- format markdown in changelog entry (#41) +- edit commit message after merging through PR (#43) +- **cli**: show release PR url in log messages (#44) + ## [v0.2.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0) ### Features diff --git a/action.yml b/action.yml index 0a488b2..8e3b8e1 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: ghcr.io/apricote/releaser-pleaser:v0.2.0 # x-releaser-pleaser-version + image: ghcr.io/apricote/releaser-pleaser:v0.3.0 # x-releaser-pleaser-version args: - run - --forge=github From af505c94c601db2a49682c853d2779c04475f3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 7 Sep 2024 21:33:28 +0200 Subject: [PATCH 011/260] refactor: labels as structs with descriptions (#46) --- internal/forge/github/github.go | 24 ++++++++------- internal/releasepr/label.go | 53 +++++++++++++++++++++++++++++++++ internal/releasepr/releasepr.go | 23 -------------- 3 files changed, 66 insertions(+), 34 deletions(-) diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index d96fc9d..90024eb 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -27,7 +27,6 @@ const ( EnvAPIToken = "GITHUB_TOKEN" // nolint:gosec // Not actually a hardcoded credential EnvUsername = "GITHUB_USER" EnvRepository = "GITHUB_REPOSITORY" - LabelColor = "dedede" ) var _ forge.Forge = &GitHub{} @@ -298,13 +297,14 @@ func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label } for _, label := range labels { - if !slices.Contains(existingLabels, string(label)) { - g.log.Info("creating label in repository", "label.name", label) + if !slices.Contains(existingLabels, label.Name) { + g.log.Info("creating label in repository", "label.name", label.Name) _, _, err := g.client.Issues.CreateLabel( ctx, g.options.Owner, g.options.Repo, &github.Label{ - Name: pointer.Pointer(string(label)), - Color: pointer.Pointer(LabelColor), + Name: pointer.Pointer(label.Name), + Color: pointer.Pointer(label.Color), + Description: pointer.Pointer(label.Description), }, ) if err != nil { @@ -393,7 +393,7 @@ func (g *GitHub) SetPullRequestLabels(ctx context.Context, pr *releasepr.Release for _, label := range remove { _, err := g.client.Issues.RemoveLabelForIssue( ctx, g.options.Owner, g.options.Repo, - pr.ID, string(label), + pr.ID, label.Name, ) if err != nil { return err @@ -402,7 +402,7 @@ func (g *GitHub) SetPullRequestLabels(ctx context.Context, pr *releasepr.Release addString := make([]string, 0, len(add)) for _, label := range add { - addString = append(addString, string(label)) + addString = append(addString, label.Name) } _, _, err := g.client.Issues.AddLabelsToIssue( @@ -458,7 +458,7 @@ func (g *GitHub) PendingReleases(ctx context.Context, pendingLabel releasepr.Lab for _, pr := range ghPRs { pending := slices.ContainsFunc(pr.Labels, func(l *github.Label) bool { - return l.GetName() == string(pendingLabel) + return l.GetName() == pendingLabel.Name }) if !pending { continue @@ -518,9 +518,11 @@ func gitHubPRToPullRequest(pr *github.PullRequest) *git.PullRequest { func gitHubPRToReleasePullRequest(pr *github.PullRequest) *releasepr.ReleasePullRequest { labels := make([]releasepr.Label, 0, len(pr.Labels)) for _, label := range pr.Labels { - labelName := releasepr.Label(label.GetName()) - if slices.Contains(releasepr.KnownLabels, releasepr.Label(label.GetName())) { - labels = append(labels, labelName) + labelName := label.GetName() + if i := slices.IndexFunc(releasepr.KnownLabels, func(label releasepr.Label) bool { + return label.Name == labelName + }); i >= 0 { + labels = append(labels, releasepr.KnownLabels[i]) } } diff --git a/internal/releasepr/label.go b/internal/releasepr/label.go index 518eb87..7b529be 100644 --- a/internal/releasepr/label.go +++ b/internal/releasepr/label.go @@ -1 +1,54 @@ package releasepr + +// Label is the string identifier of a pull/merge request label on the forge. +type Label struct { + Color string + Name string + Description string +} + +var ( + LabelNextVersionTypeNormal = Label{ + Color: "EFC15B", + Name: "rp-next-version::normal", + Description: "Request a stable version", + } + LabelNextVersionTypeRC = Label{ + Color: "EFC15B", + Name: "rp-next-version::rc", + Description: "Request a pre-release -rc version", + } + LabelNextVersionTypeBeta = Label{ + Color: "EFC15B", + Name: "rp-next-version::beta", + Description: "Request a pre-release -beta version", + } + LabelNextVersionTypeAlpha = Label{ + Color: "EFC15B", + Name: "rp-next-version::alpha", + Description: "Request a pre-release -alpha version", + } +) + +var ( + LabelReleasePending = Label{ + Color: "DEDEDE", + Name: "rp-release::pending", + Description: "Release for this PR is pending", + } + LabelReleaseTagged = Label{ + Color: "0E8A16", + Name: "rp-release::tagged", + Description: "Release for this PR is created", + } +) + +var KnownLabels = []Label{ + LabelNextVersionTypeNormal, + LabelNextVersionTypeRC, + LabelNextVersionTypeBeta, + LabelNextVersionTypeAlpha, + + LabelReleasePending, + LabelReleaseTagged, +} diff --git a/internal/releasepr/releasepr.go b/internal/releasepr/releasepr.go index 505b3c0..22eac0a 100644 --- a/internal/releasepr/releasepr.go +++ b/internal/releasepr/releasepr.go @@ -36,9 +36,6 @@ type ReleasePullRequest struct { ReleaseCommit *git.Commit } -// Label is the string identifier of a pull/merge request label on the forge. -type Label string - func NewReleasePullRequest(head, branch, version, changelogEntry string) (*ReleasePullRequest, error) { rp := &ReleasePullRequest{ Head: head, @@ -59,26 +56,6 @@ type ReleaseOverrides struct { NextVersionType versioning.NextVersionType } -const ( - LabelNextVersionTypeNormal Label = "rp-next-version::normal" - LabelNextVersionTypeRC Label = "rp-next-version::rc" - LabelNextVersionTypeBeta Label = "rp-next-version::beta" - LabelNextVersionTypeAlpha Label = "rp-next-version::alpha" - - LabelReleasePending Label = "rp-release::pending" - LabelReleaseTagged Label = "rp-release::tagged" -) - -var KnownLabels = []Label{ - LabelNextVersionTypeNormal, - LabelNextVersionTypeRC, - LabelNextVersionTypeBeta, - LabelNextVersionTypeAlpha, - - LabelReleasePending, - LabelReleaseTagged, -} - const ( DescriptionLanguagePrefix = "rp-prefix" DescriptionLanguageSuffix = "rp-suffix" From 2010ac11431f32eb37de075f6eae3af6e97e2914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 7 Sep 2024 21:36:17 +0200 Subject: [PATCH 012/260] refactor(github): add pagination helper (#47) --- internal/forge/github/github.go | 336 +++++++++++++------------------- 1 file changed, 131 insertions(+), 205 deletions(-) diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index 90024eb..11180f2 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -64,52 +64,44 @@ func (g *GitHub) GitAuth() transport.AuthMethod { func (g *GitHub) LatestTags(ctx context.Context) (git.Releases, error) { g.log.DebugContext(ctx, "listing all tags in github repository") - page := 1 + tags, err := all(func(listOptions github.ListOptions) ([]*github.RepositoryTag, *github.Response, error) { + return g.client.Repositories.ListTags( + ctx, g.options.Owner, g.options.Repo, + &listOptions, + ) + }) + if err != nil { + return git.Releases{}, err + } var releases git.Releases - for { - tags, resp, err := g.client.Repositories.ListTags( - ctx, g.options.Owner, g.options.Repo, - &github.ListOptions{Page: page, PerPage: PerPageMax}, - ) + for _, ghTag := range tags { + tag := &git.Tag{ + Hash: ghTag.GetCommit().GetSHA(), + Name: ghTag.GetName(), + } + + version, err := semver.Parse(strings.TrimPrefix(tag.Name, "v")) if err != nil { - return git.Releases{}, err + g.log.WarnContext( + ctx, "unable to parse tag as semver, skipping", + "tag.name", tag.Name, + "tag.hash", tag.Hash, + "error", err, + ) + continue } - for _, ghTag := range tags { - tag := &git.Tag{ - Hash: ghTag.GetCommit().GetSHA(), - Name: ghTag.GetName(), - } - - version, err := semver.Parse(strings.TrimPrefix(tag.Name, "v")) - if err != nil { - g.log.WarnContext( - ctx, "unable to parse tag as semver, skipping", - "tag.name", tag.Name, - "tag.hash", tag.Hash, - "error", err, - ) - continue - } - - if releases.Latest == nil { - releases.Latest = tag - } - if len(version.Pre) == 0 { - // Stable version tag - // We return once we have found the latest stable tag, not needed to look at every single tag. - releases.Stable = tag - break - } + if releases.Latest == nil { + releases.Latest = tag } - - if page == resp.LastPage || resp.LastPage == 0 { + if len(version.Pre) == 0 { + // Stable version tag + // We return once we have found the latest stable tag, not needed to look at every single tag. + releases.Stable = tag break } - - page = resp.NextPage } return releases, nil @@ -150,34 +142,19 @@ func (g *GitHub) commitsSinceTag(ctx context.Context, tag *git.Tag) ([]*github.R log := g.log.With("base", tag.Hash, "head", head) log.Debug("comparing commits", "base", tag.Hash, "head", head) - page := 1 + repositoryCommits, err := all( + func(listOptions github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) { + comparison, resp, err := g.client.Repositories.CompareCommits( + ctx, g.options.Owner, g.options.Repo, + tag.Hash, head, &listOptions) + if err != nil { + return nil, nil, err + } - var repositoryCommits []*github.RepositoryCommit - for { - log.Debug("fetching page", "page", page) - comparison, resp, err := g.client.Repositories.CompareCommits( - ctx, g.options.Owner, g.options.Repo, - tag.Hash, head, &github.ListOptions{ - Page: page, - PerPage: PerPageMax, - }) - if err != nil { - return nil, err - } - - if repositoryCommits == nil { - // Pre-initialize slice on first request - log.Debug("found commits", "length", comparison.GetTotalCommits()) - repositoryCommits = make([]*github.RepositoryCommit, 0, comparison.GetTotalCommits()) - } - - repositoryCommits = append(repositoryCommits, comparison.Commits...) - - if page == resp.LastPage || resp.LastPage == 0 { - break - } - - page = resp.NextPage + return comparison.Commits, resp, err + }) + if err != nil { + return nil, err } return repositoryCommits, nil @@ -188,37 +165,17 @@ func (g *GitHub) commitsSinceInit(ctx context.Context) ([]*github.RepositoryComm log := g.log.With("head", head) log.Debug("listing all commits") - page := 1 - - var repositoryCommits []*github.RepositoryCommit - for { - log.Debug("fetching page", "page", page) - commits, resp, err := g.client.Repositories.ListCommits( - ctx, g.options.Owner, g.options.Repo, - &github.CommitsListOptions{ - SHA: head, - ListOptions: github.ListOptions{ - Page: page, - PerPage: PerPageMax, - }, - }) - if err != nil { - return nil, err - } - - if repositoryCommits == nil && resp.LastPage > 0 { - // Pre-initialize slice on first request - log.Debug("found commits", "pages", resp.LastPage) - repositoryCommits = make([]*github.RepositoryCommit, 0, resp.LastPage*PerPageMax) - } - - repositoryCommits = append(repositoryCommits, commits...) - - if page == resp.LastPage || resp.LastPage == 0 { - break - } - - page = resp.NextPage + repositoryCommits, err := all( + func(listOptions github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) { + return g.client.Repositories.ListCommits( + ctx, g.options.Owner, g.options.Repo, + &github.CommitsListOptions{ + SHA: head, + ListOptions: listOptions, + }) + }) + if err != nil { + return nil, err } return repositoryCommits, nil @@ -230,76 +187,50 @@ func (g *GitHub) prForCommit(ctx context.Context, commit git.Commit) (*git.PullR // Using the "List pull requests" endpoint might be faster, as it allows us to fetch 100 arbitrary PRs per request, // but worst case we need to look up all PRs made in the repository ever. - log := g.log.With("commit.hash", commit.Hash) - page := 1 - var associatedPRs []*github.PullRequest + g.log.Debug("fetching pull requests associated with commit", "commit.hash", commit.Hash) - for { - log.Debug("fetching pull requests associated with commit", "page", page) - prs, resp, err := g.client.PullRequests.ListPullRequestsWithCommit( - ctx, g.options.Owner, g.options.Repo, - commit.Hash, &github.ListOptions{ - Page: page, - PerPage: PerPageMax, - }) - if err != nil { - return nil, err - } - - associatedPRs = append(associatedPRs, prs...) - - if page == resp.LastPage || resp.LastPage == 0 { - break - } - page = resp.NextPage + associatedPRs, err := all( + func(listOptions github.ListOptions) ([]*github.PullRequest, *github.Response, error) { + return g.client.PullRequests.ListPullRequestsWithCommit( + ctx, g.options.Owner, g.options.Repo, + commit.Hash, &listOptions) + }) + if err != nil { + return nil, err } - var pullrequest *github.PullRequest + var pullRequest *github.PullRequest for _, pr := range associatedPRs { // We only look for the PR that has this commit set as the "merge commit" => The result of squashing this branch onto main if pr.GetMergeCommitSHA() == commit.Hash { - pullrequest = pr + pullRequest = pr break } } - if pullrequest == nil { + if pullRequest == nil { return nil, nil } - return gitHubPRToPullRequest(pullrequest), nil + return gitHubPRToPullRequest(pullRequest), nil } func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label) error { - existingLabels := make([]string, 0, len(labels)) - - page := 1 - - for { - g.log.Debug("fetching labels on repo", "page", page) - ghLabels, resp, err := g.client.Issues.ListLabels( + g.log.Debug("fetching labels on repo") + ghLabels, err := all(func(listOptions github.ListOptions) ([]*github.Label, *github.Response, error) { + return g.client.Issues.ListLabels( ctx, g.options.Owner, g.options.Repo, - &github.ListOptions{ - Page: page, - PerPage: PerPageMax, - }) - if err != nil { - return err - } - - for _, label := range ghLabels { - existingLabels = append(existingLabels, label.GetName()) - } - - if page == resp.LastPage || resp.LastPage == 0 { - break - } - page = resp.NextPage + &listOptions) + }) + if err != nil { + return err } for _, label := range labels { - if !slices.Contains(existingLabels, label.Name) { + if !slices.ContainsFunc(ghLabels, func(ghLabel *github.Label) bool { + return ghLabel.GetName() == label.Name + }) { g.log.Info("creating label in repository", "label.name", label.Name) - _, _, err := g.client.Issues.CreateLabel( + _, _, err = g.client.Issues.CreateLabel( ctx, g.options.Owner, g.options.Repo, &github.Label{ Name: pointer.Pointer(label.Name), @@ -317,33 +248,25 @@ func (g *GitHub) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label } func (g *GitHub) PullRequestForBranch(ctx context.Context, branch string) (*releasepr.ReleasePullRequest, error) { - page := 1 - for { - prs, resp, err := g.client.PullRequests.ListPullRequestsWithCommit(ctx, g.options.Owner, g.options.Repo, branch, &github.ListOptions{ - Page: page, - PerPage: PerPageMax, + prs, err := all( + func(listOptions github.ListOptions) ([]*github.PullRequest, *github.Response, error) { + return g.client.PullRequests.ListPullRequestsWithCommit(ctx, g.options.Owner, g.options.Repo, branch, &listOptions) }) - if err != nil { - var ghErr *github.ErrorResponse - if errors.As(err, &ghErr) { - if ghErr.Message == fmt.Sprintf("No commit found for SHA: %s", branch) { - return nil, nil - } - } - return nil, err - } - - for _, pr := range prs { - if pr.GetBase().GetRef() == g.options.BaseBranch && pr.GetHead().GetRef() == branch && pr.GetState() == PRStateOpen { - return gitHubPRToReleasePullRequest(pr), nil + if err != nil { + var ghErr *github.ErrorResponse + if errors.As(err, &ghErr) { + if ghErr.Message == fmt.Sprintf("No commit found for SHA: %s", branch) { + return nil, nil } } + return nil, err + } - if page == resp.LastPage || resp.LastPage == 0 { - break + for _, pr := range prs { + if pr.GetBase().GetRef() == g.options.BaseBranch && pr.GetHead().GetRef() == branch && pr.GetState() == PRStateOpen { + return gitHubPRToReleasePullRequest(pr), nil } - page = resp.NextPage } return nil, nil @@ -431,52 +354,36 @@ func (g *GitHub) ClosePullRequest(ctx context.Context, pr *releasepr.ReleasePull } func (g *GitHub) PendingReleases(ctx context.Context, pendingLabel releasepr.Label) ([]*releasepr.ReleasePullRequest, error) { - page := 1 - - var prs []*releasepr.ReleasePullRequest - - for { - ghPRs, resp, err := g.client.PullRequests.List( + ghPRs, err := all(func(listOptions github.ListOptions) ([]*github.PullRequest, *github.Response, error) { + return g.client.PullRequests.List( ctx, g.options.Owner, g.options.Repo, &github.PullRequestListOptions{ - State: PRStateClosed, - Base: g.options.BaseBranch, - ListOptions: github.ListOptions{ - Page: page, - PerPage: PerPageMax, - }, + State: PRStateClosed, + Base: g.options.BaseBranch, + ListOptions: listOptions, }) - if err != nil { - return nil, err + }) + if err != nil { + return nil, err + } + + prs := make([]*releasepr.ReleasePullRequest, 0, len(ghPRs)) + + for _, pr := range ghPRs { + pending := slices.ContainsFunc(pr.Labels, func(l *github.Label) bool { + return l.GetName() == pendingLabel.Name + }) + if !pending { + continue } - if prs == nil && resp.LastPage > 0 { - // Pre-initialize slice on first request - g.log.Debug("found pending releases", "pages", resp.LastPage) - prs = make([]*releasepr.ReleasePullRequest, 0, (resp.LastPage-1)*PerPageMax) + // pr.Merged is always nil :( + if pr.MergedAt == nil { + // Closed and not merged + continue } - for _, pr := range ghPRs { - pending := slices.ContainsFunc(pr.Labels, func(l *github.Label) bool { - return l.GetName() == pendingLabel.Name - }) - if !pending { - continue - } - - // pr.Merged is always nil :( - if pr.MergedAt == nil { - // Closed and not merged - continue - } - - prs = append(prs, gitHubPRToReleasePullRequest(pr)) - } - - if page == resp.LastPage || resp.LastPage == 0 { - break - } - page = resp.NextPage + prs = append(prs, gitHubPRToReleasePullRequest(pr)) } return prs, nil @@ -507,6 +414,25 @@ func (g *GitHub) CreateRelease(ctx context.Context, commit git.Commit, title, ch return nil } +func all[T any](f func(listOptions github.ListOptions) ([]T, *github.Response, error)) ([]T, error) { + results := make([]T, 0) + page := 1 + + for { + pageResults, resp, err := f(github.ListOptions{Page: page, PerPage: PerPageMax}) + if err != nil { + return nil, err + } + + results = append(results, pageResults...) + + if page == resp.LastPage || resp.LastPage == 0 { + return results, nil + } + page = resp.NextPage + } +} + func gitHubPRToPullRequest(pr *github.PullRequest) *git.PullRequest { return &git.PullRequest{ ID: pr.GetNumber(), From 5ea41654a78d1670d48aaffe52184c38546e31c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 7 Sep 2024 21:51:15 +0200 Subject: [PATCH 013/260] 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. --- cmd/rp/cmd/run.go | 2 +- .../conventionalcommits/conventionalcommits.go | 9 +++++++-- .../conventionalcommits/conventionalcommits_test.go | 9 +++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index de10927..d0fc0ab 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -71,7 +71,7 @@ func run(cmd *cobra.Command, _ []string) error { f, logger, flagBranch, - conventionalcommits.NewParser(), + conventionalcommits.NewParser(logger), versioning.SemVerNextVersion, extraFiles, []updater.NewUpdater{updater.Generic}, diff --git a/internal/commitparser/conventionalcommits/conventionalcommits.go b/internal/commitparser/conventionalcommits/conventionalcommits.go index 665a02d..b253354 100644 --- a/internal/commitparser/conventionalcommits/conventionalcommits.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits.go @@ -2,6 +2,7 @@ package conventionalcommits import ( "fmt" + "log/slog" "github.com/leodido/go-conventionalcommits" "github.com/leodido/go-conventionalcommits/parser" @@ -12,9 +13,10 @@ import ( type Parser struct { machine conventionalcommits.Machine + logger *slog.Logger } -func NewParser() *Parser { +func NewParser(logger *slog.Logger) *Parser { parserMachine := parser.NewMachine( parser.WithBestEffort(), parser.WithTypes(conventionalcommits.TypesConventional), @@ -22,6 +24,7 @@ func NewParser() *Parser { return &Parser{ machine: parserMachine, + logger: logger, } } @@ -31,8 +34,10 @@ func (c *Parser) Analyze(commits []git.Commit) ([]commitparser.AnalyzedCommit, e for _, commit := range commits { msg, err := c.machine.Parse([]byte(commit.Message)) if err != nil { - return nil, fmt.Errorf("failed to parse message of commit %q: %w", commit.Hash, err) + c.logger.Warn("failed to parse message of commit, skipping", "commit.hash", commit.Hash, "err", err) + continue } + conventionalCommit, ok := msg.(*conventionalcommits.ConventionalCommit) if !ok { return nil, fmt.Errorf("unable to get ConventionalCommit from parser result: %T", msg) diff --git a/internal/commitparser/conventionalcommits/conventionalcommits_test.go b/internal/commitparser/conventionalcommits/conventionalcommits_test.go index 837035b..bc969de 100644 --- a/internal/commitparser/conventionalcommits/conventionalcommits_test.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits_test.go @@ -1,6 +1,7 @@ package conventionalcommits import ( + "log/slog" "testing" "github.com/stretchr/testify/assert" @@ -23,14 +24,14 @@ func TestAnalyzeCommits(t *testing.T) { wantErr: assert.NoError, }, { - name: "malformed commit message", + name: "skips malformed commit message", commits: []git.Commit{ { Message: "aksdjaklsdjka", }, }, - expectedCommits: nil, - wantErr: assert.Error, + expectedCommits: []commitparser.AnalyzedCommit{}, + wantErr: assert.NoError, }, { name: "drops unreleasable", @@ -114,7 +115,7 @@ func TestAnalyzeCommits(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - analyzedCommits, err := NewParser().Analyze(tt.commits) + analyzedCommits, err := NewParser(slog.Default()).Analyze(tt.commits) if !tt.wantErr(t, err) { return } From 48d9ede0a27fe34711d04dc0759f32259dcb6e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 7 Sep 2024 21:54:25 +0200 Subject: [PATCH 014/260] feat: add support for GitLab repositories (#49) --- cmd/rp/cmd/run.go | 21 +- go.mod | 8 + go.sum | 31 +++ internal/forge/github/github.go | 2 +- internal/forge/gitlab/gitlab.go | 429 ++++++++++++++++++++++++++++++-- 5 files changed, 472 insertions(+), 19 deletions(-) diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index d0fc0ab..55ca419 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -1,6 +1,7 @@ package cmd import ( + "fmt" "strings" "github.com/spf13/cobra" @@ -9,6 +10,7 @@ import ( "github.com/apricote/releaser-pleaser/internal/commitparser/conventionalcommits" "github.com/apricote/releaser-pleaser/internal/forge" "github.com/apricote/releaser-pleaser/internal/forge/github" + "github.com/apricote/releaser-pleaser/internal/forge/gitlab" "github.com/apricote/releaser-pleaser/internal/updater" "github.com/apricote/releaser-pleaser/internal/versioning" ) @@ -39,6 +41,8 @@ func init() { func run(cmd *cobra.Command, _ []string) error { ctx := cmd.Context() + var err error + logger.DebugContext(ctx, "run called", "forge", flagForge, "branch", flagBranch, @@ -53,9 +57,18 @@ func run(cmd *cobra.Command, _ []string) error { BaseBranch: flagBranch, } - switch flagForge { // nolint:gocritic // Will become a proper switch once gitlab is added - // case "gitlab": - // f = rp.NewGitLab(forgeOptions) + switch flagForge { + case "gitlab": + logger.DebugContext(ctx, "using forge GitLab") + f, err = gitlab.New(logger, &gitlab.Options{ + Options: forgeOptions, + Path: flagOwner, + Repo: flagRepo, + }) + if err != nil { + logger.ErrorContext(ctx, "failed to create client", "err", err) + return fmt.Errorf("failed to create gitlab client: %w", err) + } case "github": logger.DebugContext(ctx, "using forge GitHub") f = github.New(logger, &github.Options{ @@ -63,6 +76,8 @@ func run(cmd *cobra.Command, _ []string) error { Owner: flagOwner, Repo: flagRepo, }) + default: + return fmt.Errorf("unknown --forge: %s", flagForge) } extraFiles := parseExtraFiles(flagExtraFiles) diff --git a/go.mod b/go.mod index 7e7b81f..0175391 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 + github.com/xanzy/go-gitlab v0.109.0 github.com/yuin/goldmark v1.7.4 ) @@ -24,7 +25,10 @@ require ( github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-querystring v1.1.0 // indirect + github.com/hashicorp/go-cleanhttp v0.5.2 // indirect + github.com/hashicorp/go-retryablehttp v0.7.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -37,7 +41,11 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.26.0 // indirect golang.org/x/net v0.28.0 // indirect + golang.org/x/oauth2 v0.6.0 // indirect golang.org/x/sys v0.24.0 // indirect + golang.org/x/time v0.3.0 // indirect + google.golang.org/appengine v1.6.7 // indirect + google.golang.org/protobuf v1.29.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 65568ec..d2a734e 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,8 @@ github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcej github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= @@ -37,13 +39,24 @@ github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZt github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v63 v63.0.0 h1:13xwK/wk9alSokujB9lJkuzdmQuVn2QCPeck76wR3nE= github.com/google/go-github/v63 v63.0.0/go.mod h1:IqbcrgUmIcEaioWrGYei/09o+ge5vhffGOcxrO0AfmA= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= +github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= +github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= +github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -59,6 +72,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-conventionalcommits v0.12.0 h1:pG01rl8Ze+mxnSSVB2wPdGASXyyU25EGwLUc0bWrmKc= github.com/leodido/go-conventionalcommits v0.12.0/go.mod h1:DW+n8pQb5w/c7Vba7iGOMS3rkbPqykVlnrDykGjlsJM= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= @@ -91,6 +108,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= +github.com/xanzy/go-gitlab v0.109.0 h1:RcRme5w8VpLXTSTTMZdVoQWY37qTJWg+gwdQl4aAttE= +github.com/xanzy/go-gitlab v0.109.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -105,6 +124,7 @@ golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -114,6 +134,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= +golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -140,6 +162,7 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= @@ -148,12 +171,20 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index 11180f2..363c306 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -140,7 +140,7 @@ func (g *GitHub) CommitsSince(ctx context.Context, tag *git.Tag) ([]git.Commit, func (g *GitHub) commitsSinceTag(ctx context.Context, tag *git.Tag) ([]*github.RepositoryCommit, error) { head := g.options.BaseBranch log := g.log.With("base", tag.Hash, "head", head) - log.Debug("comparing commits", "base", tag.Hash, "head", head) + log.Debug("comparing commits") repositoryCommits, err := all( func(listOptions github.ListOptions) ([]*github.RepositoryCommit, *github.Response, error) { diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index 98a4252..8808773 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -1,31 +1,430 @@ package gitlab import ( + "context" "fmt" + "log/slog" + "os" + "slices" + "strings" + + "github.com/blang/semver/v4" + "github.com/go-git/go-git/v5/plumbing/transport" + "github.com/go-git/go-git/v5/plumbing/transport/http" + "github.com/xanzy/go-gitlab" "github.com/apricote/releaser-pleaser/internal/forge" + "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/pointer" + "github.com/apricote/releaser-pleaser/internal/releasepr" ) -// var _ forge.Forge = &GitLab{} +const ( + PerPageMax = 100 + PRStateOpen = "opened" + PRStateMerged = "merged" + PRStateEventClose = "close" + EnvAPIToken = "GITLAB_TOKEN" // nolint:gosec // Not actually a hardcoded credential +) type GitLab struct { - options forge.Options -} + options *Options -func (g *GitLab) autodiscover() { - // Read settings from GitLab-CI env vars -} - -func New(options forge.Options) *GitLab { - gl := &GitLab{ - options: options, - } - - gl.autodiscover() - - return gl + client *gitlab.Client + log *slog.Logger } func (g *GitLab) RepoURL() string { return fmt.Sprintf("https://gitlab.com/%s", g.options.Repository) } + +func (g *GitLab) CloneURL() string { + return fmt.Sprintf("https://gitlab.com/%s/%s.git", g.options.Path, g.options.Repo) +} + +func (g *GitLab) ReleaseURL(version string) string { + return fmt.Sprintf("https://gitlab.com/%s/%s/-/releases/%s", g.options.Path, g.options.Repo, version) +} + +func (g *GitLab) PullRequestURL(id int) string { + return fmt.Sprintf("https://gitlab.com/%s/%s/-/merge_requests/%d", g.options.Path, g.options.Repo, id) +} + +func (g *GitLab) GitAuth() transport.AuthMethod { + return &http.BasicAuth{ + // Username just needs to be any non-blank value + Username: "api-token", + Password: g.options.APIToken, + } +} + +func (g *GitLab) LatestTags(ctx context.Context) (git.Releases, error) { + g.log.DebugContext(ctx, "listing all tags in gitlab repository") + + tags, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.Tag, *gitlab.Response, error) { + return g.client.Tags.ListTags(g.options.ProjectID, &gitlab.ListTagsOptions{ + OrderBy: pointer.Pointer("updated"), + ListOptions: listOptions, + }, gitlab.WithContext(ctx)) + }) + if err != nil { + return git.Releases{}, err + } + + var releases git.Releases + for _, glTag := range tags { + tag := &git.Tag{ + Hash: glTag.Commit.ID, + Name: glTag.Name, + } + + version, err := semver.Parse(strings.TrimPrefix(tag.Name, "v")) + if err != nil { + g.log.WarnContext( + ctx, "unable to parse tag as semver, skipping", + "tag.name", tag.Name, + "tag.hash", tag.Hash, + "error", err, + ) + continue + } + + if releases.Latest == nil { + releases.Latest = tag + } + if len(version.Pre) == 0 { + // Stable version tag + // We return once we have found the latest stable tag, not needed to look at every single tag. + releases.Stable = tag + break + } + + } + + return releases, nil +} + +func (g *GitLab) CommitsSince(ctx context.Context, tag *git.Tag) ([]git.Commit, error) { + var err error + + head := g.options.BaseBranch + log := g.log.With("head", head) + + refName := "" + if tag != nil { + log = log.With("base", tag.Hash) + refName = fmt.Sprintf("%s..%s", tag.Hash, head) + } else { + refName = head + } + log.Debug("listing commits", "ref.name", refName) + + gitLabCommits, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.Commit, *gitlab.Response, error) { + return g.client.Commits.ListCommits(g.options.ProjectID, &gitlab.ListCommitsOptions{ + RefName: &refName, + ListOptions: listOptions, + }, gitlab.WithContext(ctx)) + }) + if err != nil { + return nil, err + } + + var commits = make([]git.Commit, 0, len(gitLabCommits)) + for _, ghCommit := range gitLabCommits { + commit := git.Commit{ + Hash: ghCommit.ID, + Message: ghCommit.Message, + } + commit.PullRequest, err = g.prForCommit(ctx, commit) + if err != nil { + return nil, fmt.Errorf("failed to check for commit pull request: %w", err) + } + + commits = append(commits, commit) + } + + return commits, nil +} + +func (g *GitLab) prForCommit(ctx context.Context, commit git.Commit) (*git.PullRequest, error) { + // We naively look up the associated MR for each commit through the "List merge requests associated with a commit" + // endpoint. This requires len(commits) requests. + // Using the "List merge requests" endpoint might be faster, as it allows us to fetch 100 arbitrary MRs per request, + // but worst case we need to look up all MRs made in the repository ever. + + log := g.log.With("commit.hash", commit.Hash) + + log.Debug("fetching pull requests associated with commit") + associatedMRs, _, err := g.client.Commits.ListMergeRequestsByCommit( + g.options.ProjectID, commit.Hash, + gitlab.WithContext(ctx), + ) + if err != nil { + return nil, err + } + + var mergeRequest *gitlab.MergeRequest + for _, mr := range associatedMRs { + // We only look for the MR that has this commit set as the "merge commit" => The result of squashing this branch onto main + if mr.MergeCommitSHA == commit.Hash { + mergeRequest = mr + break + } + } + + if mergeRequest == nil { + return nil, nil + } + + return gitlabMRToPullRequest(mergeRequest), nil +} + +func (g *GitLab) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label) error { + g.log.Debug("fetching labels on repo") + glLabels, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.Label, *gitlab.Response, error) { + return g.client.Labels.ListLabels(g.options.ProjectID, &gitlab.ListLabelsOptions{ + ListOptions: listOptions, + }, gitlab.WithContext(ctx)) + }) + if err != nil { + return err + } + + for _, label := range labels { + if !slices.ContainsFunc(glLabels, func(glLabel *gitlab.Label) bool { + return glLabel.Name == label.Name + }) { + g.log.Info("creating label in repository", "label.name", label) + _, _, err := g.client.Labels.CreateLabel(g.options.ProjectID, &gitlab.CreateLabelOptions{ + Name: pointer.Pointer(label.Name), + Color: pointer.Pointer("#" + label.Color), + Description: pointer.Pointer(label.Description), + }, + ) + if err != nil { + return err + } + } + } + + return nil +} + +func (g *GitLab) PullRequestForBranch(ctx context.Context, branch string) (*releasepr.ReleasePullRequest, error) { + // There should only be a single open merge request from branch into g.options.BaseBranch at any given moment. + // We can skip pagination and just return the first result. + mrs, _, err := g.client.MergeRequests.ListProjectMergeRequests(g.options.ProjectID, &gitlab.ListProjectMergeRequestsOptions{ + State: pointer.Pointer(PRStateOpen), + SourceBranch: pointer.Pointer(branch), + TargetBranch: pointer.Pointer(g.options.BaseBranch), + ListOptions: gitlab.ListOptions{ + Page: 1, + PerPage: PerPageMax, + }, + }, gitlab.WithContext(ctx)) + if err != nil { + return nil, err + } + + if len(mrs) >= 1 { + return gitlabMRToReleasePullRequest(mrs[0]), nil + } + + return nil, nil +} + +func (g *GitLab) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { + labels := make(gitlab.LabelOptions, 0, len(pr.Labels)) + for _, label := range pr.Labels { + labels = append(labels, label.Name) + } + + glMR, _, err := g.client.MergeRequests.CreateMergeRequest(g.options.ProjectID, &gitlab.CreateMergeRequestOptions{ + Title: &pr.Title, + Description: &pr.Description, + SourceBranch: &pr.Head, + TargetBranch: &g.options.BaseBranch, + Labels: &labels, + }, gitlab.WithContext(ctx)) + if err != nil { + return err + } + + pr.ID = glMR.IID + + return nil +} + +func (g *GitLab) UpdatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { + _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.ProjectID, pr.ID, &gitlab.UpdateMergeRequestOptions{ + Title: &pr.Title, + Description: &pr.Description, + }, gitlab.WithContext(ctx)) + + if err != nil { + return err + } + + return nil +} + +func (g *GitLab) SetPullRequestLabels(ctx context.Context, pr *releasepr.ReleasePullRequest, remove, add []releasepr.Label) error { + removeLabels := make(gitlab.LabelOptions, 0, len(remove)) + for _, label := range remove { + removeLabels = append(removeLabels, label.Name) + } + + addLabels := make(gitlab.LabelOptions, 0, len(add)) + for _, label := range add { + addLabels = append(addLabels, label.Name) + } + + _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.ProjectID, pr.ID, &gitlab.UpdateMergeRequestOptions{ + RemoveLabels: &removeLabels, + AddLabels: &addLabels, + }, gitlab.WithContext(ctx)) + + if err != nil { + return err + } + + return nil +} + +func (g *GitLab) ClosePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { + _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.ProjectID, pr.ID, &gitlab.UpdateMergeRequestOptions{ + StateEvent: pointer.Pointer(PRStateEventClose), + }, gitlab.WithContext(ctx)) + + if err != nil { + return err + } + + return nil +} + +func (g *GitLab) PendingReleases(ctx context.Context, pendingLabel releasepr.Label) ([]*releasepr.ReleasePullRequest, error) { + glMRs, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.MergeRequest, *gitlab.Response, error) { + return g.client.MergeRequests.ListMergeRequests(&gitlab.ListMergeRequestsOptions{ + State: pointer.Pointer(PRStateMerged), + Labels: &gitlab.LabelOptions{pendingLabel.Name}, + TargetBranch: pointer.Pointer(g.options.BaseBranch), + ListOptions: listOptions, + }, gitlab.WithContext(ctx)) + }) + if err != nil { + return nil, err + } + + prs := make([]*releasepr.ReleasePullRequest, 0, len(glMRs)) + + for _, mr := range glMRs { + prs = append(prs, gitlabMRToReleasePullRequest(mr)) + } + + return prs, nil +} + +func (g *GitLab) CreateRelease(ctx context.Context, commit git.Commit, title, changelog string, _, _ bool) error { + _, _, err := g.client.Releases.CreateRelease(g.options.ProjectID, &gitlab.CreateReleaseOptions{ + Name: &title, + TagName: &title, + Description: &changelog, + Ref: &commit.Hash, + }, gitlab.WithContext(ctx)) + if err != nil { + return err + } + + return nil +} + +func all[T any](f func(listOptions gitlab.ListOptions) ([]T, *gitlab.Response, error)) ([]T, error) { + results := make([]T, 0) + page := 1 + + for { + pageResults, resp, err := f(gitlab.ListOptions{Page: page, PerPage: PerPageMax}) + if err != nil { + return nil, err + } + + results = append(results, pageResults...) + + if page == resp.TotalPages || resp.TotalPages == 0 { + return results, nil + } + page = resp.NextPage + } +} + +func gitlabMRToPullRequest(pr *gitlab.MergeRequest) *git.PullRequest { + return &git.PullRequest{ + ID: pr.IID, + Title: pr.Title, + Description: pr.Description, + } +} + +func gitlabMRToReleasePullRequest(pr *gitlab.MergeRequest) *releasepr.ReleasePullRequest { + labels := make([]releasepr.Label, 0, len(pr.Labels)) + for _, labelName := range pr.Labels { + if i := slices.IndexFunc(releasepr.KnownLabels, func(label releasepr.Label) bool { + return label.Name == labelName + }); i >= 0 { + labels = append(labels, releasepr.KnownLabels[i]) + } + } + + var releaseCommit *git.Commit + if pr.MergeCommitSHA != "" { + releaseCommit = &git.Commit{Hash: pr.MergeCommitSHA} + } + + return &releasepr.ReleasePullRequest{ + PullRequest: *gitlabMRToPullRequest(pr), + Labels: labels, + + Head: pr.SHA, + ReleaseCommit: releaseCommit, + } +} + +func (g *Options) autodiscover() { + // Read settings from GitLab-CI env vars + if apiToken := os.Getenv(EnvAPIToken); apiToken != "" { + g.APIToken = apiToken + } + + // TODO: Replace hardcode project-id with a better alternative + g.ProjectID = 60698565 +} + +type Options struct { + forge.Options + + Path string + Repo string + ProjectID int + + APIToken string +} + +func New(log *slog.Logger, options *Options) (*GitLab, error) { + log = log.With("forge", "gitlab") + options.autodiscover() + + client, err := gitlab.NewClient(options.APIToken) + if err != nil { + return nil, err + } + + gl := &GitLab{ + options: options, + + client: client, + log: log, + } + + return gl, nil +} From 2fba5414e5b124ff8ab64afc3f8da6b673986a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 8 Sep 2024 20:03:19 +0200 Subject: [PATCH 015/260] 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`). --- internal/forge/gitlab/gitlab.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index 8808773..dde618b 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -6,6 +6,7 @@ import ( "log/slog" "os" "slices" + "strconv" "strings" "github.com/blang/semver/v4" @@ -25,6 +26,7 @@ const ( PRStateMerged = "merged" PRStateEventClose = "close" EnvAPIToken = "GITLAB_TOKEN" // nolint:gosec // Not actually a hardcoded credential + EnvProjectID = "CI_PROJECT_ID" ) type GitLab struct { @@ -390,14 +392,17 @@ func gitlabMRToReleasePullRequest(pr *gitlab.MergeRequest) *releasepr.ReleasePul } } -func (g *Options) autodiscover() { +func (g *Options) autodiscover(log *slog.Logger) { // Read settings from GitLab-CI env vars if apiToken := os.Getenv(EnvAPIToken); apiToken != "" { g.APIToken = apiToken } - // TODO: Replace hardcode project-id with a better alternative - g.ProjectID = 60698565 + if projectID := os.Getenv(EnvProjectID); projectID != "" { + var err error + g.ProjectID, err = strconv.ParseInt(projectID, 10, 64) + log.Error("failed to parse environment variable as integer", "env.name", EnvProjectID, "env.value", projectID, "err", err) + } } type Options struct { @@ -405,14 +410,14 @@ type Options struct { Path string Repo string - ProjectID int + ProjectID int64 APIToken string } func New(log *slog.Logger, options *Options) (*GitLab, error) { log = log.With("forge", "gitlab") - options.autodiscover() + options.autodiscover(log) client, err := gitlab.NewClient(options.APIToken) if err != nil { From ee5c7aa142ee1fd0eb1bbd0aee53e88194b1a670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 8 Sep 2024 21:01:46 +0200 Subject: [PATCH 016/260] fix(cli): command name in help output (#52) --- cmd/rp/cmd/root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/rp/cmd/root.go b/cmd/rp/cmd/root.go index dd4f9a7..4da80e5 100644 --- a/cmd/rp/cmd/root.go +++ b/cmd/rp/cmd/root.go @@ -11,7 +11,7 @@ import ( var logger *slog.Logger var rootCmd = &cobra.Command{ - Use: "releaser-pleaser", + Use: "rp", Short: "", Long: ``, Version: version(), From 634eac3b76a190ed240a3d8def464b3def628e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 8 Sep 2024 21:05:18 +0200 Subject: [PATCH 017/260] 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. --- .../conventionalcommits/conventionalcommits.go | 3 ++- .../conventionalcommits/conventionalcommits_test.go | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/commitparser/conventionalcommits/conventionalcommits.go b/internal/commitparser/conventionalcommits/conventionalcommits.go index b253354..d11970c 100644 --- a/internal/commitparser/conventionalcommits/conventionalcommits.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits.go @@ -3,6 +3,7 @@ package conventionalcommits import ( "fmt" "log/slog" + "strings" "github.com/leodido/go-conventionalcommits" "github.com/leodido/go-conventionalcommits/parser" @@ -32,7 +33,7 @@ func (c *Parser) Analyze(commits []git.Commit) ([]commitparser.AnalyzedCommit, e analyzedCommits := make([]commitparser.AnalyzedCommit, 0, len(commits)) for _, commit := range commits { - msg, err := c.machine.Parse([]byte(commit.Message)) + msg, err := c.machine.Parse([]byte(strings.TrimSpace(commit.Message))) if err != nil { c.logger.Warn("failed to parse message of commit, skipping", "commit.hash", commit.Hash, "err", err) continue diff --git a/internal/commitparser/conventionalcommits/conventionalcommits_test.go b/internal/commitparser/conventionalcommits/conventionalcommits_test.go index bc969de..ddfbaf4 100644 --- a/internal/commitparser/conventionalcommits/conventionalcommits_test.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits_test.go @@ -33,6 +33,19 @@ func TestAnalyzeCommits(t *testing.T) { expectedCommits: []commitparser.AnalyzedCommit{}, wantErr: assert.NoError, }, + { + // GitLab seems to create commits with pattern "scope: message\n" if no body is added. + // This has previously caused a parser error "missing a blank line". + // We added a workaround with `strings.TrimSpace()` and this test make sure that it does not break again. + name: "handles title with new line", + commits: []git.Commit{ + { + Message: "aksdjaklsdjka", + }, + }, + expectedCommits: []commitparser.AnalyzedCommit{}, + wantErr: assert.NoError, + }, { name: "drops unreleasable", commits: []git.Commit{ From ee83cec0494a3e756bdac5f769f6a910f66e2546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 8 Sep 2024 21:07:03 +0200 Subject: [PATCH 018/260] 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. --- cmd/rp/cmd/run.go | 3 +-- internal/forge/gitlab/gitlab.go | 47 +++++++++++++++------------------ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index 55ca419..8fe818f 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -62,8 +62,7 @@ func run(cmd *cobra.Command, _ []string) error { logger.DebugContext(ctx, "using forge GitLab") f, err = gitlab.New(logger, &gitlab.Options{ Options: forgeOptions, - Path: flagOwner, - Repo: flagRepo, + Path: fmt.Sprintf("%s/%s", flagOwner, flagRepo), }) if err != nil { logger.ErrorContext(ctx, "failed to create client", "err", err) diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index dde618b..1394898 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -6,7 +6,6 @@ import ( "log/slog" "os" "slices" - "strconv" "strings" "github.com/blang/semver/v4" @@ -26,7 +25,7 @@ const ( PRStateMerged = "merged" PRStateEventClose = "close" EnvAPIToken = "GITLAB_TOKEN" // nolint:gosec // Not actually a hardcoded credential - EnvProjectID = "CI_PROJECT_ID" + EnvProjectPath = "CI_PROJECT_PATH" ) type GitLab struct { @@ -37,19 +36,19 @@ type GitLab struct { } func (g *GitLab) RepoURL() string { - return fmt.Sprintf("https://gitlab.com/%s", g.options.Repository) + return fmt.Sprintf("https://gitlab.com/%s", g.options.Path) } func (g *GitLab) CloneURL() string { - return fmt.Sprintf("https://gitlab.com/%s/%s.git", g.options.Path, g.options.Repo) + return fmt.Sprintf("https://gitlab.com/%s.git", g.options.Path) } func (g *GitLab) ReleaseURL(version string) string { - return fmt.Sprintf("https://gitlab.com/%s/%s/-/releases/%s", g.options.Path, g.options.Repo, version) + return fmt.Sprintf("https://gitlab.com/%s/-/releases/%s", g.options.Path, version) } func (g *GitLab) PullRequestURL(id int) string { - return fmt.Sprintf("https://gitlab.com/%s/%s/-/merge_requests/%d", g.options.Path, g.options.Repo, id) + return fmt.Sprintf("https://gitlab.com/%s/-/merge_requests/%d", g.options.Path, id) } func (g *GitLab) GitAuth() transport.AuthMethod { @@ -64,7 +63,7 @@ func (g *GitLab) LatestTags(ctx context.Context) (git.Releases, error) { g.log.DebugContext(ctx, "listing all tags in gitlab repository") tags, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.Tag, *gitlab.Response, error) { - return g.client.Tags.ListTags(g.options.ProjectID, &gitlab.ListTagsOptions{ + return g.client.Tags.ListTags(g.options.Path, &gitlab.ListTagsOptions{ OrderBy: pointer.Pointer("updated"), ListOptions: listOptions, }, gitlab.WithContext(ctx)) @@ -122,7 +121,7 @@ func (g *GitLab) CommitsSince(ctx context.Context, tag *git.Tag) ([]git.Commit, log.Debug("listing commits", "ref.name", refName) gitLabCommits, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.Commit, *gitlab.Response, error) { - return g.client.Commits.ListCommits(g.options.ProjectID, &gitlab.ListCommitsOptions{ + return g.client.Commits.ListCommits(g.options.Path, &gitlab.ListCommitsOptions{ RefName: &refName, ListOptions: listOptions, }, gitlab.WithContext(ctx)) @@ -158,7 +157,7 @@ func (g *GitLab) prForCommit(ctx context.Context, commit git.Commit) (*git.PullR log.Debug("fetching pull requests associated with commit") associatedMRs, _, err := g.client.Commits.ListMergeRequestsByCommit( - g.options.ProjectID, commit.Hash, + g.options.Path, commit.Hash, gitlab.WithContext(ctx), ) if err != nil { @@ -184,7 +183,7 @@ func (g *GitLab) prForCommit(ctx context.Context, commit git.Commit) (*git.PullR func (g *GitLab) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label) error { g.log.Debug("fetching labels on repo") glLabels, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.Label, *gitlab.Response, error) { - return g.client.Labels.ListLabels(g.options.ProjectID, &gitlab.ListLabelsOptions{ + return g.client.Labels.ListLabels(g.options.Path, &gitlab.ListLabelsOptions{ ListOptions: listOptions, }, gitlab.WithContext(ctx)) }) @@ -197,7 +196,7 @@ func (g *GitLab) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label return glLabel.Name == label.Name }) { g.log.Info("creating label in repository", "label.name", label) - _, _, err := g.client.Labels.CreateLabel(g.options.ProjectID, &gitlab.CreateLabelOptions{ + _, _, err := g.client.Labels.CreateLabel(g.options.Path, &gitlab.CreateLabelOptions{ Name: pointer.Pointer(label.Name), Color: pointer.Pointer("#" + label.Color), Description: pointer.Pointer(label.Description), @@ -215,7 +214,7 @@ func (g *GitLab) EnsureLabelsExist(ctx context.Context, labels []releasepr.Label func (g *GitLab) PullRequestForBranch(ctx context.Context, branch string) (*releasepr.ReleasePullRequest, error) { // There should only be a single open merge request from branch into g.options.BaseBranch at any given moment. // We can skip pagination and just return the first result. - mrs, _, err := g.client.MergeRequests.ListProjectMergeRequests(g.options.ProjectID, &gitlab.ListProjectMergeRequestsOptions{ + mrs, _, err := g.client.MergeRequests.ListProjectMergeRequests(g.options.Path, &gitlab.ListProjectMergeRequestsOptions{ State: pointer.Pointer(PRStateOpen), SourceBranch: pointer.Pointer(branch), TargetBranch: pointer.Pointer(g.options.BaseBranch), @@ -241,7 +240,7 @@ func (g *GitLab) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePul labels = append(labels, label.Name) } - glMR, _, err := g.client.MergeRequests.CreateMergeRequest(g.options.ProjectID, &gitlab.CreateMergeRequestOptions{ + glMR, _, err := g.client.MergeRequests.CreateMergeRequest(g.options.Path, &gitlab.CreateMergeRequestOptions{ Title: &pr.Title, Description: &pr.Description, SourceBranch: &pr.Head, @@ -258,7 +257,7 @@ func (g *GitLab) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePul } func (g *GitLab) UpdatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { - _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.ProjectID, pr.ID, &gitlab.UpdateMergeRequestOptions{ + _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.Path, pr.ID, &gitlab.UpdateMergeRequestOptions{ Title: &pr.Title, Description: &pr.Description, }, gitlab.WithContext(ctx)) @@ -281,7 +280,7 @@ func (g *GitLab) SetPullRequestLabels(ctx context.Context, pr *releasepr.Release addLabels = append(addLabels, label.Name) } - _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.ProjectID, pr.ID, &gitlab.UpdateMergeRequestOptions{ + _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.Path, pr.ID, &gitlab.UpdateMergeRequestOptions{ RemoveLabels: &removeLabels, AddLabels: &addLabels, }, gitlab.WithContext(ctx)) @@ -294,7 +293,7 @@ func (g *GitLab) SetPullRequestLabels(ctx context.Context, pr *releasepr.Release } func (g *GitLab) ClosePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { - _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.ProjectID, pr.ID, &gitlab.UpdateMergeRequestOptions{ + _, _, err := g.client.MergeRequests.UpdateMergeRequest(g.options.Path, pr.ID, &gitlab.UpdateMergeRequestOptions{ StateEvent: pointer.Pointer(PRStateEventClose), }, gitlab.WithContext(ctx)) @@ -328,7 +327,7 @@ func (g *GitLab) PendingReleases(ctx context.Context, pendingLabel releasepr.Lab } func (g *GitLab) CreateRelease(ctx context.Context, commit git.Commit, title, changelog string, _, _ bool) error { - _, _, err := g.client.Releases.CreateRelease(g.options.ProjectID, &gitlab.CreateReleaseOptions{ + _, _, err := g.client.Releases.CreateRelease(g.options.Path, &gitlab.CreateReleaseOptions{ Name: &title, TagName: &title, Description: &changelog, @@ -392,32 +391,28 @@ func gitlabMRToReleasePullRequest(pr *gitlab.MergeRequest) *releasepr.ReleasePul } } -func (g *Options) autodiscover(log *slog.Logger) { +func (g *Options) autodiscover() { // Read settings from GitLab-CI env vars if apiToken := os.Getenv(EnvAPIToken); apiToken != "" { g.APIToken = apiToken } - if projectID := os.Getenv(EnvProjectID); projectID != "" { - var err error - g.ProjectID, err = strconv.ParseInt(projectID, 10, 64) - log.Error("failed to parse environment variable as integer", "env.name", EnvProjectID, "env.value", projectID, "err", err) + if projectPath := os.Getenv(EnvProjectPath); projectPath != "" { + g.Path = projectPath } } type Options struct { forge.Options - Path string - Repo string - ProjectID int64 + Path string APIToken string } func New(log *slog.Logger, options *Options) (*GitLab, error) { log = log.With("forge", "gitlab") - options.autodiscover(log) + options.autodiscover() client, err := gitlab.NewClient(options.APIToken) if err != nil { From 84d4dd9d262b2375c30a9b0582c7d66ec6768e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 17:18:24 +0200 Subject: [PATCH 019/260] chore(main): release v0.4.0-beta.0 (#50) Co-authored-by: releaser-pleaser <> --- CHANGELOG.md | 12 ++++++++++++ action.yml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eb47b20..80d9bc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [v0.4.0-beta.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.0-beta.0) + +### Features + +- add support for GitLab repositories (#49) + +### Bug Fixes + +- **parser**: continue on unparsable commit message (#48) +- **cli**: command name in help output (#52) +- **parser**: invalid handling of empty lines (#53) + ## [v0.3.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.3.0) ### :sparkles: Highlights diff --git a/action.yml b/action.yml index 8e3b8e1..bcadc15 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: ghcr.io/apricote/releaser-pleaser:v0.3.0 # x-releaser-pleaser-version + image: ghcr.io/apricote/releaser-pleaser:v0.4.0-beta.0 # x-releaser-pleaser-version args: - run - --forge=github From da0c07497b7cd4acfb85b6caf15f7ca5d19d1a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 18:41:32 +0200 Subject: [PATCH 020/260] ci: push all changes to gitlab.com mirror (#57) GitLab only considers repos on the current instance for its CI/CD catalog. We want to publish a GitLab CI/CD component for #4. --- .github/workflows/mirror.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/mirror.yaml diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml new file mode 100644 index 0000000..897cdc5 --- /dev/null +++ b/.github/workflows/mirror.yaml @@ -0,0 +1,28 @@ +name: mirror +on: + push: + branches: [main] + tags: ["*"] + +jobs: + gitlab.com: + runs-on: ubuntu-latest + env: + REMOTE: mirror + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # Need all to fetch all tags so we can push them + fetch-depth: 0 + + - name: Add Remote + env: + CLONE_URL: "https://releaser-pleaser:${{ secrets.GITLAB_COM_PUSH_TOKEN }}@gitlab.com/apricote/releaser-pleaser.git" + run: git remote add $REMOTE $CLONE_URL + + - name: Push Branches + run: git push --force --all --verbose $REMOTE + + - name: Push Tags + run: git push --force --tags --verbose $REMOTE From 7b49e8ea0c8311fe5ab5f370db8684badab2fcdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 18:43:16 +0200 Subject: [PATCH 021/260] ci: job name may not contain dot (#58) --- .github/workflows/mirror.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index 897cdc5..352ed37 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -5,7 +5,7 @@ on: tags: ["*"] jobs: - gitlab.com: + gitlab-com: runs-on: ubuntu-latest env: REMOTE: mirror From 61cf12a052c86500164821f8812f9202cc1b1961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 18:46:45 +0200 Subject: [PATCH 022/260] feat: add shell to container image (#59) Images used in GitLab CI need to have a shell included, otherwise the job could not be started. This replaces the default `cgr.dev/chainguard/static` base image with `cgr.dev/chainguard/busybox`. Busybox is the smallest image that includes a functional shell. Needed for #55. --- .ko.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.ko.yaml b/.ko.yaml index c7c0e49..49805d6 100644 --- a/.ko.yaml +++ b/.ko.yaml @@ -1,3 +1,6 @@ defaultPlatforms: - linux/arm64 - - linux/amd64 \ No newline at end of file + - linux/amd64 + +# Need a shell for gitlab-ci +defaultBaseImage: cgr.dev/chainguard/busybox From 8d7b1c9580091b78ef4e68ead6889623f198ff1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 18:54:38 +0200 Subject: [PATCH 023/260] feat(gitlab): add CI/CD component (#55) This adds a GitLab CI/CD component that can be `included` in users GitLab CI configuration to integrate releaser-pleaser. Unlike the GitHub Action, this can not easily run whenever a merge request description is changed, only when changes are pushed to main. --- .gitlab-ci.yml | 15 +++++++++++++++ templates/run.yml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 templates/run.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..742be9d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,15 @@ +stages: [release] + +# For the GitLab CI/CD component to be usable, it needs to be published in +# the CI/CD catalog. This happens on new releases. +# As the primary tagging happens on GitHub, we only react to pushed tags +# and create a corresponding GitLab Release. +create-release: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + script: echo "Creating release $CI_COMMIT_TAG" + rules: + - if: $CI_COMMIT_TAG + release: + tag_name: "$CI_COMMIT_TAG" + description: "$CI_COMMIT_TAG_MESSAGE" diff --git a/templates/run.yml b/templates/run.yml new file mode 100644 index 0000000..e1d16a5 --- /dev/null +++ b/templates/run.yml @@ -0,0 +1,36 @@ +spec: + inputs: + # Remember to update docs/reference/gitlab-ci-component.md + branch: + default: main + description: "This branch is used as the target for releases." + + token: + description: "GitLab token for creating and updating release MRs." + + extra-files: + description: 'List of files that are scanned for version references.' + default: "" + + stage: + default: build + description: 'Defines the build stage' + # Remember to update docs/reference/gitlab-ci-component.md +--- + +releaser-pleaser: + stage: $[[ inputs.stage ]] + rules: + # 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.4.0-beta.0 # x-releaser-pleaser-version + entrypoint: [""] + variables: + GITLAB_TOKEN: $[[ inputs.token ]] + script: + - | + rp run \ + --forge=gitlab \ + --branch=$[[ inputs.branch ]] \ + --extra-files=$[[ inputs.extra-files ]] From 7a3d46eac7fe23595e8ea90c9be75e5a61c91bf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 18:58:38 +0200 Subject: [PATCH 024/260] ci: update version reference in gitlab ci/cd component (#60) --- .github/workflows/releaser-pleaser.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index ff1c0fa..543c557 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -43,3 +43,4 @@ jobs: token: ${{ secrets.RELEASER_PLEASER_TOKEN }} extra-files: | action.yml + templates/run.yml From 2567293368c7c7a3e6050b3ebcf9067209b5660f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 20:59:17 +0200 Subject: [PATCH 025/260] fix: multiple extra-files are not evaluated properly (#61) Quoting issues caused multiple extra-files to be ignored. --- action.yml | 4 +-- cmd/rp/cmd/run.go | 6 +++++ cmd/rp/cmd/run_test.go | 59 ++++++++++++++++++++++++++++++++++++++++++ templates/run.yml | 2 +- 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 cmd/rp/cmd/run_test.go diff --git a/action.yml b/action.yml index bcadc15..49bf119 100644 --- a/action.yml +++ b/action.yml @@ -26,7 +26,7 @@ runs: - run - --forge=github - --branch=${{ inputs.branch }} - - --extra-files=${{ inputs.extra-files }} + - --extra-files="${{ inputs.extra-files }}" env: - GITHUB_TOKEN: ${{ inputs.token }} + GITHUB_TOKEN: "${{ inputs.token }}" GITHUB_USER: "oauth2" diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index 8fe818f..c29047b 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -95,6 +95,12 @@ func run(cmd *cobra.Command, _ []string) error { } func parseExtraFiles(input string) []string { + // We quote the arg to avoid issues with the expected newlines in the value. + // Need to remove those quotes before parsing the data + input = strings.Trim(input, `"`) + // In some situations we get a "\n" sequence, where we actually expect new lines, + // replace the two characters with an actual new line + input = strings.ReplaceAll(input, `\n`, "\n") lines := strings.Split(input, "\n") extraFiles := make([]string, 0, len(lines)) diff --git a/cmd/rp/cmd/run_test.go b/cmd/rp/cmd/run_test.go new file mode 100644 index 0000000..d4cea7a --- /dev/null +++ b/cmd/rp/cmd/run_test.go @@ -0,0 +1,59 @@ +package cmd + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_parseExtraFiles(t *testing.T) { + tests := []struct { + name string + input string + want []string + }{ + { + name: "empty", + input: ``, + want: []string{}, + }, + { + name: "empty quoted", + input: `""`, + want: []string{}, + }, + { + name: "single", + input: `foo.txt`, + want: []string{"foo.txt"}, + }, + { + name: "single quoted", + input: `"foo.txt"`, + want: []string{"foo.txt"}, + }, + { + name: "multiple", + input: `foo.txt +dir/Chart.yaml`, + want: []string{"foo.txt", "dir/Chart.yaml"}, + }, + { + name: "multiple quoted", + input: `"foo.txt +dir/Chart.yaml"`, + want: []string{"foo.txt", "dir/Chart.yaml"}, + }, + { + name: "multiple with broken new lines", + input: `"action.yml\ntemplates/run.yml\n"`, + want: []string{"action.yml", "templates/run.yml"}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := parseExtraFiles(tt.input) + assert.Equal(t, tt.want, got) + }) + } +} diff --git a/templates/run.yml b/templates/run.yml index e1d16a5..27ca27d 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -33,4 +33,4 @@ releaser-pleaser: rp run \ --forge=gitlab \ --branch=$[[ inputs.branch ]] \ - --extra-files=$[[ inputs.extra-files ]] + --extra-files="$[[ inputs.extra-files ]]" From dc1903c4b4a839a2f60a141ed222e2819901ec44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 15 Sep 2024 21:00:06 +0200 Subject: [PATCH 026/260] chore(main): release v0.4.0-beta.1 (#56) Co-authored-by: releaser-pleaser <> --- 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 80d9bc3..0f187be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [v0.4.0-beta.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.0-beta.1) + +### Features + +- add shell to container image (#59) +- **gitlab**: add CI/CD component (#55) + +### Bug Fixes + +- multiple extra-files are not evaluated properly (#61) + ## [v0.4.0-beta.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.0-beta.0) ### Features diff --git a/action.yml b/action.yml index 49bf119..15c82df 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: ghcr.io/apricote/releaser-pleaser:v0.4.0-beta.0 # x-releaser-pleaser-version + image: ghcr.io/apricote/releaser-pleaser:v0.4.0-beta.1 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index 27ca27d..bd762be 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -24,7 +24,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.4.0-beta.0 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.4.0-beta.1 # x-releaser-pleaser-version entrypoint: [""] variables: GITLAB_TOKEN: $[[ inputs.token ]] From 7bd752c2f53bb7741f55df148193395da485b405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 21 Sep 2024 13:29:26 +0200 Subject: [PATCH 027/260] chore: setup renovate (#64) --- .github/actions/setup-mdbook/action.yaml | 16 +++++ .github/renovate.json5 | 80 ++++++++++++++++++++++++ .github/workflows/ci.yaml | 2 - .github/workflows/docs.yaml | 29 +++++---- .gitlab-ci.yml | 4 +- CHANGELOG.md | 6 +- README.md | 11 +++- 7 files changed, 125 insertions(+), 23 deletions(-) create mode 100644 .github/actions/setup-mdbook/action.yaml create mode 100644 .github/renovate.json5 diff --git a/.github/actions/setup-mdbook/action.yaml b/.github/actions/setup-mdbook/action.yaml new file mode 100644 index 0000000..23e0665 --- /dev/null +++ b/.github/actions/setup-mdbook/action.yaml @@ -0,0 +1,16 @@ +name: "Setup mdbook" +inputs: + version: + description: "mdbook version" + +runs: + using: composite + steps: + - name: Setup mdbook + shell: bash + env: + url: https://github.com/rust-lang/mdbook/releases/download/${{ inputs.version }}/mdbook-${{ inputs.version }}-x86_64-unknown-linux-gnu.tar.gz + run: | + mkdir mdbook + curl -sSL "$url" | tar -xz --directory=./mdbook + echo `pwd`/mdbook >> $GITHUB_PATH diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 0000000..74a660e --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,80 @@ +{ + "extends": [ + ":semanticCommits", + ":semanticCommitTypeAll(deps)", + ":semanticCommitScopeDisabled", + + ":dependencyDashboard", + ":approveMajorUpdates", + + ":automergeMinor", + ":automergeLinters", + ":automergeTesters", + ":automergeTypes", + + ":maintainLockFilesWeekly", + ":enableVulnerabilityAlerts", + "helpers:pinGitHubActionDigests" + ], + "packageRules": [ + { + "groupName": "linters", + "matchUpdateTypes": [ + "minor", + "patch" + ], + "matchDepNames": [ + "golangci/golangci-lint" + ], + "automerge": true + }, + { + "groupName": "testing", + "matchUpdateTypes": [ + "minor", + "patch" + ], + "matchDepNames": [ + "github.com/stretchr/testify" + ], + "automerge": true + }, + { + "groupName": "github-actions", + "matchUpdateTypes": [ + "minor", + "patch" + ], + "matchDepTypes": [ + "action" + ], + "automerge": true + }, + { + "groupName": "gitlab-ci", + "matchUpdateTypes": [ + "minor", + "patch" + ], + "matchPackageNames": [ + "registry.gitlab.com/gitlab-org/release-cli" + ], + "automerge": true + } + ], + "customManagers": [ + { + "customType": "regex", + "fileMatch": [ + ".+\\.ya?ml$" + ], + "matchStrings": [ + ": (?.+) # renovate: datasource=(?[a-z-]+) depName=(?[^\\s]+)(?: lookupName=(?[^\\s]+))?(?: versioning=(?[a-z-]+))?(?: extractVersion=(?[^\\s]+))?" + ] + } + ], + "postUpdateOptions": [ + "gomodUpdateImportPaths", + "gomodTidy" + ] +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 38a1f4c..6c040c8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,7 +5,6 @@ on: branches: [main] pull_request: - jobs: lint: runs-on: ubuntu-latest @@ -24,7 +23,6 @@ jobs: version: v1.60.1 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m - test: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 908f3ad..22e29b7 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -8,33 +8,32 @@ jobs: deploy: runs-on: ubuntu-latest permissions: - contents: write # To push a branch - pages: write # To push to a GitHub Pages site + contents: write # To push a branch + pages: write # To push to a GitHub Pages site id-token: write # To update the deployment status + steps: - uses: actions/checkout@v4 with: lfs: "true" - - name: Install latest mdbook - run: | - tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name') - url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz" - mkdir mdbook - curl -sSL $url | tar -xz --directory=./mdbook - echo `pwd`/mdbook >> $GITHUB_PATH + + - uses: ./.github/actions/setup-mdbook + with: + version: v0.4.40 # renovate: datasource=github-releases depName=rust-lang/mdbook + - name: Build Book - run: | - # This assumes your book is in the root of your repository. - # Just add a `cd` here if you need to change to another directory. - cd docs - mdbook build + working-directory: docs + run: mdbook build + - name: Setup Pages uses: actions/configure-pages@v4 + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: # Upload entire repository - path: 'docs/book' + path: "docs/book" + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 742be9d..37024e6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -stages: [release] +stages: [ release ] # For the GitLab CI/CD component to be usable, it needs to be published in # the CI/CD catalog. This happens on new releases. @@ -6,7 +6,7 @@ stages: [release] # and create a corresponding GitLab Release. create-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest + image: registry.gitlab.com/gitlab-org/release-cli:v0.18.0 script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f187be..1f8c321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ You can now edit the message for a pull request after merging by adding a \```rp - **cli**: show release PR url in log messages (#44) ## [v0.2.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0) + ### Features - update version references in any files (#14) @@ -55,6 +56,7 @@ You can now edit the message for a pull request after merging by adding a \```rp - **action**: invalid quoting for extra-files arg (#25) ## [v0.2.0-beta.2](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0-beta.2) + ### Features - update version references in any files (#14) @@ -65,6 +67,7 @@ You can now edit the message for a pull request after merging by adding a \```rp - **ci**: ko pipeline permissions (#23) ## [v0.2.0-beta.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0-beta.1) + ### Features - update version references in any files (#14) @@ -74,13 +77,14 @@ You can now edit the message for a pull request after merging by adding a \```rp - **ci**: building release image fails (#21) ## [v0.2.0-beta.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.2.0-beta.0) + ### Features - update version references in any files (#14) ## [v0.1.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.1.0) -### This is the first release ever, so it also includes a lot of other functionality. +### This is the first release ever, so it also includes a lot of other functionality. ### Features diff --git a/README.md b/README.md index 6c282dd..afc56d9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # releaser-pleaser -`releaser-pleaser` is a tool designed to automate versioning and changelog management for your projects. Building on the concepts of [`release-please`](https://github.com/googleapis/release-please), it streamlines the release process through GitHub Actions or GitLab CI. +`releaser-pleaser` is a tool designed to automate versioning and changelog management for your projects. Building on the concepts of [ +`release-please`](https://github.com/googleapis/release-please), it streamlines the release process through GitHub Actions or GitLab CI. ## Features @@ -20,14 +21,18 @@ This project is still under active development. You can not reasonably use it ri ## Relation to `release-please` -After using `release-please` for 1.5 years, I've found it to be the best tool for low-effort releases currently available. While I appreciate many of its features, I identified several additional capabilities that would significantly enhance my workflow. Although it might be possible to incorporate these features into `release-please`, I decided to channel my efforts into creating a new tool that specifically addresses my needs. +After using +`release-please` for 1.5 years, I've found it to be the best tool for low-effort releases currently available. While I appreciate many of its features, I identified several additional capabilities that would significantly enhance my workflow. Although it might be possible to incorporate these features into +`release-please`, I decided to channel my efforts into creating a new tool that specifically addresses my needs. Key differences in `releaser-pleaser` include: - Support for multiple forges (both GitHub and GitLab) - Better support for pre-releases -One notable limitation of `release-please` is its deep integration with the GitHub API, making the addition of support for other platforms (like GitLab) a substantial undertaking. `releaser-pleaser` aims to overcome this limitation by design, offering a more versatile solution for automated release management across different platforms and project requirements. +One notable limitation of +`release-please` is its deep integration with the GitHub API, making the addition of support for other platforms (like GitLab) a substantial undertaking. +`releaser-pleaser` aims to overcome this limitation by design, offering a more versatile solution for automated release management across different platforms and project requirements. ## License From 90685994d773250ea8402a1fc7ae45b6b832eab2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 11:33:15 +0000 Subject: [PATCH 028/260] deps: update module google.golang.org/protobuf to v1.33.0 [security] (#65) 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 0175391..43807fd 100644 --- a/go.mod +++ b/go.mod @@ -45,7 +45,7 @@ require ( golang.org/x/sys v0.24.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.29.1 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index d2a734e..e674c66 100644 --- a/go.sum +++ b/go.sum @@ -183,8 +183,8 @@ google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6 google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= -google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= From 6a2f536650e5b82e024617e883d931e4e0089e0e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:35:27 +0200 Subject: [PATCH 029/260] deps: pin dependencies (#66) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 16 ++++++++-------- .github/workflows/docs.yaml | 8 ++++---- .github/workflows/mirror.yaml | 2 +- .github/workflows/release.yaml | 6 +++--- .github/workflows/releaser-pleaser.yaml | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6c040c8..53b3878 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,15 +10,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 with: go-version-file: go.mod - name: Run golangci-lint - uses: golangci/golangci-lint-action@v6 + uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6 with: version: v1.60.1 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m @@ -27,10 +27,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 with: go-version-file: go.mod @@ -38,7 +38,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -46,10 +46,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 with: go-version-file: go.mod diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 22e29b7..4f20137 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,7 +13,7 @@ jobs: id-token: write # To update the deployment status steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: lfs: "true" @@ -26,14 +26,14 @@ jobs: run: mdbook build - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4 - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 with: # Upload entire repository path: "docs/book" - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index 352ed37..c57187e 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -11,7 +11,7 @@ jobs: REMOTE: mirror steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: # Need all to fetch all tags so we can push them fetch-depth: 0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8e08b7a..779384b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 with: go-version-file: go.mod - - uses: ko-build/setup-ko@v0.7 + - uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7 - run: ko build --bare --tags ${{ github.ref_name }} github.com/apricote/releaser-pleaser/cmd/rp diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 543c557..4cc9c24 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -18,19 +18,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 with: ref: main - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 with: go-version-file: go.mod # Build container image from current commit and replace image ref in `action.yml` # Without this, any new flags in `action.yml` would break the job in this repository until the new # version is released. But a new version can only be released if this job works. - - uses: ko-build/setup-ko@v0.7 + - uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7 - run: ko build --bare --local --tags ci github.com/apricote/releaser-pleaser/cmd/rp - run: mkdir -p .github/actions/releaser-pleaser From 4402612538b1bcddc23e4d51bebbc097299b20cc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:37:03 +0200 Subject: [PATCH 030/260] deps: update actions/configure-pages action to v5 (#68) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 4f20137..7c2f855 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -26,7 +26,7 @@ jobs: run: mdbook build - name: Setup Pages - uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4 + uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 - name: Upload artifact uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 From 937b885696e4f6c667f093a9d907cd8a10631f2a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 13:40:15 +0200 Subject: [PATCH 031/260] deps: update module github.com/google/go-github/v63 to v65 (#69) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- internal/forge/github/github.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 43807fd..f07807f 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-git/v5 v5.12.0 - github.com/google/go-github/v63 v63.0.0 + github.com/google/go-github/v65 v65.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index e674c66..7514854 100644 --- a/go.sum +++ b/go.sum @@ -47,8 +47,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v63 v63.0.0 h1:13xwK/wk9alSokujB9lJkuzdmQuVn2QCPeck76wR3nE= -github.com/google/go-github/v63 v63.0.0/go.mod h1:IqbcrgUmIcEaioWrGYei/09o+ge5vhffGOcxrO0AfmA= +github.com/google/go-github/v65 v65.0.0 h1:pQ7BmO3DZivvFk92geC0jB0q2m3gyn8vnYPgV7GSLhQ= +github.com/google/go-github/v65 v65.0.0/go.mod h1:DvrqWo5hvsdhJvHd4WyVF9ttANN3BniqjP8uTFMNb60= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index 363c306..8dab499 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -12,7 +12,7 @@ import ( "github.com/blang/semver/v4" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" - "github.com/google/go-github/v63/github" + "github.com/google/go-github/v65/github" "github.com/apricote/releaser-pleaser/internal/forge" "github.com/apricote/releaser-pleaser/internal/git" From 997b6492de5336632b213ac6e9af0b8e9f0ebdeb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 21 Sep 2024 11:44:03 +0000 Subject: [PATCH 032/260] deps: update dependency golangci/golangci-lint to v1.61.0 (#70) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 53b3878..576ac4b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6 with: - version: v1.60.1 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.61.0 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 2621c48d75e6af251c10ec924cd5874a43aeee11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 22 Sep 2024 14:00:30 +0200 Subject: [PATCH 033/260] 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 --- internal/changelog/changelog.go | 44 ++++++++++++++++----------- internal/changelog/changelog.md.tpl | 28 +++++++++-------- internal/changelog/changelog_test.go | 3 +- internal/commitparser/commitparser.go | 15 +++++++++ releaserpleaser.go | 15 +++++++-- 5 files changed, 71 insertions(+), 34 deletions(-) diff --git a/internal/changelog/changelog.go b/internal/changelog/changelog.go index 6004829..d6386b8 100644 --- a/internal/changelog/changelog.go +++ b/internal/changelog/changelog.go @@ -26,27 +26,37 @@ func init() { } } -func NewChangelogEntry(logger *slog.Logger, commits []commitparser.AnalyzedCommit, version, link, prefix, suffix string) (string, error) { - features := make([]commitparser.AnalyzedCommit, 0) - fixes := make([]commitparser.AnalyzedCommit, 0) +func DefaultTemplate() *template.Template { + return changelogTemplate +} - for _, commit := range commits { - switch commit.Type { - case "feat": - features = append(features, commit) - case "fix": - fixes = append(fixes, commit) - } +type Data struct { + Commits map[string][]commitparser.AnalyzedCommit + Version string + VersionLink string + Prefix string + Suffix string +} + +func New(commits map[string][]commitparser.AnalyzedCommit, version, versionLink, prefix, suffix string) Data { + return Data{ + Commits: commits, + Version: version, + VersionLink: versionLink, + Prefix: prefix, + Suffix: suffix, } +} +type Formatting struct { + HideVersionTitle bool +} + +func Entry(logger *slog.Logger, tpl *template.Template, data Data, formatting Formatting) (string, error) { var changelog bytes.Buffer - err := changelogTemplate.Execute(&changelog, map[string]any{ - "Features": features, - "Fixes": fixes, - "Version": version, - "VersionLink": link, - "Prefix": prefix, - "Suffix": suffix, + err := tpl.Execute(&changelog, map[string]any{ + "Data": data, + "Formatting": formatting, }) if err != nil { return "", err diff --git a/internal/changelog/changelog.md.tpl b/internal/changelog/changelog.md.tpl index 1f7dd42..50907eb 100644 --- a/internal/changelog/changelog.md.tpl +++ b/internal/changelog/changelog.md.tpl @@ -1,22 +1,24 @@ -## [{{.Version}}]({{.VersionLink}}) -{{- if .Prefix }} -{{ .Prefix }} +{{define "entry" -}} +- {{ if .Scope }}**{{.Scope}}**: {{end}}{{.Description}} +{{ end }} + +{{- if not .Formatting.HideVersionTitle }} +## [{{.Data.Version}}]({{.Data.VersionLink}}) {{ end -}} -{{- if (gt (len .Features) 0) }} +{{- if .Data.Prefix }} +{{ .Data.Prefix }} +{{ end -}} +{{- with .Data.Commits.feat }} ### Features -{{ range .Features -}} -- {{ if .Scope }}**{{.Scope}}**: {{end}}{{.Description}} -{{ end -}} +{{ range . -}}{{template "entry" .}}{{end}} {{- end -}} -{{- if (gt (len .Fixes) 0) }} +{{- with .Data.Commits.fix }} ### Bug Fixes -{{ range .Fixes -}} -- {{ if .Scope }}**{{.Scope}}**: {{end}}{{.Description}} -{{ end -}} +{{ range . -}}{{template "entry" .}}{{end}} {{- end -}} -{{- if .Suffix }} -{{ .Suffix }} +{{- if .Data.Suffix }} +{{ .Data.Suffix }} {{ end }} diff --git a/internal/changelog/changelog_test.go b/internal/changelog/changelog_test.go index e6582c7..a969730 100644 --- a/internal/changelog/changelog_test.go +++ b/internal/changelog/changelog_test.go @@ -168,7 +168,8 @@ This version is compatible with flux-compensator v2.2 - v2.9. for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := NewChangelogEntry(slog.Default(), tt.args.analyzedCommits, tt.args.version, tt.args.link, tt.args.prefix, tt.args.suffix) + data := New(commitparser.ByType(tt.args.analyzedCommits), tt.args.version, tt.args.link, tt.args.prefix, tt.args.suffix) + got, err := Entry(slog.Default(), DefaultTemplate(), data, Formatting{}) if !tt.wantErr(t, err) { return } diff --git a/internal/commitparser/commitparser.go b/internal/commitparser/commitparser.go index 484d733..023c6b4 100644 --- a/internal/commitparser/commitparser.go +++ b/internal/commitparser/commitparser.go @@ -15,3 +15,18 @@ type AnalyzedCommit struct { Scope *string BreakingChange bool } + +// ByType groups the Commits by the type field. Used by the Changelog. +func ByType(in []AnalyzedCommit) map[string][]AnalyzedCommit { + out := map[string][]AnalyzedCommit{} + + for _, commit := range in { + if out[commit.Type] == nil { + out[commit.Type] = make([]AnalyzedCommit, 0, 1) + } + + out[commit.Type] = append(out[commit.Type], commit) + } + + return out +} diff --git a/releaserpleaser.go b/releaserpleaser.go index a69ef9e..2b1754f 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -243,7 +243,9 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { return err } - changelogEntry, err := changelog.NewChangelogEntry(logger, analyzedCommits, nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) + changelogData := changelog.New(commitparser.ByType(analyzedCommits), nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) + + changelogEntry, err := changelog.Entry(logger, changelog.DefaultTemplate(), changelogData, changelog.Formatting{}) if err != nil { return fmt.Errorf("failed to build changelog entry: %w", err) } @@ -289,9 +291,16 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger.InfoContext(ctx, "file content is already up-to-date in remote branch, skipping push") } + // We do not need the version title here. In the pull request the version is available from the title, and in the + // release on the Forge its usually in a heading somewhere above the text. + changelogEntryPullRequest, err := changelog.Entry(logger, changelog.DefaultTemplate(), changelogData, changelog.Formatting{HideVersionTitle: true}) + if err != nil { + return fmt.Errorf("failed to build pull request changelog entry: %w", err) + } + // Open/Update PR if pr == nil { - pr, err = releasepr.NewReleasePullRequest(rpBranch, rp.targetBranch, nextVersion, changelogEntry) + pr, err = releasepr.NewReleasePullRequest(rpBranch, rp.targetBranch, nextVersion, changelogEntryPullRequest) if err != nil { return err } @@ -308,7 +317,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { if err != nil { return err } - err = pr.SetDescription(changelogEntry, overrides) + err = pr.SetDescription(changelogEntryPullRequest, overrides) if err != nil { return err } From 1a370c39dc9c96b28568228b0414a1c05c6042d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Wed, 25 Sep 2024 11:23:04 +0200 Subject: [PATCH 034/260] docs: GitLab tutorial and CI/CD component reference (#72) --- README.md | 15 ++-- docs/SUMMARY.md | 4 +- docs/reference/gitlab-cicd-component.md | 23 +++++ docs/tutorials/github.md | 6 +- docs/tutorials/gitlab-access-token.png | 3 + .../gitlab-settings-merge-method.png | 3 + docs/tutorials/gitlab-settings-squash.png | 3 + docs/tutorials/gitlab.md | 88 +++++++++++++++++++ 8 files changed, 134 insertions(+), 11 deletions(-) create mode 100644 docs/reference/gitlab-cicd-component.md create mode 100644 docs/tutorials/gitlab-access-token.png create mode 100644 docs/tutorials/gitlab-settings-merge-method.png create mode 100644 docs/tutorials/gitlab-settings-squash.png create mode 100644 docs/tutorials/gitlab.md diff --git a/README.md b/README.md index afc56d9..2a70ea4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,14 @@ # releaser-pleaser -`releaser-pleaser` is a tool designed to automate versioning and changelog management for your projects. Building on the concepts of [ -`release-please`](https://github.com/googleapis/release-please), it streamlines the release process through GitHub Actions or GitLab CI. +

+ releaser-pleaser is a tool designed to automate versioning and changelog management for your projects. Building on the concepts of release-please, it streamlines the release process through GitHub Actions or GitLab CI. +

+ +

+ Badge: Documentation + Badge: Stable Release + Badge: License GPL-3.0 +

## Features @@ -15,10 +22,6 @@ `releaser-pleaser` simplifies release management, allowing maintainers to focus on development while ensuring consistent and well-documented releases. -## Status - -This project is still under active development. You can not reasonably use it right now and not all features advertised above work. Keep your eyes open for any releases. - ## Relation to `release-please` After using diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 1125209..90d3f7d 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -5,7 +5,7 @@ # Tutorials - [Getting started on GitHub](tutorials/github.md) -- [Getting started on GitLab]() +- [Getting started on GitLab](tutorials/gitlab.md) # Explanation @@ -22,7 +22,7 @@ - [Glossary](reference/glossary.md) - [Pull Request Options](reference/pr-options.md) - [GitHub Action](reference/github-action.md) -- [GitLab CI]() +- [GitLab CI/CD Component](reference/gitlab-cicd-component.md) --- diff --git a/docs/reference/gitlab-cicd-component.md b/docs/reference/gitlab-cicd-component.md new file mode 100644 index 0000000..4f35e0c --- /dev/null +++ b/docs/reference/gitlab-cicd-component.md @@ -0,0 +1,23 @@ +# GitLab CI/CD Component + +## Reference + +The CI/CD component is available as `$CI_SERVER_FQDN/apricote/releaser-pleaser/run` on gitlab.com. + +It is being distributed through the CI/CD Catalog: [apricote/releaser-pleaser](https://gitlab.com/explore/catalog/apricote/releaser-pleaser). + +## Versions + +The `apricote/releaser-pleaser` action is released together with `releaser-pleaser` and they share the version number. + +The component does not support floating tags (e.g. `v1`) right now ([#31](https://github.com/apricote/releaser-pleaser/issues/31)). You have to use the full version or commit SHA instead: `apricote/releaser-pleaser@v0.4.0`. + +## Inputs + +The following inputs are supported by the component. + +| Input | Description | Default | Example | +| ---------------------- | :-------------------------------------------------------- | ------: | -------------------------------------------------------------------: | +| `branch` | This branch is used as the target for releases. | `main` | `master` | +| `token` (**required**) | GitLab access token for creating and updating release PRs | | `$RELEASER_PLEASER_TOKEN` | +| `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml
| diff --git a/docs/tutorials/github.md b/docs/tutorials/github.md index 83f797c..693ef65 100644 --- a/docs/tutorials/github.md +++ b/docs/tutorials/github.md @@ -1,6 +1,6 @@ -# GitHub +# Getting started on GitHub -In this tutorial we show how to install `releaser-pleaser` in your GitHub project. +In this tutorial you will learn how to set up `releaser-pleaser` in your GitHub project with GitHub Actions. ## 1. Repository Settings @@ -52,7 +52,7 @@ jobs: pull-requests: write steps: - name: releaser-pleaser - uses: apricote/releaser-pleaser@v0.2.0 + uses: apricote/releaser-pleaser@v0.4.0 ``` ## 3. Release Pull Request diff --git a/docs/tutorials/gitlab-access-token.png b/docs/tutorials/gitlab-access-token.png new file mode 100644 index 0000000..15d7619 --- /dev/null +++ b/docs/tutorials/gitlab-access-token.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31b485bbe031443c4bfa0d39514dc7e5d524925aa877848def93ee40f69a1897 +size 146496 diff --git a/docs/tutorials/gitlab-settings-merge-method.png b/docs/tutorials/gitlab-settings-merge-method.png new file mode 100644 index 0000000..0ea01c7 --- /dev/null +++ b/docs/tutorials/gitlab-settings-merge-method.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b853625854582a66ab2438f11e6001a88bcb276225abed536ba68617bde324db +size 57583 diff --git a/docs/tutorials/gitlab-settings-squash.png b/docs/tutorials/gitlab-settings-squash.png new file mode 100644 index 0000000..e0c87a4 --- /dev/null +++ b/docs/tutorials/gitlab-settings-squash.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ce9b9826229851e961ef55d91cb9ba91ca9ca4d955a932d9ff6b10d04788c29 +size 41048 diff --git a/docs/tutorials/gitlab.md b/docs/tutorials/gitlab.md new file mode 100644 index 0000000..b38c807 --- /dev/null +++ b/docs/tutorials/gitlab.md @@ -0,0 +1,88 @@ +# Getting started on GitLab + +In this tutorial you will learn how to set up `releaser-pleaser` in your GitLab project with GitLab CI. + +> In `releaser-pleaser` documentation we mostly use "Pull Request" (GitHub wording) instead of "Merge Request" (GitLab wording). The GitLab-specific pages are an exception and use "Merge Request". + +## 1. Project Settings + +### 1.1. Merge Requests + +`releaser-pleaser` requires _Fast-forward merges_ and _squashing_. With other merge options it can not reliably find the right merge request for every commit on `main`. + +Open your project settings to page _Merge Requests_: + +> `https://gitlab.com/YOUR-PATH/YOUR-PROJECT/-/settings/merge_requests` + +In the "Merge method" section select "Fast-forward merge": + +![Screenshot of the required merge method settings](./gitlab-settings-merge-method.png) + +In the "Squash commits when merging" section select "Require": + +![Screenshot of the required squash settings](./gitlab-settings-squash.png) + +## 2. API Access Token + +`releaser-pleaser` uses the GitLab API to create the [release merge request](../explanation/release-pr.md) and subsequent releases for you. The default `GITLAB_TOKEN` available in CI jobs does not have enough permissions for this, so we need to create an Access Token and make it available in a CI variable. + +## 2.1. Create Project Access Token + +Open your project settings to page _Access tokens_: + +> `https://gitlab.com/YOUR-PATH/YOUR-PROJECT/-/settings/access_tokens` + +Create a token with these settings: + +- **Name**: `releaser-pleaser` +- **Role**: `Maintainer` +- **Scopes**: `api`, `read_repository`, `write_repository` + +Copy the created token for the next step. + +![Screenshot of the access token settings](./gitlab-access-token.png) + +## 2.2. Save token in CI variable + +Open your project settings to page _CI/CD_: + +> `https://gitlab.com/YOUR-PATH/YOUR-PROJECT/-/settings/ci_cd` + +In the section "Variables" click on the "Add variable" button to open the form for a new variable. Use these settings to create the new variable: + +- **Type**: Variable +- **Visibility**: Masked +- **Flags**: Uncheck "Protect variable" if your `main` branch is not protected +- **Key**: `RELEASER_PLEASER_TOKEN` +- **Value**: The project access token from the previous step + +## 3. GitLab CI/CD + +`releaser-pleaser` is published as a [GitLab CI/CD Component](https://docs.gitlab.com/ee/ci/components/): https://gitlab.com/explore/catalog/apricote/releaser-pleaser + +Create or open your `.gitlab-ci.yml` and add the following include to your configuration: + +```yaml +stages: [build] + +include: + - component: $CI_SERVER_FQDN/apricote/releaser-pleaser/run@v0.4.0-beta.1 + inputs: + token: $RELEASER_PLEASER_TOKEN +``` + +> You can set the `stage` input if you want to run `releaser-pleaser` during a different stage. + +## 4. Release Merge Request + +Once the `releaser-pleaser` job runs for the first time, you can check the logs to see what it did. +If you have releasable commits since the last tag, `releaser-pleaser` opens a release merge request for the proposed release. + +Once you merge this merge request, `releaser-pleaser` automatically creates a Git tag and GitLab Release with the proposed version and changelog. + +## Related Documentation + +- **Explanation** + - [Release Pull Request](../explanation/release-pr.md) +- **Reference** + - [GitLab CI/CD Component](../reference/gitlab-cicd-component.md) From 08505a55cda39e48c92e525bbeeed8e3afd56159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Wed, 25 Sep 2024 11:35:59 +0200 Subject: [PATCH 035/260] ci(mirror): fix missing lfs files on push (#73) --- .github/workflows/mirror.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index c57187e..76c963b 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -15,6 +15,8 @@ jobs: with: # Need all to fetch all tags so we can push them fetch-depth: 0 + # Required so they can be pushed too + lfs: true - name: Add Remote env: From 55083f2a59de3af0122db544d1f12f1b02162cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Wed, 25 Sep 2024 12:09:27 +0200 Subject: [PATCH 036/260] docs: guide for extra-files (#74) --- docs/SUMMARY.md | 1 + docs/guides/updating-arbitrary-files.md | 63 +++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 docs/guides/updating-arbitrary-files.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 90d3f7d..d001c2d 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -16,6 +16,7 @@ - [Customizing Release Notes](guides/release-notes.md) - [Pre-releases](guides/pre-releases.md) - [Workflow Permissions on GitHub](guides/github-workflow-permissions.md) +- [Updating arbitrary files](guides/updating-arbitrary-files.md) # Reference diff --git a/docs/guides/updating-arbitrary-files.md b/docs/guides/updating-arbitrary-files.md new file mode 100644 index 0000000..d4b65bf --- /dev/null +++ b/docs/guides/updating-arbitrary-files.md @@ -0,0 +1,63 @@ +# Updating arbitrary files + +In some situations it makes sense to have the current version committed in files in the repository: + +- Documentation examples +- A source-code file that has the version for user agents and introspection +- Reference to a container image tag that is built from the repository + +`releaser-pleaser` can automatically update these references in the [Release PR](../explanation/release-pr.md). + +## Markers + +The line that needs to be updated must have the marker `x-releaser-pleaser-version` somewhere after the version that should be updated. + +For example: + +```go +// version/version.go + +package version + +const Version = "v1.0.0" // x-releaser-pleaser-version +``` + +## Extra Files + +You need to tell `releaser-pleaser` which files it should update. This happens through the CI-specific configuration. + +### GitHub Action + +In the GitHub Action you can set the `extra-files` input with a list of the files. They need to be formatted as a single multi-line string with one file path per line: + +```yaml +jobs: + releaser-pleaser: + steps: + - uses: apricote/releaser-pleaser@v0.4.0 + with: + extra-files: | + version.txt + version/version.go + docker-compose.yml +``` + +### GitLab CI/CD Component + +In the GitLab CI/CD Component you can set the `extra-files` input with a list of files. They need to be formatted as a single multi-line string with one file path per line: + +```yaml +include: + - component: $CI_SERVER_FQDN/apricote/releaser-pleaser/run@v0.4.0 + inputs: + extra-files: | + version.txt + version/version.go + docker-compose.yml +``` + +## Related Documentation + +- **Reference** + - [GitHub Action](../reference/github-action.md#inputs) + - [GitLab CI/CD Component](../reference/gitlab-cicd-component.md#inputs) From 89dc9e3fe8873536ff2cf202d53d2b32915f0855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Wed, 25 Sep 2024 12:41:11 +0200 Subject: [PATCH 037/260] feat(gitlab): support self-managed instances (#75) Support self-managed gitlab instances by reading the GitLab CI environment variables. --- docs/tutorials/gitlab.md | 6 +++++ internal/forge/gitlab/gitlab.go | 45 ++++++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/docs/tutorials/gitlab.md b/docs/tutorials/gitlab.md index b38c807..2e5ed72 100644 --- a/docs/tutorials/gitlab.md +++ b/docs/tutorials/gitlab.md @@ -73,6 +73,12 @@ include: > You can set the `stage` input if you want to run `releaser-pleaser` during a different stage. +
+ +If you want to use `releaser-pleaser` on a self-managed GitLab instance, you need to mirror the GitLab.com component to your instance. See the official [GitLab documentation for details](https://docs.gitlab.com/ee/ci/components/#use-a-gitlabcom-component-in-a-self-managed-instance). + +
+ ## 4. Release Merge Request Once the `releaser-pleaser` job runs for the first time, you can check the logs to see what it did. diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index 1394898..f77b324 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -24,8 +24,14 @@ const ( PRStateOpen = "opened" PRStateMerged = "merged" PRStateEventClose = "close" - EnvAPIToken = "GITLAB_TOKEN" // nolint:gosec // Not actually a hardcoded credential - EnvProjectPath = "CI_PROJECT_PATH" + + EnvAPIToken = "GITLAB_TOKEN" // nolint:gosec // Not actually a hardcoded credential + + // The following vars are from https://docs.gitlab.com/ee/ci/variables/predefined_variables.html + + EnvAPIURL = "CI_API_V4_URL" + EnvProjectURL = "CI_PROJECT_URL" + EnvProjectPath = "CI_PROJECT_PATH" ) type GitLab struct { @@ -36,19 +42,23 @@ type GitLab struct { } func (g *GitLab) RepoURL() string { + if g.options.ProjectURL != "" { + return g.options.ProjectURL + } + return fmt.Sprintf("https://gitlab.com/%s", g.options.Path) } func (g *GitLab) CloneURL() string { - return fmt.Sprintf("https://gitlab.com/%s.git", g.options.Path) + return fmt.Sprintf("%s.git", g.RepoURL()) } func (g *GitLab) ReleaseURL(version string) string { - return fmt.Sprintf("https://gitlab.com/%s/-/releases/%s", g.options.Path, version) + return fmt.Sprintf("%s/-/releases/%s", g.RepoURL(), version) } func (g *GitLab) PullRequestURL(id int) string { - return fmt.Sprintf("https://gitlab.com/%s/-/merge_requests/%d", g.options.Path, id) + return fmt.Sprintf("%s/-/merge_requests/%d", g.RepoURL(), id) } func (g *GitLab) GitAuth() transport.AuthMethod { @@ -393,20 +403,41 @@ func gitlabMRToReleasePullRequest(pr *gitlab.MergeRequest) *releasepr.ReleasePul func (g *Options) autodiscover() { // Read settings from GitLab-CI env vars + if apiURL := os.Getenv(EnvAPIURL); apiURL != "" { + g.APIURL = apiURL + } + if apiToken := os.Getenv(EnvAPIToken); apiToken != "" { g.APIToken = apiToken } + if projectURL := os.Getenv(EnvProjectURL); projectURL != "" { + g.ProjectURL = projectURL + } + if projectPath := os.Getenv(EnvProjectPath); projectPath != "" { g.Path = projectPath } + +} + +func (g *Options) ClientOptions() []gitlab.ClientOptionFunc { + options := []gitlab.ClientOptionFunc{} + + if g.APIURL != "" { + options = append(options, gitlab.WithBaseURL(g.APIURL)) + } + + return options } type Options struct { forge.Options - Path string + ProjectURL string + Path string + APIURL string APIToken string } @@ -414,7 +445,7 @@ func New(log *slog.Logger, options *Options) (*GitLab, error) { log = log.With("forge", "gitlab") options.autodiscover() - client, err := gitlab.NewClient(options.APIToken) + client, err := gitlab.NewClient(options.APIToken, options.ClientOptions()...) if err != nil { return nil, err } From 4cc45ea244325be2a72c6a00c8823d7080319ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Wed, 25 Sep 2024 13:06:06 +0200 Subject: [PATCH 038/260] chore(main): release v0.4.0 (#62) Co-authored-by: releaser-pleaser <> --- CHANGELOG.md | 23 +++++++++++++++++++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f8c321..a3a315d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [v0.4.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.0) + +### ✨ Highlights + +#### GitLab Support + +You can now use `releaser-pleaser` with projects hosted on GitLab.com and self-managed GitLab installations. Check out the new [tutorial](https://apricote.github.io/releaser-pleaser/tutorials/gitlab.html) to get started. + +### Features + +- add support for GitLab repositories (#49) +- add shell to container image (#59) +- **gitlab**: add CI/CD component (#55) +- **changelog**: omit version heading in forge release notes +- **gitlab**: support self-managed instances (#75) + +### Bug Fixes + +- **parser**: continue on unparsable commit message (#48) +- **cli**: command name in help output (#52) +- **parser**: invalid handling of empty lines (#53) +- multiple extra-files are not evaluated properly (#61) + ## [v0.4.0-beta.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.0-beta.1) ### Features diff --git a/action.yml b/action.yml index 15c82df..118385a 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: ghcr.io/apricote/releaser-pleaser:v0.4.0-beta.1 # x-releaser-pleaser-version + image: ghcr.io/apricote/releaser-pleaser:v0.4.0 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index bd762be..0531c95 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -24,7 +24,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.4.0-beta.1 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.4.0 # x-releaser-pleaser-version entrypoint: [""] variables: GITLAB_TOKEN: $[[ inputs.token ]] From 9bb117c7b9ed156f8787a698238d07939428881f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 6 Oct 2024 13:10:54 +0000 Subject: [PATCH 039/260] deps: update module github.com/xanzy/go-gitlab to v0.110.0 (#78) 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 f07807f..e31443c 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 - github.com/xanzy/go-gitlab v0.109.0 + github.com/xanzy/go-gitlab v0.110.0 github.com/yuin/goldmark v1.7.4 ) diff --git a/go.sum b/go.sum index 7514854..b46fa77 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= -github.com/xanzy/go-gitlab v0.109.0 h1:RcRme5w8VpLXTSTTMZdVoQWY37qTJWg+gwdQl4aAttE= -github.com/xanzy/go-gitlab v0.109.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= +github.com/xanzy/go-gitlab v0.110.0 h1:hsFIFp01v/0D0sdUXoZfRk6CROzZbHQplk6NzKSFKhc= +github.com/xanzy/go-gitlab v0.110.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From 40a15dfafa5a008e3b65eb589f217c87c3e94147 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 10 Oct 2024 18:21:50 +0000 Subject: [PATCH 040/260] deps: update module github.com/xanzy/go-gitlab to v0.111.0 (#80) 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 e31443c..a90fc3c 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 - github.com/xanzy/go-gitlab v0.110.0 + github.com/xanzy/go-gitlab v0.111.0 github.com/yuin/goldmark v1.7.4 ) diff --git a/go.sum b/go.sum index b46fa77..9c69294 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= -github.com/xanzy/go-gitlab v0.110.0 h1:hsFIFp01v/0D0sdUXoZfRk6CROzZbHQplk6NzKSFKhc= -github.com/xanzy/go-gitlab v0.110.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= +github.com/xanzy/go-gitlab v0.111.0 h1:4zT52QdDVxGYAGxN2VY8upSvZIiuiI+Z4d+c+7D/lII= +github.com/xanzy/go-gitlab v0.111.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From cd412ba59fcd01529b8185c354642028c8064af4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:21:35 +0000 Subject: [PATCH 041/260] deps: update module github.com/yuin/goldmark to v1.7.6 (#81) 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 a90fc3c..2babe0b 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 github.com/xanzy/go-gitlab v0.111.0 - github.com/yuin/goldmark v1.7.4 + github.com/yuin/goldmark v1.7.6 ) require ( diff --git a/go.sum b/go.sum index 9c69294..7e6d1fe 100644 --- a/go.sum +++ b/go.sum @@ -113,8 +113,8 @@ github.com/xanzy/go-gitlab v0.111.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+ 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg= -github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.6 h1:cZgJxVh5mL5cu8KOnwxvFJy5TFB0BHUskZZyq7TYbDg= +github.com/yuin/goldmark v1.7.6/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= From da6257e6183313e544de6a187ff48917aa5b42f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:19:09 +0200 Subject: [PATCH 042/260] deps: update codecov/codecov-action digest to b9fd7d1 (#76) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 576ac4b..e218910 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4 + uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 with: token: ${{ secrets.CODECOV_TOKEN }} From de4f26225aa33763727f995db6468cfe398bb99f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:01:17 +0200 Subject: [PATCH 043/260] deps: update golangci/golangci-lint-action digest to 971e284 (#77) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e218910..33b5530 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: go-version-file: go.mod - name: Run golangci-lint - uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6 + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: version: v1.61.0 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m From 755d9b125b6fbef48733600714cc7215cff31990 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:02:39 +0200 Subject: [PATCH 044/260] deps: update actions/checkout digest to eef6144 (#79) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/docs.yaml | 2 +- .github/workflows/mirror.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 33b5530..330b568 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 7c2f855..c7318c8 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,7 +13,7 @@ jobs: id-token: write # To update the deployment status steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: lfs: "true" diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index 76c963b..780e92a 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -11,7 +11,7 @@ jobs: REMOTE: mirror steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: # Need all to fetch all tags so we can push them fetch-depth: 0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 779384b..c73c1dd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 4cc9c24..753ca31 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 with: ref: main From 2a4f2b97d18bc8d1472a1d853b7003c184a48098 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:42:23 +0000 Subject: [PATCH 045/260] deps: update module github.com/xanzy/go-gitlab to v0.112.0 (#82) 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 2babe0b..ae1bc63 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 - github.com/xanzy/go-gitlab v0.111.0 + github.com/xanzy/go-gitlab v0.112.0 github.com/yuin/goldmark v1.7.6 ) diff --git a/go.sum b/go.sum index 7e6d1fe..6c1c183 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= -github.com/xanzy/go-gitlab v0.111.0 h1:4zT52QdDVxGYAGxN2VY8upSvZIiuiI+Z4d+c+7D/lII= -github.com/xanzy/go-gitlab v0.111.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= +github.com/xanzy/go-gitlab v0.112.0 h1:6Z0cqEooCvBMfBIHw+CgO4AKGRV8na/9781xOb0+DKw= +github.com/xanzy/go-gitlab v0.112.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From acff7ea83017456ae44b4e1baac08f9dd8c2b3e0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:11:20 +0000 Subject: [PATCH 046/260] deps: update module github.com/yuin/goldmark to v1.7.7 (#83) 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 ae1bc63..739723e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 github.com/xanzy/go-gitlab v0.112.0 - github.com/yuin/goldmark v1.7.6 + github.com/yuin/goldmark v1.7.7 ) require ( diff --git a/go.sum b/go.sum index 6c1c183..269fbef 100644 --- a/go.sum +++ b/go.sum @@ -113,8 +113,8 @@ github.com/xanzy/go-gitlab v0.112.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+ 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.6 h1:cZgJxVh5mL5cu8KOnwxvFJy5TFB0BHUskZZyq7TYbDg= -github.com/yuin/goldmark v1.7.6/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= +github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= From 763018ff9bcfbd07a058029013d5ff4e077f4443 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 12:43:19 +0000 Subject: [PATCH 047/260] deps: update module github.com/yuin/goldmark to v1.7.8 (#84) 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 739723e..4dad7fe 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 github.com/xanzy/go-gitlab v0.112.0 - github.com/yuin/goldmark v1.7.7 + github.com/yuin/goldmark v1.7.8 ) require ( diff --git a/go.sum b/go.sum index 269fbef..32beda5 100644 --- a/go.sum +++ b/go.sum @@ -113,8 +113,8 @@ github.com/xanzy/go-gitlab v0.112.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+ 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.7.7 h1:5m9rrB1sW3JUMToKFQfb+FGt1U7r57IHu5GrYrG2nqU= -github.com/yuin/goldmark v1.7.7/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= +github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= From 3caa7364ee82067742c8fbed1222c7ba0b5ff794 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Thu, 17 Oct 2024 19:22:03 +0200 Subject: [PATCH 048/260] 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. --- internal/forge/gitlab/gitlab.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index f77b324..aedc4f3 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -176,8 +176,8 @@ func (g *GitLab) prForCommit(ctx context.Context, commit git.Commit) (*git.PullR var mergeRequest *gitlab.MergeRequest for _, mr := range associatedMRs { - // We only look for the MR that has this commit set as the "merge commit" => The result of squashing this branch onto main - if mr.MergeCommitSHA == commit.Hash { + // We only look for the MR that has this commit set as the "merge/squash commit" => The result of squashing this branch onto main + if mr.MergeCommitSHA == commit.Hash || mr.SquashCommitSHA == commit.Hash { mergeRequest = mr break } @@ -387,9 +387,12 @@ func gitlabMRToReleasePullRequest(pr *gitlab.MergeRequest) *releasepr.ReleasePul } } + // Commit SHA is saved in either [MergeCommitSHA] or [SquashCommitSHA] depending on which merge method was used. var releaseCommit *git.Commit if pr.MergeCommitSHA != "" { releaseCommit = &git.Commit{Hash: pr.MergeCommitSHA} + } else if pr.SquashCommitSHA != "" { + releaseCommit = &git.Commit{Hash: pr.SquashCommitSHA} } return &releasepr.ReleasePullRequest{ From 1883466c3e333da89537e4f90889ba1c572972dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Thu, 17 Oct 2024 19:24:24 +0200 Subject: [PATCH 049/260] chore(main): release v0.4.1 (#87) Co-authored-by: releaser-pleaser <> --- CHANGELOG.md | 6 ++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3a315d..1f0ad20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [v0.4.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.1) + +### Bug Fixes + +- **gitlab**: release not created when release pr was squashed (#86) + ## [v0.4.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.0) ### ✨ Highlights diff --git a/action.yml b/action.yml index 118385a..f07a88b 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: ghcr.io/apricote/releaser-pleaser:v0.4.0 # x-releaser-pleaser-version + image: ghcr.io/apricote/releaser-pleaser:v0.4.1 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index 0531c95..278a59a 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -24,7 +24,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.4.0 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.4.1 # x-releaser-pleaser-version entrypoint: [""] variables: GITLAB_TOKEN: $[[ inputs.token ]] From 8493c5a6253ac304e3ebcb27f6b4f9a305614273 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 06:09:18 +0000 Subject: [PATCH 050/260] deps: update registry.gitlab.com/gitlab-org/release-cli docker tag to v0.19.0 (#88) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 37024e6..7fcba92 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: [ release ] # and create a corresponding GitLab Release. create-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:v0.18.0 + image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0 script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG From db4aebcc73d18c9b4f7980690bfac98eaecbc8df Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:50:37 +0000 Subject: [PATCH 051/260] deps: update module github.com/xanzy/go-gitlab to v0.113.0 (#93) 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 4dad7fe..38de481 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 - github.com/xanzy/go-gitlab v0.112.0 + github.com/xanzy/go-gitlab v0.113.0 github.com/yuin/goldmark v1.7.8 ) diff --git a/go.sum b/go.sum index 32beda5..63134fb 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= -github.com/xanzy/go-gitlab v0.112.0 h1:6Z0cqEooCvBMfBIHw+CgO4AKGRV8na/9781xOb0+DKw= -github.com/xanzy/go-gitlab v0.112.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= +github.com/xanzy/go-gitlab v0.113.0 h1:v5O4R+YZbJGxKqa9iIZxjMyeKkMKBN8P6sZsNl+YckM= +github.com/xanzy/go-gitlab v0.113.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From 8c7b9fcf93a22951fe365f2b8460483aee5a772c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:22:01 +0000 Subject: [PATCH 052/260] deps: update dependency rust-lang/mdbook to v0.4.41 (#94) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index c7318c8..2cb9fa7 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.40 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.41 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 71351140f6926218d420a7b75e7e0cb29a6155f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 17:23:27 +0000 Subject: [PATCH 053/260] deps: update dependency rust-lang/mdbook to v0.4.42 (#95) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2cb9fa7..2819083 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.41 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.42 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From cbfacc894b9e24e69fd46c72dcc92b0d41c41cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 8 Nov 2024 13:27:09 +0100 Subject: [PATCH 054/260] fix(action): container image reference used wrong syntax (#96) The current value caused the following error when running the action in a different repository: Error: 'ghcr.io/apricote/releaser-pleaser:v0.4.1' should be either '[path]/Dockerfile' or 'docker://image[:tag]'. Not sure why this did not come up before, as we are also using the same format for the CI in this repository, even if we use another tag. --- .github/workflows/releaser-pleaser.yaml | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 753ca31..2e3e4cb 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -34,7 +34,7 @@ jobs: - run: ko build --bare --local --tags ci github.com/apricote/releaser-pleaser/cmd/rp - run: mkdir -p .github/actions/releaser-pleaser - - run: "sed -i 's|image: .*$|image: ghcr.io/apricote/releaser-pleaser:ci|g' action.yml" + - run: "sed -i 's|image: .*$|image: docker://ghcr.io/apricote/releaser-pleaser:ci|g' action.yml" # Dogfood the action to make sure it works for users. - name: releaser-pleaser diff --git a/action.yml b/action.yml index f07a88b..1dd625c 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: ghcr.io/apricote/releaser-pleaser:v0.4.1 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.4.1 # x-releaser-pleaser-version args: - run - --forge=github From 05be3684c61d1d59d6c4c3552c99ff51134dae18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 8 Nov 2024 13:28:52 +0100 Subject: [PATCH 055/260] chore(main): release v0.4.2 (#97) Co-authored-by: releaser-pleaser <> --- CHANGELOG.md | 6 ++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f0ad20..4e3b5c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [v0.4.2](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.2) + +### Bug Fixes + +- **action**: container image reference used wrong syntax (#96) + ## [v0.4.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.1) ### Bug Fixes diff --git a/action.yml b/action.yml index 1dd625c..76afadf 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: docker://ghcr.io/apricote/releaser-pleaser:v0.4.1 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.4.2 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index 278a59a..3a82cd1 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -24,7 +24,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.4.1 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.4.2 # x-releaser-pleaser-version entrypoint: [""] variables: GITLAB_TOKEN: $[[ inputs.token ]] From b55cba293f90d1e564794a3ae1fbc470224eaef7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 10 Nov 2024 22:51:51 +0000 Subject: [PATCH 056/260] deps: update dependency golangci/golangci-lint to v1.62.0 (#98) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 330b568..4a4cb99 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.61.0 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.62.0 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 59aa7aae020f15d712f4a8d3ad22873db3435d01 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:52:20 +0100 Subject: [PATCH 057/260] deps: update actions/setup-go digest to 41dfa10 (#90) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4a4cb99..3946c95 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: go-version-file: go.mod @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: go-version-file: go.mod @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: go-version-file: go.mod diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c73c1dd..585d7ea 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 - name: Set up Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: go-version-file: go.mod diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 2e3e4cb..4c54098 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -23,7 +23,7 @@ jobs: ref: main - name: Set up Go - uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5 + uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 with: go-version-file: go.mod From b6d6270d9e6f3d1dba6743f9f28ef604d8116012 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:52:43 +0100 Subject: [PATCH 058/260] deps: update actions/checkout digest to 11bd719 (#89) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/docs.yaml | 2 +- .github/workflows/mirror.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3946c95..fbc91b5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 2819083..974d953 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,7 +13,7 @@ jobs: id-token: write # To update the deployment status steps: - - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: lfs: "true" diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index 780e92a..e287aed 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -11,7 +11,7 @@ jobs: REMOTE: mirror steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: # Need all to fetch all tags so we can push them fetch-depth: 0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 585d7ea..e912634 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 4c54098..5c1d0b4 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: ref: main From 79c5b13e1ff360f4f428a821d41afbb2d38c9e1c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:09:17 +0100 Subject: [PATCH 059/260] deps: update codecov/codecov-action action to v5 (#102) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fbc91b5..74127eb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4 + uses: codecov/codecov-action@3b1354a6c45db9f1008891f4eafc1a7e94ce1d18 # v5 with: token: ${{ secrets.CODECOV_TOKEN }} From 147148c8911f75d831c06b69ad4c68f99945e062 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:10:33 +0100 Subject: [PATCH 060/260] chore(config): migrate config .github/renovate.json5 (#104) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/renovate.json5 | 113 ++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 58 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 74a660e..1ab8788 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -1,80 +1,77 @@ { - "extends": [ - ":semanticCommits", - ":semanticCommitTypeAll(deps)", - ":semanticCommitScopeDisabled", - - ":dependencyDashboard", - ":approveMajorUpdates", - - ":automergeMinor", - ":automergeLinters", - ":automergeTesters", - ":automergeTypes", - - ":maintainLockFilesWeekly", - ":enableVulnerabilityAlerts", - "helpers:pinGitHubActionDigests" + extends: [ + ':semanticCommits', + ':semanticCommitTypeAll(deps)', + ':semanticCommitScopeDisabled', + ':dependencyDashboard', + ':approveMajorUpdates', + ':automergeMinor', + ':automergeLinters', + ':automergeTesters', + ':automergeTypes', + ':maintainLockFilesWeekly', + ':enableVulnerabilityAlerts', + 'helpers:pinGitHubActionDigests', ], - "packageRules": [ + packageRules: [ { - "groupName": "linters", - "matchUpdateTypes": [ - "minor", - "patch" + groupName: 'linters', + matchUpdateTypes: [ + 'minor', + 'patch', ], - "matchDepNames": [ - "golangci/golangci-lint" + matchDepNames: [ + 'golangci/golangci-lint', ], - "automerge": true + automerge: true, }, { - "groupName": "testing", - "matchUpdateTypes": [ - "minor", - "patch" + groupName: 'testing', + matchUpdateTypes: [ + 'minor', + 'patch', ], - "matchDepNames": [ - "github.com/stretchr/testify" + matchDepNames: [ + 'github.com/stretchr/testify', ], - "automerge": true + automerge: true, }, { - "groupName": "github-actions", - "matchUpdateTypes": [ - "minor", - "patch" + groupName: 'github-actions', + matchUpdateTypes: [ + 'minor', + 'patch', ], - "matchDepTypes": [ - "action" + matchDepTypes: [ + 'action', ], - "automerge": true + automerge: true, }, { - "groupName": "gitlab-ci", - "matchUpdateTypes": [ - "minor", - "patch" + groupName: 'gitlab-ci', + matchUpdateTypes: [ + 'minor', + 'patch', ], - "matchPackageNames": [ - "registry.gitlab.com/gitlab-org/release-cli" + matchPackageNames: [ + 'registry.gitlab.com/gitlab-org/release-cli', ], - "automerge": true - } + automerge: true, + }, ], - "customManagers": [ + customManagers: [ { - "customType": "regex", - "fileMatch": [ - ".+\\.ya?ml$" + customType: 'regex', + fileMatch: [ + '.+\\.ya?ml$', ], - "matchStrings": [ - ": (?.+) # renovate: datasource=(?[a-z-]+) depName=(?[^\\s]+)(?: lookupName=(?[^\\s]+))?(?: versioning=(?[a-z-]+))?(?: extractVersion=(?[^\\s]+))?" - ] - } + matchStrings: [ + ': (?.+) # renovate: datasource=(?[a-z-]+) depName=(?[^\\s]+)(?: lookupName=(?[^\\s]+))?(?: versioning=(?[a-z-]+))?(?: extractVersion=(?[^\\s]+))?', + ], + }, + ], + postUpdateOptions: [ + 'gomodUpdateImportPaths', + 'gomodTidy', ], - "postUpdateOptions": [ - "gomodUpdateImportPaths", - "gomodTidy" - ] } From faf28fd3144f839159c7a96bffbc9369be992eef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:10:52 +0100 Subject: [PATCH 061/260] deps: update module github.com/google/go-github/v65 to v66 (#103) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- internal/forge/github/github.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 38de481..a9ae48f 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.0 require ( github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-git/v5 v5.12.0 - github.com/google/go-github/v65 v65.0.0 + github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 63134fb..dd83ee0 100644 --- a/go.sum +++ b/go.sum @@ -47,8 +47,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v65 v65.0.0 h1:pQ7BmO3DZivvFk92geC0jB0q2m3gyn8vnYPgV7GSLhQ= -github.com/google/go-github/v65 v65.0.0/go.mod h1:DvrqWo5hvsdhJvHd4WyVF9ttANN3BniqjP8uTFMNb60= +github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= +github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index 8dab499..2f48dcd 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -12,7 +12,7 @@ import ( "github.com/blang/semver/v4" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" - "github.com/google/go-github/v65/github" + "github.com/google/go-github/v66/github" "github.com/apricote/releaser-pleaser/internal/forge" "github.com/apricote/releaser-pleaser/internal/git" From 0ae2d909bc99b378fb8f944cfd5d072bd72a4e7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 15 Nov 2024 17:25:15 +0100 Subject: [PATCH 062/260] 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 --- .../conventionalcommits/conventionalcommits.go | 14 ++++++++++++-- .../conventionalcommits_test.go | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/internal/commitparser/conventionalcommits/conventionalcommits.go b/internal/commitparser/conventionalcommits/conventionalcommits.go index d11970c..e00af34 100644 --- a/internal/commitparser/conventionalcommits/conventionalcommits.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits.go @@ -35,8 +35,12 @@ func (c *Parser) Analyze(commits []git.Commit) ([]commitparser.AnalyzedCommit, e for _, commit := range commits { msg, err := c.machine.Parse([]byte(strings.TrimSpace(commit.Message))) if err != nil { - c.logger.Warn("failed to parse message of commit, skipping", "commit.hash", commit.Hash, "err", err) - continue + if msg == nil { + c.logger.Warn("failed to parse message of commit, skipping", "commit.hash", commit.Hash, "err", err) + continue + } + + c.logger.Warn("failed to parse message of commit fully, trying to use as much as possible", "commit.hash", commit.Hash, "err", err) } conventionalCommit, ok := msg.(*conventionalcommits.ConventionalCommit) @@ -44,6 +48,12 @@ func (c *Parser) Analyze(commits []git.Commit) ([]commitparser.AnalyzedCommit, e return nil, fmt.Errorf("unable to get ConventionalCommit from parser result: %T", msg) } + if conventionalCommit.Type == "" { + // Parsing broke before getting the type, can not use the commit + c.logger.Warn("commit type was not parsed, skipping", "commit.hash", commit.Hash, "err", err) + continue + } + commitVersionBump := conventionalCommit.VersionBump(conventionalcommits.DefaultStrategy) if commitVersionBump > conventionalcommits.UnknownVersion { // We only care about releasable commits diff --git a/internal/commitparser/conventionalcommits/conventionalcommits_test.go b/internal/commitparser/conventionalcommits/conventionalcommits_test.go index ddfbaf4..d301829 100644 --- a/internal/commitparser/conventionalcommits/conventionalcommits_test.go +++ b/internal/commitparser/conventionalcommits/conventionalcommits_test.go @@ -125,6 +125,24 @@ func TestAnalyzeCommits(t *testing.T) { }, wantErr: assert.NoError, }, + + { + name: "success with body", + commits: []git.Commit{ + { + Message: "feat: some thing (hz/fl!144)\n\nFixes #15\n\nDepends on !143", + }, + }, + expectedCommits: []commitparser.AnalyzedCommit{ + { + Commit: git.Commit{Message: "feat: some thing (hz/fl!144)\n\nFixes #15\n\nDepends on !143"}, + Type: "feat", + Description: "some thing (hz/fl!144)", + BreakingChange: false, + }, + }, + wantErr: assert.NoError, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 6c5bdfeee820a0cd1318b9be549b4a3a64c77e41 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:46:41 +0100 Subject: [PATCH 063/260] deps: update codecov/codecov-action digest to 5c47607 (#106) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 74127eb..bd79753 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@3b1354a6c45db9f1008891f4eafc1a7e94ce1d18 # v5 + uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v5 with: token: ${{ secrets.CODECOV_TOKEN }} From e9b3ba8ea2e5c5908cd30da987cf79e9d6ca7215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 15 Nov 2024 17:51:54 +0100 Subject: [PATCH 064/260] feat(gitlab): make job dependencies configurable and run immediately (#101) In the CI/CD component, make the jobs `needs` setting configurable through an input and change the default to `[]`. This will cause the job to run immediately. Co-authored-by: jo --- docs/reference/gitlab-cicd-component.md | 6 +++++- templates/run.yml | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/reference/gitlab-cicd-component.md b/docs/reference/gitlab-cicd-component.md index 4f35e0c..b22d5b2 100644 --- a/docs/reference/gitlab-cicd-component.md +++ b/docs/reference/gitlab-cicd-component.md @@ -10,7 +10,9 @@ It is being distributed through the CI/CD Catalog: [apricote/releaser-pleaser](h The `apricote/releaser-pleaser` action is released together with `releaser-pleaser` and they share the version number. -The component does not support floating tags (e.g. `v1`) right now ([#31](https://github.com/apricote/releaser-pleaser/issues/31)). You have to use the full version or commit SHA instead: `apricote/releaser-pleaser@v0.4.0`. +The component does not support floating tags (e.g. +`v1`) right now ([#31](https://github.com/apricote/releaser-pleaser/issues/31)). You have to use the full version or commit SHA instead: +`apricote/releaser-pleaser@v0.4.0`. ## Inputs @@ -21,3 +23,5 @@ The following inputs are supported by the component. | `branch` | This branch is used as the target for releases. | `main` | `master` | | `token` (**required**) | GitLab access token for creating and updating release PRs | | `$RELEASER_PLEASER_TOKEN` | | `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml
| +| `stage` | Stage the job runs in. Must exists. | `build` | `test` | +| `needs` | Other jobs the releaser-pleaser job depends on. | `[]` |
- validate-foo
- prepare-bar
| diff --git a/templates/run.yml b/templates/run.yml index 3a82cd1..dbae48e 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -15,17 +15,23 @@ spec: stage: default: build description: 'Defines the build stage' + + needs: + default: [ ] + type: array + description: 'Dependencies of the created Job' # Remember to update docs/reference/gitlab-ci-component.md --- releaser-pleaser: stage: $[[ inputs.stage ]] + needs: $[[ inputs.needs ]] rules: # 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.4.2 # x-releaser-pleaser-version - entrypoint: [""] + entrypoint: [ "" ] variables: GITLAB_TOKEN: $[[ inputs.token ]] script: From 11f840324160b64a61a0588d7e93fe172a5536d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 15 Nov 2024 18:07:59 +0100 Subject: [PATCH 065/260] 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 --- internal/git/git.go | 12 +++++++++--- releaserpleaser.go | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/internal/git/git.go b/internal/git/git.go index 09fd5c9..128f94c 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -18,7 +18,8 @@ import ( ) const ( - remoteName = "origin" + remoteName = "origin" + newFilePermissions = 0o644 ) type Commit struct { @@ -97,13 +98,18 @@ func (r *Repository) Checkout(_ context.Context, branch string) error { return nil } -func (r *Repository) UpdateFile(_ context.Context, path string, updaters []updater.Updater) error { +func (r *Repository) UpdateFile(_ context.Context, path string, create bool, updaters []updater.Updater) error { worktree, err := r.r.Worktree() if err != nil { return err } - file, err := worktree.Filesystem.OpenFile(path, os.O_RDWR, 0) + fileFlags := os.O_RDWR + if create { + fileFlags |= os.O_CREATE + } + + file, err := worktree.Filesystem.OpenFile(path, fileFlags, newFilePermissions) if err != nil { return err } diff --git a/releaserpleaser.go b/releaserpleaser.go index 2b1754f..0b1b846 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -253,14 +253,14 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { // Info for updaters info := updater.ReleaseInfo{Version: nextVersion, ChangelogEntry: changelogEntry} - err = repo.UpdateFile(ctx, updater.ChangelogFile, updater.WithInfo(info, updater.Changelog)) + err = repo.UpdateFile(ctx, updater.ChangelogFile, true, updater.WithInfo(info, updater.Changelog)) if err != nil { return fmt.Errorf("failed to update changelog file: %w", err) } for _, path := range rp.extraFiles { // TODO: Check for missing files - err = repo.UpdateFile(ctx, path, updater.WithInfo(info, rp.updaters...)) + err = repo.UpdateFile(ctx, path, false, updater.WithInfo(info, rp.updaters...)) if err != nil { return fmt.Errorf("failed to run file updater: %w", err) } From ef1d92cff0c6b2cc1e7d57ded4c6470b3e0680c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 15 Nov 2024 18:43:40 +0100 Subject: [PATCH 066/260] refactor: interface for versioning strategy (#109) --- cmd/rp/cmd/run.go | 2 +- internal/versioning/semver.go | 6 ++++-- internal/versioning/semver_test.go | 4 ++-- internal/versioning/versioning.go | 4 +++- releaserpleaser.go | 11 +++++------ 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index c29047b..ec11e24 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -86,7 +86,7 @@ func run(cmd *cobra.Command, _ []string) error { logger, flagBranch, conventionalcommits.NewParser(logger), - versioning.SemVerNextVersion, + versioning.SemVer, extraFiles, []updater.NewUpdater{updater.Generic}, ) diff --git a/internal/versioning/semver.go b/internal/versioning/semver.go index 49dc019..e6a58c7 100644 --- a/internal/versioning/semver.go +++ b/internal/versioning/semver.go @@ -10,9 +10,11 @@ import ( "github.com/apricote/releaser-pleaser/internal/git" ) -var _ Strategy = SemVerNextVersion +var SemVer Strategy = semVer{} -func SemVerNextVersion(r git.Releases, versionBump VersionBump, nextVersionType NextVersionType) (string, error) { +type semVer struct{} + +func (s semVer) NextVersion(r git.Releases, versionBump VersionBump, nextVersionType NextVersionType) (string, error) { latest, err := parseSemverWithDefault(r.Latest) if err != nil { return "", fmt.Errorf("failed to parse latest version: %w", err) diff --git a/internal/versioning/semver_test.go b/internal/versioning/semver_test.go index db22c88..702d31c 100644 --- a/internal/versioning/semver_test.go +++ b/internal/versioning/semver_test.go @@ -10,7 +10,7 @@ import ( "github.com/apricote/releaser-pleaser/internal/git" ) -func TestReleases_NextVersion(t *testing.T) { +func TestSemVer_NextVersion(t *testing.T) { type args struct { releases git.Releases versionBump VersionBump @@ -326,7 +326,7 @@ func TestReleases_NextVersion(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := SemVerNextVersion(tt.args.releases, tt.args.versionBump, tt.args.nextVersionType) + got, err := SemVer.NextVersion(tt.args.releases, tt.args.versionBump, tt.args.nextVersionType) if !tt.wantErr(t, err, fmt.Sprintf("SemVerNextVersion(Releases(%v, %v), %v, %v)", tt.args.releases.Latest, tt.args.releases.Stable, tt.args.versionBump, tt.args.nextVersionType)) { return } diff --git a/internal/versioning/versioning.go b/internal/versioning/versioning.go index 3bf8138..182983f 100644 --- a/internal/versioning/versioning.go +++ b/internal/versioning/versioning.go @@ -6,7 +6,9 @@ import ( "github.com/apricote/releaser-pleaser/internal/git" ) -type Strategy = func(git.Releases, VersionBump, NextVersionType) (string, error) +type Strategy interface { + NextVersion(git.Releases, VersionBump, NextVersionType) (string, error) +} type VersionBump conventionalcommits.VersionBump diff --git a/releaserpleaser.go b/releaserpleaser.go index 0b1b846..77f81f6 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -23,7 +23,7 @@ type ReleaserPleaser struct { logger *slog.Logger targetBranch string commitParser commitparser.CommitParser - nextVersion versioning.Strategy + versioning versioning.Strategy extraFiles []string updaters []updater.NewUpdater } @@ -34,7 +34,7 @@ func New(forge forge.Forge, logger *slog.Logger, targetBranch string, commitPars logger: logger, targetBranch: targetBranch, commitParser: commitParser, - nextVersion: versioningStrategy, + versioning: versioningStrategy, extraFiles: extraFiles, updaters: updaters, } @@ -117,7 +117,7 @@ func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *release return err } - changelog, err := pr.ChangelogText() + changelogText, err := pr.ChangelogText() if err != nil { return err } @@ -125,7 +125,7 @@ func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *release // TODO: pre-release & latest logger.DebugContext(ctx, "Creating release on forge") - err = rp.forge.CreateRelease(ctx, *pr.ReleaseCommit, version, changelog, false, true) + err = rp.forge.CreateRelease(ctx, *pr.ReleaseCommit, version, changelogText, false, true) if err != nil { return fmt.Errorf("failed to create release on forge: %w", err) } @@ -163,7 +163,6 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { if err != nil { return err } - } releases, err := rp.forge.LatestTags(ctx) @@ -223,7 +222,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { versionBump := versioning.BumpFromCommits(analyzedCommits) // TODO: Set version in release pr - nextVersion, err := rp.nextVersion(releases, versionBump, releaseOverrides.NextVersionType) + nextVersion, err := rp.versioning.NextVersion(releases, versionBump, releaseOverrides.NextVersionType) if err != nil { return err } From dd166ec446046f583933958b1337797c2f1ed189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 15 Nov 2024 18:49:50 +0100 Subject: [PATCH 067/260] 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 --- internal/versioning/semver.go | 13 ++++++++++++ internal/versioning/semver_test.go | 34 ++++++++++++++++++++++++++++++ internal/versioning/versioning.go | 1 + releaserpleaser.go | 4 ++-- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/internal/versioning/semver.go b/internal/versioning/semver.go index e6a58c7..07e0fdc 100644 --- a/internal/versioning/semver.go +++ b/internal/versioning/semver.go @@ -110,3 +110,16 @@ func parseSemverWithDefault(tag *git.Tag) (semver.Version, error) { return parsedVersion, nil } + +func (s semVer) IsPrerelease(version string) bool { + semVersion, err := parseSemverWithDefault(&git.Tag{Hash: "", Name: version}) + if err != nil { + return false + } + + if len(semVersion.Pre) > 0 { + return true + } + + return false +} diff --git a/internal/versioning/semver_test.go b/internal/versioning/semver_test.go index 702d31c..936c258 100644 --- a/internal/versioning/semver_test.go +++ b/internal/versioning/semver_test.go @@ -388,3 +388,37 @@ func TestVersionBumpFromCommits(t *testing.T) { }) } } + +func TestSemVer_IsPrerelease(t *testing.T) { + tests := []struct { + name string + version string + want bool + }{ + { + name: "empty string", + version: "", + want: false, + }, + { + name: "stable version", + version: "v1.0.0", + want: false, + }, + { + name: "pre-release version", + version: "v1.0.0-rc.1+foo", + want: true, + }, + { + name: "invalid version", + version: "ajfkdafjdsfj", + want: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + assert.Equalf(t, tt.want, SemVer.IsPrerelease(tt.version), "IsSemverPrerelease(%v)", tt.version) + }) + } +} diff --git a/internal/versioning/versioning.go b/internal/versioning/versioning.go index 182983f..a4915ff 100644 --- a/internal/versioning/versioning.go +++ b/internal/versioning/versioning.go @@ -8,6 +8,7 @@ import ( type Strategy interface { NextVersion(git.Releases, VersionBump, NextVersionType) (string, error) + IsPrerelease(version string) bool } type VersionBump conventionalcommits.VersionBump diff --git a/releaserpleaser.go b/releaserpleaser.go index 77f81f6..88b2dbb 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -122,10 +122,10 @@ func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *release return err } - // TODO: pre-release & latest + // TODO: Check if version should be marked latest logger.DebugContext(ctx, "Creating release on forge") - err = rp.forge.CreateRelease(ctx, *pr.ReleaseCommit, version, changelogText, false, true) + err = rp.forge.CreateRelease(ctx, *pr.ReleaseCommit, version, changelogText, rp.versioning.IsPrerelease(version), true) if err != nil { return fmt.Errorf("failed to create release on forge: %w", err) } From b61723279775f6ff425884ce78baf158e1aa2357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 15 Nov 2024 18:54:56 +0100 Subject: [PATCH 068/260] chore(main): release v0.5.0 (#107) Co-authored-by: releaser-pleaser <> --- CHANGELOG.md | 12 ++++++++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3b5c2..703d6b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [v0.5.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.5.0) + +### Features + +- **gitlab**: make job dependencies configurable and run immediately (#101) +- **github**: mark pre-releases correctly (#110) + +### Bug Fixes + +- use commits with slightly invalid messages in release notes (#105) +- create CHANGELOG.md if it does not exist (#108) + ## [v0.4.2](https://github.com/apricote/releaser-pleaser/releases/tag/v0.4.2) ### Bug Fixes diff --git a/action.yml b/action.yml index 76afadf..2d492dd 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: docker://ghcr.io/apricote/releaser-pleaser:v0.4.2 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.5.0 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index dbae48e..338a1b6 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.4.2 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.5.0 # x-releaser-pleaser-version entrypoint: [ "" ] variables: GITLAB_TOKEN: $[[ inputs.token ]] From b5819a2c6a919a4e9d2475ac6a7d5c4d02383dfe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 23:12:38 +0000 Subject: [PATCH 069/260] deps: update module github.com/xanzy/go-gitlab to v0.114.0 (#111) 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 a9ae48f..7c365d5 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 github.com/teekennedy/goldmark-markdown v0.3.0 - github.com/xanzy/go-gitlab v0.113.0 + github.com/xanzy/go-gitlab v0.114.0 github.com/yuin/goldmark v1.7.8 ) diff --git a/go.sum b/go.sum index dd83ee0..b27bdf5 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= -github.com/xanzy/go-gitlab v0.113.0 h1:v5O4R+YZbJGxKqa9iIZxjMyeKkMKBN8P6sZsNl+YckM= -github.com/xanzy/go-gitlab v0.113.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= +github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= +github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= From b1180a17ba1195699bae84e3b2d067bab2512cae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 22:04:38 +0100 Subject: [PATCH 070/260] deps: update codecov/codecov-action digest to 288befb (#112) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bd79753..5148e16 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@5c47607acb93fed5485fdbf7232e8a31425f672a # v5 + uses: codecov/codecov-action@288befbd1044bd1756afb0bdae077549e0ddb31f # v5 with: token: ${{ secrets.CODECOV_TOKEN }} From 05b492fa0e0c55ef5b9024a10efde02a1e5dc1b1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 13:56:11 +0000 Subject: [PATCH 071/260] deps: update module github.com/stretchr/testify to v1.10.0 (#115) 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 7c365d5..f9eaf8f 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.3.0 github.com/xanzy/go-gitlab v0.114.0 github.com/yuin/goldmark v1.7.8 diff --git a/go.sum b/go.sum index b27bdf5..0eca63f 100644 --- a/go.sum +++ b/go.sum @@ -104,8 +104,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= From 25c6cffa762563fe05717a9ce3765888ad8b91d5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 16:57:01 +0000 Subject: [PATCH 072/260] deps: update dependency golangci/golangci-lint to v1.62.2 (#116) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5148e16..89cf147 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.62.0 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.62.2 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 0ad9250a6a36b48122b6fb9b147d7a3044758a84 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:07:39 +0000 Subject: [PATCH 073/260] deps: update dependency rust-lang/mdbook to v0.4.43 (#117) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 974d953..ae4ab53 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.42 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.43 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 4af9f883824b7cb9351a46e90f7a9a0108dab29d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 01:30:33 +0000 Subject: [PATCH 074/260] deps: update registry.gitlab.com/gitlab-org/release-cli docker tag to v0.20.0 (#119) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7fcba92..f51f1e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: [ release ] # and create a corresponding GitLab Release. create-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:v0.19.0 + image: registry.gitlab.com/gitlab-org/release-cli:v0.20.0 script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG From e7db5b2e663bbdd982e4aa40d5d0d7c513ef3fdf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 21:50:52 +0000 Subject: [PATCH 075/260] deps: update module github.com/teekennedy/goldmark-markdown to v0.4.0 (#123) 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 f9eaf8f..2b2af86 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 - github.com/teekennedy/goldmark-markdown v0.3.0 + github.com/teekennedy/goldmark-markdown v0.4.0 github.com/xanzy/go-gitlab v0.114.0 github.com/yuin/goldmark v1.7.8 ) diff --git a/go.sum b/go.sum index 0eca63f..759e03d 100644 --- a/go.sum +++ b/go.sum @@ -106,8 +106,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/teekennedy/goldmark-markdown v0.3.0 h1:ik9/biVGCwGWFg8dQ3KVm2pQ/wiiG0whYiUcz9xH0W8= -github.com/teekennedy/goldmark-markdown v0.3.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= +github.com/teekennedy/goldmark-markdown v0.4.0 h1:1sWac1NtSmxuEeBtQyQu2WqAfLRc+V78rfAFJL46lhA= +github.com/teekennedy/goldmark-markdown v0.4.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= From 093f0f97bdee056d205efbfd2cb7c6859ddb8060 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 00:47:46 +0000 Subject: [PATCH 076/260] deps: update module github.com/teekennedy/goldmark-markdown to v0.4.1 (#125) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 6 ++++-- go.sum | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 2b2af86..90fca33 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/apricote/releaser-pleaser -go 1.23.0 +go 1.23.2 + +toolchain go1.23.4 require ( github.com/blang/semver/v4 v4.0.0 @@ -9,7 +11,7 @@ require ( github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.10.0 - github.com/teekennedy/goldmark-markdown v0.4.0 + github.com/teekennedy/goldmark-markdown v0.4.1 github.com/xanzy/go-gitlab v0.114.0 github.com/yuin/goldmark v1.7.8 ) diff --git a/go.sum b/go.sum index 759e03d..f9a7404 100644 --- a/go.sum +++ b/go.sum @@ -106,8 +106,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/teekennedy/goldmark-markdown v0.4.0 h1:1sWac1NtSmxuEeBtQyQu2WqAfLRc+V78rfAFJL46lhA= -github.com/teekennedy/goldmark-markdown v0.4.0/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo= +github.com/teekennedy/goldmark-markdown v0.4.1 h1:z+khlNC+dX1zsZOEmr/IqXBBJ9CwXrJU2KjF46e0DXw= +github.com/teekennedy/goldmark-markdown v0.4.1/go.mod h1:HmgaLa1NTxngaJbKPKI+3Cs6ZEHT/FffRTk8A86ognA= github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= From 4e784f2cccb14b10158a400ca8fc00cc9984fa80 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 15 Dec 2024 00:48:12 +0000 Subject: [PATCH 077/260] deps: update module golang.org/x/crypto to v0.31.0 [security] (#124) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 90fca33..34ca189 100644 --- a/go.mod +++ b/go.mod @@ -41,10 +41,10 @@ require ( github.com/skeema/knownhosts v1.3.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.26.0 // indirect + golang.org/x/crypto v0.31.0 // indirect golang.org/x/net v0.28.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sys v0.24.0 // indirect + golang.org/x/sys v0.28.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index f9a7404..6fd0278 100644 --- a/go.sum +++ b/go.sum @@ -120,8 +120,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= +golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -152,15 +152,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= -golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -169,8 +169,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 57d2ab8b26184a8cd6fbed865675988ad36c3667 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 22 Dec 2024 16:55:47 +0000 Subject: [PATCH 078/260] deps: update module golang.org/x/net to v0.33.0 [security] (#126) 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 34ca189..1f2d82a 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/time v0.3.0 // indirect diff --git a/go.sum b/go.sum index 6fd0278..91d0c4d 100644 --- a/go.sum +++ b/go.sum @@ -132,8 +132,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 928472b7ebe5eac24efd62eccb3fb11ad9555833 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 29 Dec 2024 00:22:02 +0000 Subject: [PATCH 079/260] deps: update module github.com/go-git/go-git/v5 to v5.13.0 (#127) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 62 +++++++++++++--------------------------------------------- 2 files changed, 17 insertions(+), 51 deletions(-) diff --git a/go.mod b/go.mod index 1f2d82a..eb92653 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.23.4 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.12.0 + github.com/go-git/go-git/v5 v5.13.0 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 @@ -19,13 +19,13 @@ require ( require ( dario.cat/mergo v1.0.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/ProtonMail/go-crypto v1.0.0 // indirect + github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/cloudflare/circl v1.4.0 // indirect github.com/cyphar/filepath-securejoin v0.3.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.5.0 // indirect + github.com/go-git/go-billy/v5 v5.6.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-querystring v1.1.0 // indirect diff --git a/go.sum b/go.sum index 91d0c4d..151862f 100644 --- a/go.sum +++ b/go.sum @@ -3,16 +3,14 @@ dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= -github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= +github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY= github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -21,22 +19,22 @@ github.com/cyphar/filepath-securejoin v0.3.1/go.mod h1:F7i41x/9cBF7lzCrVsYs9fuzw github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU= -github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM= +github.com/elazarl/goproxy v1.2.1 h1:njjgvO6cRG9rIqN2ebkqy6cQz2Njkx7Fsfv/zIZqgug= +github.com/elazarl/goproxy v1.2.1/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= -github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= +github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= +github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= -github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= +github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= +github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys= -github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY= +github.com/go-git/go-git/v5 v5.13.0 h1:vLn5wlGIh/X78El6r3Jr+30W16Blk0CTcxTYcYPWi5E= +github.com/go-git/go-git/v5 v5.13.0/go.mod h1:Wjo7/JyVKtQgUNdXYXIepzWfJQkUEIGvkvVkiXRR/zw= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -76,8 +74,8 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= +github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -112,72 +110,40 @@ github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy1 github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= +golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= From a85e3a17e50419e91d7a7465c7d7b00ad9b2f21c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 16:01:09 +0000 Subject: [PATCH 080/260] deps: update dependency golangci/golangci-lint to v1.63.0 (#128) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 89cf147..5512c1f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.62.2 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.63.0 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 16006339a157b2ceb5d7893d0b4c1713a5f0c1f1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Jan 2025 22:31:55 +0000 Subject: [PATCH 081/260] deps: update dependency golangci/golangci-lint to v1.63.1 (#129) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5512c1f..704be7e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.63.0 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.63.1 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From d26d0686266c765bb3efe36257e967458a8f66a2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:46:17 +0000 Subject: [PATCH 082/260] deps: update dependency golangci/golangci-lint to v1.63.2 (#130) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 704be7e..758eba2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.63.1 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.63.2 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From da6fe2a380afa34e39c2f2c7ec2c911b713badea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 19:21:43 +0000 Subject: [PATCH 083/260] deps: update module github.com/go-git/go-git/v5 to v5.13.1 (#131) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 6 +++--- go.sum | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index eb92653..43f6f90 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.23.4 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.13.0 + github.com/go-git/go-git/v5 v5.13.1 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 @@ -21,11 +21,11 @@ require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProtonMail/go-crypto v1.1.3 // indirect github.com/cloudflare/circl v1.4.0 // indirect - github.com/cyphar/filepath-securejoin v0.3.1 // indirect + github.com/cyphar/filepath-securejoin v0.3.6 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.6.0 // indirect + github.com/go-git/go-billy/v5 v5.6.1 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-querystring v1.1.0 // indirect diff --git a/go.sum b/go.sum index 151862f..d239a95 100644 --- a/go.sum +++ b/go.sum @@ -14,13 +14,13 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY= github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cyphar/filepath-securejoin v0.3.1 h1:1V7cHiaW+C+39wEfpH6XlLBQo3j/PciWFrgfCLS8XrE= -github.com/cyphar/filepath-securejoin v0.3.1/go.mod h1:F7i41x/9cBF7lzCrVsYs9fuzwRZm4NQsGTBdpp6mETc= +github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM= +github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elazarl/goproxy v1.2.1 h1:njjgvO6cRG9rIqN2ebkqy6cQz2Njkx7Fsfv/zIZqgug= -github.com/elazarl/goproxy v1.2.1/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= +github.com/elazarl/goproxy v1.2.3 h1:xwIyKHbaP5yfT6O9KIeYJR5549MXRQkoQMRXGztz8YQ= +github.com/elazarl/goproxy v1.2.3/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= @@ -29,12 +29,12 @@ github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8= -github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM= +github.com/go-git/go-billy/v5 v5.6.1 h1:u+dcrgaguSSkbjzHwelEjc0Yj300NUevrrPphk/SoRA= +github.com/go-git/go-billy/v5 v5.6.1/go.mod h1:0AsLr1z2+Uksi4NlElmMblP5rPcDZNRCD8ujZCRR2BE= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.13.0 h1:vLn5wlGIh/X78El6r3Jr+30W16Blk0CTcxTYcYPWi5E= -github.com/go-git/go-git/v5 v5.13.0/go.mod h1:Wjo7/JyVKtQgUNdXYXIepzWfJQkUEIGvkvVkiXRR/zw= +github.com/go-git/go-git/v5 v5.13.1 h1:DAQ9APonnlvSWpvolXWIuV6Q6zXy2wHbN4cVlNR5Q+M= +github.com/go-git/go-git/v5 v5.13.1/go.mod h1:qryJB4cSBoq3FRoBRf5A77joojuBcmPJ0qu3XXXVixc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -84,8 +84,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY= github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= From cc69c719cb420529c7827b96cd0ad029258cf8a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 21:21:28 +0000 Subject: [PATCH 084/260] deps: update dependency golangci/golangci-lint to v1.63.3 (#132) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 758eba2..8cb2e34 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.63.2 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.63.3 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 23bf944b6d679389149d42e6cd556d396299d152 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 21:21:29 +0000 Subject: [PATCH 085/260] deps: update dependency golangci/golangci-lint to v1.63.4 (#133) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8cb2e34..ad15814 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.63.3 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.63.4 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 42062bf4015190ad8efc66e2375741a22ae46e64 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:15:28 +0000 Subject: [PATCH 086/260] deps: update ko-build/setup-ko action to v0.8 (#134) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e912634..0e89b2e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,5 +21,5 @@ jobs: with: go-version-file: go.mod - - uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7 + - uses: ko-build/setup-ko@d982fec422852203cfb2053a8ec6ad302280d04d # v0.8 - run: ko build --bare --tags ${{ github.ref_name }} github.com/apricote/releaser-pleaser/cmd/rp diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 5c1d0b4..960d4e3 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -30,7 +30,7 @@ jobs: # Build container image from current commit and replace image ref in `action.yml` # Without this, any new flags in `action.yml` would break the job in this repository until the new # version is released. But a new version can only be released if this job works. - - uses: ko-build/setup-ko@3aebd0597dc1e9d1a26bcfdb7cbeb19c131d3037 # v0.7 + - uses: ko-build/setup-ko@d982fec422852203cfb2053a8ec6ad302280d04d # v0.8 - run: ko build --bare --local --tags ci github.com/apricote/releaser-pleaser/cmd/rp - run: mkdir -p .github/actions/releaser-pleaser From 28a71f54d49969c2fb9a90da184311db7832c489 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:25:30 +0000 Subject: [PATCH 087/260] deps: update dependency go to v1.23.5 (#136) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 43f6f90..bb2be17 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.23.4 +toolchain go1.23.5 require ( github.com/blang/semver/v4 v4.0.0 From 2526149c16f4eec83c876f5bb6088576b3eaaba1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Jan 2025 17:53:22 +0000 Subject: [PATCH 088/260] deps: update registry.gitlab.com/gitlab-org/release-cli docker tag to v0.21.0 (#138) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f51f1e3..8d1f90e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: [ release ] # and create a corresponding GitLab Release. create-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:v0.20.0 + image: registry.gitlab.com/gitlab-org/release-cli:v0.21.0 script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG From 0774353639086b23d34b23bcf56302f882dd3574 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 01:57:18 +0000 Subject: [PATCH 089/260] deps: update module github.com/go-git/go-git/v5 to v5.13.2 (#139) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 14 +++++++------- go.sum | 36 ++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index bb2be17..42180c5 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.23.5 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.13.1 + github.com/go-git/go-git/v5 v5.13.2 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.8.1 @@ -19,13 +19,13 @@ require ( require ( dario.cat/mergo v1.0.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/ProtonMail/go-crypto v1.1.3 // indirect + github.com/ProtonMail/go-crypto v1.1.5 // indirect github.com/cloudflare/circl v1.4.0 // indirect github.com/cyphar/filepath-securejoin v0.3.6 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.6.1 // indirect + github.com/go-git/go-billy/v5 v5.6.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/go-querystring v1.1.0 // indirect @@ -34,17 +34,17 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/pjbgf/sha1cd v0.3.0 // indirect + github.com/pjbgf/sha1cd v0.3.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/skeema/knownhosts v1.3.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.33.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index d239a95..ec60a3a 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk= -github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.5 h1:eoAQfK2dwL+tFSFpr7TbOaPNUbPiJj4fLYwwGE1FQO4= +github.com/ProtonMail/go-crypto v1.1.5/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -19,8 +19,8 @@ github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGL github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elazarl/goproxy v1.2.3 h1:xwIyKHbaP5yfT6O9KIeYJR5549MXRQkoQMRXGztz8YQ= -github.com/elazarl/goproxy v1.2.3/go.mod h1:YfEbZtqP4AetfO6d40vWchF3znWX7C7Vd6ZMfdL8z64= +github.com/elazarl/goproxy v1.4.0 h1:4GyuSbFa+s26+3rmYNSuUVsx+HgPrV1bk1jXI0l9wjM= +github.com/elazarl/goproxy v1.4.0/go.mod h1:X/5W/t+gzDyLfHW4DrMdpjqYjpXsURlBt9lpBDxZZZQ= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= @@ -29,12 +29,12 @@ github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.6.1 h1:u+dcrgaguSSkbjzHwelEjc0Yj300NUevrrPphk/SoRA= -github.com/go-git/go-billy/v5 v5.6.1/go.mod h1:0AsLr1z2+Uksi4NlElmMblP5rPcDZNRCD8ujZCRR2BE= +github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM= +github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.13.1 h1:DAQ9APonnlvSWpvolXWIuV6Q6zXy2wHbN4cVlNR5Q+M= -github.com/go-git/go-git/v5 v5.13.1/go.mod h1:qryJB4cSBoq3FRoBRf5A77joojuBcmPJ0qu3XXXVixc= +github.com/go-git/go-git/v5 v5.13.2 h1:7O7xvsK7K+rZPKW6AQR1YyNhfywkv7B8/FsP3ki6Zv0= +github.com/go-git/go-git/v5 v5.13.2/go.mod h1:hWdW5P4YZRjmpGHwRH2v3zkWcNl6HeXaXQEMGb3NJ9A= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -76,8 +76,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= -github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= -github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= +github.com/pjbgf/sha1cd v0.3.2 h1:a9wb0bp1oC2TGwStyn0Umc/IGKQnEgF0vVaZ8QF8eo4= +github.com/pjbgf/sha1cd v0.3.2/go.mod h1:zQWigSxVmsHEZow5qaLtPYxpcKMMQpa09ixqBxuCS6A= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -114,14 +114,14 @@ github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -131,11 +131,11 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= -golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= From 6802aad634e89492950f78f9752318b7c3bde83f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 20:52:41 +0000 Subject: [PATCH 090/260] deps: update dependency rust-lang/mdbook to v0.4.44 (#140) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index ae4ab53..9157369 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.43 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.44 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 7a92e82d9432a3d60f2513c963e804336a41b9bc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 20:36:25 +0000 Subject: [PATCH 091/260] deps: update dependency go to v1.23.6 (#141) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 42180c5..1297973 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.23.5 +toolchain go1.23.6 require ( github.com/blang/semver/v4 v4.0.0 From 34ca528570387dcc1b1ba5ff0bc507a182c36ba5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 02:49:42 +0000 Subject: [PATCH 092/260] deps: update dependency golangci/golangci-lint to v1.64.2 (#143) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ad15814..15acc57 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.63.4 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.64.2 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 871f69acbea0181bb505a8bd3e4a11f96de5c79a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 06:55:41 +0000 Subject: [PATCH 093/260] deps: update dependency go to v1.24.0 (#142) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 1297973..21735a9 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.23.6 +toolchain go1.24.0 require ( github.com/blang/semver/v4 v4.0.0 From b2a1754432a14b2f665b536f787be972df76186b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 21:50:04 +0000 Subject: [PATCH 094/260] deps: update dependency golangci/golangci-lint to v1.64.3 (#144) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 15acc57..f84f8bc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.64.2 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.64.3 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From a54d44673d98ed75c34f4ab1697d520a3b63d91d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 02:46:20 +0000 Subject: [PATCH 095/260] deps: update dependency golangci/golangci-lint to v1.64.4 (#145) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f84f8bc..eb858b1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.64.3 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.64.4 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 11c61e9dbde20e6f467a055081db45fa2bc01fd8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 01:52:19 +0000 Subject: [PATCH 096/260] deps: update dependency golangci/golangci-lint to v1.64.5 (#146) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eb858b1..e9678b9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.64.4 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.64.5 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From da66bd0cc4be584329520a06b255aca53e4cadd3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2025 22:42:09 +0000 Subject: [PATCH 097/260] deps: update module github.com/spf13/cobra to v1.9.0 (#147) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 21735a9..a7a4c67 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-git/go-git/v5 v5.13.2 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 - github.com/spf13/cobra v1.8.1 + github.com/spf13/cobra v1.9.0 github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.4.1 github.com/xanzy/go-gitlab v0.114.0 @@ -39,7 +39,7 @@ require ( github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/skeema/knownhosts v1.3.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/pflag v1.0.6 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.32.0 // indirect golang.org/x/net v0.34.0 // indirect diff --git a/go.sum b/go.sum index ec60a3a..58b6ad8 100644 --- a/go.sum +++ b/go.sum @@ -13,7 +13,7 @@ github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY= github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM= github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -94,10 +94,10 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.9.0 h1:Py5fIuq/lJsRYxcxfOtsJqpmwJWCMOUy2tMJYV8TNHE= +github.com/spf13/cobra v1.9.0/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= From 510f62f75d646c755c3b66ca754e012e73d0aae7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 02:51:50 +0000 Subject: [PATCH 098/260] deps: update module github.com/spf13/cobra to v1.9.1 (#148) 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 a7a4c67..4ca8c91 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-git/go-git/v5 v5.13.2 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 - github.com/spf13/cobra v1.9.0 + github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.4.1 github.com/xanzy/go-gitlab v0.114.0 diff --git a/go.sum b/go.sum index 58b6ad8..acf154a 100644 --- a/go.sum +++ b/go.sum @@ -94,8 +94,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= -github.com/spf13/cobra v1.9.0 h1:Py5fIuq/lJsRYxcxfOtsJqpmwJWCMOUy2tMJYV8TNHE= -github.com/spf13/cobra v1.9.0/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= From 761eede169d49081fdd73ec3585fc50ce39c56e8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 15:39:48 +0000 Subject: [PATCH 099/260] deps: update registry.gitlab.com/gitlab-org/release-cli docker tag to v0.22.0 (#149) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d1f90e..4a650d2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: [ release ] # and create a corresponding GitLab Release. create-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:v0.21.0 + image: registry.gitlab.com/gitlab-org/release-cli:v0.22.0 script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG From d22f87ecc2e32a5dd03f9582cc039302dc2594bb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 18:49:35 +0000 Subject: [PATCH 100/260] deps: update dependency rust-lang/mdbook to v0.4.45 (#150) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 9157369..1f0711b 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.44 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.45 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From e795d1648928f72216c188a726c02427435d788a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2025 16:28:51 +0000 Subject: [PATCH 101/260] deps: update module github.com/go-git/go-git/v5 to v5.14.0 (#152) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 18 +++++++++--------- go.sum | 60 +++++++++++++++++++++++++++------------------------------- 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/go.mod b/go.mod index 4ca8c91..c3f1ac5 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.0 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.13.2 + github.com/go-git/go-git/v5 v5.14.0 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.9.1 @@ -20,14 +20,14 @@ require ( dario.cat/mergo v1.0.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProtonMail/go-crypto v1.1.5 // indirect - github.com/cloudflare/circl v1.4.0 // indirect - github.com/cyphar/filepath-securejoin v0.3.6 // indirect + github.com/cloudflare/circl v1.6.0 // indirect + github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect @@ -38,13 +38,13 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect - github.com/skeema/knownhosts v1.3.0 // indirect + github.com/skeema/knownhosts v1.3.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.32.0 // indirect - golang.org/x/net v0.34.0 // indirect + golang.org/x/crypto v0.35.0 // indirect + golang.org/x/net v0.35.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sys v0.29.0 // indirect + golang.org/x/sys v0.30.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index acf154a..1f56df2 100644 --- a/go.sum +++ b/go.sum @@ -11,16 +11,16 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/cloudflare/circl v1.4.0 h1:BV7h5MgrktNzytKmWjpOtdYrf0lkkbF8YMlBGPhJQrY= -github.com/cloudflare/circl v1.4.0/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= +github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7qk= +github.com/cloudflare/circl v1.6.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= -github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM= -github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= +github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= +github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/elazarl/goproxy v1.4.0 h1:4GyuSbFa+s26+3rmYNSuUVsx+HgPrV1bk1jXI0l9wjM= -github.com/elazarl/goproxy v1.4.0/go.mod h1:X/5W/t+gzDyLfHW4DrMdpjqYjpXsURlBt9lpBDxZZZQ= +github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= +github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= @@ -33,18 +33,16 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.13.2 h1:7O7xvsK7K+rZPKW6AQR1YyNhfywkv7B8/FsP3ki6Zv0= -github.com/go-git/go-git/v5 v5.13.2/go.mod h1:hWdW5P4YZRjmpGHwRH2v3zkWcNl6HeXaXQEMGb3NJ9A= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60= +github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= +github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= @@ -84,16 +82,16 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY= github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE= -github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY= -github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M= +github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= +github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= @@ -114,14 +112,14 @@ github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= +golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= +golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -131,24 +129,22 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= +golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= +golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= +golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From d8841d3fab43912b50ae55c68ebef4831c46b122 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 01:50:07 +0000 Subject: [PATCH 102/260] deps: update dependency golangci/golangci-lint to v1.64.6 (#153) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e9678b9..3859915 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.64.5 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.64.6 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 6c57ad0fbbfbdf077b4c375f3229cbe6e058448b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 22:53:53 +0000 Subject: [PATCH 103/260] deps: update dependency go to v1.24.1 (#154) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index c3f1ac5..267604e 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.24.0 +toolchain go1.24.1 require ( github.com/blang/semver/v4 v4.0.0 From d6262d8ecb868de55f3c57bda49c4335e11f52c2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 8 Mar 2025 22:38:23 +0000 Subject: [PATCH 104/260] deps: update dependency rust-lang/mdbook to v0.4.46 (#155) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 1f0711b..9a516e9 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.45 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.46 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 4dd80c9492f18d5790f2f3ab347b71968021c961 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 9 Mar 2025 18:23:34 +0000 Subject: [PATCH 105/260] deps: update dependency rust-lang/mdbook to v0.4.47 (#156) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 9a516e9..38463d2 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.46 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.47 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 98e60583a4da4c35e9b0a01b7dd12cafb5432173 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 01:27:44 +0000 Subject: [PATCH 106/260] deps: update dependency golangci/golangci-lint to v1.64.7 (#157) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3859915..53396a6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.64.6 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.64.7 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From a594ac0373ad8d5db81a9245106809caba129a7d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 15:12:14 +0000 Subject: [PATCH 107/260] deps: update module golang.org/x/net to v0.36.0 [security] (#158) 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 267604e..4458f1c 100644 --- a/go.mod +++ b/go.mod @@ -42,7 +42,7 @@ require ( github.com/spf13/pflag v1.0.6 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.35.0 // indirect - golang.org/x/net v0.35.0 // indirect + golang.org/x/net v0.36.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect golang.org/x/sys v0.30.0 // indirect golang.org/x/time v0.3.0 // indirect diff --git a/go.sum b/go.sum index 1f56df2..1c26a30 100644 --- a/go.sum +++ b/go.sum @@ -118,8 +118,8 @@ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0 golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= -golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= +golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= From 1be7bf0f7608249c5bddf91dcf432f4bb43952d1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 23:26:21 +0000 Subject: [PATCH 108/260] deps: update dependency golangci/golangci-lint to v1.64.8 (#159) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 53396a6..2d4d1cd 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.64.7 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v1.64.8 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From f9ba6daa429b6eec4df338840b98ad1b91f31740 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 16:33:00 +0000 Subject: [PATCH 109/260] deps: update registry.gitlab.com/gitlab-org/release-cli docker tag to v0.23.0 (#161) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4a650d2..e989c90 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: [ release ] # and create a corresponding GitLab Release. create-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:v0.22.0 + image: registry.gitlab.com/gitlab-org/release-cli:v0.23.0 script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG From 00986532b959a58ed1fbe6ab498b9d7c79f2750e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 23:15:13 +0000 Subject: [PATCH 110/260] deps: update dependency rust-lang/mdbook to v0.4.48 (#162) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 38463d2..5d7bc55 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.47 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.48 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 1bb296a5090fd6e020d78c76160837b0610e4502 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Apr 2025 19:11:37 +0000 Subject: [PATCH 111/260] deps: update dependency go to v1.24.2 (#163) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4458f1c..5e902dd 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.24.1 +toolchain go1.24.2 require ( github.com/blang/semver/v4 v4.0.0 From 9d0cfc7c83a974a883e5b4641833d3587e7b1776 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 10:45:01 +0000 Subject: [PATCH 112/260] deps: update module github.com/go-git/go-git/v5 to v5.15.0 (#164) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 5e902dd..af915c3 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.2 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.14.0 + github.com/go-git/go-git/v5 v5.15.0 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.9.1 @@ -19,8 +19,8 @@ require ( require ( dario.cat/mergo v1.0.1 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect - github.com/ProtonMail/go-crypto v1.1.5 // indirect - github.com/cloudflare/circl v1.6.0 // indirect + github.com/ProtonMail/go-crypto v1.1.6 // indirect + github.com/cloudflare/circl v1.6.1 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect @@ -41,10 +41,10 @@ require ( github.com/skeema/knownhosts v1.3.1 // indirect github.com/spf13/pflag v1.0.6 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.35.0 // indirect - golang.org/x/net v0.36.0 // indirect + golang.org/x/crypto v0.37.0 // indirect + golang.org/x/net v0.39.0 // indirect golang.org/x/oauth2 v0.6.0 // indirect - golang.org/x/sys v0.30.0 // indirect + golang.org/x/sys v0.32.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index 1c26a30..119d937 100644 --- a/go.sum +++ b/go.sum @@ -3,16 +3,16 @@ dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/ProtonMail/go-crypto v1.1.5 h1:eoAQfK2dwL+tFSFpr7TbOaPNUbPiJj4fLYwwGE1FQO4= -github.com/ProtonMail/go-crypto v1.1.5/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= +github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw= +github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= -github.com/cloudflare/circl v1.6.0 h1:cr5JKic4HI+LkINy2lg3W2jF8sHCVTBncJr5gIIq7qk= -github.com/cloudflare/circl v1.6.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= +github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= +github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/cyphar/filepath-securejoin v0.4.1 h1:JyxxyPEaktOD+GAnqIqTf9A8tHyAG22rowi7HkoSU1s= github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI= @@ -33,8 +33,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60= -github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k= +github.com/go-git/go-git/v5 v5.15.0 h1:f5Qn0W0F7ry1iN0ZwIU5m/n7/BKB4hiZfc+zlZx7ly0= +github.com/go-git/go-git/v5 v5.15.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -112,14 +112,14 @@ github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs= -golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA= -golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -129,16 +129,16 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 3ed3a1856c2722db0331ac53fb01d2a750ae1d50 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 19:46:37 +0000 Subject: [PATCH 113/260] deps: update ko-build/setup-ko action to v0.9 (#165) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0e89b2e..6685ce8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,5 +21,5 @@ jobs: with: go-version-file: go.mod - - uses: ko-build/setup-ko@d982fec422852203cfb2053a8ec6ad302280d04d # v0.8 + - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 - run: ko build --bare --tags ${{ github.ref_name }} github.com/apricote/releaser-pleaser/cmd/rp diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 960d4e3..a789e22 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -30,7 +30,7 @@ jobs: # Build container image from current commit and replace image ref in `action.yml` # Without this, any new flags in `action.yml` would break the job in this repository until the new # version is released. But a new version can only be released if this job works. - - uses: ko-build/setup-ko@d982fec422852203cfb2053a8ec6ad302280d04d # v0.8 + - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 - run: ko build --bare --local --tags ci github.com/apricote/releaser-pleaser/cmd/rp - run: mkdir -p .github/actions/releaser-pleaser From 7fe19174db0c31e2f302334a6c1cc81dec4828a8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 22:44:55 +0000 Subject: [PATCH 114/260] deps: update module github.com/yuin/goldmark to v1.7.9 (#166) 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 af915c3..9246d0a 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.4.1 github.com/xanzy/go-gitlab v0.114.0 - github.com/yuin/goldmark v1.7.8 + github.com/yuin/goldmark v1.7.9 ) require ( diff --git a/go.sum b/go.sum index 119d937..d3a101e 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy1 github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= -github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.9 h1:rVSeT+f7/lAM+bJHVm5YHGwNrnd40i1Ch2DEocEjHQ0= +github.com/yuin/goldmark v1.7.9/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= From 377ec44cd3848e790d34aaa793c0cc3fcabe3696 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 22:53:41 +0000 Subject: [PATCH 115/260] deps: update module github.com/yuin/goldmark to v1.7.10 (#167) 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 9246d0a..f45bd32 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.4.1 github.com/xanzy/go-gitlab v0.114.0 - github.com/yuin/goldmark v1.7.9 + github.com/yuin/goldmark v1.7.10 ) require ( diff --git a/go.sum b/go.sum index d3a101e..df95ba2 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy1 github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.9 h1:rVSeT+f7/lAM+bJHVm5YHGwNrnd40i1Ch2DEocEjHQ0= -github.com/yuin/goldmark v1.7.9/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +github.com/yuin/goldmark v1.7.10 h1:S+LrtBjRmqMac2UdtB6yyCEJm+UILZ2fefI4p7o0QpI= +github.com/yuin/goldmark v1.7.10/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= From 85ff2126b1252713f06653c8fe71a7fb3d300516 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 22:53:49 +0000 Subject: [PATCH 116/260] deps: update module github.com/go-git/go-git/v5 to v5.16.0 (#168) 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 f45bd32..944a9bd 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.2 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.15.0 + github.com/go-git/go-git/v5 v5.16.0 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.9.1 diff --git a/go.sum b/go.sum index df95ba2..d7237db 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.15.0 h1:f5Qn0W0F7ry1iN0ZwIU5m/n7/BKB4hiZfc+zlZx7ly0= -github.com/go-git/go-git/v5 v5.15.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.0 h1:k3kuOEpkc0DeY7xlL6NaaNg39xdgQbtH5mwCafHO9AQ= +github.com/go-git/go-git/v5 v5.16.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= From b658a3a53120cba0201f5e050eeb09d9b88d94e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 01:58:58 +0000 Subject: [PATCH 117/260] deps: update module github.com/teekennedy/goldmark-markdown to v0.5.1 (#169) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 944a9bd..76aa960 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 - github.com/teekennedy/goldmark-markdown v0.4.1 + github.com/teekennedy/goldmark-markdown v0.5.1 github.com/xanzy/go-gitlab v0.114.0 github.com/yuin/goldmark v1.7.10 ) diff --git a/go.sum b/go.sum index d7237db..442fd2b 100644 --- a/go.sum +++ b/go.sum @@ -102,14 +102,16 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/teekennedy/goldmark-markdown v0.4.1 h1:z+khlNC+dX1zsZOEmr/IqXBBJ9CwXrJU2KjF46e0DXw= -github.com/teekennedy/goldmark-markdown v0.4.1/go.mod h1:HmgaLa1NTxngaJbKPKI+3Cs6ZEHT/FffRTk8A86ognA= +github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKEsEj+asVsu6M/0= +github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.10 h1:S+LrtBjRmqMac2UdtB6yyCEJm+UILZ2fefI4p7o0QpI= github.com/yuin/goldmark v1.7.10/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= From 86207b80f2ae6f8da980ee9be10b182cf4bb8434 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 14:32:40 +0000 Subject: [PATCH 118/260] deps: update module github.com/yuin/goldmark to v1.7.11 (#170) 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 76aa960..b6d9228 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/xanzy/go-gitlab v0.114.0 - github.com/yuin/goldmark v1.7.10 + github.com/yuin/goldmark v1.7.11 ) require ( diff --git a/go.sum b/go.sum index 442fd2b..f8bd701 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy1 github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.10 h1:S+LrtBjRmqMac2UdtB6yyCEJm+UILZ2fefI4p7o0QpI= -github.com/yuin/goldmark v1.7.10/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +github.com/yuin/goldmark v1.7.11 h1:ZCxLyDMtz0nT2HFfsYG8WZ47Trip2+JyLysKcMYE5bo= +github.com/yuin/goldmark v1.7.11/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From d93378a72ecb5e17f2731b44de8030844f61e24c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 23:23:44 +0000 Subject: [PATCH 119/260] deps: update dependency rust-lang/mdbook to v0.4.49 (#171) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 5d7bc55..f8d6e93 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.48 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.49 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From c31e40d04bc9acc7b152d630cbdf3a6b2be0aebf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 19:20:16 +0000 Subject: [PATCH 120/260] deps: update dependency go to v1.24.3 (#172) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b6d9228..bb18377 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.24.2 +toolchain go1.24.3 require ( github.com/blang/semver/v4 v4.0.0 From 9c95dd558b48341a7b03090cb29fdd25b8797908 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 17 May 2025 14:40:46 +0000 Subject: [PATCH 121/260] deps: update module github.com/yuin/goldmark to v1.7.12 (#173) 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 bb18377..9865d59 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/xanzy/go-gitlab v0.114.0 - github.com/yuin/goldmark v1.7.11 + github.com/yuin/goldmark v1.7.12 ) require ( diff --git a/go.sum b/go.sum index f8bd701..d879a5f 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy1 github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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.11 h1:ZCxLyDMtz0nT2HFfsYG8WZ47Trip2+JyLysKcMYE5bo= -github.com/yuin/goldmark v1.7.11/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +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= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From d9c081d2801c8eea09bf1b82fef0a4eee04dbd59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Thu, 22 May 2025 15:27:49 +0200 Subject: [PATCH 122/260] fix: invalid version for subsequent pre-releases (#174) If two pre-releases were cut in a row, the second pre-release version would only consider the semantic changes since the previous pre-release, but base its new version of the latest tag. Example: - stable tag: `1.2.0` - latest tag: `1.3.0-rc.1` - 1 commit since with `fix:` tag The resulting releaser-pleaser tag would be: `1.2.1-rc.2`. It should be `1.3.0-rc.2` instead. This is now fixed by considering different commit ranges for versioning and changelog. For a stable version we want the list of changes since the stable tag. For a prerelease version we want the list of changes since the latest tag. To avoid repeating the same features over and over in a series of multiple pre-releases. This behaviour already existed and worked. For a stable version, we want to consider all changes since the stable tag. For a prerelease version, we also want to consider all changes since the stable tag. This was broken and only used the changes since the latest tag. --- releaserpleaser.go | 67 ++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/releaserpleaser.go b/releaserpleaser.go index 88b2dbb..f2f4064 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -179,34 +179,16 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger.InfoContext(ctx, "no latest tag found") } - // By default, we want to show everything that has happened since the last stable release - lastReleaseCommit := releases.Stable - if releaseOverrides.NextVersionType.IsPrerelease() { - // if the new release will be a prerelease, - // only show changes since the latest release (stable or prerelease) - lastReleaseCommit = releases.Latest - } - - commits, err := rp.forge.CommitsSince(ctx, lastReleaseCommit) + // For stable releases, we want to consider all changes since the last stable release for version and changelog. + // For prereleases, we want to consider all changes... + // - since the last stable release for the version + // - since the latest release (stable or prerelease) for the changelog + analyzedCommitsForVersioning, err := rp.analyzedCommitsSince(ctx, releases.Stable) if err != nil { return err } - commits, err = parsePRBodyForCommitOverrides(commits) - if err != nil { - return err - } - - logger.InfoContext(ctx, "Found releasable commits", "length", len(commits)) - - analyzedCommits, err := rp.commitParser.Analyze(commits) - if err != nil { - return err - } - - logger.InfoContext(ctx, "Analyzed commits", "length", len(analyzedCommits)) - - if len(analyzedCommits) == 0 { + if len(analyzedCommitsForVersioning) == 0 { if pr != nil { logger.InfoContext(ctx, "closing existing pull requests, no commits available", "pr.id", pr.ID, "pr.title", pr.Title) err = rp.forge.ClosePullRequest(ctx, pr) @@ -220,7 +202,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { return nil } - versionBump := versioning.BumpFromCommits(analyzedCommits) + versionBump := versioning.BumpFromCommits(analyzedCommitsForVersioning) // TODO: Set version in release pr nextVersion, err := rp.versioning.NextVersion(releases, versionBump, releaseOverrides.NextVersionType) if err != nil { @@ -228,6 +210,14 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { } logger.InfoContext(ctx, "next version", "version", nextVersion) + analyzedCommitsForChangelog := analyzedCommitsForVersioning + if releaseOverrides.NextVersionType.IsPrerelease() && releases.Latest != releases.Stable { + analyzedCommitsForChangelog, err = rp.analyzedCommitsSince(ctx, releases.Latest) + if err != nil { + return err + } + } + logger.DebugContext(ctx, "cloning repository", "clone.url", rp.forge.CloneURL()) repo, err := git.CloneRepo(ctx, logger, rp.forge.CloneURL(), rp.targetBranch, rp.forge.GitAuth()) if err != nil { @@ -242,7 +232,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { return err } - changelogData := changelog.New(commitparser.ByType(analyzedCommits), nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) + changelogData := changelog.New(commitparser.ByType(analyzedCommitsForChangelog), nextVersion, rp.forge.ReleaseURL(nextVersion), releaseOverrides.Prefix, releaseOverrides.Suffix) changelogEntry, err := changelog.Entry(logger, changelog.DefaultTemplate(), changelogData, changelog.Formatting{}) if err != nil { @@ -330,3 +320,28 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { return nil } + +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) + + commits, err := rp.forge.CommitsSince(ctx, since) + if err != nil { + return nil, err + } + + commits, err = parsePRBodyForCommitOverrides(commits) + if err != nil { + return nil, err + } + + logger.InfoContext(ctx, "Found releasable commits", "length", len(commits)) + + analyzedCommits, err := rp.commitParser.Analyze(commits) + if err != nil { + return nil, err + } + + logger.InfoContext(ctx, "Analyzed commits", "length", len(analyzedCommits)) + + return analyzedCommits, nil +} From fe3c9488b36faf1120f08208557ca440734eb286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Thu, 22 May 2025 15:38:41 +0200 Subject: [PATCH 123/260] chore(main): release v0.5.1 (#175) ### Bug Fixes - invalid version for subsequent pre-releases (#174) --- CHANGELOG.md | 6 ++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 703d6b9..4cc4b81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [v0.5.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.5.1) + +### Bug Fixes + +- invalid version for subsequent pre-releases (#174) + ## [v0.5.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.5.0) ### Features diff --git a/action.yml b/action.yml index 2d492dd..a1c5de1 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.0 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.5.1 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index 338a1b6..cbde7ad 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.0 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.5.1 # x-releaser-pleaser-version entrypoint: [ "" ] variables: GITLAB_TOKEN: $[[ inputs.token ]] From 58a9f1c9d5c98eed60cb6c29c6132e29afe2625b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 23 May 2025 16:12:43 +0000 Subject: [PATCH 124/260] deps: update dependency rust-lang/mdbook to v0.4.50 (#176) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index f8d6e93..70f0fa3 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.49 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.50 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From c1b0f15e07a7bae9177f1684908aafeb6cd41eec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 23:34:42 +0000 Subject: [PATCH 125/260] deps: update dependency rust-lang/mdbook to v0.4.51 (#177) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 70f0fa3..f9baa0a 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.50 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.51 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 9c8b854de0f22856bc591d7ed3295d571d3d8468 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 2 Jun 2025 21:27:02 +0000 Subject: [PATCH 126/260] deps: update registry.gitlab.com/gitlab-org/release-cli docker tag to v0.24.0 (#179) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e989c90..5530600 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,7 +6,7 @@ stages: [ release ] # and create a corresponding GitLab Release. create-release: stage: release - image: registry.gitlab.com/gitlab-org/release-cli:v0.23.0 + image: registry.gitlab.com/gitlab-org/release-cli:v0.24.0 script: echo "Creating release $CI_COMMIT_TAG" rules: - if: $CI_COMMIT_TAG From 31b12b9c33e408b6d01ef452730f2f4cb642bd3b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:24:23 +0000 Subject: [PATCH 127/260] deps: update module github.com/go-git/go-git/v5 to v5.16.1 (#180) 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 9865d59..079ba35 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.3 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.16.0 + github.com/go-git/go-git/v5 v5.16.1 github.com/google/go-github/v66 v66.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.9.1 diff --git a/go.sum b/go.sum index d879a5f..29cd3c2 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.16.0 h1:k3kuOEpkc0DeY7xlL6NaaNg39xdgQbtH5mwCafHO9AQ= -github.com/go-git/go-git/v5 v5.16.0/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.1 h1:TuxMBWNL7R05tXsUGi0kh1vi4tq0WfXNLlIrAkXG1k8= +github.com/go-git/go-git/v5 v5.16.1/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= From 1f882bf0142be5f51b939d295a613ed9776b9340 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 6 Jun 2025 22:07:04 +0000 Subject: [PATCH 128/260] deps: update dependency go to v1.24.4 (#181) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 079ba35..5de97a4 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.24.3 +toolchain go1.24.4 require ( github.com/blang/semver/v4 v4.0.0 From 359912dcc05a59018da772b03eaee514fddd0089 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:24:24 +0200 Subject: [PATCH 129/260] deps: update actions/setup-go digest to d35c59a (#122) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2d4d1cd..f3d138b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: go-version-file: go.mod @@ -30,7 +30,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: go-version-file: go.mod @@ -49,7 +49,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: go-version-file: go.mod diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6685ce8..6da204d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 - name: Set up Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: go-version-file: go.mod diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index a789e22..6898924 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -23,7 +23,7 @@ jobs: ref: main - name: Set up Go - uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5 + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 with: go-version-file: go.mod From f49481cd9289f50e840f897cfc2fd89daf0e6760 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:24:36 +0200 Subject: [PATCH 130/260] deps: update golangci/golangci-lint-action digest to 55c2c14 (#135) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f3d138b..0c35301 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: go-version-file: go.mod - name: Run golangci-lint - uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 + uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6 with: version: v1.64.8 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m From 49855aa70092ef63b27dc92b97cf75a0f5da5960 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:39:05 +0200 Subject: [PATCH 131/260] deps: update module github.com/google/go-github/v66 to v72 (#185) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- internal/forge/github/github.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 5de97a4..c937d88 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.24.4 require ( github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-git/v5 v5.16.1 - github.com/google/go-github/v66 v66.0.0 + github.com/google/go-github/v72 v72.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 diff --git a/go.sum b/go.sum index 29cd3c2..e488fc9 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6 github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= -github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= +github.com/google/go-github/v72 v72.0.0 h1:FcIO37BLoVPBO9igQQ6tStsv2asG4IPcYFi655PPvBM= +github.com/google/go-github/v72 v72.0.0/go.mod h1:WWtw8GMRiL62mvIquf1kO3onRHeWWKmK01qdCY8c5fg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index 2f48dcd..a296c2a 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -12,7 +12,7 @@ import ( "github.com/blang/semver/v4" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" - "github.com/google/go-github/v66/github" + "github.com/google/go-github/v72/github" "github.com/apricote/releaser-pleaser/internal/forge" "github.com/apricote/releaser-pleaser/internal/git" From e3ecd8993cd58a1203e5147f2447318b47a30e96 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 16:39:18 +0000 Subject: [PATCH 132/260] chore: update golangci-lint to v2 and fix breakage (#184) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit deps: update golangci/golangci-lint-action action to v8 Co-authored-by: Julian Tölle --- .github/workflows/ci.yaml | 4 +- .golangci.yaml | 61 +++++++++++++++++++++------- internal/git/git.go | 2 +- internal/releasepr/releasepr.go | 2 +- internal/releasepr/releasepr_test.go | 5 +-- 5 files changed, 53 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0c35301..6e7c542 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,9 +18,9 @@ jobs: go-version-file: go.mod - name: Run golangci-lint - uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6 + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v1.64.8 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v2.1.6 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: diff --git a/.golangci.yaml b/.golangci.yaml index b3e717d..5af5a17 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,14 +1,38 @@ +version: "2" linters: - presets: - - bugs - - error - - import - - metalinter - - module - - unused - enable: + - asasalint + - asciicheck + - bidichk + - bodyclose + - contextcheck + - durationcheck + - errchkjson + - errorlint + - exhaustive + - gocheckcompilerdirectives + - gochecksumtype + - gocritic + - gomoddirectives + - gomodguard + - gosec + - gosmopolitan + - loggercheck + - makezero + - musttag + - nilerr + - nilnesserr + - noctx + - protogetter + - reassign + - recvcheck + - rowserrcheck + - spancheck + - sqlclosecheck - testifylint + - unparam + - zerologlint + - revive disable: # preset error @@ -18,10 +42,19 @@ linters: # preset import - depguard -linters-settings: - gci: - sections: - - standard - - default - - localmodule + settings: + revive: + rules: + - name: exported + disabled: true +formatters: + enable: + - gci + - goimports + settings: + gci: + sections: + - standard + - default + - localmodule diff --git a/internal/git/git.go b/internal/git/git.go index 128f94c..87d94d9 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -113,7 +113,7 @@ func (r *Repository) UpdateFile(_ context.Context, path string, create bool, upd if err != nil { return err } - defer file.Close() + defer file.Close() //nolint:errcheck content, err := io.ReadAll(file) if err != nil { diff --git a/internal/releasepr/releasepr.go b/internal/releasepr/releasepr.go index 22eac0a..4437786 100644 --- a/internal/releasepr/releasepr.go +++ b/internal/releasepr/releasepr.go @@ -98,7 +98,7 @@ func (pr *ReleasePullRequest) parseVersioningFlags(overrides ReleaseOverrides) R overrides.NextVersionType = versioning.NextVersionTypeAlpha case LabelReleasePending, LabelReleaseTagged: // These labels have no effect on the versioning. - break + continue } } diff --git a/internal/releasepr/releasepr_test.go b/internal/releasepr/releasepr_test.go index 09beaae..346bacb 100644 --- a/internal/releasepr/releasepr_test.go +++ b/internal/releasepr/releasepr_test.go @@ -1,7 +1,6 @@ package releasepr import ( - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -59,7 +58,7 @@ func TestReleasePullRequest_GetOverrides(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got, err := tt.pr.GetOverrides() - if !tt.wantErr(t, err, fmt.Sprintf("GetOverrides()")) { + if !tt.wantErr(t, err, "GetOverrides()") { return } assert.Equalf(t, tt.want, got, "GetOverrides()") @@ -115,7 +114,7 @@ Suffix Things }, } got, err := pr.ChangelogText() - if !tt.wantErr(t, err, fmt.Sprintf("ChangelogText()")) { + if !tt.wantErr(t, err, "ChangelogText()") { return } assert.Equalf(t, tt.want, got, "ChangelogText()") From d91d93fc8cfa24ffeabc0c7eea5154936c3b41cb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 18:39:31 +0200 Subject: [PATCH 133/260] deps: update codecov/codecov-action digest to 18283e0 (#113) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6e7c542..919e80d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@288befbd1044bd1756afb0bdae077549e0ddb31f # v5 + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5 with: token: ${{ secrets.CODECOV_TOKEN }} From ad13dc24e0457c95f92876481bae7a5ebb8532e1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Jun 2025 16:40:56 +0000 Subject: [PATCH 134/260] chore(config): migrate config .github/renovate.json5 (#186) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/renovate.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 1ab8788..83d07be 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -62,8 +62,8 @@ customManagers: [ { customType: 'regex', - fileMatch: [ - '.+\\.ya?ml$', + managerFilePatterns: [ + '/.+\\.ya?ml$/', ], matchStrings: [ ': (?.+) # renovate: datasource=(?[a-z-]+) depName=(?[^\\s]+)(?: lookupName=(?[^\\s]+))?(?: versioning=(?[a-z-]+))?(?: extractVersion=(?[^\\s]+))?', From 17793565434d664be36ef864a5db75e551bb05a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 7 Jun 2025 18:42:29 +0200 Subject: [PATCH 135/260] deps: replace xanzy/go-gitlab with official client (#182) --- go.mod | 9 +++------ go.sum | 24 ++++++------------------ internal/forge/gitlab/gitlab.go | 10 +++++----- 3 files changed, 14 insertions(+), 29 deletions(-) diff --git a/go.mod b/go.mod index c937d88..4a0f0c4 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 - github.com/xanzy/go-gitlab v0.114.0 github.com/yuin/goldmark v1.7.12 + gitlab.com/gitlab-org/api/client-go v0.129.0 ) require ( @@ -27,7 +27,6 @@ require ( github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect - github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.7 // indirect @@ -43,11 +42,9 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.37.0 // indirect golang.org/x/net v0.39.0 // indirect - golang.org/x/oauth2 v0.6.0 // indirect + golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/sys v0.32.0 // indirect - golang.org/x/time v0.3.0 // indirect - google.golang.org/appengine v1.6.7 // indirect - google.golang.org/protobuf v1.33.0 // indirect + golang.org/x/time v0.11.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index e488fc9..12e5551 100644 --- a/go.sum +++ b/go.sum @@ -37,9 +37,6 @@ github.com/go-git/go-git/v5 v5.16.1 h1:TuxMBWNL7R05tXsUGi0kh1vi4tq0WfXNLlIrAkXG1 github.com/go-git/go-git/v5 v5.16.1/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= @@ -104,27 +101,24 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKEsEj+asVsu6M/0= github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= -github.com/xanzy/go-gitlab v0.114.0 h1:0wQr/KBckwrZPfEMjRqpUz0HmsKKON9UhCYv9KDy19M= -github.com/xanzy/go-gitlab v0.114.0/go.mod h1:wKNKh3GkYDMOsGmnfuX+ITCmDuSDWFO0G+C4AygL9RY= 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= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= -golang.org/x/oauth2 v0.6.0 h1:Lh8GPgSKBfWSwFvtuWOfeI3aAAnbXTSutYxJiOJFgIw= -golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= +golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -136,19 +130,13 @@ golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= +golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index aedc4f3..f53777a 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -11,7 +11,7 @@ import ( "github.com/blang/semver/v4" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" - "github.com/xanzy/go-gitlab" + gitlab "gitlab.com/gitlab-org/api/client-go" "github.com/apricote/releaser-pleaser/internal/forge" "github.com/apricote/releaser-pleaser/internal/git" @@ -174,7 +174,7 @@ func (g *GitLab) prForCommit(ctx context.Context, commit git.Commit) (*git.PullR return nil, err } - var mergeRequest *gitlab.MergeRequest + var mergeRequest *gitlab.BasicMergeRequest for _, mr := range associatedMRs { // We only look for the MR that has this commit set as the "merge/squash commit" => The result of squashing this branch onto main if mr.MergeCommitSHA == commit.Hash || mr.SquashCommitSHA == commit.Hash { @@ -315,7 +315,7 @@ func (g *GitLab) ClosePullRequest(ctx context.Context, pr *releasepr.ReleasePull } func (g *GitLab) PendingReleases(ctx context.Context, pendingLabel releasepr.Label) ([]*releasepr.ReleasePullRequest, error) { - glMRs, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.MergeRequest, *gitlab.Response, error) { + glMRs, err := all(func(listOptions gitlab.ListOptions) ([]*gitlab.BasicMergeRequest, *gitlab.Response, error) { return g.client.MergeRequests.ListMergeRequests(&gitlab.ListMergeRequestsOptions{ State: pointer.Pointer(PRStateMerged), Labels: &gitlab.LabelOptions{pendingLabel.Name}, @@ -369,7 +369,7 @@ func all[T any](f func(listOptions gitlab.ListOptions) ([]T, *gitlab.Response, e } } -func gitlabMRToPullRequest(pr *gitlab.MergeRequest) *git.PullRequest { +func gitlabMRToPullRequest(pr *gitlab.BasicMergeRequest) *git.PullRequest { return &git.PullRequest{ ID: pr.IID, Title: pr.Title, @@ -377,7 +377,7 @@ func gitlabMRToPullRequest(pr *gitlab.MergeRequest) *git.PullRequest { } } -func gitlabMRToReleasePullRequest(pr *gitlab.MergeRequest) *releasepr.ReleasePullRequest { +func gitlabMRToReleasePullRequest(pr *gitlab.BasicMergeRequest) *releasepr.ReleasePullRequest { labels := make([]releasepr.Label, 0, len(pr.Labels)) for _, labelName := range pr.Labels { if i := slices.IndexFunc(releasepr.KnownLabels, func(label releasepr.Label) bool { From f2786c8f398ec9b475d37162b4d7c331560a301a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Jun 2025 07:06:06 +0000 Subject: [PATCH 136/260] deps: update module github.com/go-git/go-git/v5 to v5.16.2 (#188) 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 4a0f0c4..1cb7b8b 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ toolchain go1.24.4 require ( github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-git/v5 v5.16.1 + github.com/go-git/go-git/v5 v5.16.2 github.com/google/go-github/v72 v72.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/spf13/cobra v1.9.1 diff --git a/go.sum b/go.sum index 12e5551..3c37570 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.16.1 h1:TuxMBWNL7R05tXsUGi0kh1vi4tq0WfXNLlIrAkXG1k8= -github.com/go-git/go-git/v5 v5.16.1/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.2 h1:fT6ZIOjE5iEnkzKyxTHK1W4HGAsPhqEqiSAssSO77hM= +github.com/go-git/go-git/v5 v5.16.2/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= From 175d6d0633785c1a6680da57d67a53801d0719c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Mon, 9 Jun 2025 10:06:56 +0200 Subject: [PATCH 137/260] 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. --- internal/forge/forge.go | 3 +++ internal/forge/github/github.go | 23 +++++++++++++++++ internal/forge/gitlab/gitlab.go | 16 ++++++++++++ internal/git/git.go | 37 ++++++++++++++++++-------- internal/git/git_test.go | 46 +++++++++++++++++++++++++++++++++ releaserpleaser.go | 9 +++++-- 6 files changed, 121 insertions(+), 13 deletions(-) create mode 100644 internal/git/git_test.go diff --git a/internal/forge/forge.go b/internal/forge/forge.go index 0bd119a..3e4c25e 100644 --- a/internal/forge/forge.go +++ b/internal/forge/forge.go @@ -17,6 +17,9 @@ type Forge interface { GitAuth() transport.AuthMethod + // CommitAuthor returns the git author used for the release commit. It should be the user whose token is used to talk to the API. + CommitAuthor(context.Context) (git.Author, error) + // LatestTags returns the last stable tag created on the main branch. If there is a more recent pre-release tag, // that is also returned. If no tag is found, it returns nil. LatestTags(context.Context) (git.Releases, error) diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index a296c2a..3bff3e6 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -29,6 +29,13 @@ const ( EnvRepository = "GITHUB_REPOSITORY" ) +var ( + gitHubActionsBotAuthor = git.Author{ + Name: "github-actions[bot]", + Email: "41898282+github-actions[bot]@users.noreply.github.com", + } +) + var _ forge.Forge = &GitHub{} type GitHub struct { @@ -61,6 +68,22 @@ func (g *GitHub) GitAuth() transport.AuthMethod { } } +func (g *GitHub) CommitAuthor(ctx context.Context) (git.Author, error) { + g.log.DebugContext(ctx, "getting commit author from current token user") + + user, _, err := g.client.Users.Get(ctx, "") + if err != nil { + g.log.WarnContext(ctx, "failed to get commit author from API, using default github-actions[bot] user", "error", err) + + return gitHubActionsBotAuthor, nil + } + + return git.Author{ + Name: user.GetName(), + Email: user.GetEmail(), + }, nil +} + func (g *GitHub) LatestTags(ctx context.Context) (git.Releases, error) { g.log.DebugContext(ctx, "listing all tags in github repository") diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index f53777a..06de7fd 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -69,6 +69,22 @@ func (g *GitLab) GitAuth() transport.AuthMethod { } } +func (g *GitLab) CommitAuthor(ctx context.Context) (git.Author, error) { + g.log.DebugContext(ctx, "getting commit author from current token user") + + user, _, err := g.client.Users.CurrentUser(gitlab.WithContext(ctx)) + if err != nil { + return git.Author{}, err + } + + // TODO: Return bot when nothing is returned? + + return git.Author{ + Name: user.Name, + Email: user.Email, + }, nil +} + func (g *GitLab) LatestTags(ctx context.Context) (git.Releases, error) { g.log.DebugContext(ctx, "listing all tags in gitlab repository") diff --git a/internal/git/git.go b/internal/git/git.go index 87d94d9..95f05e0 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -45,6 +45,27 @@ type Releases struct { Stable *Tag } +type Author struct { + Name string + Email string +} + +func (a Author) signature(when time.Time) *object.Signature { + return &object.Signature{ + Name: a.Name, + Email: a.Email, + When: when, + } +} + +func (a Author) String() string { + return fmt.Sprintf("%s <%s>", a.Name, a.Email) +} + +var ( + committer = Author{Name: "releaser-pleaser", Email: ""} +) + func CloneRepo(ctx context.Context, logger *slog.Logger, cloneURL, branch string, auth transport.AuthMethod) (*Repository, error) { dir, err := os.MkdirTemp("", "releaser-pleaser.*") if err != nil { @@ -150,15 +171,17 @@ func (r *Repository) UpdateFile(_ context.Context, path string, create bool, upd return nil } -func (r *Repository) Commit(_ context.Context, message string) (Commit, error) { +func (r *Repository) Commit(_ context.Context, message string, author Author) (Commit, error) { worktree, err := r.r.Worktree() if err != nil { return Commit{}, err } + now := time.Now() + releaseCommitHash, err := worktree.Commit(message, &git.CommitOptions{ - Author: signature(), - Committer: signature(), + Author: author.signature(now), + Committer: committer.signature(now), }) if err != nil { return Commit{}, fmt.Errorf("failed to commit changes: %w", err) @@ -223,11 +246,3 @@ func (r *Repository) ForcePush(ctx context.Context, branch string) error { Auth: r.auth, }) } - -func signature() *object.Signature { - return &object.Signature{ - Name: "releaser-pleaser", - Email: "", - When: time.Now(), - } -} diff --git a/internal/git/git_test.go b/internal/git/git_test.go new file mode 100644 index 0000000..399c2ba --- /dev/null +++ b/internal/git/git_test.go @@ -0,0 +1,46 @@ +package git + +import ( + "reflect" + "strconv" + "testing" + "time" + + "github.com/go-git/go-git/v5/plumbing/object" +) + +func TestAuthor_signature(t *testing.T) { + now := time.Now() + + tests := []struct { + author Author + want *object.Signature + }{ + {author: Author{Name: "foo", Email: "bar@example.com"}, want: &object.Signature{Name: "foo", Email: "bar@example.com", When: now}}, + {author: Author{Name: "bar", Email: "foo@example.com"}, want: &object.Signature{Name: "bar", Email: "foo@example.com", When: now}}, + } + for i, tt := range tests { + t.Run(strconv.FormatInt(int64(i), 10), func(t *testing.T) { + if got := tt.author.signature(now); !reflect.DeepEqual(got, tt.want) { + t.Errorf("signature() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestAuthor_String(t *testing.T) { + tests := []struct { + author Author + want string + }{ + {author: Author{Name: "foo", Email: "bar@example.com"}, want: "foo "}, + {author: Author{Name: "bar", Email: "foo@example.com"}, want: "bar "}, + } + for i, tt := range tests { + t.Run(strconv.FormatInt(int64(i), 10), func(t *testing.T) { + if got := tt.author.String(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("String() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/releaserpleaser.go b/releaserpleaser.go index f2f4064..13e2381 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -255,13 +255,18 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { } } + releaseCommitAuthor, err := rp.forge.CommitAuthor(ctx) + if err != nil { + return fmt.Errorf("failed to get commit author: %w", err) + } + releaseCommitMessage := fmt.Sprintf("chore(%s): release %s", rp.targetBranch, nextVersion) - releaseCommit, err := repo.Commit(ctx, releaseCommitMessage) + releaseCommit, err := repo.Commit(ctx, releaseCommitMessage, releaseCommitAuthor) if err != nil { return fmt.Errorf("failed to commit changes: %w", err) } - logger.InfoContext(ctx, "created release commit", "commit.hash", releaseCommit.Hash, "commit.message", releaseCommit.Message) + logger.InfoContext(ctx, "created release commit", "commit.hash", releaseCommit.Hash, "commit.message", releaseCommit.Message, "commit.author", releaseCommitAuthor) // Check if anything changed in comparison to the remote branch (if exists) newReleasePRChanges, err := repo.HasChangesWithRemote(ctx, rpBranch) From 81a855f5ab34904b25ce192317c6be54c8a60899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Mon, 9 Jun 2025 10:52:09 +0200 Subject: [PATCH 138/260] 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 --- go.mod | 2 +- internal/git/git.go | 68 ++++++++++++-- internal/git/git_test.go | 126 +++++++++++++++++++++++++ internal/git/util_test.go | 189 ++++++++++++++++++++++++++++++++++++++ releaserpleaser.go | 2 +- 5 files changed, 376 insertions(+), 11 deletions(-) create mode 100644 internal/git/util_test.go diff --git a/go.mod b/go.mod index 1cb7b8b..e8038f4 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ toolchain go1.24.4 require ( github.com/blang/semver/v4 v4.0.0 + github.com/go-git/go-billy/v5 v5.6.2 github.com/go-git/go-git/v5 v5.16.2 github.com/google/go-github/v72 v72.0.0 github.com/leodido/go-conventionalcommits v0.12.0 @@ -25,7 +26,6 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.6.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect diff --git a/internal/git/git.go b/internal/git/git.go index 95f05e0..136a828 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -193,8 +193,27 @@ func (r *Repository) Commit(_ context.Context, message string, author Author) (C }, nil } -func (r *Repository) HasChangesWithRemote(ctx context.Context, branch string) (bool, error) { - remoteRef, err := r.r.Reference(plumbing.NewRemoteReferenceName(remoteName, branch), false) +// HasChangesWithRemote checks if the following two diffs are equal: +// +// - **Local**: remote/main..branch +// - **Remote**: (git merge-base remote/main remote/branch)..remote/branch +// +// This is done to avoid pushing when the only change would be a rebase of remote/branch onto the current remote/main. +func (r *Repository) HasChangesWithRemote(ctx context.Context, mainBranch, prBranch string) (bool, error) { + return r.hasChangesWithRemote(ctx, + plumbing.NewRemoteReferenceName(remoteName, mainBranch), + plumbing.NewBranchReferenceName(prBranch), + plumbing.NewRemoteReferenceName(remoteName, prBranch), + ) +} + +func (r *Repository) hasChangesWithRemote(ctx context.Context, mainBranchRef, localPRBranchRef, remotePRBranchRef plumbing.ReferenceName) (bool, error) { + commitOnRemoteMain, err := r.commitFromRef(mainBranchRef) + if err != nil { + return false, err + } + + commitOnRemotePRBranch, err := r.commitFromRef(remotePRBranchRef) if err != nil { if err.Error() == "reference not found" { // No remote branch means that there are changes @@ -204,29 +223,60 @@ func (r *Repository) HasChangesWithRemote(ctx context.Context, branch string) (b return false, err } - remoteCommit, err := r.r.CommitObject(remoteRef.Hash()) + currentRemotePRMergeBase, err := r.mergeBase(commitOnRemoteMain, commitOnRemotePRBranch) + if err != nil { + return false, err + } + if currentRemotePRMergeBase == nil { + // If there is no merge base something weird has happened with the + // remote main branch, and we should definitely push updates. + return false, nil + } + + remoteDiff, err := commitOnRemotePRBranch.PatchContext(ctx, currentRemotePRMergeBase) if err != nil { return false, err } - localRef, err := r.r.Reference(plumbing.NewBranchReferenceName(branch), false) + commitOnLocalPRBranch, err := r.commitFromRef(localPRBranchRef) if err != nil { return false, err } - localCommit, err := r.r.CommitObject(localRef.Hash()) + localDiff, err := commitOnRemoteMain.PatchContext(ctx, commitOnLocalPRBranch) if err != nil { return false, err } - diff, err := localCommit.PatchContext(ctx, remoteCommit) + return remoteDiff.String() == localDiff.String(), nil +} + +func (r *Repository) commitFromRef(refName plumbing.ReferenceName) (*object.Commit, error) { + ref, err := r.r.Reference(refName, false) if err != nil { - return false, err + return nil, err } - hasChanges := len(diff.FilePatches()) > 0 + commit, err := r.r.CommitObject(ref.Hash()) + if err != nil { + return nil, err + } - return hasChanges, nil + return commit, nil +} + +func (r *Repository) mergeBase(a, b *object.Commit) (*object.Commit, error) { + mergeBases, err := a.MergeBase(b) + if err != nil { + return nil, err + } + + if len(mergeBases) == 0 { + return nil, nil + } + + // :shrug: We dont really care which commit we pick, at worst we do an unnecessary push. + return mergeBases[0], nil } func (r *Repository) ForcePush(ctx context.Context, branch string) error { diff --git a/internal/git/git_test.go b/internal/git/git_test.go index 399c2ba..3d05538 100644 --- a/internal/git/git_test.go +++ b/internal/git/git_test.go @@ -1,12 +1,15 @@ package git import ( + "context" "reflect" "strconv" "testing" "time" + "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" + "github.com/stretchr/testify/assert" ) func TestAuthor_signature(t *testing.T) { @@ -44,3 +47,126 @@ func TestAuthor_String(t *testing.T) { }) } } + +const testMainBranch = "main" +const testPRBranch = "releaser-pleaser" + +func TestRepository_HasChangesWithRemote(t *testing.T) { + // go-git/v5 has a bug where it tries to delete the repo root dir (".") multiple times if there is no file left in it. + // this happens while switching branches in worktree.go rmFileAndDirsIfEmpty. + // TODO: Fix bug upstream + // For now I just make sure that there is always at least one file left in the dir by adding an empty "README.md" in the test util. + + mainBranchRef := plumbing.NewBranchReferenceName(testMainBranch) + localPRBranchRef := plumbing.NewBranchReferenceName(testPRBranch) + remotePRBranchRef := plumbing.NewBranchReferenceName("remote/" + testPRBranch) + + tests := []struct { + name string + repo TestRepo + want bool + wantErr assert.ErrorAssertionFunc + }{ + { + name: "no remote pr branch", + repo: WithTestRepo( + WithCommit( + "chore: release v1.0.0", + WithFile("VERSION", "v1.0.0"), + ), + WithCommit( + "chore: release v1.1.0", + OnBranch(mainBranchRef), + AsNewBranch(localPRBranchRef), + WithFile("VERSION", "v1.1.0"), + ), + ), + want: true, + wantErr: assert.NoError, + }, + { + name: "remote pr branch matches local", + repo: WithTestRepo( + WithCommit( + "chore: release v1.0.0", + WithFile("VERSION", "v1.0.0"), + ), + WithCommit( + "chore: release v1.1.0", + OnBranch(mainBranchRef), + AsNewBranch(remotePRBranchRef), + WithFile("VERSION", "v1.1.0"), + ), + WithCommit( + "chore: release v1.1.0", + OnBranch(mainBranchRef), + AsNewBranch(localPRBranchRef), + WithFile("VERSION", "v1.1.0"), + ), + ), + want: false, + wantErr: assert.NoError, + }, + { + name: "remote pr only needs rebase", + repo: WithTestRepo( + WithCommit( + "chore: release v1.0.0", + WithFile("VERSION", "v1.0.0"), + ), + WithCommit( + "chore: release v1.1.0", + OnBranch(mainBranchRef), + AsNewBranch(remotePRBranchRef), + WithFile("VERSION", "v1.1.0"), + ), + WithCommit( + "feat: new feature on remote", + OnBranch(mainBranchRef), + WithFile("feature", "yes"), + ), + WithCommit( + "chore: release v1.1.0", + OnBranch(mainBranchRef), + AsNewBranch(localPRBranchRef), + WithFile("VERSION", "v1.1.0"), + ), + ), + want: false, + wantErr: assert.NoError, + }, + { + name: "needs update", + repo: WithTestRepo( + WithCommit( + "chore: release v1.0.0", + WithFile("VERSION", "v1.0.0"), + ), + WithCommit( + "chore: release v1.1.0", + OnBranch(mainBranchRef), + AsNewBranch(remotePRBranchRef), + WithFile("VERSION", "v1.1.0"), + ), + WithCommit( + "chore: release v1.2.0", + OnBranch(mainBranchRef), + AsNewBranch(localPRBranchRef), + WithFile("VERSION", "v1.2.0"), + ), + ), + want: false, + wantErr: assert.NoError, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + repo := tt.repo(t) + got, err := repo.hasChangesWithRemote(context.Background(), mainBranchRef, localPRBranchRef, remotePRBranchRef) + if !tt.wantErr(t, err) { + return + } + assert.Equal(t, tt.want, got) + }) + } +} diff --git a/internal/git/util_test.go b/internal/git/util_test.go new file mode 100644 index 0000000..eff947f --- /dev/null +++ b/internal/git/util_test.go @@ -0,0 +1,189 @@ +package git + +import ( + "fmt" + "io" + "log/slog" + "os" + "testing" + "time" + + "github.com/go-git/go-billy/v5/memfs" + "github.com/go-git/go-git/v5" + "github.com/go-git/go-git/v5/plumbing" + "github.com/go-git/go-git/v5/plumbing/object" + "github.com/go-git/go-git/v5/storage/memory" + "github.com/stretchr/testify/require" +) + +var ( + author = &object.Signature{ + Name: "releaser-pleaser", + When: time.Date(2020, 01, 01, 01, 01, 01, 01, time.UTC), + } +) + +type CommitOption func(*commitOptions) +type commitOptions struct { + cleanFiles bool + files []commitFile + tags []string + newRef plumbing.ReferenceName + parentRef plumbing.ReferenceName +} +type commitFile struct { + path string + content string +} + +type TestCommit func(*testing.T, *Repository) error +type TestRepo func(*testing.T) *Repository + +func WithCommit(message string, options ...CommitOption) TestCommit { + return func(t *testing.T, repo *Repository) error { + t.Helper() + + require.NotEmpty(t, message, "commit message is required") + + opts := &commitOptions{} + for _, opt := range options { + opt(opts) + } + + wt, err := repo.r.Worktree() + require.NoError(t, err) + + if opts.parentRef != "" { + checkoutOptions := &git.CheckoutOptions{} + + if opts.newRef != "" { + parentRef, err := repo.r.Reference(opts.parentRef, false) + require.NoError(t, err) + + checkoutOptions.Create = true + checkoutOptions.Hash = parentRef.Hash() + checkoutOptions.Branch = opts.newRef + } else { + checkoutOptions.Branch = opts.parentRef + } + + err = wt.Checkout(checkoutOptions) + require.NoError(t, err) + } + + // Yeet all files + if opts.cleanFiles { + files, err := wt.Filesystem.ReadDir(".") + require.NoError(t, err, "failed to get current files") + + for _, fileInfo := range files { + err = wt.Filesystem.Remove(fileInfo.Name()) + require.NoError(t, err, "failed to remove file %q", fileInfo.Name()) + } + } + + // Create new files + for _, fileInfo := range opts.files { + file, err := wt.Filesystem.Create(fileInfo.path) + require.NoError(t, err, "failed to create file %q", fileInfo.path) + + _, err = file.Write([]byte(fileInfo.content)) + _ = file.Close() + require.NoError(t, err, "failed to write content to file %q", fileInfo.path) + + _, err = wt.Add(fileInfo.path) + require.NoError(t, err, "failed to stage changes to file %q", fileInfo.path) + + } + + // Commit + commitHash, err := wt.Commit(message, &git.CommitOptions{ + All: true, + AllowEmptyCommits: true, + Author: author, + Committer: author, + }) + require.NoError(t, err, "failed to commit") + + // Create tags + for _, tagName := range opts.tags { + _, err = repo.r.CreateTag(tagName, commitHash, nil) + require.NoError(t, err, "failed to create tag %q", tagName) + } + + return nil + } +} + +func WithFile(path, content string) CommitOption { + return func(opts *commitOptions) { + opts.files = append(opts.files, commitFile{path: path, content: content}) + } +} + +// WithCleanFiles removes all previous files from the repo. Make sure to leave at least one file in the root +// directory when switching branches! +func WithCleanFiles() CommitOption { + return func(opts *commitOptions) { + opts.cleanFiles = true + } +} + +func AsNewBranch(ref plumbing.ReferenceName) CommitOption { + return func(opts *commitOptions) { + opts.newRef = ref + } +} + +func OnBranch(ref plumbing.ReferenceName) CommitOption { + return func(opts *commitOptions) { + opts.parentRef = ref + } +} + +func WithTag(name string) CommitOption { + return func(opts *commitOptions) { + opts.tags = append(opts.tags, name) + } +} + +// Can be useful to debug git issues by using it in a terminal +const useOnDiskTestRepository = false + +func WithTestRepo(commits ...TestCommit) TestRepo { + return func(t *testing.T) *Repository { + t.Helper() + + repo := &Repository{ + logger: slog.New(slog.NewTextHandler(io.Discard, nil)), + } + + var err error + + initOptions := git.InitOptions{DefaultBranch: plumbing.Main} + + if useOnDiskTestRepository { + dir, err := os.MkdirTemp(os.TempDir(), "rp-test-repo-") + require.NoError(t, err, "failed to create temp directory") + + repo.r, err = git.PlainInitWithOptions(dir, &git.PlainInitOptions{InitOptions: initOptions}) + require.NoError(t, err, "failed to create fs repository") + + fmt.Printf("using temp directory: %s", dir) + } else { + repo.r, err = git.InitWithOptions(memory.NewStorage(), memfs.New(), initOptions) + require.NoError(t, err, "failed to create in-memory repository") + } + + // Make initial commit + err = WithCommit("chore: init", WithFile("README.md", "# git test util"))(t, repo) + require.NoError(t, err, "failed to create init commit") + + for i, commit := range commits { + err = commit(t, repo) + require.NoError(t, err, "failed to create commit %d", i) + } + + return repo + } +} diff --git a/releaserpleaser.go b/releaserpleaser.go index 13e2381..3c316ae 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -269,7 +269,7 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger.InfoContext(ctx, "created release commit", "commit.hash", releaseCommit.Hash, "commit.message", releaseCommit.Message, "commit.author", releaseCommitAuthor) // Check if anything changed in comparison to the remote branch (if exists) - newReleasePRChanges, err := repo.HasChangesWithRemote(ctx, rpBranch) + newReleasePRChanges, err := repo.HasChangesWithRemote(ctx, rp.targetBranch, rpBranch) if err != nil { return err } 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 139/260] 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 140/260] 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 141/260] 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 142/260] 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 eae0045359e44bd3fca1c8f543657baa13bfd5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 15:11:28 +0200 Subject: [PATCH 143/260] feat: colorize log output (#195) Makes it easier to read, uses lmittmann/tint. --- cmd/rp/cmd/root.go | 12 +++++++++--- go.mod | 1 + go.sum | 2 ++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/rp/cmd/root.go b/cmd/rp/cmd/root.go index 4da80e5..14a5d14 100644 --- a/cmd/rp/cmd/root.go +++ b/cmd/rp/cmd/root.go @@ -4,7 +4,9 @@ import ( "log/slog" "os" "runtime/debug" + "time" + "github.com/lmittmann/tint" "github.com/spf13/cobra" ) @@ -46,8 +48,12 @@ func Execute() { } func init() { - logger = slog.New(slog.NewTextHandler(os.Stderr, &slog.HandlerOptions{ - Level: slog.LevelDebug, - })) + logger = slog.New( + tint.NewHandler(os.Stderr, &tint.Options{ + Level: slog.LevelDebug, + TimeFormat: time.RFC3339, + }), + ) + slog.SetDefault(logger) } diff --git a/go.mod b/go.mod index 341b585..395b57f 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/go-git/go-git/v5 v5.16.2 github.com/google/go-github/v72 v72.0.0 github.com/leodido/go-conventionalcommits v0.12.0 + github.com/lmittmann/tint v1.1.2 github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 diff --git a/go.sum b/go.sum index 518418d..9fd54cc 100644 --- a/go.sum +++ b/go.sum @@ -65,6 +65,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-conventionalcommits v0.12.0 h1:pG01rl8Ze+mxnSSVB2wPdGASXyyU25EGwLUc0bWrmKc= github.com/leodido/go-conventionalcommits v0.12.0/go.mod h1:DW+n8pQb5w/c7Vba7iGOMS3rkbPqykVlnrDykGjlsJM= +github.com/lmittmann/tint v1.1.2 h1:2CQzrL6rslrsyjqLDwD11bZ5OpLBPU+g3G/r5LSfS8w= +github.com/lmittmann/tint v1.1.2/go.mod h1:HIS3gSy7qNwGCj+5oRjAutErFBl4BzdQP6cJZ0NfMwE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= From 08d35f2f572e88b6638f7c226b9d0213af76a785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 15:19:34 +0200 Subject: [PATCH 144/260] feat: graceful shutdown when CI job is cancelled (#196) By listening on SIGINT and SIGTERM signals we can stop executing as soon as reasonably possible. This helps to avoid uncessary work and stop the job earlier. Right now we have no manual checks for cancelled contexts, and rely on the http client to check for it while making requests. --- cmd/rp/cmd/root.go | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/cmd/rp/cmd/root.go b/cmd/rp/cmd/root.go index 14a5d14..2799e6d 100644 --- a/cmd/rp/cmd/root.go +++ b/cmd/rp/cmd/root.go @@ -1,9 +1,12 @@ package cmd import ( + "context" "log/slog" "os" + "os/signal" "runtime/debug" + "syscall" "time" "github.com/lmittmann/tint" @@ -13,10 +16,12 @@ import ( var logger *slog.Logger var rootCmd = &cobra.Command{ - Use: "rp", - Short: "", - Long: ``, - Version: version(), + Use: "rp", + Short: "", + Long: ``, + Version: version(), + SilenceUsage: true, // Makes it harder to find the actual error + SilenceErrors: true, // We log manually with slog } func version() string { @@ -41,8 +46,33 @@ func version() string { } func Execute() { - err := rootCmd.Execute() + // Behaviour when cancelling jobs: + // + // GitHub Actions: https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-workflow-runs/canceling-a-workflow#steps-github-takes-to-cancel-a-workflow-run + // 1. SIGINT + // 2. Wait 7500ms + // 3. SIGTERM + // 4. Wait 2500ms + // 5. SIGKILL + // + // GitLab CI/CD: https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/4446 + // 1. SIGTERM + // 2. Wait ??? + // 3. SIGKILL + // + // We therefore need to listen on SIGINT and SIGTERM + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + go func() { + // Make sure to stop listening on signals after receiving the first signal to hand control of the signal back + // to the runtime. The Go runtime implements a "force shutdown" if the signal is received again. + <-ctx.Done() + logger.InfoContext(ctx, "Received shutdown signal, stopping...") + stop() + }() + + err := rootCmd.ExecuteContext(ctx) if err != nil { + logger.ErrorContext(ctx, err.Error()) os.Exit(1) } } From d24ae7de98ae7590bc191c67a2357c059d33fc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 15:23:05 +0200 Subject: [PATCH 145/260] feat: detect changed pull request description and retry process (#197) If the release PR description was changed by a human after releaser-pleaser fetched the PR for the first time, releaser-pleaser would revert the users changes accidentally. This commit introduces an additional check right before updating the pull request description, to make sure we do not accidentally loose user changes. There is still the potential for a conflict in between us checking the description is the same, and updating the description. The time window for this should be reduced from multiple seconds-minutes to a few hundred milliseconds at most. In case a conflict is detected, we retry the whole process up to 2 times, to make sure that the users changes are reflected as soon as possible. This is especially important on GitLab CI/CD because a changed pull (merge) request description does not cause another job to run. With this change, the branch is still pushed, as the user is not expected to make any changes to it. Fixes #151 --- releaserpleaser.go | 58 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/releaserpleaser.go b/releaserpleaser.go index 409d8bb..a09aefe 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -2,6 +2,7 @@ package rp import ( "context" + "errors" "fmt" "log/slog" @@ -18,6 +19,14 @@ const ( PullRequestBranchFormat = "releaser-pleaser--branches--%s" ) +const ( + PullRequestConflictAttempts = 3 +) + +var ( + ErrorPullRequestConflict = errors.New("conflict: pull request description was changed while releaser-pleaser was running") +) + type ReleaserPleaser struct { forge forge.Forge logger *slog.Logger @@ -57,7 +66,7 @@ func (rp *ReleaserPleaser) Run(ctx context.Context) error { return fmt.Errorf("failed to create pending releases: %w", err) } - err = rp.runReconcileReleasePR(ctx) + err = rp.runReconcileReleasePRWithRetries(ctx) if err != nil { return fmt.Errorf("failed to reconcile release pull request: %w", err) } @@ -143,6 +152,36 @@ func (rp *ReleaserPleaser) createPendingRelease(ctx context.Context, pr *release return nil } +// runReconcileReleasePRWithRetries retries runReconcileReleasePR up to PullRequestConflictAttempts times, but only +// when a ErrorPullRequestConflict was encountered. +func (rp *ReleaserPleaser) runReconcileReleasePRWithRetries(ctx context.Context) error { + logger := rp.logger.With("method", "runReconcileReleasePRWithRetries", "totalAttempts", PullRequestConflictAttempts) + var err error + + for i := range PullRequestConflictAttempts { + logger := logger.With("attempt", i+1) + logger.DebugContext(ctx, "attempting runReconcileReleasePR") + + err = rp.runReconcileReleasePR(ctx) + if err != nil { + if errors.Is(err, ErrorPullRequestConflict) { + logger.WarnContext(ctx, "detected conflict while updating pull request description, retrying") + continue + } + + break + } + + break + } + + if err != nil { + return err + } + + return nil +} + func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { logger := rp.logger.With("method", "runReconcileReleasePR") @@ -305,6 +344,23 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { } logger.InfoContext(ctx, "opened pull request", "pr.title", pr.Title, "pr.id", pr.ID, "pr.url", rp.forge.PullRequestURL(pr.ID)) } else { + // Check if the pull request was updated while releaser-pleaser was running. + // This avoids a conflict where the user updated the PR while releaser-pleaser already pulled the info, and + // releaser-pleaser subsequently reverts the users changes. There is still a minimal time window for this to + // happen between us checking the PR again and submitting our changes. + + logger.DebugContext(ctx, "checking for conflict in pr description", "pr.id", pr.ID) + recheckPR, err := rp.forge.PullRequestForBranch(ctx, rpBranch) + if err != nil { + return err + } + if recheckPR == nil { + return fmt.Errorf("PR was deleted while releaser-pleaser was running") + } + if recheckPR.Description != pr.Description { + return ErrorPullRequestConflict + } + pr.SetTitle(rp.targetBranch, nextVersion) overrides, err := pr.GetOverrides() From 2d3a9609390e1646b39dd1d64ba5825f5f77599a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 15:43:35 +0200 Subject: [PATCH 146/260] feat: run one job concurrently to reduce chance of conflicts (#198) Each run of releaser-pleaser acts on the same global state in the forge. Therefore, parallel runs are unnecessary. This commit also communicates to the GitHub and GitLab CI pipelines that the releaser-pleaser jobs can be cancelled as early as possible. - On GitHub Actions this can be guaranteed through the workflow settings. These settings are copied into each repository that uses releaser-pleaser, so users need to update this manually. I will add a note to the release notes for this. - On GitLab CI/CD this requires the user to configure a project level setting to "auto-cancel redundant pipelines". We will not recommend user to set this, as it is quite invasive and can break their regular CI pipelines. --- .github/workflows/releaser-pleaser.yaml | 7 +++++++ docs/tutorials/github.md | 4 ++++ templates/run.yml | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 6898924..f8d1aa5 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -10,6 +10,13 @@ on: - labeled - unlabeled +# Only one job needs to run at a time, if a new job is started there is probably new data to include in the response, so +# it does not make sense to finish the previous job. This also helps with "data-race conflicts", where a human changes +# the PR description but releaser-pleaser was already running and overwrites the humans changes. +concurrency: + group: releaser-pleaser + cancel-in-progress: true + permissions: {} jobs: diff --git a/docs/tutorials/github.md b/docs/tutorials/github.md index 693ef65..02812b2 100644 --- a/docs/tutorials/github.md +++ b/docs/tutorials/github.md @@ -44,6 +44,10 @@ on: - labeled - unlabeled +concurrency: + group: releaser-pleaser + cancel-in-progress: true + jobs: releaser-pleaser: runs-on: ubuntu-latest diff --git a/templates/run.yml b/templates/run.yml index cbde7ad..9382d79 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -26,9 +26,19 @@ spec: releaser-pleaser: stage: $[[ inputs.stage ]] needs: $[[ inputs.needs ]] + rules: # There is no way to run a pipeline when the MR description is updated :( - if: $CI_COMMIT_BRANCH == "$[[ inputs.branch ]]" + + # If a newer releaser-pleaser job runs, this one may be cancelled without problem, releaser-pleaser is idempotent. + # This only works if the user enables "auto-cancel redundant pipelines", which we do tell them to, because this is + # intrusive and up to the user. + interruptible: true + + # No need to have multiple releaser-pleaser jobs running at the same time. They all act on the same global state. + resource_group: releaser-pleaser + image: name: ghcr.io/apricote/releaser-pleaser:v0.5.1 # x-releaser-pleaser-version entrypoint: [ "" ] From d540e2221dc710058f9a786c8d6c8a17049fca6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 16:24:16 +0200 Subject: [PATCH 147/260] docs: describe concurrency and conflict considerations (#199) Describe the issue with concurrency, the global state and what went into the recent changes in #196, #197 and #198. --- docs/SUMMARY.md | 1 + docs/explanation/concurrency-conflicts.md | 65 +++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 docs/explanation/concurrency-conflicts.md diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index d001c2d..b13bf24 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -10,6 +10,7 @@ # Explanation - [Release Pull Request](explanation/release-pr.md) +- [Concurrency and Conflicts](explanation/concurrency-conflicts.md) # Guides diff --git a/docs/explanation/concurrency-conflicts.md b/docs/explanation/concurrency-conflicts.md new file mode 100644 index 0000000..9d14eb7 --- /dev/null +++ b/docs/explanation/concurrency-conflicts.md @@ -0,0 +1,65 @@ +# Concurrency and Conflicts + +## Why + +`releaser-pleaser` works on the "shared global state" that is your project on GitHub/GitLab. Each execution reads from that state and makes changes to it. While `releaser-pleaser` is generally [idempotent](https://en.wikipedia.org/wiki/Idempotence), we still need to consider concurrent executions for two reasons: avoiding conflicts and saving resources. + +### Avoiding conflicts + +The [Release Pull Request](release-pr.md) is used by `releaser-pleaser` to show the current release. Users may update the PR description to add additional notes into the Changelog. + +When `releaser-pleaser` is running while the user modifies the Release Pull Request description, `releaser-pleaser` may overwrite the description afterward based on its outdated local copy of the pull request. + +### Saving resources + +While `releaser-pleaser` is idempotent, there is no benefit to running it multiple times in parallel. In the best case, `releaser-pleaser` could be stopped as soon as a new "change" that is relevant to it comes in and restarts based on that new state. + +## Measures taken + +### Concurrency limits in CI environments + +Our default configurations for [GitHub Actions](../tutorials/github.md) and [GitLab CI/CD](../tutorials/gitlab.md) try to limit concurrent `releaser-pleaser` jobs to a single one. + +#### GitHub Actions + +On GitHub Actions, we use a `concurrency.group` to restrict it to a single running job per repository. + +GitHub cancels the currently running job and any other pending ones when a new one is started. This makes sure that `releaser-pleaser` always works with the latest state. + +Users need to enable this in their workflow (included in our GitHub tutorial): + +```yaml +concurrency: + group: releaser-pleaser + cancel-in-progress: true +``` + +#### GitLab + +On GitLab CI/CD, we use a `resource_group: releaser-pleaser` in our GitLab CI/CD component to restrict it to a single running job per repository. This is part of the component YAML, so users do not need to set this manually. + +There is no easy way to cancel the running job, so we let it proceed and rely on the other measures to safely handle the data. Users can enable "auto-cancel redundant pipelines" if they want, but should consider the ramifications for the rest of their CI carefully before doing so. + +### Graceful shutdown + +When GitHub Actions and GitLab CI/CD cancel jobs, they first sent a signal to the running process (`SIGINT` on GitHub and `SIGTERM` on GitLab). We listen for these signals and initiate a shutdown of the process. This helps save resources by shutting down as fast as possible, but in a controlled manner. + +### Re-checking PR description for conflict + +When `releaser-pleaser` prepares the Release Pull Request, the first step is to check if there is an existing PR already opened. It then reads from this PR to learn if the user modified the release in some way ([Release Notes](../guides/release-notes.md#for-the-release), [Pre-releases](../guides/pre-releases.md)). Based on this, it prepares the commit and the next iteration of the Release Pull Request description. The last step is to update the Release Pull Request description. + +Depending on the time since the last release, a lot of API calls are made to learn about these changes; this can take between a few seconds and a few minutes. If the user makes any changes to the Release Pull Request in this time frame, they are not considered for the next iteration of the description. To make sure that we do not lose these changes, `releaser-pleaser` fetches the Release Pull Request description again right before updating it. In case it changed from the start of the process, the attempt is aborted, and the whole process is retried two times. + +This does not fully eliminate the potential for data loss, but reduces the time frame from multiple seconds (up to minutes) to a few hundred milliseconds. + +## Related Documentation + +- **Explanation** + - [Release Pull Request](release-pr.md) +- **Guide** + - [Pre-releases](../guides/pre-releases.md) + - [Customizing Release Notes](../guides/release-notes.md) +- **Tutorial** + - [Getting started on GitHub](../tutorials/github.md) + - [Getting started on GitLab](../tutorials/gitlab.md) + From 0de242a4e6f224e2bb0366e04576aedd40de20c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 16:34:26 +0200 Subject: [PATCH 148/260] ci: only build single platform for local releaser-pleaser jobs (#200) The image is never pushed and only executed on linux/amd64 hosts, so building linux/arm64 is a waste of time and resources. --- .github/workflows/releaser-pleaser.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index f8d1aa5..aa5097f 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -38,7 +38,7 @@ jobs: # Without this, any new flags in `action.yml` would break the job in this repository until the new # version is released. But a new version can only be released if this job works. - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 - - run: ko build --bare --local --tags ci github.com/apricote/releaser-pleaser/cmd/rp + - run: ko build --bare --local --platform linux/amd64 --tags ci github.com/apricote/releaser-pleaser/cmd/rp - run: mkdir -p .github/actions/releaser-pleaser - run: "sed -i 's|image: .*$|image: docker://ghcr.io/apricote/releaser-pleaser:ci|g' action.yml" From fc1ee70c28f94391de0d5126427f85858f74fef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 14 Jun 2025 16:47:17 +0200 Subject: [PATCH 149/260] chore(main): release v0.6.0 (#189) --- CHANGELOG.md | 39 +++++++++++++++++++++++++++++++++++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cc4b81..f860642 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,44 @@ # Changelog +## [v0.6.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.6.0) + +### ✨ Highlights + +#### Reduced resource usage + +`releaser-pleaser` now uses less resources: + +- It now skips pushing changes to the release pull request if they are only a rebase. +- The configurations for GitHub Actions and GitLab CI/CD now makes sure that only a single job is running at the same time. On GitHub unnecessary/duplicate jobs are also automatically aborted. +- It handles the stop signals from the CI environment and tries to exit quickly. + +\```yaml +concurrency: +group: releaser-pleaser +cancel-in-progress: true +\``` + +#### Avoid losing manual edits to release pull request + +Before, releaser-pleaser was prone to overwriting user changes to the release pull request if they were made after releaser-pleaser already started running. There is now an additional check right before submitting the changes to see if the description changed, and retry if it did. + +#### Proper commit authorship + +Before, the release commits were created by `releaser-pleaser <>`. This was ugly to look at. We now check for details on the API user used to talk to the forge, and use that users details instead as the commit author. The committer is still `releaser-pleaser`. + +### Features + +- real user as commit author (#187) +- avoid pushing release branch only for rebasing (#114) +- colorize log output (#195) +- graceful shutdown when CI job is cancelled (#196) +- detect changed pull request description and retry process (#197) +- run one job concurrently to reduce chance of conflicts (#198) + +### 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 9382d79..e6ffe6d 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -40,7 +40,7 @@ releaser-pleaser: resource_group: releaser-pleaser 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 ]] From 5a273f9ab5e840dce857438dab60535a190b5c19 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 28 Jun 2025 21:42:14 +0000 Subject: [PATCH 150/260] deps: update dependency golangci/golangci-lint to v2.2.0 (#202) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 919e80d..3c7282d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v2.1.6 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v2.2.0 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From dfe39868ac7652a6de81d55209cc1799b3721646 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 22:15:32 +0000 Subject: [PATCH 151/260] deps: update dependency golangci/golangci-lint to v2.2.1 (#203) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3c7282d..eee89f7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v2.2.0 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v2.2.1 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 48b8696efc2adf983bb4b9d87a518b2e9a5af552 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 1 Jul 2025 19:53:10 +0000 Subject: [PATCH 152/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.131.0 (#204) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 395b57f..c3d746f 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,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.1 + gitlab.com/gitlab-org/api/client-go v0.131.0 ) require ( @@ -30,7 +30,7 @@ require ( github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.7 // indirect + github.com/hashicorp/go-retryablehttp v0.7.8 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect diff --git a/go.sum b/go.sum index 9fd54cc..13f6278 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k= github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= -github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU= -github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk= +github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48= +github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -107,8 +107,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.1 h1:1xF5C5Zq3sFeNg3PzS2z63oqrxifne3n/OnbI7nptRc= -gitlab.com/gitlab-org/api/client-go v0.130.1/go.mod h1:ZhSxLAWadqP6J9lMh40IAZOlOxBLPRh7yFOXR/bMJWM= +gitlab.com/gitlab-org/api/client-go v0.131.0 h1:a431AKWkrSO5dgY5o5okFjxpANhkGpzxnZrjAHRyqp8= +gitlab.com/gitlab-org/api/client-go v0.131.0/go.mod h1:U83AmpPrAir8NH31T/BstwZcJzS/nGZptOXtGjPZrbI= 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 6e97e0d6012ecb8b75d029518b84e0cca0411b2b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:10:25 +0000 Subject: [PATCH 153/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.132.0 (#205) 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 c3d746f..80ec6a0 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,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.131.0 + gitlab.com/gitlab-org/api/client-go v0.132.0 ) require ( diff --git a/go.sum b/go.sum index 13f6278..03ad515 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.131.0 h1:a431AKWkrSO5dgY5o5okFjxpANhkGpzxnZrjAHRyqp8= -gitlab.com/gitlab-org/api/client-go v0.131.0/go.mod h1:U83AmpPrAir8NH31T/BstwZcJzS/nGZptOXtGjPZrbI= +gitlab.com/gitlab-org/api/client-go v0.132.0 h1:6W4VAmbWVbjUEoQiybPAn6bMP5v0Ga9jeTJaRtc7zfI= +gitlab.com/gitlab-org/api/client-go v0.132.0/go.mod h1:U83AmpPrAir8NH31T/BstwZcJzS/nGZptOXtGjPZrbI= 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 a7347bc191d52f26e7b54faa4709fe2847fad073 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 12:13:44 +0000 Subject: [PATCH 154/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.133.0 (#206) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 80ec6a0..1873343 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,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.132.0 + gitlab.com/gitlab-org/api/client-go v0.133.0 ) require ( @@ -45,7 +45,7 @@ require ( golang.org/x/net v0.39.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/sys v0.32.0 // indirect - golang.org/x/time v0.11.0 // indirect + golang.org/x/time v0.12.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 03ad515..21265c9 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.132.0 h1:6W4VAmbWVbjUEoQiybPAn6bMP5v0Ga9jeTJaRtc7zfI= -gitlab.com/gitlab-org/api/client-go v0.132.0/go.mod h1:U83AmpPrAir8NH31T/BstwZcJzS/nGZptOXtGjPZrbI= +gitlab.com/gitlab-org/api/client-go v0.133.0 h1:Y+t86XrCUY24A1yLMU1mYgC1/kvUTohLPG7bUJs692M= +gitlab.com/gitlab-org/api/client-go v0.133.0/go.mod h1:crkp9sCwMQ8gDwuMLgk11sDT336t6U3kESBT0BGsOBo= 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= @@ -135,8 +135,8 @@ golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= -golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= -golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= +golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 3e77b7e0d991a7c0026c022cc80b7fff868b4ee8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Jul 2025 16:50:20 +0000 Subject: [PATCH 155/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.134.0 (#208) 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 1873343..bc921e3 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,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.133.0 + gitlab.com/gitlab-org/api/client-go v0.134.0 ) require ( diff --git a/go.sum b/go.sum index 21265c9..96a3479 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.133.0 h1:Y+t86XrCUY24A1yLMU1mYgC1/kvUTohLPG7bUJs692M= -gitlab.com/gitlab-org/api/client-go v0.133.0/go.mod h1:crkp9sCwMQ8gDwuMLgk11sDT336t6U3kESBT0BGsOBo= +gitlab.com/gitlab-org/api/client-go v0.134.0 h1:J4i6qPN5hRLsqatPxVbe9w2C0A3JEItyCQrzsP52S2k= +gitlab.com/gitlab-org/api/client-go v0.134.0/go.mod h1:crkp9sCwMQ8gDwuMLgk11sDT336t6U3kESBT0BGsOBo= 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 75fe90ab6e761336e9e2a5e1ed55d483114ddb6a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Jul 2025 00:02:06 +0000 Subject: [PATCH 156/260] deps: update dependency go to v1.24.5 (#209) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bc921e3..694111d 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.24.4 +toolchain go1.24.5 require ( github.com/blang/semver/v4 v4.0.0 From bcca36e8568de1f8ecb58ddaea18e61b058b352f Mon Sep 17 00:00:00 2001 From: Zadkiel AHARONIAN Date: Fri, 11 Jul 2025 11:23:21 +0200 Subject: [PATCH 157/260] 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". --- internal/forge/gitlab/gitlab.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/forge/gitlab/gitlab.go b/internal/forge/gitlab/gitlab.go index 06de7fd..d710f41 100644 --- a/internal/forge/gitlab/gitlab.go +++ b/internal/forge/gitlab/gitlab.go @@ -193,7 +193,7 @@ func (g *GitLab) prForCommit(ctx context.Context, commit git.Commit) (*git.PullR var mergeRequest *gitlab.BasicMergeRequest for _, mr := range associatedMRs { // We only look for the MR that has this commit set as the "merge/squash commit" => The result of squashing this branch onto main - if mr.MergeCommitSHA == commit.Hash || mr.SquashCommitSHA == commit.Hash { + if mr.MergeCommitSHA == commit.Hash || mr.SquashCommitSHA == commit.Hash || mr.SHA == commit.Hash { mergeRequest = mr break } @@ -403,12 +403,15 @@ func gitlabMRToReleasePullRequest(pr *gitlab.BasicMergeRequest) *releasepr.Relea } } - // Commit SHA is saved in either [MergeCommitSHA] or [SquashCommitSHA] depending on which merge method was used. + // Commit SHA is saved in either [MergeCommitSHA], [SquashCommitSHA] or [SHA] depending on which merge method was used. var releaseCommit *git.Commit - if pr.MergeCommitSHA != "" { + switch { + case pr.MergeCommitSHA != "": releaseCommit = &git.Commit{Hash: pr.MergeCommitSHA} - } else if pr.SquashCommitSHA != "" { + case pr.SquashCommitSHA != "": releaseCommit = &git.Commit{Hash: pr.SquashCommitSHA} + case pr.MergedAt != nil && pr.SHA != "": + releaseCommit = &git.Commit{Hash: pr.SHA} } return &releasepr.ReleasePullRequest{ From 8eb7eadc4ee5d6fc8071de87998efbda67d8e1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 11 Jul 2025 11:32:09 +0200 Subject: [PATCH 158/260] chore(main): release v0.6.1 (#211) --- CHANGELOG.md | 6 ++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f860642..1cb192f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [v0.6.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.6.1) + +### Bug Fixes + +- **gitlab**: support fast-forward merges (#210) + ## [v0.6.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.6.0) ### ✨ Highlights diff --git a/action.yml b/action.yml index 07be63f..225e3cc 100644 --- a/action.yml +++ b/action.yml @@ -21,7 +21,7 @@ inputs: outputs: {} runs: using: 'docker' - image: docker://ghcr.io/apricote/releaser-pleaser:v0.6.0 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.6.1 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index e6ffe6d..c18a330 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -40,7 +40,7 @@ releaser-pleaser: resource_group: releaser-pleaser image: - name: ghcr.io/apricote/releaser-pleaser:v0.6.0 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.6.1 # x-releaser-pleaser-version entrypoint: [ "" ] variables: GITLAB_TOKEN: $[[ inputs.token ]] From 942aa80aa9f4e140c5ce96551ba0bb2c65a4d4fc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 11 Jul 2025 16:02:05 +0000 Subject: [PATCH 159/260] deps: update dependency golangci/golangci-lint to v2.2.2 (#212) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index eee89f7..0cb7c52 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v2.2.1 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v2.2.2 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From 64874f9089fa1cc07d26249c762450f4790d9e5b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 02:12:30 +0000 Subject: [PATCH 160/260] deps: update dependency rust-lang/mdbook to v0.4.52 (#214) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index f9baa0a..f1fb5d1 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -19,7 +19,7 @@ jobs: - uses: ./.github/actions/setup-mdbook with: - version: v0.4.51 # renovate: datasource=github-releases depName=rust-lang/mdbook + version: v0.4.52 # renovate: datasource=github-releases depName=rust-lang/mdbook - name: Build Book working-directory: docs From 273107b9af0ac9c4674767f0a4f207d34af5b7a2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 22:36:38 +0000 Subject: [PATCH 161/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.137.0 (#217) 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 694111d..1d2c5b9 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,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.134.0 + gitlab.com/gitlab-org/api/client-go v0.137.0 ) require ( diff --git a/go.sum b/go.sum index 96a3479..84dea5b 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.134.0 h1:J4i6qPN5hRLsqatPxVbe9w2C0A3JEItyCQrzsP52S2k= -gitlab.com/gitlab-org/api/client-go v0.134.0/go.mod h1:crkp9sCwMQ8gDwuMLgk11sDT336t6U3kESBT0BGsOBo= +gitlab.com/gitlab-org/api/client-go v0.137.0 h1:H26yL44qnb38Czl20pEINCJrcj63W6/BX8iKPVUKQP0= +gitlab.com/gitlab-org/api/client-go v0.137.0/go.mod h1:AcAYES3lfkIS4zhso04S/wyUaWQmDYve2Fd9AF7C6qc= 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 785c29deb2930d24467829e0753ae3d961d7dc0a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 21:14:29 +0000 Subject: [PATCH 162/260] deps: update module github.com/yuin/goldmark to v1.7.13 (#218) 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 1d2c5b9..a51759b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/spf13/cobra v1.9.1 github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 - github.com/yuin/goldmark v1.7.12 + github.com/yuin/goldmark v1.7.13 gitlab.com/gitlab-org/api/client-go v0.137.0 ) diff --git a/go.sum b/go.sum index 84dea5b..67d3691 100644 --- a/go.sum +++ b/go.sum @@ -105,8 +105,8 @@ github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKE github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= 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= +github.com/yuin/goldmark v1.7.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= +github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= gitlab.com/gitlab-org/api/client-go v0.137.0 h1:H26yL44qnb38Czl20pEINCJrcj63W6/BX8iKPVUKQP0= gitlab.com/gitlab-org/api/client-go v0.137.0/go.mod h1:AcAYES3lfkIS4zhso04S/wyUaWQmDYve2Fd9AF7C6qc= go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o= From 1fad5e6264e1fb60c7885acb4133743f2ba82023 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 3 Aug 2025 00:47:54 +0000 Subject: [PATCH 163/260] deps: update dependency golangci/golangci-lint to v2.3.1 (#216) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0cb7c52..c18bbfb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v2.2.2 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v2.3.1 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From e73bf82a9210114c73793b8e208e53ac1f16bcc4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:26:34 +0000 Subject: [PATCH 164/260] deps: update dependency go to v1.24.6 (#219) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index a51759b..d297733 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.24.5 +toolchain go1.24.6 require ( github.com/blang/semver/v4 v4.0.0 From 763a5defacd3abc7fb12edcb45681e0f7613ea06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 13:44:44 +0000 Subject: [PATCH 165/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.138.0 (#221) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index d297733..bf5dbd1 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.137.0 + gitlab.com/gitlab-org/api/client-go v0.138.0 ) require ( @@ -44,7 +44,7 @@ require ( golang.org/x/crypto v0.37.0 // indirect golang.org/x/net v0.39.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect - golang.org/x/sys v0.32.0 // indirect + golang.org/x/sys v0.34.0 // indirect golang.org/x/time v0.12.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 67d3691..011ad72 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.137.0 h1:H26yL44qnb38Czl20pEINCJrcj63W6/BX8iKPVUKQP0= -gitlab.com/gitlab-org/api/client-go v0.137.0/go.mod h1:AcAYES3lfkIS4zhso04S/wyUaWQmDYve2Fd9AF7C6qc= +gitlab.com/gitlab-org/api/client-go v0.138.0 h1:2BmPq3or7PU0HqDXPsmgA2dwopRZ1RsOHbVBKNKqAAE= +gitlab.com/gitlab-org/api/client-go v0.138.0/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= 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= @@ -127,14 +127,14 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= -golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= +golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= -golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= +golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= +golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From fd903e056cdb21835bf9126763731c6ee4de30d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 09:51:56 +0000 Subject: [PATCH 166/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.139.0 (#223) 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 bf5dbd1..4566c00 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.138.0 + gitlab.com/gitlab-org/api/client-go v0.139.0 ) require ( diff --git a/go.sum b/go.sum index 011ad72..295c4ad 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.138.0 h1:2BmPq3or7PU0HqDXPsmgA2dwopRZ1RsOHbVBKNKqAAE= -gitlab.com/gitlab-org/api/client-go v0.138.0/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= +gitlab.com/gitlab-org/api/client-go v0.139.0 h1:vowWNd02ifl0dv7RulWpGDmTgD42SGFEZ28FQg9yDQA= +gitlab.com/gitlab-org/api/client-go v0.139.0/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= 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 2fe0f0e5b68f02b5ce657f53cc3cd91c31b70509 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 00:57:48 +0000 Subject: [PATCH 167/260] deps: update dependency golangci/golangci-lint to v2.4.0 (#224) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c18bbfb..f2a8386 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v2.3.1 # renovate: datasource=github-releases depName=golangci/golangci-lint + version: v2.4.0 # renovate: datasource=github-releases depName=golangci/golangci-lint args: --timeout 5m test: From eb6c6877376155ad43d8df1e54b327e21281291a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:09:38 +0000 Subject: [PATCH 168/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.139.2 (#226) 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 4566c00..c178720 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.139.0 + gitlab.com/gitlab-org/api/client-go v0.139.2 ) require ( diff --git a/go.sum b/go.sum index 295c4ad..e3bbfaf 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.139.0 h1:vowWNd02ifl0dv7RulWpGDmTgD42SGFEZ28FQg9yDQA= -gitlab.com/gitlab-org/api/client-go v0.139.0/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= +gitlab.com/gitlab-org/api/client-go v0.139.2 h1:Le1/q+ZBYSr3HG9mSJa+/ci36S9tFsa9nEG3b2Cq6kk= +gitlab.com/gitlab-org/api/client-go v0.139.2/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= 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 6e2c75437614915832e4921ae188a2ea2ea071fe Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 17:25:07 +0000 Subject: [PATCH 169/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.140.0 (#227) 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 c178720..ee19076 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.139.2 + gitlab.com/gitlab-org/api/client-go v0.140.0 ) require ( diff --git a/go.sum b/go.sum index e3bbfaf..c79ed6f 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.139.2 h1:Le1/q+ZBYSr3HG9mSJa+/ci36S9tFsa9nEG3b2Cq6kk= -gitlab.com/gitlab-org/api/client-go v0.139.2/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= +gitlab.com/gitlab-org/api/client-go v0.140.0 h1:xajVsCRN7BJ5YNTygBvth89uWUBGPy5aKtRkkH/2xbo= +gitlab.com/gitlab-org/api/client-go v0.140.0/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= 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 dbde726d156fe8c3ca6cc20593738b5a36b0cfbc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 22:53:08 +0000 Subject: [PATCH 170/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.141.1 (#228) 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 ee19076..dadc183 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.140.0 + gitlab.com/gitlab-org/api/client-go v0.141.1 ) require ( diff --git a/go.sum b/go.sum index c79ed6f..64fd85d 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.140.0 h1:xajVsCRN7BJ5YNTygBvth89uWUBGPy5aKtRkkH/2xbo= -gitlab.com/gitlab-org/api/client-go v0.140.0/go.mod h1:vY0XbE86FvL7v5jCGDiaFgDyCV8YbmjIIkBhXx+ZDWM= +gitlab.com/gitlab-org/api/client-go v0.141.1 h1:d27K2wKSAzp6ytoc7pwJrNGQy5PRAVNXgVav16KfEMg= +gitlab.com/gitlab-org/api/client-go v0.141.1/go.mod h1:IVkgruxTxL3I9250JBxDeSS1gt+/OO5fQnQnMINMtZ0= 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 014ec7b7235222f7ee60da31c84ea6c2fd73b0ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Aug 2025 17:46:15 +0000 Subject: [PATCH 171/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.141.2 (#230) 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 dadc183..c6aef66 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.141.1 + gitlab.com/gitlab-org/api/client-go v0.141.2 ) require ( diff --git a/go.sum b/go.sum index 64fd85d..e40f773 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.141.1 h1:d27K2wKSAzp6ytoc7pwJrNGQy5PRAVNXgVav16KfEMg= -gitlab.com/gitlab-org/api/client-go v0.141.1/go.mod h1:IVkgruxTxL3I9250JBxDeSS1gt+/OO5fQnQnMINMtZ0= +gitlab.com/gitlab-org/api/client-go v0.141.2 h1:Ijlg+4sYV6WQgiw7rbNHYdHqrnt+bR0CTOm7u5n243M= +gitlab.com/gitlab-org/api/client-go v0.141.2/go.mod h1:3YuWlZCirs2TTcaAzM6qNwVHB7WvV67ATb0GGpBCdlQ= 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 73d9c877b0db326219c43f241f3777849bdd0e71 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 21 Aug 2025 17:57:43 +0000 Subject: [PATCH 172/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.142.0 (#231) 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 c6aef66..41f54c3 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.10.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.141.2 + gitlab.com/gitlab-org/api/client-go v0.142.0 ) require ( diff --git a/go.sum b/go.sum index e40f773..bc93f70 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.141.2 h1:Ijlg+4sYV6WQgiw7rbNHYdHqrnt+bR0CTOm7u5n243M= -gitlab.com/gitlab-org/api/client-go v0.141.2/go.mod h1:3YuWlZCirs2TTcaAzM6qNwVHB7WvV67ATb0GGpBCdlQ= +gitlab.com/gitlab-org/api/client-go v0.142.0 h1:cR8+RhDc7ooH0SiGNhgm3Nf5ZpW5D1R3DLshfAXJZmQ= +gitlab.com/gitlab-org/api/client-go v0.142.0/go.mod h1:3YuWlZCirs2TTcaAzM6qNwVHB7WvV67ATb0GGpBCdlQ= 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 2f7e8b9afeca39bb258ef7d8909d559f8aa86c32 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 23 Aug 2025 20:23:12 +0200 Subject: [PATCH 173/260] deps: update actions/checkout digest to 08eba0b (#220) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/docs.yaml | 2 +- .github/workflows/mirror.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f2a8386..79d9779 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - name: Set up Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - name: Set up Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - name: Set up Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index f1fb5d1..912615e 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,7 +13,7 @@ jobs: id-token: write # To update the deployment status steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 with: lfs: "true" diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index e287aed..d7feadb 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -11,7 +11,7 @@ jobs: REMOTE: mirror steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 with: # Need all to fetch all tags so we can push them fetch-depth: 0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 6da204d..bcc947d 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - name: Set up Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index aa5097f..6e79306 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 with: ref: main From 6237c9b666f2b46b4f491536d7a8ac396d4c61af Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 23 Aug 2025 20:23:41 +0200 Subject: [PATCH 174/260] deps: update codecov/codecov-action digest to fdcc847 (#229) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 79d9779..9d137dc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -38,7 +38,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5 + uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5 with: token: ${{ secrets.CODECOV_TOKEN }} From 1e9e0aa5d908a2dff5f6997186badaf29aaf76f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattis=20Kr=C3=A4mer?= Date: Sat, 23 Aug 2025 22:05:52 +0200 Subject: [PATCH 175/260] feat: add updater for package.json (#213) --- action.yml | 5 ++ cmd/rp/cmd/run.go | 23 +++++--- docs/reference/github-action.md | 11 ++-- docs/reference/gitlab-cicd-component.md | 1 + internal/git/git.go | 3 +- internal/updater/changelog.go | 2 +- internal/updater/changelog_test.go | 25 +++++---- internal/updater/generic.go | 2 +- internal/updater/generic_test.go | 20 ++++--- internal/updater/packagejson.go | 30 +++++++++++ internal/updater/packagejson_test.go | 70 +++++++++++++++++++++++++ internal/updater/updater.go | 2 +- internal/updater/updater_test.go | 17 +++--- templates/run.yml | 7 ++- 14 files changed, 174 insertions(+), 44 deletions(-) create mode 100644 internal/updater/packagejson.go create mode 100644 internal/updater/packagejson_test.go diff --git a/action.yml b/action.yml index 225e3cc..5a3d233 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,10 @@ inputs: description: 'List of files that are scanned for version references.' required: false default: "" + update-package-json: + description: 'Update version field in package.json file.' + required: false + default: "false" # Remember to update docs/reference/github-action.md outputs: {} runs: @@ -27,6 +31,7 @@ runs: - --forge=github - --branch=${{ inputs.branch }} - --extra-files="${{ inputs.extra-files }}" + - ${{ inputs.update-package-json == 'true' && '--update-package-json' || '' }} env: GITHUB_TOKEN: "${{ inputs.token }}" GITHUB_USER: "oauth2" diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index ec11e24..fa48cc0 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -21,21 +21,22 @@ var runCmd = &cobra.Command{ } var ( - flagForge string - flagBranch string - flagOwner string - flagRepo string - flagExtraFiles string + flagForge string + flagBranch string + flagOwner string + flagRepo string + flagExtraFiles string + flagUpdatePackageJson bool ) func init() { rootCmd.AddCommand(runCmd) - runCmd.PersistentFlags().StringVar(&flagForge, "forge", "", "") runCmd.PersistentFlags().StringVar(&flagBranch, "branch", "main", "") runCmd.PersistentFlags().StringVar(&flagOwner, "owner", "", "") runCmd.PersistentFlags().StringVar(&flagRepo, "repo", "", "") runCmd.PersistentFlags().StringVar(&flagExtraFiles, "extra-files", "", "") + runCmd.PersistentFlags().BoolVar(&flagUpdatePackageJson, "update-package-json", false, "") } func run(cmd *cobra.Command, _ []string) error { @@ -48,6 +49,7 @@ func run(cmd *cobra.Command, _ []string) error { "branch", flagBranch, "owner", flagOwner, "repo", flagRepo, + "update-package-json", flagUpdatePackageJson, ) var f forge.Forge @@ -81,6 +83,13 @@ func run(cmd *cobra.Command, _ []string) error { extraFiles := parseExtraFiles(flagExtraFiles) + updaters := []updater.NewUpdater{updater.Generic} + + if flagUpdatePackageJson { + logger.DebugContext(ctx, "package.json updater enabled") + updaters = append(updaters, updater.PackageJson) + } + releaserPleaser := rp.New( f, logger, @@ -88,7 +97,7 @@ func run(cmd *cobra.Command, _ []string) error { conventionalcommits.NewParser(logger), versioning.SemVer, extraFiles, - []updater.NewUpdater{updater.Generic}, + updaters, ) return releaserPleaser.Run(ctx) diff --git a/docs/reference/github-action.md b/docs/reference/github-action.md index eec9789..3a849dc 100644 --- a/docs/reference/github-action.md +++ b/docs/reference/github-action.md @@ -14,11 +14,12 @@ The action does not support floating tags (e.g. `v1`) right now ([#31](https://g The following inputs are supported by the `apricote/releaser-pleaser` GitHub Action. -| Input | Description | Default | Example | -| ------------- | :----------------------------------------------------- | --------------: | -------------------------------------------------------------------: | -| `branch` | This branch is used as the target for releases. | `main` | `master` | -| `token` | GitHub token for creating and updating release PRs | `$GITHUB_TOKEN` | `${{secrets.RELEASER_PLEASER_TOKEN}}` | -| `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml
| +| Input | Description | Default | Example | +| --------------------- | :------------------------------------------------------ | --------------: | -------------------------------------------------------------------: | +| `branch` | This branch is used as the target for releases. | `main` | `master` | +| `token` | GitHub token for creating and updating release PRs | `$GITHUB_TOKEN` | `${{secrets.RELEASER_PLEASER_TOKEN}}` | +| `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml
| +| `update-package-json` | Update version field in package.json file. | `false` | `true` | ## Outputs diff --git a/docs/reference/gitlab-cicd-component.md b/docs/reference/gitlab-cicd-component.md index b22d5b2..01a6fc2 100644 --- a/docs/reference/gitlab-cicd-component.md +++ b/docs/reference/gitlab-cicd-component.md @@ -23,5 +23,6 @@ The following inputs are supported by the component. | `branch` | This branch is used as the target for releases. | `main` | `master` | | `token` (**required**) | GitLab access token for creating and updating release PRs | | `$RELEASER_PLEASER_TOKEN` | | `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml
| +| `update-package-json` | Update version field in package.json file. | `false` | `true` | | `stage` | Stage the job runs in. Must exists. | `build` | `test` | | `needs` | Other jobs the releaser-pleaser job depends on. | `[]` |
- validate-foo
- prepare-bar
| diff --git a/internal/git/git.go b/internal/git/git.go index d1db11b..b9c750e 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -6,6 +6,7 @@ import ( "io" "log/slog" "os" + "path/filepath" "time" "github.com/go-git/go-git/v5" @@ -144,7 +145,7 @@ func (r *Repository) UpdateFile(_ context.Context, path string, create bool, upd updatedContent := string(content) for _, update := range updaters { - updatedContent, err = update(updatedContent) + updatedContent, err = update(updatedContent, filepath.Base(path)) if err != nil { return fmt.Errorf("failed to run updater on file %s", path) } diff --git a/internal/updater/changelog.go b/internal/updater/changelog.go index 8bdb9f6..8d6d68c 100644 --- a/internal/updater/changelog.go +++ b/internal/updater/changelog.go @@ -15,7 +15,7 @@ var ( ) func Changelog(info ReleaseInfo) Updater { - return func(content string) (string, error) { + return func(content string, filename string) (string, error) { headerIndex := ChangelogUpdaterHeaderRegex.FindStringIndex(content) if headerIndex == nil && len(content) != 0 { return "", fmt.Errorf("unexpected format of CHANGELOG.md, header does not match") diff --git a/internal/updater/changelog_test.go b/internal/updater/changelog_test.go index 917cd14..35878b9 100644 --- a/internal/updater/changelog_test.go +++ b/internal/updater/changelog_test.go @@ -9,11 +9,12 @@ import ( func TestChangelogUpdater_UpdateContent(t *testing.T) { tests := []updaterTestCase{ { - name: "empty file", - content: "", - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n"}, - want: "# Changelog\n\n## v1.0.0\n", - wantErr: assert.NoError, + name: "empty file", + content: "", + filename: "CHANGELOG.md", + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n"}, + want: "# Changelog\n\n## v1.0.0\n", + wantErr: assert.NoError, }, { name: "well-formatted changelog", @@ -27,7 +28,8 @@ func TestChangelogUpdater_UpdateContent(t *testing.T) { ### Bazuuum `, - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, + filename: "CHANGELOG.md", + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, want: `# Changelog ## v1.0.0 @@ -45,11 +47,12 @@ func TestChangelogUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "error on invalid header", - content: "What even is this file?", - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, - want: "", - wantErr: assert.Error, + name: "error on invalid header", + content: "What even is this file?", + filename: "CHANGELOG.md", + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, + want: "", + wantErr: assert.Error, }, } for _, tt := range tests { diff --git a/internal/updater/generic.go b/internal/updater/generic.go index b8d73b0..1883c1a 100644 --- a/internal/updater/generic.go +++ b/internal/updater/generic.go @@ -8,7 +8,7 @@ import ( var GenericUpdaterSemVerRegex = regexp.MustCompile(`\d+\.\d+\.\d+(-[\w.]+)?(.*x-releaser-pleaser-version)`) func Generic(info ReleaseInfo) Updater { - return func(content string) (string, error) { + return func(content string, filename string) (string, error) { // We strip the "v" prefix to avoid adding/removing it from the users input. version := strings.TrimPrefix(info.Version, "v") diff --git a/internal/updater/generic_test.go b/internal/updater/generic_test.go index e0a8d1d..4cc8952 100644 --- a/internal/updater/generic_test.go +++ b/internal/updater/generic_test.go @@ -9,8 +9,9 @@ import ( func TestGenericUpdater_UpdateContent(t *testing.T) { tests := []updaterTestCase{ { - name: "single line", - content: "v1.0.0 // x-releaser-pleaser-version", + name: "single line", + content: "v1.0.0 // x-releaser-pleaser-version", + filename: "version.txt", info: ReleaseInfo{ Version: "v1.2.0", }, @@ -18,8 +19,9 @@ func TestGenericUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "multiline line", - content: "Foooo\n\v1.2.0\nv1.0.0 // x-releaser-pleaser-version\n", + name: "multiline line", + content: "Foooo\n\v1.2.0\nv1.0.0 // x-releaser-pleaser-version\n", + filename: "version.txt", info: ReleaseInfo{ Version: "v1.2.0", }, @@ -27,8 +29,9 @@ func TestGenericUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "invalid existing version", - content: "1.0 // x-releaser-pleaser-version", + name: "invalid existing version", + content: "1.0 // x-releaser-pleaser-version", + filename: "version.txt", info: ReleaseInfo{ Version: "v1.2.0", }, @@ -36,8 +39,9 @@ func TestGenericUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "complicated line", - content: "version: v1.2.0-alpha.1 => Awesome, isnt it? x-releaser-pleaser-version foobar", + name: "complicated line", + content: "version: v1.2.0-alpha.1 => Awesome, isnt it? x-releaser-pleaser-version foobar", + filename: "version.txt", info: ReleaseInfo{ Version: "v1.2.0", }, diff --git a/internal/updater/packagejson.go b/internal/updater/packagejson.go new file mode 100644 index 0000000..58f2cc3 --- /dev/null +++ b/internal/updater/packagejson.go @@ -0,0 +1,30 @@ +package updater + +import ( + "regexp" + "strings" +) + +// PackageJson creates an updater that modifies the version field in package.json files +func PackageJson(info ReleaseInfo) Updater { + return func(content string, filename string) (string, error) { + if filename != "package.json" { + return content, nil // No update needed for non-package.json files + } + // We strip the "v" prefix to match npm versioning convention + version := strings.TrimPrefix(info.Version, "v") + + // Regex to match "version": "..." with flexible whitespace and quote styles + versionRegex := regexp.MustCompile(`("version"\s*:\s*)"[^"]*"`) + + // Check if the file contains a version field + if !versionRegex.MatchString(content) { + return content, nil + } + + // Replace the version value while preserving the original formatting + updatedContent := versionRegex.ReplaceAllString(content, `${1}"`+version+`"`) + + return updatedContent, nil + } +} diff --git a/internal/updater/packagejson_test.go b/internal/updater/packagejson_test.go new file mode 100644 index 0000000..4fd196e --- /dev/null +++ b/internal/updater/packagejson_test.go @@ -0,0 +1,70 @@ +package updater + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestPackageJsonUpdater(t *testing.T) { + tests := []updaterTestCase{ + { + name: "simple package.json", + content: `{"name":"test","version":"1.0.0"}`, + filename: "package.json", + info: ReleaseInfo{ + Version: "v2.0.5", + }, + want: `{"name":"test","version":"2.0.5"}`, + wantErr: assert.NoError, + }, + { + name: "simple package.json, wrong name", + content: `{"name":"test","version":"1.0.0"}`, + filename: "nopackage.json", + info: ReleaseInfo{ + Version: "v2.0.5", + }, + want: `{"name":"test","version":"1.0.0"}`, + wantErr: assert.NoError, + }, + { + name: "complex package.json", + content: "{\n \"name\": \"test\",\n \"version\": \"1.0.0\",\n \"dependencies\": {\n \"foo\": \"^1.0.0\"\n }\n}", + filename: "package.json", + info: ReleaseInfo{ + Version: "v2.0.0", + }, + want: "{\n \"name\": \"test\",\n \"version\": \"2.0.0\",\n \"dependencies\": {\n \"foo\": \"^1.0.0\"\n }\n}", + wantErr: assert.NoError, + }, + { + name: "invalid json", + content: `not json`, + filename: "package.json", + info: ReleaseInfo{ + Version: "v2.0.0", + }, + want: `not json`, + wantErr: assert.NoError, + }, + { + name: "json without version", + content: `{"name":"test"}`, + filename: "package.json", + info: ReleaseInfo{ + Version: "v2.0.0", + }, + want: `{"name":"test"}`, + wantErr: assert.NoError, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + fmt.Println("Running updater test for PackageJson") + runUpdaterTest(t, PackageJson, tt) + }) + } +} diff --git a/internal/updater/updater.go b/internal/updater/updater.go index fb773b4..f5fd677 100644 --- a/internal/updater/updater.go +++ b/internal/updater/updater.go @@ -5,7 +5,7 @@ type ReleaseInfo struct { ChangelogEntry string } -type Updater func(string) (string, error) +type Updater func(content string, filename string) (string, error) type NewUpdater func(ReleaseInfo) Updater diff --git a/internal/updater/updater_test.go b/internal/updater/updater_test.go index 0c0c40e..17162ef 100644 --- a/internal/updater/updater_test.go +++ b/internal/updater/updater_test.go @@ -8,19 +8,20 @@ import ( ) type updaterTestCase struct { - name string - content string - info ReleaseInfo - want string - wantErr assert.ErrorAssertionFunc + name string + content string + filename string + info ReleaseInfo + want string + wantErr assert.ErrorAssertionFunc } func runUpdaterTest(t *testing.T, constructor NewUpdater, tt updaterTestCase) { t.Helper() - got, err := constructor(tt.info)(tt.content) - if !tt.wantErr(t, err, fmt.Sprintf("Updater(%v, %v)", tt.content, tt.info)) { + got, err := constructor(tt.info)(tt.content, tt.filename) + if !tt.wantErr(t, err, fmt.Sprintf("Updater(%v, %v, %v)", tt.content, tt.filename, tt.info)) { return } - assert.Equalf(t, tt.want, got, "Updater(%v, %v)", tt.content, tt.info) + assert.Equalf(t, tt.want, got, "Updater(%v, %v, %v)", tt.content, tt.filename, tt.info) } diff --git a/templates/run.yml b/templates/run.yml index c18a330..66037b1 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -12,6 +12,10 @@ spec: description: 'List of files that are scanned for version references.' default: "" + update-package-json: + description: 'Update version field in package.json file.' + default: "false" + stage: default: build description: 'Defines the build stage' @@ -49,4 +53,5 @@ releaser-pleaser: rp run \ --forge=gitlab \ --branch=$[[ inputs.branch ]] \ - --extra-files="$[[ inputs.extra-files ]]" + --extra-files="$[[ inputs.extra-files ]]" \ + $([[ inputs.update-package-json == "true" ]] && echo "--update-package-json" || echo "") From f1aa1a2ef43aa646f8385e753b43712b9de36468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 23 Aug 2025 22:14:34 +0200 Subject: [PATCH 176/260] 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. --- action.yml | 12 +++--- cmd/rp/cmd/run.go | 53 +++++++++++++++++++------ cmd/rp/cmd/run_test.go | 40 +++++++++++++++++++ docs/SUMMARY.md | 1 + docs/guides/updating-arbitrary-files.md | 10 +++-- docs/reference/github-action.md | 16 ++++---- docs/reference/gitlab-cicd-component.md | 16 ++++---- docs/reference/glossary.md | 28 +++++++++---- docs/reference/updaters.md | 33 +++++++++++++++ internal/git/git.go | 15 ++----- internal/updater/changelog.go | 19 ++++++++- internal/updater/changelog_test.go | 37 +++++++++-------- internal/updater/generic.go | 22 +++++++++- internal/updater/generic_test.go | 32 ++++++++------- internal/updater/packagejson.go | 25 ++++++++---- internal/updater/packagejson_test.go | 44 +++++++++----------- internal/updater/updater.go | 6 ++- internal/updater/updater_test.go | 19 +++++---- releaserpleaser.go | 20 ++++------ templates/run.yml | 10 ++--- 20 files changed, 307 insertions(+), 151 deletions(-) create mode 100644 docs/reference/updaters.md diff --git a/action.yml b/action.yml index 5a3d233..651ca09 100644 --- a/action.yml +++ b/action.yml @@ -14,15 +14,15 @@ inputs: required: false default: ${{ github.token }} extra-files: - description: 'List of files that are scanned for version references.' + description: 'List of files that are scanned for version references by the generic updater.' required: false default: "" - update-package-json: - description: 'Update version field in package.json file.' + updaters: + description: "List of updaters that are run. Default updaters can be removed by specifying them as -name. Multiple updaters should be concatenated with a comma. Default Updaters: changelog,generic" required: false - default: "false" + default: "" # Remember to update docs/reference/github-action.md -outputs: {} +outputs: { } runs: using: 'docker' image: docker://ghcr.io/apricote/releaser-pleaser:v0.6.1 # x-releaser-pleaser-version @@ -31,7 +31,7 @@ runs: - --forge=github - --branch=${{ inputs.branch }} - --extra-files="${{ inputs.extra-files }}" - - ${{ inputs.update-package-json == 'true' && '--update-package-json' || '' }} + - --updaters="${{ inputs.updaters }}" env: GITHUB_TOKEN: "${{ inputs.token }}" GITHUB_USER: "oauth2" diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index fa48cc0..202ba3d 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "slices" "strings" "github.com/spf13/cobra" @@ -21,12 +22,12 @@ var runCmd = &cobra.Command{ } var ( - flagForge string - flagBranch string - flagOwner string - flagRepo string - flagExtraFiles string - flagUpdatePackageJson bool + flagForge string + flagBranch string + flagOwner string + flagRepo string + flagExtraFiles string + flagUpdaters []string ) func init() { @@ -36,7 +37,7 @@ func init() { runCmd.PersistentFlags().StringVar(&flagOwner, "owner", "", "") runCmd.PersistentFlags().StringVar(&flagRepo, "repo", "", "") runCmd.PersistentFlags().StringVar(&flagExtraFiles, "extra-files", "", "") - runCmd.PersistentFlags().BoolVar(&flagUpdatePackageJson, "update-package-json", false, "") + runCmd.PersistentFlags().StringSliceVar(&flagUpdaters, "updaters", []string{}, "") } func run(cmd *cobra.Command, _ []string) error { @@ -49,7 +50,6 @@ func run(cmd *cobra.Command, _ []string) error { "branch", flagBranch, "owner", flagOwner, "repo", flagRepo, - "update-package-json", flagUpdatePackageJson, ) var f forge.Forge @@ -83,11 +83,19 @@ func run(cmd *cobra.Command, _ []string) error { extraFiles := parseExtraFiles(flagExtraFiles) - updaters := []updater.NewUpdater{updater.Generic} - - if flagUpdatePackageJson { - logger.DebugContext(ctx, "package.json updater enabled") - updaters = append(updaters, updater.PackageJson) + updaterNames := parseUpdaters(flagUpdaters) + updaters := []updater.Updater{} + for _, name := range updaterNames { + switch name { + case "generic": + updaters = append(updaters, updater.Generic(extraFiles)) + case "changelog": + updaters = append(updaters, updater.Changelog()) + case "packagejson": + updaters = append(updaters, updater.PackageJson()) + default: + return fmt.Errorf("unknown updater: %s", name) + } } releaserPleaser := rp.New( @@ -122,3 +130,22 @@ func parseExtraFiles(input string) []string { return extraFiles } + +func parseUpdaters(input []string) []string { + names := []string{"changelog", "generic"} + + for _, u := range input { + if strings.HasPrefix(u, "-") { + name := u[1:] + names = slices.DeleteFunc(names, func(existingName string) bool { return existingName == name }) + } else { + names = append(names, u) + } + } + + // Make sure we only have unique updaters + slices.Sort(names) + names = slices.Compact(names) + + return names +} diff --git a/cmd/rp/cmd/run_test.go b/cmd/rp/cmd/run_test.go index d4cea7a..8354478 100644 --- a/cmd/rp/cmd/run_test.go +++ b/cmd/rp/cmd/run_test.go @@ -57,3 +57,43 @@ dir/Chart.yaml"`, }) } } + +func Test_parseUpdaters(t *testing.T) { + tests := []struct { + name string + input []string + want []string + }{ + { + name: "empty", + input: []string{}, + want: []string{"changelog", "generic"}, + }, + { + name: "remove defaults", + input: []string{"-changelog", "-generic"}, + want: []string{}, + }, + { + name: "remove unknown is ignored", + input: []string{"-fooo"}, + want: []string{"changelog", "generic"}, + }, + { + name: "add new entry", + input: []string{"bar"}, + want: []string{"bar", "changelog", "generic"}, + }, + { + name: "duplicates are removed", + input: []string{"bar", "bar", "changelog"}, + want: []string{"bar", "changelog", "generic"}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := parseUpdaters(tt.input) + assert.Equal(t, tt.want, got) + }) + } +} diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index b13bf24..0a22df1 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -25,6 +25,7 @@ - [Pull Request Options](reference/pr-options.md) - [GitHub Action](reference/github-action.md) - [GitLab CI/CD Component](reference/gitlab-cicd-component.md) +- [Updaters](reference/updaters.md) --- diff --git a/docs/guides/updating-arbitrary-files.md b/docs/guides/updating-arbitrary-files.md index d4b65bf..e7df9a5 100644 --- a/docs/guides/updating-arbitrary-files.md +++ b/docs/guides/updating-arbitrary-files.md @@ -10,7 +10,8 @@ In some situations it makes sense to have the current version committed in files ## Markers -The line that needs to be updated must have the marker `x-releaser-pleaser-version` somewhere after the version that should be updated. +The line that needs to be updated must have the marker +`x-releaser-pleaser-version` somewhere after the version that should be updated. For example: @@ -28,7 +29,8 @@ You need to tell `releaser-pleaser` which files it should update. This happens t ### GitHub Action -In the GitHub Action you can set the `extra-files` input with a list of the files. They need to be formatted as a single multi-line string with one file path per line: +In the GitHub Action you can set the +`extra-files` input with a list of the files. They need to be formatted as a single multi-line string with one file path per line: ```yaml jobs: @@ -44,7 +46,8 @@ jobs: ### GitLab CI/CD Component -In the GitLab CI/CD Component you can set the `extra-files` input with a list of files. They need to be formatted as a single multi-line string with one file path per line: +In the GitLab CI/CD Component you can set the +`extra-files` input with a list of files. They need to be formatted as a single multi-line string with one file path per line: ```yaml include: @@ -61,3 +64,4 @@ include: - **Reference** - [GitHub Action](../reference/github-action.md#inputs) - [GitLab CI/CD Component](../reference/gitlab-cicd-component.md#inputs) + - [Updaters](../reference/updaters.md#generic-updater) diff --git a/docs/reference/github-action.md b/docs/reference/github-action.md index 3a849dc..c5d595a 100644 --- a/docs/reference/github-action.md +++ b/docs/reference/github-action.md @@ -8,18 +8,20 @@ The action is available as `apricote/releaser-pleaser` on GitHub.com. The `apricote/releaser-pleaser` action is released together with `releaser-pleaser` and they share the version number. -The action does not support floating tags (e.g. `v1`) right now ([#31](https://github.com/apricote/releaser-pleaser/issues/31)). You have to use the full version or commit SHA instead: `apricote/releaser-pleaser@v0.2.0`. +The action does not support floating tags (e.g. +`v1`) right now ([#31](https://github.com/apricote/releaser-pleaser/issues/31)). You have to use the full version or commit SHA instead: +`apricote/releaser-pleaser@v0.2.0`. ## Inputs The following inputs are supported by the `apricote/releaser-pleaser` GitHub Action. -| Input | Description | Default | Example | -| --------------------- | :------------------------------------------------------ | --------------: | -------------------------------------------------------------------: | -| `branch` | This branch is used as the target for releases. | `main` | `master` | -| `token` | GitHub token for creating and updating release PRs | `$GITHUB_TOKEN` | `${{secrets.RELEASER_PLEASER_TOKEN}}` | -| `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml
| -| `update-package-json` | Update version field in package.json file. | `false` | `true` | +| Input | Description | Default | Example | +|---------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------:|---------------------------------------------------------------------:| +| `branch` | This branch is used as the target for releases. | `main` | `master` | +| `token` | GitHub token for creating and updating release PRs | `$GITHUB_TOKEN` | `${{secrets.RELEASER_PLEASER_TOKEN}}` | +| `extra-files` | List of files that are scanned for version references by the generic updater. | `""` |
version/version.go
deploy/deployment.yaml
| +| `updaters` | List of updaters that are run. Default updaters can be removed by specifying them as -name. Multiple updaters should be concatenated with a comma. Default Updaters: changelog,generic | `""` | `-generic,packagejson` | ## Outputs diff --git a/docs/reference/gitlab-cicd-component.md b/docs/reference/gitlab-cicd-component.md index 01a6fc2..3080fcf 100644 --- a/docs/reference/gitlab-cicd-component.md +++ b/docs/reference/gitlab-cicd-component.md @@ -18,11 +18,11 @@ The component does not support floating tags (e.g. The following inputs are supported by the component. -| Input | Description | Default | Example | -| ---------------------- | :-------------------------------------------------------- | ------: | -------------------------------------------------------------------: | -| `branch` | This branch is used as the target for releases. | `main` | `master` | -| `token` (**required**) | GitLab access token for creating and updating release PRs | | `$RELEASER_PLEASER_TOKEN` | -| `extra-files` | List of files that are scanned for version references. | `""` |
version/version.go
deploy/deployment.yaml
| -| `update-package-json` | Update version field in package.json file. | `false` | `true` | -| `stage` | Stage the job runs in. Must exists. | `build` | `test` | -| `needs` | Other jobs the releaser-pleaser job depends on. | `[]` |
- validate-foo
- prepare-bar
| +| Input | Description | Default | Example | +|------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------:|---------------------------------------------------------------------:| +| `branch` | This branch is used as the target for releases. | `main` | `master` | +| `token` (**required**) | GitLab access token for creating and updating release PRs | | `$RELEASER_PLEASER_TOKEN` | +| `extra-files` | List of files that are scanned for version references by the generic updater. | `""` |
version/version.go
deploy/deployment.yaml
| +| `updaters` | List of updaters that are run. Default updaters can be removed by specifying them as -name. Multiple updaters should be concatenated with a comma. Default Updaters: changelog,generic | `""` | `-generic,packagejson` | +| `stage` | Stage the job runs in. Must exists. | `build` | `test` | +| `needs` | Other jobs the releaser-pleaser job depends on. | `[]` |
- validate-foo
- prepare-bar
| diff --git a/docs/reference/glossary.md b/docs/reference/glossary.md index 543f970..8966f55 100644 --- a/docs/reference/glossary.md +++ b/docs/reference/glossary.md @@ -2,17 +2,21 @@ ### Changelog -The Changelog is a file in the repository (`CHANGELOG.md`) that contains the [Release Notes](#release-notes) for every release of that repository. Usually, new releases are added at the top of the file. +The Changelog is a file in the repository ( +`CHANGELOG.md`) that contains the [Release Notes](#release-notes) for every release of that repository. Usually, new releases are added at the top of the file. ### Conventional Commits -[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) is a specification for commit messages. It is the only supported commit message schema in `releaser-pleaser`. Follow the link to learn more. +[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) is a specification for commit messages. It is the only supported commit message schema in +`releaser-pleaser`. Follow the link to learn more. ### Forge -A **forge** is a web-based collaborative software platform for both developing and sharing computer applications.[^wp-forge] +A **forge +** is a web-based collaborative software platform for both developing and sharing computer applications.[^wp-forge] -Right now only **GitHub** is supported. We plan to support **GitLab** in the future ([#4](https://github.com/apricote/releaser-pleaser/issues/4)). For other forges like Forgejo or Gitea, please open an issue and submit a pull request. +Right now only **GitHub** is supported. We plan to support **GitLab +** in the future ([#4](https://github.com/apricote/releaser-pleaser/issues/4)). For other forges like Forgejo or Gitea, please open an issue and submit a pull request. [^wp-forge]: Quote from [Wikipedia "Forge (software)"]() @@ -24,7 +28,8 @@ In `releaser-pleaser` Markdown is used for most texts. ### Pre-release -Pre-releases are a concept of [SemVer](#semantic-versioning-semver). They follow the normal versioning schema but use a suffix out of `-alpha.X`, `-beta.X` and `-rc.X`. +Pre-releases are a concept of [SemVer](#semantic-versioning-semver). They follow the normal versioning schema but use a suffix out of +`-alpha.X`, `-beta.X` and `-rc.X`. Pre-releases are not considered "stable" and are usually not recommended for most users. @@ -32,7 +37,9 @@ Learn more in the [Pre-releases](../guides/pre-releases.md) guide. ### Release Pull Request -A Release Pull Request is opened by `releaser-pleaser` whenever it finds releasable commits in your project. It proposes a new version number and the Changelog. Once it is merged, `releaser-pleaser` creates a matching release. +A Release Pull Request is opened by +`releaser-pleaser` whenever it finds releasable commits in your project. It proposes a new version number and the Changelog. Once it is merged, +`releaser-pleaser` creates a matching release. Learn more in the [Release Pull Request](../explanation/release-pr.md) explanation. @@ -44,4 +51,11 @@ Learn more in the [Release Notes customization](../guides/release-notes.md) guid ### Semantic Versioning (SemVer) -[Semantic Versioning](https://semver.org/) is a specification for version numbers. It is the only supported versioning schema in `releaser-pleaser`. Follow the link to learn more. +[Semantic Versioning](https://semver.org/) is a specification for version numbers. It is the only supported versioning schema in +`releaser-pleaser`. Follow the link to learn more. + +### Updater + +Updaters can update or create files that will be included in [Release Pull Request](#release-pull-request). Examples of Updaters are +`changelog` for `CHANGELOG.md`, `generic` that can update arbitrary files and +`packagejson` that knows how to update Node.JS `package.json` files. \ No newline at end of file diff --git a/docs/reference/updaters.md b/docs/reference/updaters.md new file mode 100644 index 0000000..6bafff4 --- /dev/null +++ b/docs/reference/updaters.md @@ -0,0 +1,33 @@ +# Updaters + +There are different updater for different purposes available. + +They each have a name and may be enabled by default. You can configure which updaters are used through the +`updaters` input on GitHub Actions and GitLab CI/CD. This is a comma-delimited list of updaters that should be enabled, for updaters that are enabled by default you can remove them by adding a minus before its name: + +``` +updaters: -generic,packagejson +``` + +## Changelog + +- **Name**: `changelog` +- **Default**: enabled + +This updater creates the `CHANGELOG.md` file and adds new release notes to it. + +## Generic Updater + +- **Name**: `generic` +- **Default**: enabled + +This updater can update any file and only needs a marker on the line. It is enabled by default. + +Learn more about this updater in ["Updating arbitrary files"](../guides/updating-arbitrary-files.md). + +## Node.js `package.json` Updater + +- **Name**: `packagejson` +- **Default**: disabled + +This updater can update the `version` field in Node.js `package.json` files. The updater is disabled by default. diff --git a/internal/git/git.go b/internal/git/git.go index b9c750e..ad5c0a3 100644 --- a/internal/git/git.go +++ b/internal/git/git.go @@ -6,7 +6,6 @@ import ( "io" "log/slog" "os" - "path/filepath" "time" "github.com/go-git/go-git/v5" @@ -14,8 +13,6 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/go-git/go-git/v5/plumbing/transport" - - "github.com/apricote/releaser-pleaser/internal/updater" ) const ( @@ -120,7 +117,7 @@ func (r *Repository) Checkout(_ context.Context, branch string) error { return nil } -func (r *Repository) UpdateFile(_ context.Context, path string, create bool, updaters []updater.Updater) error { +func (r *Repository) UpdateFile(_ context.Context, path string, create bool, updateHook func(string) (string, error)) error { worktree, err := r.r.Worktree() if err != nil { return err @@ -142,13 +139,9 @@ func (r *Repository) UpdateFile(_ context.Context, path string, create bool, upd return err } - updatedContent := string(content) - - for _, update := range updaters { - updatedContent, err = update(updatedContent, filepath.Base(path)) - if err != nil { - return fmt.Errorf("failed to run updater on file %s", path) - } + updatedContent, err := updateHook(string(content)) + if err != nil { + return fmt.Errorf("failed to run update hook on file %s", path) } err = file.Truncate(0) diff --git a/internal/updater/changelog.go b/internal/updater/changelog.go index 8d6d68c..a7c7506 100644 --- a/internal/updater/changelog.go +++ b/internal/updater/changelog.go @@ -14,8 +14,23 @@ var ( ChangelogUpdaterHeaderRegex = regexp.MustCompile(`^# Changelog\n`) ) -func Changelog(info ReleaseInfo) Updater { - return func(content string, filename string) (string, error) { +func Changelog() Updater { + return changelog{} +} + +type changelog struct { +} + +func (c changelog) Files() []string { + return []string{ChangelogFile} +} + +func (c changelog) CreateNewFiles() bool { + return true +} + +func (c changelog) Update(info ReleaseInfo) func(content string) (string, error) { + return func(content string) (string, error) { headerIndex := ChangelogUpdaterHeaderRegex.FindStringIndex(content) if headerIndex == nil && len(content) != 0 { return "", fmt.Errorf("unexpected format of CHANGELOG.md, header does not match") diff --git a/internal/updater/changelog_test.go b/internal/updater/changelog_test.go index 35878b9..c0becb5 100644 --- a/internal/updater/changelog_test.go +++ b/internal/updater/changelog_test.go @@ -6,15 +6,22 @@ import ( "github.com/stretchr/testify/assert" ) -func TestChangelogUpdater_UpdateContent(t *testing.T) { +func TestChangelogUpdater_Files(t *testing.T) { + assert.Equal(t, []string{"CHANGELOG.md"}, Changelog().Files()) +} + +func TestChangelogUpdater_CreateNewFiles(t *testing.T) { + assert.True(t, Changelog().CreateNewFiles()) +} + +func TestChangelogUpdater_Update(t *testing.T) { tests := []updaterTestCase{ { - name: "empty file", - content: "", - filename: "CHANGELOG.md", - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n"}, - want: "# Changelog\n\n## v1.0.0\n", - wantErr: assert.NoError, + name: "empty file", + content: "", + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n"}, + want: "# Changelog\n\n## v1.0.0\n", + wantErr: assert.NoError, }, { name: "well-formatted changelog", @@ -28,8 +35,7 @@ func TestChangelogUpdater_UpdateContent(t *testing.T) { ### Bazuuum `, - filename: "CHANGELOG.md", - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, want: `# Changelog ## v1.0.0 @@ -47,17 +53,16 @@ func TestChangelogUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "error on invalid header", - content: "What even is this file?", - filename: "CHANGELOG.md", - info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, - want: "", - wantErr: assert.Error, + name: "error on invalid header", + content: "What even is this file?", + info: ReleaseInfo{ChangelogEntry: "## v1.0.0\n\n- Version 1, juhu.\n"}, + want: "", + wantErr: assert.Error, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - runUpdaterTest(t, Changelog, tt) + runUpdaterTest(t, Changelog(), tt) }) } } diff --git a/internal/updater/generic.go b/internal/updater/generic.go index 1883c1a..11b21a4 100644 --- a/internal/updater/generic.go +++ b/internal/updater/generic.go @@ -7,8 +7,26 @@ import ( var GenericUpdaterSemVerRegex = regexp.MustCompile(`\d+\.\d+\.\d+(-[\w.]+)?(.*x-releaser-pleaser-version)`) -func Generic(info ReleaseInfo) Updater { - return func(content string, filename string) (string, error) { +func Generic(files []string) Updater { + return generic{ + files: files, + } +} + +type generic struct { + files []string +} + +func (g generic) Files() []string { + return g.files +} + +func (g generic) CreateNewFiles() bool { + return false +} + +func (g generic) Update(info ReleaseInfo) func(content string) (string, error) { + return func(content string) (string, error) { // We strip the "v" prefix to avoid adding/removing it from the users input. version := strings.TrimPrefix(info.Version, "v") diff --git a/internal/updater/generic_test.go b/internal/updater/generic_test.go index 4cc8952..7c007a4 100644 --- a/internal/updater/generic_test.go +++ b/internal/updater/generic_test.go @@ -6,12 +6,19 @@ import ( "github.com/stretchr/testify/assert" ) -func TestGenericUpdater_UpdateContent(t *testing.T) { +func TestGenericUpdater_Files(t *testing.T) { + assert.Equal(t, []string{"foo.bar", "version.txt"}, Generic([]string{"foo.bar", "version.txt"}).Files()) +} + +func TestGenericUpdater_CreateNewFiles(t *testing.T) { + assert.False(t, Generic([]string{}).CreateNewFiles()) +} + +func TestGenericUpdater_Update(t *testing.T) { tests := []updaterTestCase{ { - name: "single line", - content: "v1.0.0 // x-releaser-pleaser-version", - filename: "version.txt", + name: "single line", + content: "v1.0.0 // x-releaser-pleaser-version", info: ReleaseInfo{ Version: "v1.2.0", }, @@ -19,9 +26,8 @@ func TestGenericUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "multiline line", - content: "Foooo\n\v1.2.0\nv1.0.0 // x-releaser-pleaser-version\n", - filename: "version.txt", + name: "multiline line", + content: "Foooo\n\v1.2.0\nv1.0.0 // x-releaser-pleaser-version\n", info: ReleaseInfo{ Version: "v1.2.0", }, @@ -29,9 +35,8 @@ func TestGenericUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "invalid existing version", - content: "1.0 // x-releaser-pleaser-version", - filename: "version.txt", + name: "invalid existing version", + content: "1.0 // x-releaser-pleaser-version", info: ReleaseInfo{ Version: "v1.2.0", }, @@ -39,9 +44,8 @@ func TestGenericUpdater_UpdateContent(t *testing.T) { wantErr: assert.NoError, }, { - name: "complicated line", - content: "version: v1.2.0-alpha.1 => Awesome, isnt it? x-releaser-pleaser-version foobar", - filename: "version.txt", + name: "complicated line", + content: "version: v1.2.0-alpha.1 => Awesome, isnt it? x-releaser-pleaser-version foobar", info: ReleaseInfo{ Version: "v1.2.0", }, @@ -51,7 +55,7 @@ func TestGenericUpdater_UpdateContent(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - runUpdaterTest(t, Generic, tt) + runUpdaterTest(t, Generic([]string{"version.txt"}), tt) }) } } diff --git a/internal/updater/packagejson.go b/internal/updater/packagejson.go index 58f2cc3..0fcb8a5 100644 --- a/internal/updater/packagejson.go +++ b/internal/updater/packagejson.go @@ -6,11 +6,22 @@ import ( ) // PackageJson creates an updater that modifies the version field in package.json files -func PackageJson(info ReleaseInfo) Updater { - return func(content string, filename string) (string, error) { - if filename != "package.json" { - return content, nil // No update needed for non-package.json files - } +func PackageJson() Updater { + return packagejson{} +} + +type packagejson struct{} + +func (p packagejson) Files() []string { + return []string{"package.json"} +} + +func (p packagejson) CreateNewFiles() bool { + return false +} + +func (p packagejson) Update(info ReleaseInfo) func(content string) (string, error) { + return func(content string) (string, error) { // We strip the "v" prefix to match npm versioning convention version := strings.TrimPrefix(info.Version, "v") @@ -23,8 +34,6 @@ func PackageJson(info ReleaseInfo) Updater { } // Replace the version value while preserving the original formatting - updatedContent := versionRegex.ReplaceAllString(content, `${1}"`+version+`"`) - - return updatedContent, nil + return versionRegex.ReplaceAllString(content, `${1}"`+version+`"`), nil } } diff --git a/internal/updater/packagejson_test.go b/internal/updater/packagejson_test.go index 4fd196e..9bff8b7 100644 --- a/internal/updater/packagejson_test.go +++ b/internal/updater/packagejson_test.go @@ -1,18 +1,24 @@ package updater import ( - "fmt" "testing" "github.com/stretchr/testify/assert" ) -func TestPackageJsonUpdater(t *testing.T) { +func TestPackageJsonUpdater_Files(t *testing.T) { + assert.Equal(t, []string{"package.json"}, PackageJson().Files()) +} + +func TestPackageJsonUpdater_CreateNewFiles(t *testing.T) { + assert.False(t, PackageJson().CreateNewFiles()) +} + +func TestPackageJsonUpdater_Update(t *testing.T) { tests := []updaterTestCase{ { - name: "simple package.json", - content: `{"name":"test","version":"1.0.0"}`, - filename: "package.json", + name: "simple package.json", + content: `{"name":"test","version":"1.0.0"}`, info: ReleaseInfo{ Version: "v2.0.5", }, @@ -20,19 +26,8 @@ func TestPackageJsonUpdater(t *testing.T) { wantErr: assert.NoError, }, { - name: "simple package.json, wrong name", - content: `{"name":"test","version":"1.0.0"}`, - filename: "nopackage.json", - info: ReleaseInfo{ - Version: "v2.0.5", - }, - want: `{"name":"test","version":"1.0.0"}`, - wantErr: assert.NoError, - }, - { - name: "complex package.json", - content: "{\n \"name\": \"test\",\n \"version\": \"1.0.0\",\n \"dependencies\": {\n \"foo\": \"^1.0.0\"\n }\n}", - filename: "package.json", + name: "complex package.json", + content: "{\n \"name\": \"test\",\n \"version\": \"1.0.0\",\n \"dependencies\": {\n \"foo\": \"^1.0.0\"\n }\n}", info: ReleaseInfo{ Version: "v2.0.0", }, @@ -40,9 +35,8 @@ func TestPackageJsonUpdater(t *testing.T) { wantErr: assert.NoError, }, { - name: "invalid json", - content: `not json`, - filename: "package.json", + name: "invalid json", + content: `not json`, info: ReleaseInfo{ Version: "v2.0.0", }, @@ -50,9 +44,8 @@ func TestPackageJsonUpdater(t *testing.T) { wantErr: assert.NoError, }, { - name: "json without version", - content: `{"name":"test"}`, - filename: "package.json", + name: "json without version", + content: `{"name":"test"}`, info: ReleaseInfo{ Version: "v2.0.0", }, @@ -63,8 +56,7 @@ func TestPackageJsonUpdater(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - fmt.Println("Running updater test for PackageJson") - runUpdaterTest(t, PackageJson, tt) + runUpdaterTest(t, PackageJson(), tt) }) } } diff --git a/internal/updater/updater.go b/internal/updater/updater.go index f5fd677..6e27f37 100644 --- a/internal/updater/updater.go +++ b/internal/updater/updater.go @@ -5,7 +5,11 @@ type ReleaseInfo struct { ChangelogEntry string } -type Updater func(content string, filename string) (string, error) +type Updater interface { + Files() []string + CreateNewFiles() bool + Update(info ReleaseInfo) func(content string) (string, error) +} type NewUpdater func(ReleaseInfo) Updater diff --git a/internal/updater/updater_test.go b/internal/updater/updater_test.go index 17162ef..5a90936 100644 --- a/internal/updater/updater_test.go +++ b/internal/updater/updater_test.go @@ -8,20 +8,19 @@ import ( ) type updaterTestCase struct { - name string - content string - filename string - info ReleaseInfo - want string - wantErr assert.ErrorAssertionFunc + name string + content string + info ReleaseInfo + want string + wantErr assert.ErrorAssertionFunc } -func runUpdaterTest(t *testing.T, constructor NewUpdater, tt updaterTestCase) { +func runUpdaterTest(t *testing.T, u Updater, tt updaterTestCase) { t.Helper() - got, err := constructor(tt.info)(tt.content, tt.filename) - if !tt.wantErr(t, err, fmt.Sprintf("Updater(%v, %v, %v)", tt.content, tt.filename, tt.info)) { + got, err := u.Update(tt.info)(tt.content) + if !tt.wantErr(t, err, fmt.Sprintf("Updater(%v, %v)", tt.content, tt.info)) { return } - assert.Equalf(t, tt.want, got, "Updater(%v, %v, %v)", tt.content, tt.filename, tt.info) + assert.Equalf(t, tt.want, got, "Updater(%v, %v)", tt.content, tt.info) } diff --git a/releaserpleaser.go b/releaserpleaser.go index a09aefe..b72b85f 100644 --- a/releaserpleaser.go +++ b/releaserpleaser.go @@ -34,10 +34,10 @@ type ReleaserPleaser struct { commitParser commitparser.CommitParser versioning versioning.Strategy extraFiles []string - updaters []updater.NewUpdater + updaters []updater.Updater } -func New(forge forge.Forge, logger *slog.Logger, targetBranch string, commitParser commitparser.CommitParser, versioningStrategy versioning.Strategy, extraFiles []string, updaters []updater.NewUpdater) *ReleaserPleaser { +func New(forge forge.Forge, logger *slog.Logger, targetBranch string, commitParser commitparser.CommitParser, versioningStrategy versioning.Strategy, extraFiles []string, updaters []updater.Updater) *ReleaserPleaser { return &ReleaserPleaser{ forge: forge, logger: logger, @@ -281,16 +281,12 @@ func (rp *ReleaserPleaser) runReconcileReleasePR(ctx context.Context) error { // Info for updaters info := updater.ReleaseInfo{Version: nextVersion, ChangelogEntry: changelogEntry} - err = repo.UpdateFile(ctx, updater.ChangelogFile, true, updater.WithInfo(info, updater.Changelog)) - if err != nil { - return fmt.Errorf("failed to update changelog file: %w", err) - } - - for _, path := range rp.extraFiles { - // TODO: Check for missing files - err = repo.UpdateFile(ctx, path, false, updater.WithInfo(info, rp.updaters...)) - if err != nil { - return fmt.Errorf("failed to run file updater: %w", err) + for _, u := range rp.updaters { + for _, file := range u.Files() { + err = repo.UpdateFile(ctx, file, u.CreateNewFiles(), u.Update(info)) + if err != nil { + return fmt.Errorf("failed to run updater %T: %w", u, err) + } } } diff --git a/templates/run.yml b/templates/run.yml index 66037b1..79459d9 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -9,12 +9,12 @@ spec: description: "GitLab token for creating and updating release MRs." extra-files: - description: 'List of files that are scanned for version references.' + description: 'List of files that are scanned for version references by the generic updater.' default: "" - update-package-json: - description: 'Update version field in package.json file.' - default: "false" + updaters: + description: "List of updaters that are run. Default updaters can be removed by specifying them as -name. Multiple updaters should be concatenated with a comma. Default Updaters: changelog,generic" + default: "" stage: default: build @@ -54,4 +54,4 @@ releaser-pleaser: --forge=gitlab \ --branch=$[[ inputs.branch ]] \ --extra-files="$[[ inputs.extra-files ]]" \ - $([[ inputs.update-package-json == "true" ]] && echo "--update-package-json" || echo "") + --updaters="$[[ inputs.updaters ]]" From 5306e2dd35de78b281e3307bc0864ba768f015c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 23 Aug 2025 22:38:24 +0200 Subject: [PATCH 177/260] fix: filter out empty updaters in input (#235) --- cmd/rp/cmd/run.go | 4 ++++ cmd/rp/cmd/run_test.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index 202ba3d..a70e915 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -135,6 +135,10 @@ func parseUpdaters(input []string) []string { names := []string{"changelog", "generic"} for _, u := range input { + if u == "" { + continue + } + if strings.HasPrefix(u, "-") { name := u[1:] names = slices.DeleteFunc(names, func(existingName string) bool { return existingName == name }) diff --git a/cmd/rp/cmd/run_test.go b/cmd/rp/cmd/run_test.go index 8354478..4c6ceff 100644 --- a/cmd/rp/cmd/run_test.go +++ b/cmd/rp/cmd/run_test.go @@ -89,6 +89,11 @@ func Test_parseUpdaters(t *testing.T) { input: []string{"bar", "bar", "changelog"}, want: []string{"bar", "changelog", "generic"}, }, + { + name: "remove empty entries", + input: []string{""}, + want: []string{"changelog", "generic"}, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 48b1894cac4aca3f04e6985a3d05cc77d5e6efb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 23 Aug 2025 22:40:28 +0200 Subject: [PATCH 178/260] 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 --- internal/changelog/changelog.md.tpl | 2 +- internal/changelog/changelog_test.go | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/internal/changelog/changelog.md.tpl b/internal/changelog/changelog.md.tpl index 50907eb..0a73dd5 100644 --- a/internal/changelog/changelog.md.tpl +++ b/internal/changelog/changelog.md.tpl @@ -1,5 +1,5 @@ {{define "entry" -}} -- {{ if .Scope }}**{{.Scope}}**: {{end}}{{.Description}} +- {{ if .BreakingChange}}**BREAKING**: {{end}}{{ if .Scope }}**{{.Scope}}**: {{end}}{{.Description}} {{ end }} {{- if not .Formatting.HideVersionTitle }} diff --git a/internal/changelog/changelog_test.go b/internal/changelog/changelog_test.go index a969730..e4fe52f 100644 --- a/internal/changelog/changelog_test.go +++ b/internal/changelog/changelog_test.go @@ -54,6 +54,23 @@ func Test_NewChangelogEntry(t *testing.T) { want: "## [1.0.0](https://example.com/1.0.0)\n\n### Features\n\n- Foobar!\n", wantErr: assert.NoError, }, + { + name: "single breaking change", + args: args{ + analyzedCommits: []commitparser.AnalyzedCommit{ + { + Commit: git.Commit{}, + Type: "feat", + Description: "Foobar!", + BreakingChange: true, + }, + }, + version: "1.0.0", + link: "https://example.com/1.0.0", + }, + want: "## [1.0.0](https://example.com/1.0.0)\n\n### Features\n\n- **BREAKING**: Foobar!\n", + wantErr: assert.NoError, + }, { name: "single fix", args: args{ From d259921215a04117e6b97124b180d051fbf7b946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 23 Aug 2025 23:00:52 +0200 Subject: [PATCH 179/260] 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 --- internal/forge/github/github.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index 3bff3e6..f950add 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -296,6 +296,13 @@ func (g *GitHub) PullRequestForBranch(ctx context.Context, branch string) (*rele } func (g *GitHub) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { + // If the Pull Request is created without the labels releaser-pleaser will create a new PR in the run. The user may merge both and have duplicate entries in the changelog. + // We try to avoid this situation by checking for a cancelled context first, and then running both API calls without passing along any cancellations. + if ctx.Err() != nil { + return ctx.Err() + } + ctx = context.WithoutCancel(ctx) + ghPR, _, err := g.client.PullRequests.Create( ctx, g.options.Owner, g.options.Repo, &github.NewPullRequest{ @@ -309,7 +316,6 @@ func (g *GitHub) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePul return err } - // TODO: String ID? pr.ID = ghPR.GetNumber() err = g.SetPullRequestLabels(ctx, pr, []releasepr.Label{}, pr.Labels) From b3cb9e128ccc8d968949dc34fdee8a61d21b834a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 23 Aug 2025 23:05:30 +0200 Subject: [PATCH 180/260] chore(main): release v0.7.0 (#232) --- CHANGELOG.md | 22 ++++++++++++++++++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb192f..7038de1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [v0.7.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.7.0) + +### Highlights :sparkles: + +#### Update version in `package.json` + +Thanks to @Mattzi it is now possible to use `releaser-pleaser` in Javascript/Node.js projects with a `package.json` file. + +You can enable this with the option `updaters: packagejson` in the GitHub Actions / GitLab CI/CD config. + +All updaters, including the defaults `changelog` and `generic` can now be enabled and disabled through this field. You can find a full list in the [documentation](https://apricote.github.io/releaser-pleaser/reference/updaters.html). + +### Features + +- add updater for package.json (#213) +- highlight breaking changes in release notes (#234) + +### Bug Fixes + +- filter out empty updaters in input (#235) +- **github**: duplicate release pr when process is stopped at wrong moment (#236) + ## [v0.6.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.6.1) ### Bug Fixes diff --git a/action.yml b/action.yml index 651ca09..a6de20c 100644 --- a/action.yml +++ b/action.yml @@ -25,7 +25,7 @@ inputs: outputs: { } runs: using: 'docker' - image: docker://ghcr.io/apricote/releaser-pleaser:v0.6.1 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.7.0 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index 79459d9..0d71f84 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -44,7 +44,7 @@ releaser-pleaser: resource_group: releaser-pleaser image: - name: ghcr.io/apricote/releaser-pleaser:v0.6.1 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.7.0 # x-releaser-pleaser-version entrypoint: [ "" ] variables: GITLAB_TOKEN: $[[ inputs.token ]] From c768260a2ecd56c8a8f397243ae56b76f1ec2dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 24 Aug 2025 15:49:23 +0200 Subject: [PATCH 181/260] chore: use mise to install all tools in CI and locally (#237) Makes sure that I have the same versions locally as CI --- .github/workflows/ci.yaml | 19 +++++-------------- .github/workflows/release.yaml | 6 +----- .github/workflows/releaser-pleaser.yaml | 10 +++------- mise.toml | 10 ++++++++++ 4 files changed, 19 insertions(+), 26 deletions(-) create mode 100644 mise.toml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9d137dc..75e33e4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,7 +2,7 @@ name: ci on: push: - branches: [main] + branches: [ main ] pull_request: jobs: @@ -12,15 +12,12 @@ jobs: - name: Checkout uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - - name: Set up Go - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 - with: - go-version-file: go.mod + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 - name: Run golangci-lint uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8 with: - version: v2.4.0 # renovate: datasource=github-releases depName=golangci/golangci-lint + install-mode: none args: --timeout 5m test: @@ -29,10 +26,7 @@ jobs: - name: Checkout uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - - name: Set up Go - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 - with: - go-version-file: go.mod + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 - name: Run tests run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... @@ -48,10 +42,7 @@ jobs: - name: Checkout uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - - name: Set up Go - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 - with: - go-version-file: go.mod + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 - name: Run go mod tidy run: go mod tidy diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index bcc947d..1374fd6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,10 +16,6 @@ jobs: - name: Checkout uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - - name: Set up Go - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 - with: - go-version-file: go.mod + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 - - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 - run: ko build --bare --tags ${{ github.ref_name }} github.com/apricote/releaser-pleaser/cmd/rp diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 6e79306..5536579 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -2,7 +2,7 @@ name: releaser-pleaser on: push: - branches: [main] + branches: [ main ] # Using pull_request_target to avoid tainting the actual release PR with code from open feature pull requests pull_request_target: types: @@ -17,7 +17,7 @@ concurrency: group: releaser-pleaser cancel-in-progress: true -permissions: {} +permissions: { } jobs: releaser-pleaser: @@ -29,15 +29,11 @@ jobs: with: ref: main - - name: Set up Go - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 - with: - go-version-file: go.mod + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 # Build container image from current commit and replace image ref in `action.yml` # Without this, any new flags in `action.yml` would break the job in this repository until the new # version is released. But a new version can only be released if this job works. - - uses: ko-build/setup-ko@d006021bd0c28d1ce33a07e7943d48b079944c8d # v0.9 - run: ko build --bare --local --platform linux/amd64 --tags ci github.com/apricote/releaser-pleaser/cmd/rp - run: mkdir -p .github/actions/releaser-pleaser diff --git a/mise.toml b/mise.toml new file mode 100644 index 0000000..d520f6f --- /dev/null +++ b/mise.toml @@ -0,0 +1,10 @@ +[tools] +go = "1.25.0" +golangci-lint = "v2.4.0" +goreleaser = "v2.9.0" +"github:rust-lang/mdBook" = "v0.4.52" +"github:ko-build/ko" = "v0.18.0" + +[settings] +# Experimental features are needed for the Go backend +experimental = true From 5b5b29c0b58cb655504d86f01bd925cdc7544db4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 13:50:59 +0000 Subject: [PATCH 182/260] deps: update dependency go to v1.25.0 (#222) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 41f54c3..997a693 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.24.6 +toolchain go1.25.0 require ( github.com/blang/semver/v4 v4.0.0 From e6503da93a115cd4a8f8b242cab19fce8c206880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 24 Aug 2025 16:44:05 +0200 Subject: [PATCH 183/260] refactor(cmd): use factories instead of global cobra command structs (#238) This enables us to create new commands for e2e tests. --- cmd/rp/cmd/root.go | 39 ++++------ cmd/rp/cmd/run.go | 176 ++++++++++++++++++++++---------------------- cmd/rp/main.go | 1 + internal/log/log.go | 23 ++++++ 4 files changed, 128 insertions(+), 111 deletions(-) create mode 100644 internal/log/log.go diff --git a/cmd/rp/cmd/root.go b/cmd/rp/cmd/root.go index 2799e6d..f2dd180 100644 --- a/cmd/rp/cmd/root.go +++ b/cmd/rp/cmd/root.go @@ -7,21 +7,23 @@ import ( "os/signal" "runtime/debug" "syscall" - "time" - "github.com/lmittmann/tint" "github.com/spf13/cobra" ) -var logger *slog.Logger +func NewRootCmd() *cobra.Command { + var cmd = &cobra.Command{ + Use: "rp", + Short: "", + Long: ``, + Version: version(), + SilenceUsage: true, // Makes it harder to find the actual error + SilenceErrors: true, // We log manually with slog + } -var rootCmd = &cobra.Command{ - Use: "rp", - Short: "", - Long: ``, - Version: version(), - SilenceUsage: true, // Makes it harder to find the actual error - SilenceErrors: true, // We log manually with slog + cmd.AddCommand(newRunCommand()) + + return cmd } func version() string { @@ -66,24 +68,13 @@ func Execute() { // Make sure to stop listening on signals after receiving the first signal to hand control of the signal back // to the runtime. The Go runtime implements a "force shutdown" if the signal is received again. <-ctx.Done() - logger.InfoContext(ctx, "Received shutdown signal, stopping...") + slog.InfoContext(ctx, "Received shutdown signal, stopping...") stop() }() - err := rootCmd.ExecuteContext(ctx) + err := NewRootCmd().ExecuteContext(ctx) if err != nil { - logger.ErrorContext(ctx, err.Error()) + slog.ErrorContext(ctx, err.Error()) os.Exit(1) } } - -func init() { - logger = slog.New( - tint.NewHandler(os.Stderr, &tint.Options{ - Level: slog.LevelDebug, - TimeFormat: time.RFC3339, - }), - ) - - slog.SetDefault(logger) -} diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index a70e915..d6bbe4b 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -2,6 +2,7 @@ package cmd import ( "fmt" + "log/slog" "slices" "strings" @@ -12,103 +13,104 @@ import ( "github.com/apricote/releaser-pleaser/internal/forge" "github.com/apricote/releaser-pleaser/internal/forge/github" "github.com/apricote/releaser-pleaser/internal/forge/gitlab" + "github.com/apricote/releaser-pleaser/internal/log" "github.com/apricote/releaser-pleaser/internal/updater" "github.com/apricote/releaser-pleaser/internal/versioning" ) -var runCmd = &cobra.Command{ - Use: "run", - RunE: run, -} - -var ( - flagForge string - flagBranch string - flagOwner string - flagRepo string - flagExtraFiles string - flagUpdaters []string -) - -func init() { - rootCmd.AddCommand(runCmd) - runCmd.PersistentFlags().StringVar(&flagForge, "forge", "", "") - runCmd.PersistentFlags().StringVar(&flagBranch, "branch", "main", "") - runCmd.PersistentFlags().StringVar(&flagOwner, "owner", "", "") - runCmd.PersistentFlags().StringVar(&flagRepo, "repo", "", "") - runCmd.PersistentFlags().StringVar(&flagExtraFiles, "extra-files", "", "") - runCmd.PersistentFlags().StringSliceVar(&flagUpdaters, "updaters", []string{}, "") -} - -func run(cmd *cobra.Command, _ []string) error { - ctx := cmd.Context() - - var err error - - logger.DebugContext(ctx, "run called", - "forge", flagForge, - "branch", flagBranch, - "owner", flagOwner, - "repo", flagRepo, +func newRunCommand() *cobra.Command { + var ( + flagForge string + flagBranch string + flagOwner string + flagRepo string + flagExtraFiles string + flagUpdaters []string ) - var f forge.Forge + var cmd = &cobra.Command{ + Use: "run", + RunE: func(cmd *cobra.Command, _ []string) error { + ctx := cmd.Context() + logger := log.GetLogger(cmd.ErrOrStderr()) - forgeOptions := forge.Options{ - Repository: flagRepo, - BaseBranch: flagBranch, + var err error + + logger.DebugContext(ctx, "run called", + "forge", flagForge, + "branch", flagBranch, + "owner", flagOwner, + "repo", flagRepo, + ) + + var f forge.Forge + + forgeOptions := forge.Options{ + Repository: flagRepo, + BaseBranch: flagBranch, + } + + switch flagForge { + case "gitlab": + logger.DebugContext(ctx, "using forge GitLab") + f, err = gitlab.New(logger, &gitlab.Options{ + Options: forgeOptions, + Path: fmt.Sprintf("%s/%s", flagOwner, flagRepo), + }) + if err != nil { + slog.ErrorContext(ctx, "failed to create client", "err", err) + return fmt.Errorf("failed to create gitlab client: %w", err) + } + case "github": + logger.DebugContext(ctx, "using forge GitHub") + f = github.New(logger, &github.Options{ + Options: forgeOptions, + Owner: flagOwner, + Repo: flagRepo, + }) + default: + return fmt.Errorf("unknown --forge: %s", flagForge) + } + + extraFiles := parseExtraFiles(flagExtraFiles) + + updaterNames := parseUpdaters(flagUpdaters) + updaters := []updater.Updater{} + for _, name := range updaterNames { + switch name { + case "generic": + updaters = append(updaters, updater.Generic(extraFiles)) + case "changelog": + updaters = append(updaters, updater.Changelog()) + case "packagejson": + updaters = append(updaters, updater.PackageJson()) + default: + return fmt.Errorf("unknown updater: %s", name) + } + } + + releaserPleaser := rp.New( + f, + logger, + flagBranch, + conventionalcommits.NewParser(logger), + versioning.SemVer, + extraFiles, + updaters, + ) + + return releaserPleaser.Run(ctx) + }, } - switch flagForge { - case "gitlab": - logger.DebugContext(ctx, "using forge GitLab") - f, err = gitlab.New(logger, &gitlab.Options{ - Options: forgeOptions, - Path: fmt.Sprintf("%s/%s", flagOwner, flagRepo), - }) - if err != nil { - logger.ErrorContext(ctx, "failed to create client", "err", err) - return fmt.Errorf("failed to create gitlab client: %w", err) - } - case "github": - logger.DebugContext(ctx, "using forge GitHub") - f = github.New(logger, &github.Options{ - Options: forgeOptions, - Owner: flagOwner, - Repo: flagRepo, - }) - default: - return fmt.Errorf("unknown --forge: %s", flagForge) - } + cmd.PersistentFlags().StringVar(&flagForge, "forge", "", "") + cmd.PersistentFlags().StringVar(&flagBranch, "branch", "main", "") + cmd.PersistentFlags().StringVar(&flagOwner, "owner", "", "") + cmd.PersistentFlags().StringVar(&flagRepo, "repo", "", "") + cmd.PersistentFlags().StringVar(&flagExtraFiles, "extra-files", "", "") + cmd.PersistentFlags().StringSliceVar(&flagUpdaters, "updaters", []string{}, "") - extraFiles := parseExtraFiles(flagExtraFiles) - - updaterNames := parseUpdaters(flagUpdaters) - updaters := []updater.Updater{} - for _, name := range updaterNames { - switch name { - case "generic": - updaters = append(updaters, updater.Generic(extraFiles)) - case "changelog": - updaters = append(updaters, updater.Changelog()) - case "packagejson": - updaters = append(updaters, updater.PackageJson()) - default: - return fmt.Errorf("unknown updater: %s", name) - } - } - - releaserPleaser := rp.New( - f, - logger, - flagBranch, - conventionalcommits.NewParser(logger), - versioning.SemVer, - extraFiles, - updaters, - ) - - return releaserPleaser.Run(ctx) + return cmd } func parseExtraFiles(input string) []string { diff --git a/cmd/rp/main.go b/cmd/rp/main.go index 462629b..734709c 100644 --- a/cmd/rp/main.go +++ b/cmd/rp/main.go @@ -2,6 +2,7 @@ package main import ( "github.com/apricote/releaser-pleaser/cmd/rp/cmd" + _ "github.com/apricote/releaser-pleaser/internal/log" ) func main() { diff --git a/internal/log/log.go b/internal/log/log.go new file mode 100644 index 0000000..32219fd --- /dev/null +++ b/internal/log/log.go @@ -0,0 +1,23 @@ +package log + +import ( + "io" + "log/slog" + "os" + "time" + + "github.com/lmittmann/tint" +) + +func GetLogger(w io.Writer) *slog.Logger { + return slog.New( + tint.NewHandler(w, &tint.Options{ + Level: slog.LevelDebug, + TimeFormat: time.RFC3339, + }), + ) +} + +func init() { + slog.SetDefault(GetLogger(os.Stderr)) +} From e6c8f3f93b8a6387b6706a3dd6596498178f3c12 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 16:45:41 +0200 Subject: [PATCH 184/260] deps: update actions/upload-pages-artifact action to v4 (#240) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 912615e..0a411be 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -29,7 +29,7 @@ jobs: uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5 - name: Upload artifact - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 + uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4 with: # Upload entire repository path: "docs/book" From 16ba2c6b090788850ec7d882b7e265c9d215c2d9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 16:46:16 +0200 Subject: [PATCH 185/260] deps: update module github.com/google/go-github/v72 to v74 (#241) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- internal/forge/github/github.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 997a693..84390a0 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-billy/v5 v5.6.2 github.com/go-git/go-git/v5 v5.16.2 - github.com/google/go-github/v72 v72.0.0 + github.com/google/go-github/v74 v74.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/lmittmann/tint v1.1.2 github.com/spf13/cobra v1.9.1 diff --git a/go.sum b/go.sum index bc93f70..283db4c 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUv github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v72 v72.0.0 h1:FcIO37BLoVPBO9igQQ6tStsv2asG4IPcYFi655PPvBM= -github.com/google/go-github/v72 v72.0.0/go.mod h1:WWtw8GMRiL62mvIquf1kO3onRHeWWKmK01qdCY8c5fg= +github.com/google/go-github/v74 v74.0.0 h1:yZcddTUn8DPbj11GxnMrNiAnXH14gNs559AsUpNpPgM= +github.com/google/go-github/v74 v74.0.0/go.mod h1:ubn/YdyftV80VPSI26nSJvaEsTOnsjrxG3o9kJhcyak= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= diff --git a/internal/forge/github/github.go b/internal/forge/github/github.go index f950add..d01e529 100644 --- a/internal/forge/github/github.go +++ b/internal/forge/github/github.go @@ -12,7 +12,7 @@ import ( "github.com/blang/semver/v4" "github.com/go-git/go-git/v5/plumbing/transport" "github.com/go-git/go-git/v5/plumbing/transport/http" - "github.com/google/go-github/v72/github" + "github.com/google/go-github/v74/github" "github.com/apricote/releaser-pleaser/internal/forge" "github.com/apricote/releaser-pleaser/internal/git" From 563885899c914d62f670ac71b6c7427e8795b149 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 16:46:49 +0200 Subject: [PATCH 186/260] deps: update actions/checkout action to v5 (#239) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/docs.yaml | 2 +- .github/workflows/mirror.yaml | 2 +- .github/workflows/release.yaml | 2 +- .github/workflows/releaser-pleaser.yaml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 75e33e4..cb821e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 0a411be..4e728bc 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -13,7 +13,7 @@ jobs: id-token: write # To update the deployment status steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: lfs: "true" diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml index d7feadb..940d149 100644 --- a/.github/workflows/mirror.yaml +++ b/.github/workflows/mirror.yaml @@ -11,7 +11,7 @@ jobs: REMOTE: mirror steps: - name: Checkout - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: # Need all to fetch all tags so we can push them fetch-depth: 0 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1374fd6..7a0c0df 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index 5536579..e40d6cd 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 with: ref: main From e83a7c9a23270f264b954fd4c70f6387aff93b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 24 Aug 2025 16:52:01 +0200 Subject: [PATCH 187/260] ci: mise cleanup (#242) - Renovate does not find the "github:*" dependencies in `mise.toml` - The `mdbooks` tools was still installed manually with our own action, this is removed and mise is used instead. --- .github/actions/setup-mdbook/action.yaml | 16 ---------------- .github/workflows/docs.yaml | 4 ---- mise.toml | 4 ++-- 3 files changed, 2 insertions(+), 22 deletions(-) delete mode 100644 .github/actions/setup-mdbook/action.yaml diff --git a/.github/actions/setup-mdbook/action.yaml b/.github/actions/setup-mdbook/action.yaml deleted file mode 100644 index 23e0665..0000000 --- a/.github/actions/setup-mdbook/action.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: "Setup mdbook" -inputs: - version: - description: "mdbook version" - -runs: - using: composite - steps: - - name: Setup mdbook - shell: bash - env: - url: https://github.com/rust-lang/mdbook/releases/download/${{ inputs.version }}/mdbook-${{ inputs.version }}-x86_64-unknown-linux-gnu.tar.gz - run: | - mkdir mdbook - curl -sSL "$url" | tar -xz --directory=./mdbook - echo `pwd`/mdbook >> $GITHUB_PATH diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 4e728bc..b7c6dfe 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -17,10 +17,6 @@ jobs: with: lfs: "true" - - uses: ./.github/actions/setup-mdbook - with: - version: v0.4.52 # renovate: datasource=github-releases depName=rust-lang/mdbook - - name: Build Book working-directory: docs run: mdbook build diff --git a/mise.toml b/mise.toml index d520f6f..d72aea4 100644 --- a/mise.toml +++ b/mise.toml @@ -2,8 +2,8 @@ go = "1.25.0" golangci-lint = "v2.4.0" goreleaser = "v2.9.0" -"github:rust-lang/mdBook" = "v0.4.52" -"github:ko-build/ko" = "v0.18.0" +"github:rust-lang/mdBook" = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook +"github:ko-build/ko" = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko [settings] # Experimental features are needed for the Go backend From 44b76e55f82e2e534fa45facf02c114cc41a5305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 24 Aug 2025 16:56:11 +0200 Subject: [PATCH 188/260] ci: allow regex manager in toml files for mise (#243) --- .github/renovate.json5 | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 83d07be..751d049 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -64,6 +64,7 @@ customType: 'regex', managerFilePatterns: [ '/.+\\.ya?ml$/', + '/.+\\.toml$/' ], matchStrings: [ ': (?.+) # renovate: datasource=(?[a-z-]+) depName=(?[^\\s]+)(?: lookupName=(?[^\\s]+))?(?: versioning=(?[a-z-]+))?(?: extractVersion=(?[^\\s]+))?', From f077b647e70e3107ebe013c0a1db551434b88bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 24 Aug 2025 17:07:58 +0200 Subject: [PATCH 189/260] ci: separate renovate manager for toml (#244) --- .github/renovate.json5 | 10 +++++++++- mise.toml | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 751d049..5110561 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -64,12 +64,20 @@ customType: 'regex', managerFilePatterns: [ '/.+\\.ya?ml$/', - '/.+\\.toml$/' ], matchStrings: [ ': (?.+) # renovate: datasource=(?[a-z-]+) depName=(?[^\\s]+)(?: lookupName=(?[^\\s]+))?(?: versioning=(?[a-z-]+))?(?: extractVersion=(?[^\\s]+))?', ], }, + { + customType: 'regex', + managerFilePatterns: [ + '/.+\\.toml$/' + ], + matchStrings: [ + '= "(?.+)" # renovate: datasource=(?[a-z-]+) depName=(?[^\\s]+)(?: lookupName=(?[^\\s]+))?(?: versioning=(?[a-z-]+))?(?: extractVersion=(?[^\\s]+))?', + ], + } ], postUpdateOptions: [ 'gomodUpdateImportPaths', diff --git a/mise.toml b/mise.toml index d72aea4..bc2630d 100644 --- a/mise.toml +++ b/mise.toml @@ -2,8 +2,8 @@ go = "1.25.0" golangci-lint = "v2.4.0" goreleaser = "v2.9.0" -"github:rust-lang/mdBook" = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook -"github:ko-build/ko" = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko +mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook +ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko [settings] # Experimental features are needed for the Go backend From e1afa22e0a88c884cc3519ffe682643c5d8c8343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 24 Aug 2025 17:16:40 +0200 Subject: [PATCH 190/260] ci: mdbooks binary is missing (#245) --- .github/workflows/docs.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index b7c6dfe..fcafe52 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -17,6 +17,8 @@ jobs: with: lfs: "true" + - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 + - name: Build Book working-directory: docs run: mdbook build From 852c08ed3d313e085e4fab12acf1bcdbf5585d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sun, 24 Aug 2025 17:39:10 +0200 Subject: [PATCH 191/260] ci: fix ko settings after using mise (#246) --- .github/workflows/release.yaml | 8 ++++++++ .github/workflows/releaser-pleaser.yaml | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7a0c0df..7da1f8a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,4 +18,12 @@ jobs: - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3 + - name: Prepare ko + run: | + echo "${{ github.token }}" | ko login ghcr.io --username "dummy" --password-stdin + + repo=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') + echo "KO_DOCKER_REPO=ghcr.io/${repo}" + echo "KO_DOCKER_REPO=ghcr.io/${repo}" >> $GITHUB_ENV + - run: ko build --bare --tags ${{ github.ref_name }} github.com/apricote/releaser-pleaser/cmd/rp diff --git a/.github/workflows/releaser-pleaser.yaml b/.github/workflows/releaser-pleaser.yaml index e40d6cd..8d1e62b 100644 --- a/.github/workflows/releaser-pleaser.yaml +++ b/.github/workflows/releaser-pleaser.yaml @@ -36,8 +36,7 @@ jobs: # version is released. But a new version can only be released if this job works. - run: ko build --bare --local --platform linux/amd64 --tags ci github.com/apricote/releaser-pleaser/cmd/rp - - run: mkdir -p .github/actions/releaser-pleaser - - run: "sed -i 's|image: .*$|image: docker://ghcr.io/apricote/releaser-pleaser:ci|g' action.yml" + - run: "sed -i 's|image: .*$|image: docker://ko.local:ci|g' action.yml" # Dogfood the action to make sure it works for users. - name: releaser-pleaser From 69be23dd6feff3e3b2f281e139a3fa8fa436b14e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 22:11:38 +0000 Subject: [PATCH 192/260] deps: update module github.com/stretchr/testify to v1.11.0 (#247) 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 84390a0..9e2338c 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/leodido/go-conventionalcommits v0.12.0 github.com/lmittmann/tint v1.1.2 github.com/spf13/cobra v1.9.1 - github.com/stretchr/testify v1.10.0 + github.com/stretchr/testify v1.11.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 gitlab.com/gitlab-org/api/client-go v0.142.0 diff --git a/go.sum b/go.sum index 283db4c..0a7d21b 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8= +github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKEsEj+asVsu6M/0= github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= From ce56ac0cd1725527583f91a56069017dbacdfb02 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Aug 2025 05:34:37 +0000 Subject: [PATCH 193/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.142.1 (#248) 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 9e2338c..ba52487 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.142.0 + gitlab.com/gitlab-org/api/client-go v0.142.1 ) require ( diff --git a/go.sum b/go.sum index 0a7d21b..47c22c2 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.142.0 h1:cR8+RhDc7ooH0SiGNhgm3Nf5ZpW5D1R3DLshfAXJZmQ= -gitlab.com/gitlab-org/api/client-go v0.142.0/go.mod h1:3YuWlZCirs2TTcaAzM6qNwVHB7WvV67ATb0GGpBCdlQ= +gitlab.com/gitlab-org/api/client-go v0.142.1 h1:PFMUo/MPVjLlUDUE0RPpufrsjaMQbyZHSmhP25MHsZw= +gitlab.com/gitlab-org/api/client-go v0.142.1/go.mod h1:Pht8kWkFX+obFPjQK3fct8gk+kILqH/ur5v31+VFsKc= 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 c4610b8e5e849a4da792cffa085aa738ce918aeb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 18:07:17 +0000 Subject: [PATCH 194/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.142.2 (#249) 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 ba52487..d94ebdb 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.0 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.142.1 + gitlab.com/gitlab-org/api/client-go v0.142.2 ) require ( diff --git a/go.sum b/go.sum index 47c22c2..18cc8f7 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.142.1 h1:PFMUo/MPVjLlUDUE0RPpufrsjaMQbyZHSmhP25MHsZw= -gitlab.com/gitlab-org/api/client-go v0.142.1/go.mod h1:Pht8kWkFX+obFPjQK3fct8gk+kILqH/ur5v31+VFsKc= +gitlab.com/gitlab-org/api/client-go v0.142.2 h1:GtaORG+VsYSFcyaZ4M+V7JC7bXVh3zGB1Nchf2UE914= +gitlab.com/gitlab-org/api/client-go v0.142.2/go.mod h1:Pht8kWkFX+obFPjQK3fct8gk+kILqH/ur5v31+VFsKc= 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 84b3acbe4d5031c2a8f1b29ed2374dba8a9125e5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Aug 2025 12:05:21 +0000 Subject: [PATCH 195/260] deps: update module github.com/stretchr/testify to v1.11.1 (#250) 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 d94ebdb..b58db82 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/leodido/go-conventionalcommits v0.12.0 github.com/lmittmann/tint v1.1.2 github.com/spf13/cobra v1.9.1 - github.com/stretchr/testify v1.11.0 + github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 gitlab.com/gitlab-org/api/client-go v0.142.2 diff --git a/go.sum b/go.sum index 18cc8f7..f2d29fd 100644 --- a/go.sum +++ b/go.sum @@ -99,8 +99,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8= -github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKEsEj+asVsu6M/0= github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= From 1d2f74752b180130ff1c8cd886329c581abab7eb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Aug 2025 07:46:08 +0000 Subject: [PATCH 196/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.142.4 (#251) 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 b58db82..96e21c2 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.142.2 + gitlab.com/gitlab-org/api/client-go v0.142.4 ) require ( diff --git a/go.sum b/go.sum index f2d29fd..13aa562 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.142.2 h1:GtaORG+VsYSFcyaZ4M+V7JC7bXVh3zGB1Nchf2UE914= -gitlab.com/gitlab-org/api/client-go v0.142.2/go.mod h1:Pht8kWkFX+obFPjQK3fct8gk+kILqH/ur5v31+VFsKc= +gitlab.com/gitlab-org/api/client-go v0.142.4 h1:tTm+hUPrOcTavmKpM9YIP503IE0EdAkg4TG3t6QGbiw= +gitlab.com/gitlab-org/api/client-go v0.142.4/go.mod h1:Ru5IRauphXt9qwmTzJD7ou1dH7Gc6pnsdFWEiMMpmB0= 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 132f62d82d034519f9a59dbf0fa18eec1081a3c6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 31 Aug 2025 10:33:26 +0000 Subject: [PATCH 197/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.142.5 (#252) 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 96e21c2..8791dc4 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.142.4 + gitlab.com/gitlab-org/api/client-go v0.142.5 ) require ( diff --git a/go.sum b/go.sum index 13aa562..73a2168 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.142.4 h1:tTm+hUPrOcTavmKpM9YIP503IE0EdAkg4TG3t6QGbiw= -gitlab.com/gitlab-org/api/client-go v0.142.4/go.mod h1:Ru5IRauphXt9qwmTzJD7ou1dH7Gc6pnsdFWEiMMpmB0= +gitlab.com/gitlab-org/api/client-go v0.142.5 h1:zvengEU958Fjwasi1V+9QNRw0viqNKkqUwvFD15XDZI= +gitlab.com/gitlab-org/api/client-go v0.142.5/go.mod h1:Ru5IRauphXt9qwmTzJD7ou1dH7Gc6pnsdFWEiMMpmB0= 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 f765abbb920032dbe57586f0129581b802fa3b22 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 18:51:22 +0000 Subject: [PATCH 198/260] deps: update dependency go to v1.25.1 (#254) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- mise.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 8791dc4..f4ad69c 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.23.2 -toolchain go1.25.0 +toolchain go1.25.1 require ( github.com/blang/semver/v4 v4.0.0 diff --git a/mise.toml b/mise.toml index bc2630d..46db89d 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,5 @@ [tools] -go = "1.25.0" +go = "1.25.1" golangci-lint = "v2.4.0" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook From de80649838b123d048152ed5086a7f045f47727c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 21:37:38 +0000 Subject: [PATCH 199/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.142.6 (#255) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index f4ad69c..1350860 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.142.5 + gitlab.com/gitlab-org/api/client-go v0.142.6 ) require ( diff --git a/go.sum b/go.sum index 73a2168..ac07f96 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.142.5 h1:zvengEU958Fjwasi1V+9QNRw0viqNKkqUwvFD15XDZI= -gitlab.com/gitlab-org/api/client-go v0.142.5/go.mod h1:Ru5IRauphXt9qwmTzJD7ou1dH7Gc6pnsdFWEiMMpmB0= +gitlab.com/gitlab-org/api/client-go v0.142.6 h1:RjqPb7XxJypn9DzkSTuQUOJN7wpRGXZFH8rJCLj4Bg8= +gitlab.com/gitlab-org/api/client-go v0.142.6/go.mod h1:t02B5oJWYEzalBlYIh+PmEJm2H4LPC/VFM1xks5qtG8= 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= @@ -133,8 +133,8 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= +golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 5ea1798a68d81c99ca29d632da9c36ffc0254f2c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 21:37:52 +0000 Subject: [PATCH 200/260] deps: update module github.com/spf13/cobra to v1.10.1 (#256) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1350860..e91a956 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/google/go-github/v74 v74.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/lmittmann/tint v1.1.2 - github.com/spf13/cobra v1.9.1 + github.com/spf13/cobra v1.10.1 github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 @@ -39,7 +39,7 @@ require ( github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/skeema/knownhosts v1.3.1 // indirect - github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/pflag v1.0.9 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.37.0 // indirect golang.org/x/net v0.39.0 // indirect diff --git a/go.sum b/go.sum index ac07f96..afee8d5 100644 --- a/go.sum +++ b/go.sum @@ -91,10 +91,10 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= -github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= -github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= -github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= +github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= +github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= +github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= From 3f9108e70293ee386cd92497a474cb99832405f0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 12:07:27 +0000 Subject: [PATCH 201/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.143.0 (#257) 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 e91a956..2fb5d03 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.142.6 + gitlab.com/gitlab-org/api/client-go v0.143.0 ) require ( diff --git a/go.sum b/go.sum index afee8d5..b17c2b0 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.142.6 h1:RjqPb7XxJypn9DzkSTuQUOJN7wpRGXZFH8rJCLj4Bg8= -gitlab.com/gitlab-org/api/client-go v0.142.6/go.mod h1:t02B5oJWYEzalBlYIh+PmEJm2H4LPC/VFM1xks5qtG8= +gitlab.com/gitlab-org/api/client-go v0.143.0 h1:/WXq1qvDi80bziVRmbQeJvFuILdUk4KXGcBNeHB6er8= +gitlab.com/gitlab-org/api/client-go v0.143.0/go.mod h1:t02B5oJWYEzalBlYIh+PmEJm2H4LPC/VFM1xks5qtG8= 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 bccfa93a1569f8cc4db7a4829d3a3113a7a51c9a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 22:14:06 +0000 Subject: [PATCH 202/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.143.1 (#258) 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 2fb5d03..c9d089d 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.143.0 + gitlab.com/gitlab-org/api/client-go v0.143.1 ) require ( diff --git a/go.sum b/go.sum index b17c2b0..1f3298e 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.143.0 h1:/WXq1qvDi80bziVRmbQeJvFuILdUk4KXGcBNeHB6er8= -gitlab.com/gitlab-org/api/client-go v0.143.0/go.mod h1:t02B5oJWYEzalBlYIh+PmEJm2H4LPC/VFM1xks5qtG8= +gitlab.com/gitlab-org/api/client-go v0.143.1 h1:5HyFrXtBZ0WbWLl6Ighrv8wxZ/NWz/KimZiXw6gCT9s= +gitlab.com/gitlab-org/api/client-go v0.143.1/go.mod h1:wvte1ie2U9x25hadhyuCkYug/uxsWMWOTcrgm+f7Big= 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 e7950cfbc1f06df119e35dc86c0246c794c50b17 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 13:03:16 +0000 Subject: [PATCH 203/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.143.2 (#259) 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 c9d089d..f162c31 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.143.1 + gitlab.com/gitlab-org/api/client-go v0.143.2 ) require ( diff --git a/go.sum b/go.sum index 1f3298e..4f3a3dc 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.143.1 h1:5HyFrXtBZ0WbWLl6Ighrv8wxZ/NWz/KimZiXw6gCT9s= -gitlab.com/gitlab-org/api/client-go v0.143.1/go.mod h1:wvte1ie2U9x25hadhyuCkYug/uxsWMWOTcrgm+f7Big= +gitlab.com/gitlab-org/api/client-go v0.143.2 h1:tfmUW8u+G/DGKOB/FDR0c06f0RVUAEe0ym8WpLoiHXI= +gitlab.com/gitlab-org/api/client-go v0.143.2/go.mod h1:gJn5yLx9vYGXr73Yv0ueHWCVl+fL8iUOgJFxC7qV+iM= 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 6b9738bcea4de9f89acb8ee89bfc786adc582087 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 06:39:09 +0000 Subject: [PATCH 204/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.143.3 (#260) 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 f162c31..2b8be3d 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.143.2 + gitlab.com/gitlab-org/api/client-go v0.143.3 ) require ( diff --git a/go.sum b/go.sum index 4f3a3dc..0c0256a 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.143.2 h1:tfmUW8u+G/DGKOB/FDR0c06f0RVUAEe0ym8WpLoiHXI= -gitlab.com/gitlab-org/api/client-go v0.143.2/go.mod h1:gJn5yLx9vYGXr73Yv0ueHWCVl+fL8iUOgJFxC7qV+iM= +gitlab.com/gitlab-org/api/client-go v0.143.3 h1:4Q4zumLVUnxn/s06RD9U3fyibD1/zr43gTDDtRkjqbA= +gitlab.com/gitlab-org/api/client-go v0.143.3/go.mod h1:rw89Kl9AsKmxRhzkfUSfZ+1jpTewwueKvAYwoYmUoQ8= 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 e3d2cfa6b847e2306df7f8e83f9b016482e47ea3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 13:30:36 +0200 Subject: [PATCH 205/260] deps: update codecov/codecov-action digest to 5a10915 (#253) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cb821e6..ddc3e66 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,7 @@ jobs: run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./... - name: Upload results to Codecov - uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5 with: token: ${{ secrets.CODECOV_TOKEN }} From afef176e37408508da739b9033d7ccd1cd17523c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 12 Sep 2025 15:20:21 +0000 Subject: [PATCH 206/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.144.0 (#263) 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 2b8be3d..22ee46f 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.143.3 + gitlab.com/gitlab-org/api/client-go v0.144.0 ) require ( diff --git a/go.sum b/go.sum index 0c0256a..fed9f72 100644 --- a/go.sum +++ b/go.sum @@ -107,8 +107,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.143.3 h1:4Q4zumLVUnxn/s06RD9U3fyibD1/zr43gTDDtRkjqbA= -gitlab.com/gitlab-org/api/client-go v0.143.3/go.mod h1:rw89Kl9AsKmxRhzkfUSfZ+1jpTewwueKvAYwoYmUoQ8= +gitlab.com/gitlab-org/api/client-go v0.144.0 h1:np2G+h2vanpxQrqGIM9LGmoKQecyUanj68JlNmNdc3o= +gitlab.com/gitlab-org/api/client-go v0.144.0/go.mod h1:rw89Kl9AsKmxRhzkfUSfZ+1jpTewwueKvAYwoYmUoQ8= 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 fcf79061498d94592b10c8dd0c04c3f809d64395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Sat, 13 Sep 2025 12:00:54 +0200 Subject: [PATCH 207/260] 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 --- .github/workflows/ci.yaml | 29 ++ .golangci.yaml | 4 + cmd/rp/cmd/run.go | 24 ++ codecov.yaml | 2 + go.mod | 9 +- go.sum | 19 ++ internal/forge/forgejo/forgejo.go | 529 ++++++++++++++++++++++++++++++ mise.toml | 15 + test/e2e/forge.go | 19 ++ test/e2e/forgejo/app.ini | 23 ++ test/e2e/forgejo/compose.yaml | 16 + test/e2e/forgejo/forge.go | 113 +++++++ test/e2e/forgejo/forgejo_test.go | 39 +++ test/e2e/framework.go | 96 ++++++ 14 files changed, 936 insertions(+), 1 deletion(-) create mode 100644 codecov.yaml create mode 100644 internal/forge/forgejo/forgejo.go create mode 100644 test/e2e/forge.go create mode 100644 test/e2e/forgejo/app.ini create mode 100644 test/e2e/forgejo/compose.yaml create mode 100644 test/e2e/forgejo/forge.go create mode 100644 test/e2e/forgejo/forgejo_test.go create mode 100644 test/e2e/framework.go diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ddc3e66..6483868 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,6 +35,35 @@ jobs: uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5 with: token: ${{ secrets.CODECOV_TOKEN }} + flags: unit + + test-e2e-forgejo: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Set up Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 + with: + go-version-file: go.mod + + # We can not use "jobs..services". + # We want to mount the config file, which is only available after "Checkout". + - name: Start Forgejo + working-directory: test/e2e/forgejo + run: docker compose up --wait + + - name: Run tests + run: go test -tags e2e_forgejo -v -race -coverpkg=./... -coverprofile=coverage.txt ./test/e2e/forgejo + + + - name: Upload results to Codecov + uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + flags: e2e go-mod-tidy: runs-on: ubuntu-latest diff --git a/.golangci.yaml b/.golangci.yaml index 5af5a17..b66f0a5 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -48,6 +48,10 @@ linters: - name: exported disabled: true + gomoddirectives: + replace-allow-list: + - codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 + formatters: enable: - gci diff --git a/cmd/rp/cmd/run.go b/cmd/rp/cmd/run.go index d6bbe4b..3d575b0 100644 --- a/cmd/rp/cmd/run.go +++ b/cmd/rp/cmd/run.go @@ -11,6 +11,7 @@ import ( rp "github.com/apricote/releaser-pleaser" "github.com/apricote/releaser-pleaser/internal/commitparser/conventionalcommits" "github.com/apricote/releaser-pleaser/internal/forge" + "github.com/apricote/releaser-pleaser/internal/forge/forgejo" "github.com/apricote/releaser-pleaser/internal/forge/github" "github.com/apricote/releaser-pleaser/internal/forge/gitlab" "github.com/apricote/releaser-pleaser/internal/log" @@ -26,6 +27,10 @@ func newRunCommand() *cobra.Command { flagRepo string flagExtraFiles string flagUpdaters []string + + flagAPIURL string + flagAPIToken string + flagUsername string ) var cmd = &cobra.Command{ @@ -68,6 +73,21 @@ func newRunCommand() *cobra.Command { Owner: flagOwner, Repo: flagRepo, }) + case "forgejo": + logger.DebugContext(ctx, "using forge Forgejo") + f, err = forgejo.New(logger, &forgejo.Options{ + Options: forgeOptions, + Owner: flagOwner, + Repo: flagRepo, + + APIURL: flagAPIURL, + APIToken: flagAPIToken, + Username: flagUsername, + }) + if err != nil { + logger.ErrorContext(ctx, "failed to create client", "err", err) + return fmt.Errorf("failed to create forgejo client: %w", err) + } default: return fmt.Errorf("unknown --forge: %s", flagForge) } @@ -110,6 +130,10 @@ func newRunCommand() *cobra.Command { cmd.PersistentFlags().StringVar(&flagExtraFiles, "extra-files", "", "") cmd.PersistentFlags().StringSliceVar(&flagUpdaters, "updaters", []string{}, "") + cmd.PersistentFlags().StringVar(&flagAPIURL, "api-url", "", "") + cmd.PersistentFlags().StringVar(&flagAPIToken, "api-token", "", "") + cmd.PersistentFlags().StringVar(&flagUsername, "username", "", "") + return cmd } diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 0000000..b52d0c4 --- /dev/null +++ b/codecov.yaml @@ -0,0 +1,2 @@ +ignore: + - "test" diff --git a/go.mod b/go.mod index 22ee46f..a9edd3d 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,11 @@ module github.com/apricote/releaser-pleaser -go 1.23.2 +go 1.24 toolchain go1.25.1 require ( + codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.0.0-00010101000000-000000000000 github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-billy/v5 v5.6.2 github.com/go-git/go-git/v5 v5.16.2 @@ -20,17 +21,21 @@ require ( require ( dario.cat/mergo v1.0.1 // indirect + github.com/42wim/httpsig v1.2.3 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/ProtonMail/go-crypto v1.1.6 // indirect github.com/cloudflare/circl v1.6.1 // indirect github.com/cyphar/filepath-securejoin v0.4.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/davidmz/go-pageant v1.0.2 // indirect github.com/emirpasic/gods v1.18.1 // indirect + github.com/go-fed/httpsig v1.1.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/google/go-querystring v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.8 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect @@ -49,3 +54,5 @@ require ( gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +replace codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 => codeberg.org/apricote/forgejo-sdk/forgejo/v2 v2.1.2-0.20250615152743-47d3f0434561 diff --git a/go.sum b/go.sum index fed9f72..fee79a7 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,9 @@ +codeberg.org/apricote/forgejo-sdk/forgejo/v2 v2.1.2-0.20250615152743-47d3f0434561 h1:ZFGmrGQ7cd2mbSLrfjrj3COwPKFfKM6sDO/IsrGDW7w= +codeberg.org/apricote/forgejo-sdk/forgejo/v2 v2.1.2-0.20250615152743-47d3f0434561/go.mod h1:2i9GsyawlJtVMO5pTS/Om5uo2O3JN/eCjGWy5v15NGg= dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s= dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/42wim/httpsig v1.2.3 h1:xb0YyWhkYj57SPtfSttIobJUPJZB9as1nsfo7KWVcEs= +github.com/42wim/httpsig v1.2.3/go.mod h1:nZq9OlYKDrUBhptd77IHx4/sZZD+IxTBADvAPI9G/EM= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= @@ -19,6 +23,8 @@ github.com/cyphar/filepath-securejoin v0.4.1/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGL github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davidmz/go-pageant v1.0.2 h1:bPblRCh5jGU+Uptpz6LgMZGD5hJoOt7otgT454WvHn0= +github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= @@ -27,6 +33,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= +github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI= +github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM= @@ -50,6 +58,8 @@ github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB1 github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-retryablehttp v0.7.8 h1:ylXZWnqa7Lhqpk0L1P1LzDtGcCR0rPVUrx/c8Unxc48= github.com/hashicorp/go-retryablehttp v0.7.8/go.mod h1:rjiScheydd+CxvumBsIrFKlx3iS0jrZ7LvzFGFmuKbw= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= @@ -111,16 +121,23 @@ gitlab.com/gitlab-org/api/client-go v0.144.0 h1:np2G+h2vanpxQrqGIM9LGmoKQecyUanj gitlab.com/gitlab-org/api/client-go v0.144.0/go.mod h1:rw89Kl9AsKmxRhzkfUSfZ+1jpTewwueKvAYwoYmUoQ8= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -132,6 +149,8 @@ golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= diff --git a/internal/forge/forgejo/forgejo.go b/internal/forge/forgejo/forgejo.go new file mode 100644 index 0000000..9b0c548 --- /dev/null +++ b/internal/forge/forgejo/forgejo.go @@ -0,0 +1,529 @@ +package forgejo + +import ( + "context" + "fmt" + "log/slog" + "slices" + "strings" + + "codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2" + "github.com/blang/semver/v4" + "github.com/go-git/go-git/v5/plumbing/transport" + "github.com/go-git/go-git/v5/plumbing/transport/http" + + "github.com/apricote/releaser-pleaser/internal/forge" + "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/pointer" + "github.com/apricote/releaser-pleaser/internal/releasepr" +) + +const () + +var _ forge.Forge = &Forgejo{} + +type Forgejo struct { + options *Options + + client *forgejo.Client + log *slog.Logger +} + +func (f *Forgejo) RepoURL() string { + return fmt.Sprintf("%s/%s/%s", f.options.APIURL, f.options.Owner, f.options.Repo) +} + +func (f *Forgejo) CloneURL() string { + return fmt.Sprintf("%s.git", f.RepoURL()) +} + +func (f *Forgejo) ReleaseURL(version string) string { + return fmt.Sprintf("%s/releases/tag/%s", f.RepoURL(), version) +} + +func (f *Forgejo) PullRequestURL(id int) string { + return fmt.Sprintf("%s/pulls/%d", f.RepoURL(), id) +} + +func (f *Forgejo) GitAuth() transport.AuthMethod { + return &http.BasicAuth{ + Username: f.options.Username, + Password: f.options.APIToken, + } +} + +func (f *Forgejo) CommitAuthor(ctx context.Context) (git.Author, error) { + f.log.DebugContext(ctx, "getting commit author from current token user") + + user, _, err := f.client.GetMyUserInfo() + if err != nil { + return git.Author{}, err + } + + // TODO: Same for other forges? + name := user.FullName + if name == "" { + name = user.UserName + } + + return git.Author{ + Name: name, + Email: user.Email, + }, nil +} + +func (f *Forgejo) LatestTags(ctx context.Context) (git.Releases, error) { + f.log.DebugContext(ctx, "listing all tags in forgejo repository") + + tags, err := all(func(listOptions forgejo.ListOptions) ([]*forgejo.Tag, *forgejo.Response, error) { + return f.client.ListRepoTags(f.options.Owner, f.options.Repo, + forgejo.ListRepoTagsOptions{ListOptions: listOptions}, + ) + }) + if err != nil { + return git.Releases{}, err + } + + var releases git.Releases + + for _, fTag := range tags { + tag := &git.Tag{ + Hash: fTag.Commit.SHA, + Name: fTag.Name, + } + + version, err := semver.Parse(strings.TrimPrefix(tag.Name, "v")) + if err != nil { + f.log.WarnContext( + ctx, "unable to parse tag as semver, skipping", + "tag.name", tag.Name, + "tag.hash", tag.Hash, + "error", err, + ) + continue + } + + if releases.Latest == nil { + releases.Latest = tag + } + if len(version.Pre) == 0 { + // Stable version tag + // We return once we have found the latest stable tag, not needed to look at every single tag. + releases.Stable = tag + break + } + } + + return releases, nil +} + +func (f *Forgejo) CommitsSince(ctx context.Context, tag *git.Tag) ([]git.Commit, error) { + var repositoryCommits []*forgejo.Commit + var err error + if tag != nil { + repositoryCommits, err = f.commitsSinceTag(ctx, tag) + } else { + repositoryCommits, err = f.commitsSinceInit(ctx) + } + + if err != nil { + return nil, err + } + + var commits = make([]git.Commit, 0, len(repositoryCommits)) + for _, fCommit := range repositoryCommits { + commit := git.Commit{ + Hash: fCommit.SHA, + Message: fCommit.RepoCommit.Message, + } + commit.PullRequest, err = f.prForCommit(ctx, commit) + if err != nil { + return nil, fmt.Errorf("failed to check for commit pull request: %w", err) + } + + commits = append(commits, commit) + } + + return commits, nil +} + +func (f *Forgejo) commitsSinceTag(_ context.Context, tag *git.Tag) ([]*forgejo.Commit, error) { + head := f.options.BaseBranch + log := f.log.With("base", tag.Hash, "head", head) + log.Debug("comparing commits") + + compare, _, err := f.client.CompareCommits( + f.options.Owner, f.options.Repo, + tag.Hash, head) + if err != nil { + return nil, err + } + + return compare.Commits, nil +} + +func (f *Forgejo) commitsSinceInit(_ context.Context) ([]*forgejo.Commit, error) { + head := f.options.BaseBranch + log := f.log.With("head", head) + log.Debug("listing all commits") + + repositoryCommits, err := all( + func(listOptions forgejo.ListOptions) ([]*forgejo.Commit, *forgejo.Response, error) { + return f.client.ListRepoCommits( + f.options.Owner, f.options.Repo, + forgejo.ListCommitOptions{ + ListOptions: listOptions, + SHA: f.options.BaseBranch, + }) + }) + if err != nil { + return nil, err + } + + return repositoryCommits, nil +} + +func (f *Forgejo) prForCommit(_ context.Context, commit git.Commit) (*git.PullRequest, error) { + // We naively look up the associated PR for each commit through the "List pull requests associated with a commit" + // endpoint. This requires len(commits) requests. + // Using the "List pull requests" endpoint might be faster, as it allows us to fetch 100 arbitrary PRs per request, + // but worst case we need to look up all PRs made in the repository ever. + + f.log.Debug("fetching pull requests associated with commit", "commit.hash", commit.Hash) + + pullRequest, _, err := f.client.GetCommitPullRequest( + f.options.Owner, f.options.Repo, + commit.Hash, + ) + if err != nil { + if strings.HasPrefix(err.Error(), "pull request does not exist") { + return nil, nil + } + + return nil, err + } + + return forgejoPRToPullRequest(pullRequest), nil +} + +func (f *Forgejo) EnsureLabelsExist(_ context.Context, labels []releasepr.Label) error { + f.log.Debug("fetching labels on repo") + fLabels, err := all(func(listOptions forgejo.ListOptions) ([]*forgejo.Label, *forgejo.Response, error) { + return f.client.ListRepoLabels( + f.options.Owner, f.options.Repo, + forgejo.ListLabelsOptions{ListOptions: listOptions}) + }) + if err != nil { + return err + } + + for _, label := range labels { + if !slices.ContainsFunc(fLabels, func(fLabel *forgejo.Label) bool { + return fLabel.Name == label.Name + }) { + f.log.Info("creating label in repository", "label.name", label.Name) + _, _, err = f.client.CreateLabel( + f.options.Owner, f.options.Repo, + forgejo.CreateLabelOption{ + Name: label.Name, + Color: label.Color, + Description: label.Description, + }, + ) + if err != nil { + return err + } + } + } + + return nil +} + +func (f *Forgejo) PullRequestForBranch(_ context.Context, branch string) (*releasepr.ReleasePullRequest, error) { + prs, err := all( + func(listOptions forgejo.ListOptions) ([]*forgejo.PullRequest, *forgejo.Response, error) { + return f.client.ListRepoPullRequests( + f.options.Owner, f.options.Repo, + forgejo.ListPullRequestsOptions{ + ListOptions: listOptions, + State: forgejo.StateOpen, + }, + ) + }, + ) + if err != nil { + return nil, err + } + + for _, pr := range prs { + if pr.Base.Ref == f.options.BaseBranch && pr.Head.Ref == branch { + return forgejoPRToReleasePullRequest(pr), nil + } + } + + return nil, nil +} + +func (f *Forgejo) CreatePullRequest(ctx context.Context, pr *releasepr.ReleasePullRequest) error { + fPR, _, err := f.client.CreatePullRequest( + f.options.Owner, f.options.Repo, + forgejo.CreatePullRequestOption{ + Title: pr.Title, + Head: pr.Head, + Base: f.options.BaseBranch, + Body: pr.Description, + }, + ) + if err != nil { + return err + } + + // TODO: String ID? + pr.ID = int(fPR.ID) + + err = f.SetPullRequestLabels(ctx, pr, []releasepr.Label{}, pr.Labels) + if err != nil { + return err + } + + return nil +} + +func (f *Forgejo) UpdatePullRequest(_ context.Context, pr *releasepr.ReleasePullRequest) error { + _, _, err := f.client.EditPullRequest( + f.options.Owner, f.options.Repo, + int64(pr.ID), forgejo.EditPullRequestOption{ + Title: pr.Title, + Body: pr.Description, + }, + ) + if err != nil { + return err + } + + return nil +} + +func (f *Forgejo) SetPullRequestLabels(_ context.Context, pr *releasepr.ReleasePullRequest, remove, add []releasepr.Label) error { + allLabels, err := all( + func(listOptions forgejo.ListOptions) ([]*forgejo.Label, *forgejo.Response, error) { + return f.client.ListRepoLabels(f.options.Owner, f.options.Repo, forgejo.ListLabelsOptions{ListOptions: listOptions}) + }, + ) + if err != nil { + return err + } + + findLabel := func(labelName string) *forgejo.Label { + for _, fLabel := range allLabels { + if fLabel.Name == labelName { + return fLabel + } + } + + return nil + } + + for _, label := range remove { + fLabel := findLabel(label.Name) + if fLabel == nil { + return fmt.Errorf("unable to remove label %q, not found in API", label.Name) + } + + _, err = f.client.DeleteIssueLabel( + f.options.Owner, f.options.Repo, + int64(pr.ID), fLabel.ID, + ) + if err != nil { + return err + } + } + + addIDs := make([]int64, 0, len(add)) + for _, label := range add { + fLabel := findLabel(label.Name) + if fLabel == nil { + return fmt.Errorf("unable to add label %q, not found in API", label.Name) + } + + addIDs = append(addIDs, fLabel.ID) + } + + _, _, err = f.client.AddIssueLabels( + f.options.Owner, f.options.Repo, + int64(pr.ID), forgejo.IssueLabelsOption{Labels: addIDs}, + ) + if err != nil { + return err + } + + return nil +} + +func (f *Forgejo) ClosePullRequest(_ context.Context, pr *releasepr.ReleasePullRequest) error { + _, _, err := f.client.EditPullRequest( + f.options.Owner, f.options.Repo, + int64(pr.ID), forgejo.EditPullRequestOption{ + State: pointer.Pointer(forgejo.StateClosed), + }, + ) + if err != nil { + return err + } + + return nil +} + +func (f *Forgejo) PendingReleases(_ context.Context, pendingLabel releasepr.Label) ([]*releasepr.ReleasePullRequest, error) { + fPRs, err := all(func(listOptions forgejo.ListOptions) ([]*forgejo.PullRequest, *forgejo.Response, error) { + return f.client.ListRepoPullRequests( + f.options.Owner, f.options.Repo, + forgejo.ListPullRequestsOptions{ + // Filtering by Label ID is possible in the API, but not implemented in the Go SDK. + State: forgejo.StateClosed, + ListOptions: listOptions, + }) + }) + if err != nil { + // "The target couldn't be found." means that the repo does not have pull requests activated. + return nil, err + } + + prs := make([]*releasepr.ReleasePullRequest, 0, len(fPRs)) + + for _, pr := range fPRs { + pending := slices.ContainsFunc(pr.Labels, func(l *forgejo.Label) bool { + return l.Name == pendingLabel.Name + }) + if !pending { + continue + } + + // pr.Merged is always nil :( + if !pr.HasMerged { + // Closed and not merged + continue + } + + prs = append(prs, forgejoPRToReleasePullRequest(pr)) + } + + return prs, nil +} + +func (f *Forgejo) CreateRelease(_ context.Context, commit git.Commit, title, changelog string, preRelease, latest bool) error { + // latest can not be set through the API + + _, _, err := f.client.CreateRelease( + f.options.Owner, f.options.Repo, + forgejo.CreateReleaseOption{ + TagName: title, + Target: commit.Hash, + Title: title, + Note: changelog, + IsPrerelease: preRelease, + }, + ) + if err != nil { + return err + } + + return nil +} + +func all[T any](f func(listOptions forgejo.ListOptions) ([]T, *forgejo.Response, error)) ([]T, error) { + results := make([]T, 0) + page := 1 + + for { + pageResults, resp, err := f(forgejo.ListOptions{Page: page}) + if err != nil { + return nil, err + } + + results = append(results, pageResults...) + + if page == resp.LastPage || resp.LastPage == 0 { + return results, nil + } + page = resp.NextPage + } +} + +func forgejoPRToPullRequest(pr *forgejo.PullRequest) *git.PullRequest { + return &git.PullRequest{ + ID: int(pr.ID), + Title: pr.Title, + Description: pr.Body, + } +} + +func forgejoPRToReleasePullRequest(pr *forgejo.PullRequest) *releasepr.ReleasePullRequest { + labels := make([]releasepr.Label, 0, len(pr.Labels)) + for _, label := range pr.Labels { + labelName := label.Name + if i := slices.IndexFunc(releasepr.KnownLabels, func(label releasepr.Label) bool { + return label.Name == labelName + }); i >= 0 { + labels = append(labels, releasepr.KnownLabels[i]) + } + } + + var releaseCommit *git.Commit + if pr.MergedCommitID != nil { + releaseCommit = &git.Commit{Hash: *pr.MergedCommitID} + } + + return &releasepr.ReleasePullRequest{ + PullRequest: *forgejoPRToPullRequest(pr), + Labels: labels, + + Head: pr.Head.Ref, + ReleaseCommit: releaseCommit, + } +} + +func (g *Options) autodiscover() { + // TODO +} + +func (g *Options) ClientOptions() []forgejo.ClientOption { + options := []forgejo.ClientOption{} + + if g.APIToken != "" { + options = append(options, forgejo.SetToken(g.APIToken)) + } + + return options +} + +type Options struct { + forge.Options + + Owner string + Repo string + + APIURL string + Username string + APIToken string +} + +func New(log *slog.Logger, options *Options) (*Forgejo, error) { + options.autodiscover() + + client, err := forgejo.NewClient(options.APIURL, options.ClientOptions()...) + if err != nil { + return nil, err + } + + client.SetUserAgent("releaser-pleaser") + + f := &Forgejo{ + options: options, + + client: client, + log: log.With("forge", "forgejo"), + } + + return f, nil +} diff --git a/mise.toml b/mise.toml index 46db89d..9503842 100644 --- a/mise.toml +++ b/mise.toml @@ -8,3 +8,18 @@ ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko [settings] # Experimental features are needed for the Go backend experimental = true + +[tasks.lint] +run = "golangci-lint run" + +[tasks.test] +run = "go test -v -race ./..." + +[tasks.test-e2e] +run = "go test -tags e2e_forgejo -v -race ./test/e2e/forgejo" + +[tasks.e2e-forgejo-start] +run = "docker compose --project-directory ./test/e2e/forgejo up -d --wait" + +[tasks.e2e-forgejo-stop] +run = "docker compose --project-directory ./test/e2e/forgejo down" diff --git a/test/e2e/forge.go b/test/e2e/forge.go new file mode 100644 index 0000000..ea55545 --- /dev/null +++ b/test/e2e/forge.go @@ -0,0 +1,19 @@ +package e2e + +import ( + "context" + "testing" +) + +type TestForge interface { + Init(ctx context.Context, runID string) error + CreateRepo(t *testing.T, opts CreateRepoOpts) (*Repository, error) + + RunArguments() []string +} + +type CreateRepoOpts struct { + Name string + Description string + DefaultBranch string +} diff --git a/test/e2e/forgejo/app.ini b/test/e2e/forgejo/app.ini new file mode 100644 index 0000000..4a22d2e --- /dev/null +++ b/test/e2e/forgejo/app.ini @@ -0,0 +1,23 @@ +WORK_PATH = /data/gitea + +[database] +DB_TYPE = sqlite3 +PATH = /data/gitea/forgejo.db + +[security] +INSTALL_LOCK = true +SECRET_KEY = releaser-pleaser +INTERNAL_TOKEN = releaser-pleaser + +[service] +REGISTER_EMAIL_CONFIRM = false +ENABLE_NOTIFY_MAIL = false +DISABLE_REGISTRATION = true + +[server] +DOMAIN = localhost +HTTP_PORT = 3000 +ROOT_URL = http://localhost:3000/ + +[oauth2] +JWT_SECRET = rTD-FL2n_aBB6v4AOcr5lBvwgZ6PSr3HGZAuNH6nMu8 diff --git a/test/e2e/forgejo/compose.yaml b/test/e2e/forgejo/compose.yaml new file mode 100644 index 0000000..3f20c3a --- /dev/null +++ b/test/e2e/forgejo/compose.yaml @@ -0,0 +1,16 @@ +services: + forgejo: + image: codeberg.org/forgejo/forgejo:11 + ports: + - '3000:3000' + - '222:22' + volumes: + - data:/data/gitea + - ./app.ini:/data/gitea/conf/app.ini:ro + + healthcheck: + test: ["CMD", "curl", "localhost:3000/api/healthz"] + + +volumes: + data: diff --git a/test/e2e/forgejo/forge.go b/test/e2e/forgejo/forge.go new file mode 100644 index 0000000..c631cb8 --- /dev/null +++ b/test/e2e/forgejo/forge.go @@ -0,0 +1,113 @@ +package forgejo + +import ( + "context" + "fmt" + "log/slog" + "os/exec" + "strings" + "testing" + + "codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2" + + "github.com/apricote/releaser-pleaser/test/e2e" +) + +const ( + TestAPIURL = "http://localhost:3000" + + TestUserNameTemplate = "rp-%s" + TestUserPassword = "releaser-pleaser" + TestUserEmailTemplate = "releaser-pleaser-%s@example.com" + TestTokenName = "rp" + TestTokenScopes = "write:user,write:issue,write:repository" +) + +type TestForge struct { + username string + token string + client *forgejo.Client +} + +func (f *TestForge) Init(ctx context.Context, runID string) error { + if err := f.initUser(ctx, runID); err != nil { + return err + } + if err := f.initClient(ctx); err != nil { + return err + } + + return nil +} + +func (f *TestForge) initUser(ctx context.Context, runID string) error { + f.username = fmt.Sprintf(TestUserNameTemplate, runID) + + //gosec:disable G204 + if output, err := exec.CommandContext(ctx, + "docker", "compose", "exec", "--user=1000", "forgejo", + "forgejo", "admin", "user", "create", + "--username", f.username, + "--password", TestUserPassword, + "--email", fmt.Sprintf(TestUserEmailTemplate, runID), + "--must-change-password=false", + ).CombinedOutput(); err != nil { + slog.Debug("create forgejo user output", "output", output) + return fmt.Errorf("failed to create forgejo user: %w", err) + } + + //gosec:disable G204 + token, err := exec.CommandContext(ctx, + "docker", "compose", "exec", "--user=1000", "forgejo", + "forgejo", "admin", "user", "generate-access-token", + "--username", f.username, + "--token-name", TestTokenName, + "--scopes", TestTokenScopes, + "--raw", + ).Output() + if err != nil { + return fmt.Errorf("failed to create forgejo token: %w", err) + } + + f.token = strings.TrimSpace(string(token)) + + return nil +} + +func (f *TestForge) initClient(ctx context.Context) (err error) { + f.client, err = forgejo.NewClient(TestAPIURL, + forgejo.SetToken(f.token), + forgejo.SetUserAgent("releaser-pleaser-e2e-tests"), + forgejo.SetContext(ctx), + // forgejo.SetDebugMode(), + ) + return err +} + +func (f *TestForge) CreateRepo(t *testing.T, opts e2e.CreateRepoOpts) (*e2e.Repository, error) { + t.Helper() + + repo, _, err := f.client.CreateRepo(forgejo.CreateRepoOption{ + Name: opts.Name, + Description: opts.Description, + DefaultBranch: opts.DefaultBranch, + Readme: "Default", + AutoInit: true, + }) + if err != nil { + return nil, err + } + + return &e2e.Repository{ + Name: repo.Name, + }, nil +} + +func (f *TestForge) RunArguments() []string { + return []string{"--forge=forgejo", + fmt.Sprintf("--owner=%s", f.username), + fmt.Sprintf("--api-url=%s", TestAPIURL), + fmt.Sprintf("--api-token=%s", f.token), + fmt.Sprintf("--username=%s", f.username), + } +} diff --git a/test/e2e/forgejo/forgejo_test.go b/test/e2e/forgejo/forgejo_test.go new file mode 100644 index 0000000..b52504f --- /dev/null +++ b/test/e2e/forgejo/forgejo_test.go @@ -0,0 +1,39 @@ +//go:build e2e_forgejo + +package forgejo + +import ( + "context" + "log/slog" + "os" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/apricote/releaser-pleaser/test/e2e" +) + +var ( + f *e2e.Framework +) + +func TestMain(m *testing.M) { + ctx := context.Background() + + var err error + f, err = e2e.NewFramework(ctx, &TestForge{}) + if err != nil { + slog.Error("failed to set up test framework", "err", err) + } + + os.Exit(m.Run()) +} + +func TestCreateRepository(t *testing.T) { + _ = f.NewRepository(t, t.Name()) +} + +func TestRun(t *testing.T) { + repo := f.NewRepository(t, t.Name()) + require.NoError(t, f.Run(t, repo, []string{})) +} diff --git a/test/e2e/framework.go b/test/e2e/framework.go new file mode 100644 index 0000000..7352f14 --- /dev/null +++ b/test/e2e/framework.go @@ -0,0 +1,96 @@ +package e2e + +import ( + "bytes" + "context" + "crypto/rand" + "encoding/hex" + "fmt" + "strings" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/apricote/releaser-pleaser/cmd/rp/cmd" +) + +const ( + TestDefaultBranch = "main" +) + +func randomString() string { + randomBytes := make([]byte, 4) + if _, err := rand.Read(randomBytes); err != nil { + panic(err) + } + return hex.EncodeToString(randomBytes) +} + +type Framework struct { + runID string + forge TestForge +} + +func NewFramework(ctx context.Context, forge TestForge) (*Framework, error) { + f := &Framework{ + runID: randomString(), + forge: forge, + } + + err := forge.Init(ctx, f.runID) + if err != nil { + return nil, err + } + + return f, nil +} + +type Repository struct { + Name string +} + +func (f *Framework) NewRepository(t *testing.T, name string) *Repository { + t.Helper() + + r := &Repository{ + Name: fmt.Sprintf("%s-%s-%s", name, f.runID, randomString()), + } + + repo, err := f.forge.CreateRepo(t, CreateRepoOpts{ + Name: r.Name, + Description: name, + DefaultBranch: TestDefaultBranch, + }) + require.NoError(t, err) + require.NotNil(t, repo) + + return r +} + +func (f *Framework) Run(t *testing.T, r *Repository, extraFiles []string) error { + t.Helper() + + ctx := t.Context() + + rootCmd := cmd.NewRootCmd() + rootCmd.SetArgs(append([]string{ + "run", + fmt.Sprintf("--repo=%s", r.Name), + fmt.Sprintf("--extra-files=%q", strings.Join(extraFiles, "\n")), + }, f.forge.RunArguments()...)) + + var stdout, stderr bytes.Buffer + + rootCmd.SetOut(&stdout) + rootCmd.SetErr(&stderr) + + err := rootCmd.ExecuteContext(ctx) + + stdoutString := stdout.String() + stderrString := stderr.String() + + t.Log(stdoutString) + t.Log(stderrString) + + return err +} From 2c1d29f6397bdbc930f834a8763a6debe396f614 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 14 Sep 2025 01:31:08 +0000 Subject: [PATCH 208/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.144.1 (#267) 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 a9edd3d..4784bcb 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.144.0 + gitlab.com/gitlab-org/api/client-go v0.144.1 ) require ( diff --git a/go.sum b/go.sum index fee79a7..174a773 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.144.0 h1:np2G+h2vanpxQrqGIM9LGmoKQecyUanj68JlNmNdc3o= -gitlab.com/gitlab-org/api/client-go v0.144.0/go.mod h1:rw89Kl9AsKmxRhzkfUSfZ+1jpTewwueKvAYwoYmUoQ8= +gitlab.com/gitlab-org/api/client-go v0.144.1 h1:/3eMNjz5zhKQiEQzFl8a3aZgcCV4/0E5uNM8+lVgdlc= +gitlab.com/gitlab-org/api/client-go v0.144.1/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 8c6b99560c1c6f4e86bf2be823c7e9f34d72526a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 14 Sep 2025 09:39:48 +0000 Subject: [PATCH 209/260] deps: update module codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 to v2.2.0 (#268) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4784bcb..cffcc1b 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.24 toolchain go1.25.1 require ( - codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.0.0-00010101000000-000000000000 + codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-billy/v5 v5.6.2 github.com/go-git/go-git/v5 v5.16.2 From cc627599dbc7bc7d2520060f4d19a7e3ed4c51e3 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 14:46:37 +0200 Subject: [PATCH 210/260] deps: update codecov/codecov-action digest to 5a10915 (#266) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6483868..b36cb39 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,7 +60,7 @@ jobs: - name: Upload results to Codecov - uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5 with: token: ${{ secrets.CODECOV_TOKEN }} flags: e2e From f300bbb6b0ef4916450b44ab035a53ee8753ff9f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 14:47:12 +0200 Subject: [PATCH 211/260] deps: update actions/checkout digest to 08eba0b (#264) --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b36cb39..a5f2854 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - name: Set up Go uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 From ef94c3c8f7cafdee5f8ab20621e451b50443ba6d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 Sep 2025 10:51:32 +0000 Subject: [PATCH 212/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.145.0 (#269) 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 cffcc1b..9678d10 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.144.1 + gitlab.com/gitlab-org/api/client-go v0.145.0 ) require ( diff --git a/go.sum b/go.sum index 174a773..40a87c1 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.144.1 h1:/3eMNjz5zhKQiEQzFl8a3aZgcCV4/0E5uNM8+lVgdlc= -gitlab.com/gitlab-org/api/client-go v0.144.1/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= +gitlab.com/gitlab-org/api/client-go v0.145.0 h1:gvi4bwoF6fyQq6kJix4WicApy/jBRpGlqzI0PDRD9kU= +gitlab.com/gitlab-org/api/client-go v0.145.0/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 250cc6c2aaa808483ae48b2992e5d7153680874f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:32:34 +0000 Subject: [PATCH 213/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.146.0 (#270) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 3 ++- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9678d10..07a0266 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.145.0 + gitlab.com/gitlab-org/api/client-go v0.146.0 ) require ( @@ -47,6 +47,7 @@ require ( github.com/spf13/pflag v1.0.9 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect golang.org/x/crypto v0.37.0 // indirect + golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/net v0.39.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/sys v0.34.0 // indirect diff --git a/go.sum b/go.sum index 40a87c1..103b6c1 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.145.0 h1:gvi4bwoF6fyQq6kJix4WicApy/jBRpGlqzI0PDRD9kU= -gitlab.com/gitlab-org/api/client-go v0.145.0/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= +gitlab.com/gitlab-org/api/client-go v0.146.0 h1:G8koalztNq+/6O8+YkQ5hqi2KdViaRcqhUHaS/xqoAw= +gitlab.com/gitlab-org/api/client-go v0.146.0/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 63acf9aa3a326947528c1ec76f059250cf81ed31 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 20:45:11 +0000 Subject: [PATCH 214/260] deps: update dependency golangci-lint to v2.5.0 (#271) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 9503842..98f49f9 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.1" -golangci-lint = "v2.4.0" +golangci-lint = "2.5.0" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko From d0a44e3fb8d71f036916daaa26a3ec73a7089d58 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 10:09:57 +0000 Subject: [PATCH 215/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.147.0 (#272) 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 07a0266..0ee96cf 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.146.0 + gitlab.com/gitlab-org/api/client-go v0.147.0 ) require ( diff --git a/go.sum b/go.sum index 103b6c1..506f169 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.146.0 h1:G8koalztNq+/6O8+YkQ5hqi2KdViaRcqhUHaS/xqoAw= -gitlab.com/gitlab-org/api/client-go v0.146.0/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= +gitlab.com/gitlab-org/api/client-go v0.147.0 h1:1Zp5kkwsv/GeECjdcX8zxFlos7/4omGXD1KBgZx/hH4= +gitlab.com/gitlab-org/api/client-go v0.147.0/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 63a8b91b344eba1bdfd1385279727b3da1412efc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 16:42:57 +0000 Subject: [PATCH 216/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.147.1 (#273) 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 0ee96cf..7e90f80 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.147.0 + gitlab.com/gitlab-org/api/client-go v0.147.1 ) require ( diff --git a/go.sum b/go.sum index 506f169..d003de2 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.147.0 h1:1Zp5kkwsv/GeECjdcX8zxFlos7/4omGXD1KBgZx/hH4= -gitlab.com/gitlab-org/api/client-go v0.147.0/go.mod h1:eABRp++g3IbUP10ZeBIys+9g59dgJnlQLEk8XgKNB54= +gitlab.com/gitlab-org/api/client-go v0.147.1 h1:I6SqcetiBg/rfhK05CFdNS61YFsdiZBjIuzXqNY8BAk= +gitlab.com/gitlab-org/api/client-go v0.147.1/go.mod h1:9Y5ivg3xj5KJ+TAyRmNSiQtpkoqKsHLRRlLKpgXNJ+Q= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 93bb42e7815f08657ccc29a38040ecdaf62f82b2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 11:10:35 +0000 Subject: [PATCH 217/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.148.0 (#274) 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 7e90f80..00f14c3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.147.1 + gitlab.com/gitlab-org/api/client-go v0.148.0 ) require ( diff --git a/go.sum b/go.sum index d003de2..01b2027 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.147.1 h1:I6SqcetiBg/rfhK05CFdNS61YFsdiZBjIuzXqNY8BAk= -gitlab.com/gitlab-org/api/client-go v0.147.1/go.mod h1:9Y5ivg3xj5KJ+TAyRmNSiQtpkoqKsHLRRlLKpgXNJ+Q= +gitlab.com/gitlab-org/api/client-go v0.148.0 h1:64dZ08MfUXOUJQLCkj9gfgdYaG8TEl/Of2cED+3S+pI= +gitlab.com/gitlab-org/api/client-go v0.148.0/go.mod h1:9Y5ivg3xj5KJ+TAyRmNSiQtpkoqKsHLRRlLKpgXNJ+Q= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 612928a382e9327630ecde4b9100822db52bd2d6 Mon Sep 17 00:00:00 2001 From: "Jonas L." Date: Thu, 25 Sep 2025 12:25:35 +0200 Subject: [PATCH 218/260] fix: using code blocks within release-notes (#275) Increase the number of code blocks backticks to 4 for the release note prefix and suffix, to allow users to embed their own code blocks using only 3 backticks. --- docs/guides/release-notes.md | 8 +- docs/reference/pr-options.md | 8 +- internal/releasepr/releasepr.md.tpl | 8 +- internal/releasepr/releasepr_test.go | 109 +++--------------- internal/testdata/changelog-content.txt | 7 ++ internal/testdata/changelog.txt | 13 +++ .../testdata/description-no-overrides.txt | 28 +++++ internal/testdata/description-overrides.txt | 44 +++++++ internal/testdata/description-prefix.txt | 41 +++++++ internal/testdata/description-suffix.txt | 31 +++++ internal/testdata/prefix.txt | 13 +++ internal/testdata/suffix.txt | 3 + internal/testdata/testdata.go | 19 +++ 13 files changed, 229 insertions(+), 103 deletions(-) create mode 100644 internal/testdata/changelog-content.txt create mode 100644 internal/testdata/changelog.txt create mode 100644 internal/testdata/description-no-overrides.txt create mode 100644 internal/testdata/description-overrides.txt create mode 100644 internal/testdata/description-prefix.txt create mode 100644 internal/testdata/description-suffix.txt create mode 100644 internal/testdata/prefix.txt create mode 100644 internal/testdata/suffix.txt create mode 100644 internal/testdata/testdata.go diff --git a/docs/guides/release-notes.md b/docs/guides/release-notes.md index d994294..599fb52 100644 --- a/docs/guides/release-notes.md +++ b/docs/guides/release-notes.md @@ -43,17 +43,17 @@ The release pull request description has text fields where maintainers can add t When you edit the description, make sure to put your desired content into the code blocks named `rp-prefix` and `rp-suffix`. Only the content of these blocks is considered. -> ```rp-prefix +> ~~~~rp-prefix > ### Prefix > > This will be shown as the Prefix. -> ``` +> ~~~~ > -> ```rp-suffix +> ~~~~rp-suffix > ### Suffix > > This will be shown as the Suffix. -> ``` +> ~~~~ To match the style of the auto-generated release notes, you should start any headings at level 3 (`### Title`). diff --git a/docs/reference/pr-options.md b/docs/reference/pr-options.md index 266bd08..1b096d4 100644 --- a/docs/reference/pr-options.md +++ b/docs/reference/pr-options.md @@ -30,17 +30,17 @@ Any text in code blocks with these languages is being added to the start or end **Examples**: - ```rp-prefix + ~~~~rp-prefix #### Awesome new feature! This text is at the start of the release notes. - ``` + ~~~~ - ```rp-suffix + ~~~~rp-suffix #### Version Compatibility And this at the end. - ``` + ~~~~ ### Status diff --git a/internal/releasepr/releasepr.md.tpl b/internal/releasepr/releasepr.md.tpl index 6f74aa0..3242c5d 100644 --- a/internal/releasepr/releasepr.md.tpl +++ b/internal/releasepr/releasepr.md.tpl @@ -15,18 +15,18 @@ If you want to modify the proposed release, add you overrides here. You can lear This will be added to the start of the release notes. -```rp-prefix +~~~~rp-prefix {{- if .Overrides.Prefix }} {{ .Overrides.Prefix }}{{ end }} -``` +~~~~ ### Suffix / End This will be added to the end of the release notes. -```rp-suffix +~~~~rp-suffix {{- if .Overrides.Suffix }} {{ .Overrides.Suffix }}{{ end }} -``` +~~~~ diff --git a/internal/releasepr/releasepr_test.go b/internal/releasepr/releasepr_test.go index 346bacb..1f1111b 100644 --- a/internal/releasepr/releasepr_test.go +++ b/internal/releasepr/releasepr_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/testdata" "github.com/apricote/releaser-pleaser/internal/versioning" ) @@ -37,20 +38,24 @@ func TestReleasePullRequest_GetOverrides(t *testing.T) { name: "prefix in description", pr: ReleasePullRequest{ PullRequest: git.PullRequest{ - Description: "```rp-prefix\n## Foo\n\n- Cool thing\n```", + Description: testdata.MustReadFileString(t, "description-prefix.txt"), }, }, - want: ReleaseOverrides{Prefix: "## Foo\n\n- Cool thing"}, + want: ReleaseOverrides{ + Prefix: testdata.MustReadFileString(t, "prefix.txt"), + }, wantErr: assert.NoError, }, { name: "suffix in description", pr: ReleasePullRequest{ PullRequest: git.PullRequest{ - Description: "```rp-suffix\n## Compatibility\n\nNo compatibility guarantees.\n```", + Description: testdata.MustReadFileString(t, "description-suffix.txt"), }, }, - want: ReleaseOverrides{Suffix: "## Compatibility\n\nNo compatibility guarantees."}, + want: ReleaseOverrides{ + Suffix: testdata.MustReadFileString(t, "suffix.txt"), + }, wantErr: assert.NoError, }, } @@ -80,30 +85,10 @@ func TestReleasePullRequest_ChangelogText(t *testing.T) { wantErr: assert.NoError, }, { - name: "with section", - description: `# Foobar - - -This is the changelog - -## Awesome - -### New - -#### Changes - - -Suffix Things -`, - want: `This is the changelog - -## Awesome - -### New - -#### Changes -`, - wantErr: assert.NoError, + name: "with section", + description: testdata.MustReadFileString(t, "changelog.txt"), + want: testdata.MustReadFileString(t, "changelog-content.txt"), + wantErr: assert.NoError, }, } for _, tt := range tests { @@ -178,75 +163,17 @@ func TestReleasePullRequest_SetDescription(t *testing.T) { name: "no overrides", changelogEntry: `## v1.0.0`, overrides: ReleaseOverrides{}, - want: ` -## v1.0.0 - - ---- - -
-

PR by releaser-pleaser 🤖

- -If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs. - -## Release Notes - -### Prefix / Start - -This will be added to the start of the release notes. - -` + "```" + `rp-prefix -` + "```" + ` - -### Suffix / End - -This will be added to the end of the release notes. - -` + "```" + `rp-suffix -` + "```" + ` - -
-`, - wantErr: assert.NoError, + want: testdata.MustReadFileString(t, "description-no-overrides.txt"), + wantErr: assert.NoError, }, { name: "existing overrides", changelogEntry: `## v1.0.0`, overrides: ReleaseOverrides{ - Prefix: "This release is awesome!", - Suffix: "Fooo", + Prefix: testdata.MustReadFileString(t, "prefix.txt"), + Suffix: testdata.MustReadFileString(t, "suffix.txt"), }, - want: ` -## v1.0.0 - - ---- - -
-

PR by releaser-pleaser 🤖

- -If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs. - -## Release Notes - -### Prefix / Start - -This will be added to the start of the release notes. - -` + "```" + `rp-prefix -This release is awesome! -` + "```" + ` - -### Suffix / End - -This will be added to the end of the release notes. - -` + "```" + `rp-suffix -Fooo -` + "```" + ` - -
-`, + want: testdata.MustReadFileString(t, "description-overrides.txt"), wantErr: assert.NoError, }, } diff --git a/internal/testdata/changelog-content.txt b/internal/testdata/changelog-content.txt new file mode 100644 index 0000000..3b95e44 --- /dev/null +++ b/internal/testdata/changelog-content.txt @@ -0,0 +1,7 @@ +This is the changelog + +## Awesome + +### New + +#### Changes diff --git a/internal/testdata/changelog.txt b/internal/testdata/changelog.txt new file mode 100644 index 0000000..f77bc5a --- /dev/null +++ b/internal/testdata/changelog.txt @@ -0,0 +1,13 @@ +# Foobar + + +This is the changelog + +## Awesome + +### New + +#### Changes + + +Suffix Things \ No newline at end of file diff --git a/internal/testdata/description-no-overrides.txt b/internal/testdata/description-no-overrides.txt new file mode 100644 index 0000000..8a98ae4 --- /dev/null +++ b/internal/testdata/description-no-overrides.txt @@ -0,0 +1,28 @@ + +## v1.0.0 + + +--- + +
+

PR by releaser-pleaser 🤖

+ +If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs. + +## Release Notes + +### Prefix / Start + +This will be added to the start of the release notes. + +~~~~rp-prefix +~~~~ + +### Suffix / End + +This will be added to the end of the release notes. + +~~~~rp-suffix +~~~~ + +
diff --git a/internal/testdata/description-overrides.txt b/internal/testdata/description-overrides.txt new file mode 100644 index 0000000..2fb8249 --- /dev/null +++ b/internal/testdata/description-overrides.txt @@ -0,0 +1,44 @@ + +## v1.0.0 + + +--- + +
+

PR by releaser-pleaser 🤖

+ +If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs. + +## Release Notes + +### Prefix / Start + +This will be added to the start of the release notes. + +~~~~rp-prefix +## Foo + +- Cool thing + +```go +// Some code example +func IsPositive(number int) error { + if number < 0 { + return fmt.Errorf("number %d is negative", number) + } + return nil +} +``` +~~~~ + +### Suffix / End + +This will be added to the end of the release notes. + +~~~~rp-suffix +## Compatibility + +No compatibility guarantees. +~~~~ + +
diff --git a/internal/testdata/description-prefix.txt b/internal/testdata/description-prefix.txt new file mode 100644 index 0000000..3a30166 --- /dev/null +++ b/internal/testdata/description-prefix.txt @@ -0,0 +1,41 @@ + +## v1.0.0 + + +--- + +
+

PR by releaser-pleaser 🤖

+ +If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs. + +## Release Notes + +### Prefix / Start + +This will be added to the start of the release notes. + +~~~~rp-prefix +## Foo + +- Cool thing + +```go +// Some code example +func IsPositive(number int) error { + if number < 0 { + return fmt.Errorf("number %d is negative", number) + } + return nil +} +``` +~~~~ + +### Suffix / End + +This will be added to the end of the release notes. + +~~~~rp-suffix +~~~~ + +
diff --git a/internal/testdata/description-suffix.txt b/internal/testdata/description-suffix.txt new file mode 100644 index 0000000..4ce7f3b --- /dev/null +++ b/internal/testdata/description-suffix.txt @@ -0,0 +1,31 @@ + +## v1.0.0 + + +--- + +
+

PR by releaser-pleaser 🤖

+ +If you want to modify the proposed release, add you overrides here. You can learn more about the options in the docs. + +## Release Notes + +### Prefix / Start + +This will be added to the start of the release notes. + +~~~~rp-prefix +~~~~ + +### Suffix / End + +This will be added to the end of the release notes. + +~~~~rp-suffix +## Compatibility + +No compatibility guarantees. +~~~~ + +
diff --git a/internal/testdata/prefix.txt b/internal/testdata/prefix.txt new file mode 100644 index 0000000..55271d3 --- /dev/null +++ b/internal/testdata/prefix.txt @@ -0,0 +1,13 @@ +## Foo + +- Cool thing + +```go +// Some code example +func IsPositive(number int) error { + if number < 0 { + return fmt.Errorf("number %d is negative", number) + } + return nil +} +``` \ No newline at end of file diff --git a/internal/testdata/suffix.txt b/internal/testdata/suffix.txt new file mode 100644 index 0000000..b8d35c0 --- /dev/null +++ b/internal/testdata/suffix.txt @@ -0,0 +1,3 @@ +## Compatibility + +No compatibility guarantees. \ No newline at end of file diff --git a/internal/testdata/testdata.go b/internal/testdata/testdata.go new file mode 100644 index 0000000..28c87d1 --- /dev/null +++ b/internal/testdata/testdata.go @@ -0,0 +1,19 @@ +package testdata + +import ( + "embed" + "testing" +) + +//go:embed *.txt +var testdata embed.FS + +func MustReadFileString(t *testing.T, name string) string { + t.Helper() + + content, err := testdata.ReadFile(name) + if err != nil { + t.Fatal(err) + } + return string(content) +} From b0c50518b3c324d88cb4d1a1c3403c60a3fb83f8 Mon Sep 17 00:00:00 2001 From: "Jonas L." Date: Thu, 25 Sep 2025 12:40:35 +0200 Subject: [PATCH 219/260] fix: no html escaping for changelog template (#277) --- internal/changelog/changelog.go | 2 +- internal/changelog/changelog_test.go | 25 ++++---------------- internal/testdata/changelog-entry-prefix.txt | 19 +++++++++++++++ internal/testdata/changelog-entry-suffix.txt | 9 +++++++ internal/testdata/description-overrides.txt | 2 +- internal/testdata/description-suffix.txt | 2 +- internal/testdata/suffix.txt | 2 +- 7 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 internal/testdata/changelog-entry-prefix.txt create mode 100644 internal/testdata/changelog-entry-suffix.txt diff --git a/internal/changelog/changelog.go b/internal/changelog/changelog.go index d6386b8..dda751a 100644 --- a/internal/changelog/changelog.go +++ b/internal/changelog/changelog.go @@ -3,9 +3,9 @@ package changelog import ( "bytes" _ "embed" - "html/template" "log" "log/slog" + "text/template" "github.com/apricote/releaser-pleaser/internal/commitparser" "github.com/apricote/releaser-pleaser/internal/markdown" diff --git a/internal/changelog/changelog_test.go b/internal/changelog/changelog_test.go index e4fe52f..c2bbf71 100644 --- a/internal/changelog/changelog_test.go +++ b/internal/changelog/changelog_test.go @@ -8,6 +8,7 @@ import ( "github.com/apricote/releaser-pleaser/internal/commitparser" "github.com/apricote/releaser-pleaser/internal/git" + "github.com/apricote/releaser-pleaser/internal/testdata" ) func ptr[T any](input T) *T { @@ -143,16 +144,9 @@ func Test_NewChangelogEntry(t *testing.T) { }, version: "1.0.0", link: "https://example.com/1.0.0", - prefix: "### Breaking Changes", + prefix: testdata.MustReadFileString(t, "prefix.txt"), }, - want: `## [1.0.0](https://example.com/1.0.0) - -### Breaking Changes - -### Bug Fixes - -- Foobar! -`, + want: testdata.MustReadFileString(t, "changelog-entry-prefix.txt"), wantErr: assert.NoError, }, { @@ -167,18 +161,9 @@ func Test_NewChangelogEntry(t *testing.T) { }, version: "1.0.0", link: "https://example.com/1.0.0", - suffix: "### Compatibility\n\nThis version is compatible with flux-compensator v2.2 - v2.9.", + suffix: testdata.MustReadFileString(t, "suffix.txt"), }, - want: `## [1.0.0](https://example.com/1.0.0) - -### Bug Fixes - -- Foobar! - -### Compatibility - -This version is compatible with flux-compensator v2.2 - v2.9. -`, + want: testdata.MustReadFileString(t, "changelog-entry-suffix.txt"), wantErr: assert.NoError, }, } diff --git a/internal/testdata/changelog-entry-prefix.txt b/internal/testdata/changelog-entry-prefix.txt new file mode 100644 index 0000000..186d04a --- /dev/null +++ b/internal/testdata/changelog-entry-prefix.txt @@ -0,0 +1,19 @@ +## [1.0.0](https://example.com/1.0.0) + +## Foo + +- Cool thing + +```go +// Some code example +func IsPositive(number int) error { + if number < 0 { + return fmt.Errorf("number %d is negative", number) + } + return nil +} +``` + +### Bug Fixes + +- Foobar! diff --git a/internal/testdata/changelog-entry-suffix.txt b/internal/testdata/changelog-entry-suffix.txt new file mode 100644 index 0000000..91bbb05 --- /dev/null +++ b/internal/testdata/changelog-entry-suffix.txt @@ -0,0 +1,9 @@ +## [1.0.0](https://example.com/1.0.0) + +### Bug Fixes + +- Foobar! + +## Compatibility + +This version is compatible with flux-compensator v2.2 - v2.9. diff --git a/internal/testdata/description-overrides.txt b/internal/testdata/description-overrides.txt index 2fb8249..5a1db7e 100644 --- a/internal/testdata/description-overrides.txt +++ b/internal/testdata/description-overrides.txt @@ -38,7 +38,7 @@ This will be added to the end of the release notes. ~~~~rp-suffix ## Compatibility -No compatibility guarantees. +This version is compatible with flux-compensator v2.2 - v2.9. ~~~~ diff --git a/internal/testdata/description-suffix.txt b/internal/testdata/description-suffix.txt index 4ce7f3b..d0a1596 100644 --- a/internal/testdata/description-suffix.txt +++ b/internal/testdata/description-suffix.txt @@ -25,7 +25,7 @@ This will be added to the end of the release notes. ~~~~rp-suffix ## Compatibility -No compatibility guarantees. +This version is compatible with flux-compensator v2.2 - v2.9. ~~~~ diff --git a/internal/testdata/suffix.txt b/internal/testdata/suffix.txt index b8d35c0..3fc6656 100644 --- a/internal/testdata/suffix.txt +++ b/internal/testdata/suffix.txt @@ -1,3 +1,3 @@ ## Compatibility -No compatibility guarantees. \ No newline at end of file +This version is compatible with flux-compensator v2.2 - v2.9. \ No newline at end of file From fa27415be5a0b3feff8a0a07a6299b15743f412f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Fri, 26 Sep 2025 07:36:27 +0200 Subject: [PATCH 220/260] chore(main): release v0.7.1 (#278) --- CHANGELOG.md | 7 +++++++ action.yml | 2 +- templates/run.yml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7038de1..2ba0bc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [v0.7.1](https://github.com/apricote/releaser-pleaser/releases/tag/v0.7.1) + +### Bug Fixes + +- using code blocks within release-notes (#275) +- no html escaping for changelog template (#277) + ## [v0.7.0](https://github.com/apricote/releaser-pleaser/releases/tag/v0.7.0) ### Highlights :sparkles: diff --git a/action.yml b/action.yml index a6de20c..5d25210 100644 --- a/action.yml +++ b/action.yml @@ -25,7 +25,7 @@ inputs: outputs: { } runs: using: 'docker' - image: docker://ghcr.io/apricote/releaser-pleaser:v0.7.0 # x-releaser-pleaser-version + image: docker://ghcr.io/apricote/releaser-pleaser:v0.7.1 # x-releaser-pleaser-version args: - run - --forge=github diff --git a/templates/run.yml b/templates/run.yml index 0d71f84..b8a6513 100644 --- a/templates/run.yml +++ b/templates/run.yml @@ -44,7 +44,7 @@ releaser-pleaser: resource_group: releaser-pleaser image: - name: ghcr.io/apricote/releaser-pleaser:v0.7.0 # x-releaser-pleaser-version + name: ghcr.io/apricote/releaser-pleaser:v0.7.1 # x-releaser-pleaser-version entrypoint: [ "" ] variables: GITLAB_TOKEN: $[[ inputs.token ]] From 71364599d8dc06759ec9864833ac9def6091cf69 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 17:51:38 +0000 Subject: [PATCH 221/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.148.1 (#279) 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 00f14c3..f87a373 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.148.0 + gitlab.com/gitlab-org/api/client-go v0.148.1 ) require ( diff --git a/go.sum b/go.sum index 01b2027..676597c 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.148.0 h1:64dZ08MfUXOUJQLCkj9gfgdYaG8TEl/Of2cED+3S+pI= -gitlab.com/gitlab-org/api/client-go v0.148.0/go.mod h1:9Y5ivg3xj5KJ+TAyRmNSiQtpkoqKsHLRRlLKpgXNJ+Q= +gitlab.com/gitlab-org/api/client-go v0.148.1 h1:xds5sz/aylLFX9wdTnaqalRDPmlZTzbp0vKA64nbLo4= +gitlab.com/gitlab-org/api/client-go v0.148.1/go.mod h1:9Y5ivg3xj5KJ+TAyRmNSiQtpkoqKsHLRRlLKpgXNJ+Q= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 21e3fdbcaded020d94412bf2f6a01632b3104a2d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 01:14:18 +0000 Subject: [PATCH 222/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.149.0 (#280) 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 f87a373..91336d4 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.148.1 + gitlab.com/gitlab-org/api/client-go v0.149.0 ) require ( diff --git a/go.sum b/go.sum index 676597c..aa1490d 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.148.1 h1:xds5sz/aylLFX9wdTnaqalRDPmlZTzbp0vKA64nbLo4= -gitlab.com/gitlab-org/api/client-go v0.148.1/go.mod h1:9Y5ivg3xj5KJ+TAyRmNSiQtpkoqKsHLRRlLKpgXNJ+Q= +gitlab.com/gitlab-org/api/client-go v0.149.0 h1:Rp+q5QCBb2LEryCp68iHkW0K9YX9xcX0DbsRtaxqK6Y= +gitlab.com/gitlab-org/api/client-go v0.149.0/go.mod h1:P3UhcdtBYT1dpqA33GibGrVl4dZWBs3vINR+YOaM+mA= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 0d16c770d3e19bfdb22339c54bce5c87cef3c415 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 10:02:04 +0000 Subject: [PATCH 223/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.150.0 (#281) 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 91336d4..959f222 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.149.0 + gitlab.com/gitlab-org/api/client-go v0.150.0 ) require ( diff --git a/go.sum b/go.sum index aa1490d..56b25e0 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.149.0 h1:Rp+q5QCBb2LEryCp68iHkW0K9YX9xcX0DbsRtaxqK6Y= -gitlab.com/gitlab-org/api/client-go v0.149.0/go.mod h1:P3UhcdtBYT1dpqA33GibGrVl4dZWBs3vINR+YOaM+mA= +gitlab.com/gitlab-org/api/client-go v0.150.0 h1:vaSt6hBsSAXc1ZQIEMa1sGuG9vBu3nUGouURDTrPMPw= +gitlab.com/gitlab-org/api/client-go v0.150.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From ff899fe9e8ddef8212f3e53106ef4cbac6f2a46a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 5 Oct 2025 00:49:57 +0000 Subject: [PATCH 224/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.151.0 (#283) 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 959f222..ded8c24 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.150.0 + gitlab.com/gitlab-org/api/client-go v0.151.0 ) require ( diff --git a/go.sum b/go.sum index 56b25e0..746a470 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.150.0 h1:vaSt6hBsSAXc1ZQIEMa1sGuG9vBu3nUGouURDTrPMPw= -gitlab.com/gitlab-org/api/client-go v0.150.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.151.0 h1:8jXu3CDlQp1ZXQf+M0hBIAm8v+RrKCiRtXIdngfLDw4= +gitlab.com/gitlab-org/api/client-go v0.151.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 8607cb6f71f7310692e39f96e5b4d44fc18f9b06 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 5 Oct 2025 21:47:34 +0000 Subject: [PATCH 225/260] deps: update module github.com/go-git/go-git/v5 to v5.16.3 (#284) 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 ded8c24..467fe06 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-billy/v5 v5.6.2 - github.com/go-git/go-git/v5 v5.16.2 + github.com/go-git/go-git/v5 v5.16.3 github.com/google/go-github/v74 v74.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/lmittmann/tint v1.1.2 diff --git a/go.sum b/go.sum index 746a470..0a72b2f 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.16.2 h1:fT6ZIOjE5iEnkzKyxTHK1W4HGAsPhqEqiSAssSO77hM= -github.com/go-git/go-git/v5 v5.16.2/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.3 h1:Z8BtvxZ09bYm/yYNgPKCzgWtaRqDTgIKRgIRHBfU6Z8= +github.com/go-git/go-git/v5 v5.16.3/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= From e32838e3d03009f7ebcdf0c1d0a89607f303c7fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 00:46:25 +0000 Subject: [PATCH 226/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.152.0 (#286) 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 467fe06..1b50be8 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.151.0 + gitlab.com/gitlab-org/api/client-go v0.152.0 ) require ( diff --git a/go.sum b/go.sum index 0a72b2f..ef865f1 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.151.0 h1:8jXu3CDlQp1ZXQf+M0hBIAm8v+RrKCiRtXIdngfLDw4= -gitlab.com/gitlab-org/api/client-go v0.151.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.152.0 h1:G7aHUkWgo6jG8vRgITn7/fPTSHpSgXGGlJine2KzE2A= +gitlab.com/gitlab-org/api/client-go v0.152.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From d95b779f834b6c248c3a9049378a26b9e67d3e88 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 04:15:40 +0000 Subject: [PATCH 227/260] deps: update dependency go to v1.25.2 (#287) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- mise.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 1b50be8..61b8be6 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.24 -toolchain go1.25.1 +toolchain go1.25.2 require ( codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 diff --git a/mise.toml b/mise.toml index 98f49f9..8af4a75 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,5 @@ [tools] -go = "1.25.1" +go = "1.25.2" golangci-lint = "2.5.0" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook From f24b69e8fa51d0b92efde3714a8948271bf37f9b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 09:01:44 +0000 Subject: [PATCH 228/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.153.0 (#288) 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 61b8be6..aae0fbc 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.152.0 + gitlab.com/gitlab-org/api/client-go v0.153.0 ) require ( diff --git a/go.sum b/go.sum index ef865f1..252b88b 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.152.0 h1:G7aHUkWgo6jG8vRgITn7/fPTSHpSgXGGlJine2KzE2A= -gitlab.com/gitlab-org/api/client-go v0.152.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.153.0 h1:Wx8CM+nJYds6K7nTqdNoUXI/g79fz1iB7zlksnUrlpE= +gitlab.com/gitlab-org/api/client-go v0.153.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 918249a0d34a4c9d3af491cee5097fcba7a7729b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 15:03:19 +0000 Subject: [PATCH 229/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.154.0 (#289) 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 aae0fbc..9b24e5d 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.153.0 + gitlab.com/gitlab-org/api/client-go v0.154.0 ) require ( diff --git a/go.sum b/go.sum index 252b88b..3fe9ce7 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.153.0 h1:Wx8CM+nJYds6K7nTqdNoUXI/g79fz1iB7zlksnUrlpE= -gitlab.com/gitlab-org/api/client-go v0.153.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.154.0 h1:RnAozG7ToCunYizz0v+vJEDj/id1dt820vV4mYOrLFw= +gitlab.com/gitlab-org/api/client-go v0.154.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From cead3fb5c1bfa1978ab5e6e563fba08c37c46781 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 02:00:41 +0000 Subject: [PATCH 230/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.155.0 (#290) 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 9b24e5d..8dae618 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.154.0 + gitlab.com/gitlab-org/api/client-go v0.155.0 ) require ( diff --git a/go.sum b/go.sum index 3fe9ce7..9e73a71 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.154.0 h1:RnAozG7ToCunYizz0v+vJEDj/id1dt820vV4mYOrLFw= -gitlab.com/gitlab-org/api/client-go v0.154.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.155.0 h1:8qtopz3ATA0uXceMFmoxPw14rwJ+M5racAEGhGFnwgc= +gitlab.com/gitlab-org/api/client-go v0.155.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 0d2efe0a6d561e5c0077ee829811214d7c240a45 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 08:51:53 +0000 Subject: [PATCH 231/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.156.0 (#291) 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 8dae618..4af72b4 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.155.0 + gitlab.com/gitlab-org/api/client-go v0.156.0 ) require ( diff --git a/go.sum b/go.sum index 9e73a71..584c94c 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.155.0 h1:8qtopz3ATA0uXceMFmoxPw14rwJ+M5racAEGhGFnwgc= -gitlab.com/gitlab-org/api/client-go v0.155.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.156.0 h1:dHgFtA9Z28Oz6veBYR09SQ7eT3qof9ZsY9QMH3D9KaA= +gitlab.com/gitlab-org/api/client-go v0.156.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 226548adfa44883a0c8115474dbd414389741ede Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 18:11:57 +0000 Subject: [PATCH 232/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.157.0 (#292) 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 4af72b4..7517760 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.156.0 + gitlab.com/gitlab-org/api/client-go v0.157.0 ) require ( diff --git a/go.sum b/go.sum index 584c94c..b511642 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.156.0 h1:dHgFtA9Z28Oz6veBYR09SQ7eT3qof9ZsY9QMH3D9KaA= -gitlab.com/gitlab-org/api/client-go v0.156.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.157.0 h1:B+/Ku1ek3V/MInR/SmvL4FOqE0YYx51u7lBVYIHC2ic= +gitlab.com/gitlab-org/api/client-go v0.157.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 0129c78abcf79881c955b61561caed01e996b84c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Oct 2025 22:16:30 +0000 Subject: [PATCH 233/260] deps: update dependency go to v1.25.3 (#293) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- mise.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 7517760..fad2b16 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.24 -toolchain go1.25.2 +toolchain go1.25.3 require ( codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 diff --git a/mise.toml b/mise.toml index 8af4a75..72a0e97 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,5 @@ [tools] -go = "1.25.2" +go = "1.25.3" golangci-lint = "2.5.0" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook From 23e9d06c6e6f8475dd55b1abf460711575966ded Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Oct 2025 16:15:14 +0000 Subject: [PATCH 234/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.157.1 (#294) 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 fad2b16..1bbb69e 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.157.0 + gitlab.com/gitlab-org/api/client-go v0.157.1 ) require ( diff --git a/go.sum b/go.sum index b511642..c66782b 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.157.0 h1:B+/Ku1ek3V/MInR/SmvL4FOqE0YYx51u7lBVYIHC2ic= -gitlab.com/gitlab-org/api/client-go v0.157.0/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.157.1 h1:oYbOYk0A2Q+bc1drw8fikSvgi5GImQ9Cj0L0zkZ+PfY= +gitlab.com/gitlab-org/api/client-go v0.157.1/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From cb92e2b67f58f02a185b7367bbfc58cea212a5dc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 01:06:35 +0000 Subject: [PATCH 235/260] deps: update dependency golangci-lint to v2.6.0 (#295) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 72a0e97..5c1fdeb 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.3" -golangci-lint = "2.5.0" +golangci-lint = "2.6.0" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko From c4796a546e561f7fc43d9ce380dc46576a557d49 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:31:58 +0000 Subject: [PATCH 236/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.158.0 (#296) 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 1bbb69e..b448e52 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.157.1 + gitlab.com/gitlab-org/api/client-go v0.158.0 ) require ( diff --git a/go.sum b/go.sum index c66782b..2fa9abc 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.157.1 h1:oYbOYk0A2Q+bc1drw8fikSvgi5GImQ9Cj0L0zkZ+PfY= -gitlab.com/gitlab-org/api/client-go v0.157.1/go.mod h1:CQVoxjEswJZeXft4Mi+H+OF1MVrpNVF6m4xvlPTQ2J4= +gitlab.com/gitlab-org/api/client-go v0.158.0 h1:CfWA94ZaU4STlIfsYBGcpks3eUVojXvNFaytmNptbX8= +gitlab.com/gitlab-org/api/client-go v0.158.0/go.mod h1:D0DHF7ILUfFo/JcoGMAEndiKMm8SiP/WjyJ4OfXxCKw= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From c1c2111e035626a96d81ff37242bc22ee54509c0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 4 Nov 2025 12:51:40 +0000 Subject: [PATCH 237/260] deps: update dependency golangci-lint to v2.6.1 (#297) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 5c1fdeb..0c2d92e 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.3" -golangci-lint = "2.6.0" +golangci-lint = "2.6.1" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko From 29a033103dce56047eff011ac2a1b53a94659a54 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 01:05:09 +0000 Subject: [PATCH 238/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.159.0 (#298) 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 b448e52..2dfcf62 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.158.0 + gitlab.com/gitlab-org/api/client-go v0.159.0 ) require ( diff --git a/go.sum b/go.sum index 2fa9abc..0b1b5c6 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.158.0 h1:CfWA94ZaU4STlIfsYBGcpks3eUVojXvNFaytmNptbX8= -gitlab.com/gitlab-org/api/client-go v0.158.0/go.mod h1:D0DHF7ILUfFo/JcoGMAEndiKMm8SiP/WjyJ4OfXxCKw= +gitlab.com/gitlab-org/api/client-go v0.159.0 h1:ibKeribio/OCsrsUz7pkgIN4E7HWDyrw/lDR6P2R7lU= +gitlab.com/gitlab-org/api/client-go v0.159.0/go.mod h1:D0DHF7ILUfFo/JcoGMAEndiKMm8SiP/WjyJ4OfXxCKw= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 291581ef6d52703e4ff926de28b422701064a063 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 21:07:16 +0000 Subject: [PATCH 239/260] deps: update dependency go to v1.25.4 (#299) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- mise.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 2dfcf62..b3fd407 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.24 -toolchain go1.25.3 +toolchain go1.25.4 require ( codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 diff --git a/mise.toml b/mise.toml index 0c2d92e..8615b58 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,5 @@ [tools] -go = "1.25.3" +go = "1.25.4" golangci-lint = "2.6.1" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook From 6dd0424029834beadc31e3fb9318c08d281a290e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 13 Nov 2025 00:00:03 +0000 Subject: [PATCH 240/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.160.0 (#300) 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 b3fd407..fa0bee3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.159.0 + gitlab.com/gitlab-org/api/client-go v0.160.0 ) require ( diff --git a/go.sum b/go.sum index 0b1b5c6..b426c51 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.159.0 h1:ibKeribio/OCsrsUz7pkgIN4E7HWDyrw/lDR6P2R7lU= -gitlab.com/gitlab-org/api/client-go v0.159.0/go.mod h1:D0DHF7ILUfFo/JcoGMAEndiKMm8SiP/WjyJ4OfXxCKw= +gitlab.com/gitlab-org/api/client-go v0.160.0 h1:aMQzbcE8zFe0lR/J+a3zneEgH+/EBFs8rD8Chrr4Snw= +gitlab.com/gitlab-org/api/client-go v0.160.0/go.mod h1:ooCNtKB7OyP7GBa279+HrUS3eeJF6Yi6XABZZy7RTSk= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 0f040ff8e7defc5cbce2c1c1fe752372f41c03b1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 14 Nov 2025 18:13:08 +0000 Subject: [PATCH 241/260] deps: update dependency golangci-lint to v2.6.2 (#301) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 8615b58..f6a62b8 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.4" -golangci-lint = "2.6.1" +golangci-lint = "2.6.2" goreleaser = "v2.9.0" mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko From ad845e61c7bae7b303b585e0b863d7755f06b3a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 18 Nov 2025 06:50:50 +0000 Subject: [PATCH 242/260] deps: update dependency rust-lang/mdbook to v0.5.0 (#303) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index f6a62b8..b912757 100644 --- a/mise.toml +++ b/mise.toml @@ -2,7 +2,7 @@ go = "1.25.4" golangci-lint = "2.6.2" goreleaser = "v2.9.0" -mdbook = "v0.4.52" # renovate: datasource=github-releases depName=rust-lang/mdbook +mdbook = "v0.5.0" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko [settings] From ec851d7511a2d475c4f2ec420895475c2db39f55 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Nov 2025 21:04:09 +0000 Subject: [PATCH 243/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.160.1 (#304) 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 fa0bee3..2ab7ff3 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.160.0 + gitlab.com/gitlab-org/api/client-go v0.160.1 ) require ( diff --git a/go.sum b/go.sum index b426c51..9ae846c 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.160.0 h1:aMQzbcE8zFe0lR/J+a3zneEgH+/EBFs8rD8Chrr4Snw= -gitlab.com/gitlab-org/api/client-go v0.160.0/go.mod h1:ooCNtKB7OyP7GBa279+HrUS3eeJF6Yi6XABZZy7RTSk= +gitlab.com/gitlab-org/api/client-go v0.160.1 h1:7kEgo1yQ3ZMRps/2JbXzqbRb4Rs8n2ECkAv+6MadJw8= +gitlab.com/gitlab-org/api/client-go v0.160.1/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From 995f4beb9ad80dfc2dd0145e4b0935d73633ecce Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 05:39:33 +0000 Subject: [PATCH 244/260] deps: update dependency rust-lang/mdbook to v0.5.1 (#305) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index b912757..5dda70d 100644 --- a/mise.toml +++ b/mise.toml @@ -2,7 +2,7 @@ go = "1.25.4" golangci-lint = "2.6.2" goreleaser = "v2.9.0" -mdbook = "v0.5.0" # renovate: datasource=github-releases depName=rust-lang/mdbook +mdbook = "v0.5.1" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko [settings] From e5bccc9fb9293aec0208085840cc4e0a4537d9f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 09:57:10 +0000 Subject: [PATCH 245/260] deps: update module golang.org/x/crypto to v0.45.0 [security] (#306) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 8 ++++---- go.sum | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 2ab7ff3..93a8855 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/apricote/releaser-pleaser -go 1.24 +go 1.24.0 toolchain go1.25.4 @@ -46,11 +46,11 @@ require ( github.com/skeema/knownhosts v1.3.1 // indirect github.com/spf13/pflag v1.0.9 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect - golang.org/x/crypto v0.37.0 // indirect + golang.org/x/crypto v0.45.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/net v0.39.0 // indirect + golang.org/x/net v0.47.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect - golang.org/x/sys v0.34.0 // indirect + golang.org/x/sys v0.38.0 // indirect golang.org/x/time v0.12.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 9ae846c..bb56416 100644 --- a/go.sum +++ b/go.sum @@ -125,15 +125,15 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= -golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= +golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= +golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= -golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= +golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= +golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -144,16 +144,16 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= +golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= -golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= +golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= +golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng= -golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU= +golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= +golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= From 9592a6a9754a2e3e4190c1cc8bf411e9371382a2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 02:08:18 +0000 Subject: [PATCH 246/260] deps: update module github.com/go-git/go-git/v5 to v5.16.4 (#307) 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 93a8855..c047c28 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 github.com/blang/semver/v4 v4.0.0 github.com/go-git/go-billy/v5 v5.6.2 - github.com/go-git/go-git/v5 v5.16.3 + github.com/go-git/go-git/v5 v5.16.4 github.com/google/go-github/v74 v74.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/lmittmann/tint v1.1.2 diff --git a/go.sum b/go.sum index bb56416..cf8c5c0 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UN github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.16.3 h1:Z8BtvxZ09bYm/yYNgPKCzgWtaRqDTgIKRgIRHBfU6Z8= -github.com/go-git/go-git/v5 v5.16.3/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= +github.com/go-git/go-git/v5 v5.16.4 h1:7ajIEZHZJULcyJebDLo99bGgS0jRrOxzZG4uCk2Yb2Y= +github.com/go-git/go-git/v5 v5.16.4/go.mod h1:4Ge4alE/5gPs30F2H1esi2gPd69R0C39lolkucHBOp8= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ= github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= From b451c086341b271508edaa1e00f8106d725fceca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 12:50:46 +0000 Subject: [PATCH 247/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.160.2 (#308) 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 c047c28..69a0ff8 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.160.1 + gitlab.com/gitlab-org/api/client-go v0.160.2 ) require ( diff --git a/go.sum b/go.sum index cf8c5c0..180f830 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.160.1 h1:7kEgo1yQ3ZMRps/2JbXzqbRb4Rs8n2ECkAv+6MadJw8= -gitlab.com/gitlab-org/api/client-go v0.160.1/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= +gitlab.com/gitlab-org/api/client-go v0.160.2 h1:InFTeAoGZoQWFS+4xA2kjOp+FaxnuuUsNm6KuyftK3o= +gitlab.com/gitlab-org/api/client-go v0.160.2/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From db611e5cc2c702f571ad5b46d6548ffde0dd13c7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 21:30:33 +0000 Subject: [PATCH 248/260] deps: update module gitlab.com/gitlab-org/api/client-go to v0.161.1 (#309) 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 69a0ff8..d864a77 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 - gitlab.com/gitlab-org/api/client-go v0.160.2 + gitlab.com/gitlab-org/api/client-go v0.161.1 ) require ( diff --git a/go.sum b/go.sum index 180f830..3314a6d 100644 --- a/go.sum +++ b/go.sum @@ -117,8 +117,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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= -gitlab.com/gitlab-org/api/client-go v0.160.2 h1:InFTeAoGZoQWFS+4xA2kjOp+FaxnuuUsNm6KuyftK3o= -gitlab.com/gitlab-org/api/client-go v0.160.2/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= +gitlab.com/gitlab-org/api/client-go v0.161.1 h1:XX0EtVGL6cGEdNy9xnJ96CSciIzjCwAVsayItHY1YyU= +gitlab.com/gitlab-org/api/client-go v0.161.1/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= 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-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= From fb2a0b8167fffec20e61ab3af443b8c9ef91632b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 17:37:09 +0000 Subject: [PATCH 249/260] deps: update dependency go to v1.25.5 (#310) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- mise.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index d864a77..2a472a4 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/apricote/releaser-pleaser go 1.24.0 -toolchain go1.25.4 +toolchain go1.25.5 require ( codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 diff --git a/mise.toml b/mise.toml index 5dda70d..b979567 100644 --- a/mise.toml +++ b/mise.toml @@ -1,5 +1,5 @@ [tools] -go = "1.25.4" +go = "1.25.5" golangci-lint = "2.6.2" goreleaser = "v2.9.0" mdbook = "v0.5.1" # renovate: datasource=github-releases depName=rust-lang/mdbook From 6dfa96a9ba0f973fe57ba6fcae12f5607eae9684 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 21:01:35 +0000 Subject: [PATCH 250/260] deps: update dependency golangci-lint to v2.7.0 (#311) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index b979567..d2052ec 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.5" -golangci-lint = "2.6.2" +golangci-lint = "2.7.0" goreleaser = "v2.9.0" mdbook = "v0.5.1" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko From 8d6175c13b021497242966bd0c5b411d3482f158 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 03:50:01 +0000 Subject: [PATCH 251/260] deps: update module github.com/spf13/cobra to v1.10.2 (#312) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2a472a4..5e31c2b 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/google/go-github/v74 v74.0.0 github.com/leodido/go-conventionalcommits v0.12.0 github.com/lmittmann/tint v1.1.2 - github.com/spf13/cobra v1.10.1 + github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 github.com/yuin/goldmark v1.7.13 diff --git a/go.sum b/go.sum index 3314a6d..d1597c4 100644 --- a/go.sum +++ b/go.sum @@ -101,8 +101,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8= github.com/skeema/knownhosts v1.3.1/go.mod h1:r7KTdC8l4uxWRyK2TpQZ/1o5HaSzh06ePQNxPwTcfiY= -github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= -github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= +github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU= +github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4= github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -121,6 +121,7 @@ gitlab.com/gitlab-org/api/client-go v0.161.1 h1:XX0EtVGL6cGEdNy9xnJ96CSciIzjCwAV gitlab.com/gitlab-org/api/client-go v0.161.1/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= 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= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= From 60d9aa39822223667c4af3741b23bbb0936470d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 6 Dec 2025 13:00:46 +0000 Subject: [PATCH 252/260] deps: update module github.com/go-git/go-billy/v5 to v5.7.0 (#315) 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 5e31c2b..b758e14 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.25.5 require ( codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2 v2.2.0 github.com/blang/semver/v4 v4.0.0 - github.com/go-git/go-billy/v5 v5.6.2 + github.com/go-git/go-billy/v5 v5.7.0 github.com/go-git/go-git/v5 v5.16.4 github.com/google/go-github/v74 v74.0.0 github.com/leodido/go-conventionalcommits v0.12.0 diff --git a/go.sum b/go.sum index d1597c4..31a2c93 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI= github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.6.2 h1:6Q86EsPXMa7c3YZ3aLAQsMA0VlWmy43r6FHqa/UNbRM= -github.com/go-git/go-billy/v5 v5.6.2/go.mod h1:rcFC2rAsp/erv7CMz9GczHcuD0D32fWzH+MJAU+jaUU= +github.com/go-git/go-billy/v5 v5.7.0 h1:83lBUJhGWhYp0ngzCMSgllhUSuoHP1iEWYjsPl9nwqM= +github.com/go-git/go-billy/v5 v5.7.0/go.mod h1:/1IUejTKH8xipsAcdfcSAlUlo2J7lkYV8GTKxAT/L3E= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.16.4 h1:7ajIEZHZJULcyJebDLo99bGgS0jRrOxzZG4uCk2Yb2Y= From 804cf8040af1575fb062da044d738d7de646e7a9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 6 Dec 2025 18:00:02 +0000 Subject: [PATCH 253/260] deps: update dependency golangci-lint to v2.7.1 (#313) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index d2052ec..057f5b7 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.5" -golangci-lint = "2.7.0" +golangci-lint = "2.7.1" goreleaser = "v2.9.0" mdbook = "v0.5.1" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko From 163eaf31a60300a8b2ca9e47637beafe4e5dda70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 7 Dec 2025 18:13:31 +0000 Subject: [PATCH 254/260] deps: update dependency golangci-lint to v2.7.2 (#316) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 057f5b7..ed65ed4 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.5" -golangci-lint = "2.7.1" +golangci-lint = "2.7.2" goreleaser = "v2.9.0" mdbook = "v0.5.1" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko From b48c9a654f301e4ce2855272b45e07ee99b3363d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:50:29 +0000 Subject: [PATCH 255/260] deps: update dependency rust-lang/mdbook to v0.5.2 (#319) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index ed65ed4..281e54f 100644 --- a/mise.toml +++ b/mise.toml @@ -2,7 +2,7 @@ go = "1.25.5" golangci-lint = "2.7.2" goreleaser = "v2.9.0" -mdbook = "v0.5.1" # renovate: datasource=github-releases depName=rust-lang/mdbook +mdbook = "v0.5.2" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko [settings] From d9c8d3e5afaf811bed08fa29e9edcc727a80ac56 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 13 Dec 2025 16:47:59 +0000 Subject: [PATCH 256/260] deps: update dependency ko-build/ko to v0.18.1 (#320) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 281e54f..3ebe653 100644 --- a/mise.toml +++ b/mise.toml @@ -3,7 +3,7 @@ go = "1.25.5" golangci-lint = "2.7.2" goreleaser = "v2.9.0" mdbook = "v0.5.2" # renovate: datasource=github-releases depName=rust-lang/mdbook -ko = "v0.18.0" # renovate: datasource=github-releases depName=ko-build/ko +ko = "v0.18.1" # renovate: datasource=github-releases depName=ko-build/ko [settings] # Experimental features are needed for the Go backend From 6ef140514085c277a0a2ee2cbc8c7911ecb3edc2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 4 Jan 2026 14:32:11 +0000 Subject: [PATCH 257/260] deps: update module github.com/yuin/goldmark to v1.7.14 (#322) 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 b758e14..59787ee 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 - github.com/yuin/goldmark v1.7.13 + github.com/yuin/goldmark v1.7.14 gitlab.com/gitlab-org/api/client-go v0.161.1 ) diff --git a/go.sum b/go.sum index 31a2c93..6e24530 100644 --- a/go.sum +++ b/go.sum @@ -115,8 +115,8 @@ github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKE github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= 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.13 h1:GPddIs617DnBLFFVJFgpo1aBfe/4xcvMc3SB5t/D0pA= -github.com/yuin/goldmark v1.7.13/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +github.com/yuin/goldmark v1.7.14 h1:9F3UqVQdZ5GG5y6TU0l1TbbDhZmqfevaOcinQt88Qi8= +github.com/yuin/goldmark v1.7.14/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= gitlab.com/gitlab-org/api/client-go v0.161.1 h1:XX0EtVGL6cGEdNy9xnJ96CSciIzjCwAVsayItHY1YyU= gitlab.com/gitlab-org/api/client-go v0.161.1/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o= From 60cbffba9d6d382737b65fceabd8aab645383772 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 21:42:52 +0000 Subject: [PATCH 258/260] deps: update module github.com/yuin/goldmark to v1.7.15 (#323) 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 59787ee..713caee 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 - github.com/yuin/goldmark v1.7.14 + github.com/yuin/goldmark v1.7.15 gitlab.com/gitlab-org/api/client-go v0.161.1 ) diff --git a/go.sum b/go.sum index 6e24530..3771a2f 100644 --- a/go.sum +++ b/go.sum @@ -115,8 +115,8 @@ github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKE github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= 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.14 h1:9F3UqVQdZ5GG5y6TU0l1TbbDhZmqfevaOcinQt88Qi8= -github.com/yuin/goldmark v1.7.14/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +github.com/yuin/goldmark v1.7.15 h1:xYJWgq3Qd8qsaZpj5pHKoEI4mosqVZi/qRpq/MdKyyk= +github.com/yuin/goldmark v1.7.15/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= gitlab.com/gitlab-org/api/client-go v0.161.1 h1:XX0EtVGL6cGEdNy9xnJ96CSciIzjCwAVsayItHY1YyU= gitlab.com/gitlab-org/api/client-go v0.161.1/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o= From 2a1a08057b4fa82bb2653cd0ccbb8ebfc4deabcd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 10:02:37 +0000 Subject: [PATCH 259/260] deps: update module github.com/yuin/goldmark to v1.7.16 (#324) 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 713caee..5653239 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 github.com/teekennedy/goldmark-markdown v0.5.1 - github.com/yuin/goldmark v1.7.15 + github.com/yuin/goldmark v1.7.16 gitlab.com/gitlab-org/api/client-go v0.161.1 ) diff --git a/go.sum b/go.sum index 3771a2f..870cb83 100644 --- a/go.sum +++ b/go.sum @@ -115,8 +115,8 @@ github.com/teekennedy/goldmark-markdown v0.5.1 h1:2lIlJ3AcIwaD1wFl4dflJSJFMhRTKE github.com/teekennedy/goldmark-markdown v0.5.1/go.mod h1:so260mNSPELuRyynZY18719dRYlD+OSnAovqsyrOMOM= 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.15 h1:xYJWgq3Qd8qsaZpj5pHKoEI4mosqVZi/qRpq/MdKyyk= -github.com/yuin/goldmark v1.7.15/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= +github.com/yuin/goldmark v1.7.16 h1:n+CJdUxaFMiDUNnWC3dMWCIQJSkxH4uz3ZwQBkAlVNE= +github.com/yuin/goldmark v1.7.16/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= gitlab.com/gitlab-org/api/client-go v0.161.1 h1:XX0EtVGL6cGEdNy9xnJ96CSciIzjCwAVsayItHY1YyU= gitlab.com/gitlab-org/api/client-go v0.161.1/go.mod h1:YqKcnxyV9OPAL5U99mpwBVEgBPz1PK/3qwqq/3h6bao= go.abhg.dev/goldmark/toc v0.11.0 h1:IRixVy3/yVPKvFBc37EeBPi8XLTXrtH6BYaonSjkF8o= From 944b70cee920ec93d17e741d932d6b27f35054bd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 01:43:29 +0000 Subject: [PATCH 260/260] deps: update dependency golangci-lint to v2.8.0 (#325) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- mise.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mise.toml b/mise.toml index 3ebe653..4db342a 100644 --- a/mise.toml +++ b/mise.toml @@ -1,6 +1,6 @@ [tools] go = "1.25.5" -golangci-lint = "2.7.2" +golangci-lint = "2.8.0" goreleaser = "v2.9.0" mdbook = "v0.5.2" # renovate: datasource=github-releases depName=rust-lang/mdbook ko = "v0.18.1" # renovate: datasource=github-releases depName=ko-build/ko