diff --git a/CHANGELOG.md b/CHANGELOG.md index d902aaa9c..7ed91bb7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ignore skip comments when cron event, by [@bradrydzewski](https://github.com/bradrydzewski). [#2835](https://github.com/drone/drone/issues/2835). - support for admission extensions, by [@bradrydzewski](https://github.com/bradrydzewski). [#2043](https://github.com/drone/drone/issues/2043). - endpoint to provide link to git resources, by [@bradrydzewski](https://github.com/bradrydzewski). [#2843](https://github.com/drone/drone/issues/2843). +- improve bitbucket status display text on new pull request screen, by [@bradrydzewski](https://github.com/bradrydzewski). ### Fixed - missing cron job name in user interface, by [@bradrydzewski](https://github.com/bradrydzewski). diff --git a/cmd/drone-server/inject_client.go b/cmd/drone-server/inject_client.go index 7b0c955e7..6c269e8ef 100644 --- a/cmd/drone-server/inject_client.go +++ b/cmd/drone-server/inject_client.go @@ -22,6 +22,7 @@ import ( "io/ioutil" "net/http" "net/http/httputil" + "strings" "github.com/drone/drone/cmd/drone-server/config" "github.com/drone/go-scm/scm" @@ -123,10 +124,10 @@ func provideGiteaClient(config config.Config) *scm.Client { Source: &oauth2.Refresher{ ClientID: config.Gitea.ClientID, ClientSecret: config.Gitea.ClientSecret, - Endpoint: config.Gitea.Server + "/login/oauth/access_token", + Endpoint: strings.TrimSuffix(config.Gitea.Server, "/") + "/login/oauth/access_token", Source: oauth2.ContextTokenSource(), }, - Base: defaultTransport(config.Gitea.SkipVerify), + Base: defaultTransport(config.Gitea.SkipVerify), }, } return client diff --git a/go.mod b/go.mod index c9f292840..375f176c8 100644 --- a/go.mod +++ b/go.mod @@ -20,11 +20,11 @@ require ( github.com/drone/drone-go v1.0.6 github.com/drone/drone-runtime v1.1.0 github.com/drone/drone-ui v0.0.0-20190921185401-7346724427f2 - github.com/drone/drone-yaml v1.2.3-0.20190902155851-ad8ad9816fbf + github.com/drone/drone-yaml v1.2.3-0.20190924213155-be6b37e0b4cd github.com/drone/envsubst v1.0.1 github.com/drone/go-license v1.0.2 github.com/drone/go-login v1.0.4-0.20190311170324-2a4df4f242a2 - github.com/drone/go-scm v1.6.1-0.20190921005131-635e46e88c20 + github.com/drone/go-scm v1.6.1-0.20190925190122-ed2b9269c97d github.com/drone/signal v1.0.0 github.com/dustin/go-humanize v1.0.0 github.com/ghodss/yaml v1.0.0 diff --git a/go.sum b/go.sum index 69d761b44..dbc4711a2 100644 --- a/go.sum +++ b/go.sum @@ -124,6 +124,8 @@ github.com/drone/drone-yaml v1.2.3-0.20190807054305-a4a63fe917cb h1:YsuNqXQD8+Fb github.com/drone/drone-yaml v1.2.3-0.20190807054305-a4a63fe917cb/go.mod h1:QsqliFK8nG04AHFN9tTn9XJomRBQHD4wcejWW1uz/10= github.com/drone/drone-yaml v1.2.3-0.20190902155851-ad8ad9816fbf h1:/devrXEXhpmOrJpPxYxxz3PInxqNzqo6hzxDYVfmwJg= github.com/drone/drone-yaml v1.2.3-0.20190902155851-ad8ad9816fbf/go.mod h1:QsqliFK8nG04AHFN9tTn9XJomRBQHD4wcejWW1uz/10= +github.com/drone/drone-yaml v1.2.3-0.20190924213155-be6b37e0b4cd h1:xbC7iwsybaLuCyjxv7Rf3L+OxqeqJgLDezeg0oTx3iw= +github.com/drone/drone-yaml v1.2.3-0.20190924213155-be6b37e0b4cd/go.mod h1:QsqliFK8nG04AHFN9tTn9XJomRBQHD4wcejWW1uz/10= github.com/drone/envsubst v1.0.1 h1:NOOStingM2sbBwsIUeQkKUz8ShwCUzmqMxWrpXItfPE= github.com/drone/envsubst v1.0.1/go.mod h1:bkZbnc/2vh1M12Ecn7EYScpI4YGYU0etwLJICOWi8Z0= github.com/drone/go-license v1.0.2 h1:7OwndfYk+Lp/cGHkxe4HUn/Ysrrw3WYH2pnd99yrkok= @@ -157,6 +159,8 @@ github.com/drone/go-scm v1.6.1-0.20190920225054-0d1ea63283ad h1:rVQW27ofuahCt6Vu github.com/drone/go-scm v1.6.1-0.20190920225054-0d1ea63283ad/go.mod h1:YT4FxQ3U/ltdCrBJR9B0tRpJ1bYA/PM3NyaLE/rYIvw= github.com/drone/go-scm v1.6.1-0.20190921005131-635e46e88c20 h1:/Ler+K1NlugcNoBPBLMCcWoN73rnPf+Fscdugb8KWYU= github.com/drone/go-scm v1.6.1-0.20190921005131-635e46e88c20/go.mod h1:YT4FxQ3U/ltdCrBJR9B0tRpJ1bYA/PM3NyaLE/rYIvw= +github.com/drone/go-scm v1.6.1-0.20190925190122-ed2b9269c97d h1:mCRC22oGGXPra874ceoKQGIijnLKil4u2X/9klh+1mg= +github.com/drone/go-scm v1.6.1-0.20190925190122-ed2b9269c97d/go.mod h1:YT4FxQ3U/ltdCrBJR9B0tRpJ1bYA/PM3NyaLE/rYIvw= github.com/drone/signal v1.0.0 h1:NrnM2M/4yAuU/tXs6RP1a1ZfxnaHwYkd0kJurA1p6uI= github.com/drone/signal v1.0.0/go.mod h1:S8t92eFT0g4WUgEc/LxG+LCuiskpMNsG0ajAMGnyZpc= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= diff --git a/service/status/status.go b/service/status/status.go index 47c8dbb9a..7bde6d4c2 100644 --- a/service/status/status.go +++ b/service/status/status.go @@ -82,6 +82,7 @@ func (s *service) Send(ctx context.Context, user *core.User, req *core.StatusInp } _, _, err = s.client.Repositories.CreateStatus(ctx, req.Repo.Slug, req.Build.After, &scm.StatusInput{ + Title: fmt.Sprintf("Build #%d", req.Build.Number), Desc: createDesc(req.Build.Status), Label: createLabel(s.name, req.Build.Event), State: convertStatus(req.Build.Status), diff --git a/service/status/status_test.go b/service/status/status_test.go index 89d68551e..70d7426ac 100644 --- a/service/status/status_test.go +++ b/service/status/status_test.go @@ -28,6 +28,7 @@ func TestStatus(t *testing.T) { mockRenewer.EXPECT().Renew(gomock.Any(), mockUser, false).Return(nil) statusInput := &scm.StatusInput{ + Title: "Build #1", State: scm.StateSuccess, Label: "continuous-integration/drone/push", Desc: "Build is passing", @@ -65,6 +66,7 @@ func TestStatus_ErrNotSupported(t *testing.T) { mockRenewer.EXPECT().Renew(gomock.Any(), mockUser, false).Return(nil) statusInput := &scm.StatusInput{ + Title: "Build #1", State: scm.StateSuccess, Label: "continuous-integration/drone/push", Desc: "Build is passing",