Skip to content

Commit 2eca2b9

Browse files
committed
Merge master into prod, release: v1.1.40
2 parents d36e7ff + 5c627f0 commit 2eca2b9

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ curl -X POST --data 'just a text body' -H 'Example-Header: example header value'
264264
by default the server will print what and where it would send (debug mode), so you should see this in the server's log:
265265

266266
```
267-
2017/09/10 16:30:18 ===> Triggering Build: (url:https://www.bitrise.io/app/BITRISE-APP-SLUG/build/start.json)
267+
2017/09/10 16:30:18 ===> Triggering Build: (url:https://app.bitrise.io/app/BITRISE-APP-SLUG/build/start.json)
268268
2017/09/10 16:30:18 ====> JSON body: {"build_params":{"branch":"master","environments":[{"mapped_to":"BITRISE_WEBHOOK_PASSTHROUGH_HEADERS","value":"{\"Accept\":[\"*/*\"],\"Accept-Encoding\":[\"gzip\"],\"Content-Length\":[\"16\"],\"Content-Type\":[\"application/x-www-form-urlencoded\"],\"Example-Header\":[\"example header value\"],\"User-Agent\":[\"curl/7.54.0\"],\"X-Forwarded-For\":[\"::1\"]}","is_expand":false},{"mapped_to":"BITRISE_WEBHOOK_PASSTHROUGH_BODY","value":"just a text body","is_expand":false}]},"triggered_by":"webhook"}
269269
```
270270

@@ -404,6 +404,9 @@ provider implementation.
404404
* Once your transform functions are well tested you should get back to the `TransformRequest` function,
405405
test & implement that too
406406
* You should include a sample webhook data & test, as you can see it in the `github` and `bitbucketv2` services.
407+
* Run the tests & linters with: `bitrise run test`
408+
* To run only the Go tests: `go test ./...`
409+
* To run only the tests of your own package (`github` in this example): `go test ./service/hook/github/...`
407410
* Once the implementation is ready you can register a path/route for the service/provider:
408411
* Open `service/hook/endpoint.go`
409412
* Add your provider to the `supportedProviders` map

bitriseapi/bitriseapi_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import (
99
func TestBuildTriggerURL(t *testing.T) {
1010
t.Log("Endpoint URL doesn't end with /")
1111
{
12-
url, err := BuildTriggerURL("https://www.bitrise.io", "a..............b")
12+
url, err := BuildTriggerURL("https://app.bitrise.io", "a..............b")
1313
require.NoError(t, err)
14-
require.Equal(t, "https://www.bitrise.io/app/a..............b/build/start.json", url.String())
14+
require.Equal(t, "https://app.bitrise.io/app/a..............b/build/start.json", url.String())
1515
}
1616

1717
t.Log("Endpoint URL ends with /")
1818
{
19-
url, err := BuildTriggerURL("https://www.bitrise.io/", "a..............b")
19+
url, err := BuildTriggerURL("https://app.bitrise.io/", "a..............b")
2020
require.NoError(t, err)
21-
require.Equal(t, "https://www.bitrise.io/app/a..............b/build/start.json", url.String())
21+
require.Equal(t, "https://app.bitrise.io/app/a..............b/build/start.json", url.String())
2222
}
2323
}
2424

@@ -71,7 +71,7 @@ func Test_TriggerAPIParamsModel_Validate(t *testing.T) {
7171
}
7272

7373
func TestTriggerBuild(t *testing.T) {
74-
url, err := BuildTriggerURL("https://www.bitrise.io", "app-slug")
74+
url, err := BuildTriggerURL("https://app.bitrise.io", "app-slug")
7575
require.NoError(t, err)
7676

7777
t.Log("Empty trigger api params (invalid)")

service/hook/endpoint.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"github.com/bitrise-io/bitrise-webhooks/metrics"
1212
"github.com/bitrise-io/bitrise-webhooks/service"
1313
"github.com/bitrise-io/bitrise-webhooks/service/hook/assembla"
14+
"github.com/bitrise-io/bitrise-webhooks/service/hook/bitbucketserver"
1415
"github.com/bitrise-io/bitrise-webhooks/service/hook/bitbucketv2"
1516
hookCommon "github.com/bitrise-io/bitrise-webhooks/service/hook/common"
1617
"github.com/bitrise-io/bitrise-webhooks/service/hook/deveo"
@@ -23,7 +24,6 @@ import (
2324
"github.com/bitrise-io/go-utils/colorstring"
2425
"github.com/gorilla/mux"
2526
"github.com/pkg/errors"
26-
"github.com/bitrise-io/bitrise-webhooks/service/hook/bitbucketserver"
2727
)
2828

2929
func supportedProviders() map[string]hookCommon.Provider {
@@ -169,7 +169,7 @@ func HTTPHandler(w http.ResponseWriter, r *http.Request) {
169169
// Let's Trigger a build / some builds!
170170
triggerURL := config.SendRequestToURL
171171
if triggerURL == nil {
172-
u, err := bitriseapi.BuildTriggerURL("https://www.bitrise.io", appSlug)
172+
u, err := bitriseapi.BuildTriggerURL("https://app.bitrise.io", appSlug)
173173
if err != nil {
174174
log.Printf(" [!] Exception: hookHandler: failed to create Build Trigger URL: %s", err)
175175
respondWithErrorString(w, &hookProvider, fmt.Sprintf("Failed to create Build Trigger URL: %s", err))

version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
package version
22

33
// VERSION ...
4-
const VERSION = "1.1.39"
4+
const VERSION = "1.1.40"

0 commit comments

Comments
 (0)