From ec02379b04aa65935d1c7ecb40510f2ce12fbc03 Mon Sep 17 00:00:00 2001 From: Joan Flotats <96056718+j04n-f@users.noreply.github.com> Date: Tue, 30 Jul 2024 20:37:33 +0200 Subject: [PATCH] Use Bitbucket PR title for pipeline message (#3984) --- server/forge/bitbucket/convert.go | 2 +- server/forge/bitbucket/convert_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server/forge/bitbucket/convert.go b/server/forge/bitbucket/convert.go index a3b1376b7..05588b8d4 100644 --- a/server/forge/bitbucket/convert.go +++ b/server/forge/bitbucket/convert.go @@ -178,7 +178,7 @@ func convertPullHook(from *internal.PullRequestHook) *model.Pipeline { ), ForgeURL: from.PullRequest.Links.HTML.Href, Branch: from.PullRequest.Source.Branch.Name, - Message: from.PullRequest.Desc, + Message: from.PullRequest.Title, Avatar: from.Actor.Links.Avatar.Href, Author: from.Actor.Login, Sender: from.Actor.Login, diff --git a/server/forge/bitbucket/convert_test.go b/server/forge/bitbucket/convert_test.go index ee47a2770..b1adad929 100644 --- a/server/forge/bitbucket/convert_test.go +++ b/server/forge/bitbucket/convert_test.go @@ -131,7 +131,7 @@ func Test_helper(t *testing.T) { hook.PullRequest.Source.Repo.FullName = "baz/bar" hook.PullRequest.Source.Commit.Hash = "c8411d7" hook.PullRequest.Links.HTML.Href = "https://bitbucket.org/foo/bar/pulls/5" - hook.PullRequest.Desc = "updated README" + hook.PullRequest.Title = "updated README" hook.PullRequest.Updated = time.Now() pipeline := convertPullHook(hook) @@ -143,7 +143,7 @@ func Test_helper(t *testing.T) { g.Assert(pipeline.ForgeURL).Equal(hook.PullRequest.Links.HTML.Href) g.Assert(pipeline.Ref).Equal("refs/heads/change") g.Assert(pipeline.Refspec).Equal("change:main") - g.Assert(pipeline.Message).Equal(hook.PullRequest.Desc) + g.Assert(pipeline.Message).Equal(hook.PullRequest.Title) g.Assert(pipeline.Timestamp).Equal(hook.PullRequest.Updated.Unix()) })