From ce51d658295035d5ac3fde6461be291314106d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thor=20Anker=20Kvisg=C3=A5rd=20Lange?= Date: Tue, 27 Feb 2024 17:15:11 +0100 Subject: [PATCH] fix: Make sure to refresh access token when reading commit information (#3447) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When receiving notification by webhook the forge tries to read information on the latest commit when constructing the pipeline. This requires a call to the Bitbucket API which again requires the access token to be up-to-date. Signed-off-by: Thor Anker Kvisgård Lange --- server/forge/bitbucketdatacenter/bitbucketdatacenter.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/forge/bitbucketdatacenter/bitbucketdatacenter.go b/server/forge/bitbucketdatacenter/bitbucketdatacenter.go index 7b678594a..386be1a80 100644 --- a/server/forge/bitbucketdatacenter/bitbucketdatacenter.go +++ b/server/forge/bitbucketdatacenter/bitbucketdatacenter.go @@ -525,6 +525,8 @@ func (c *client) getUserAndRepo(ctx context.Context, r *model.Repo) (*model.User } log.Trace().Any("user", user).Msg("got user") + forge.Refresh(ctx, c, _store, user) + return user, repo, nil }