-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show modal with error message when release is blocked
- Loading branch information
1 parent
a4a62a3
commit c8b1a8a
Showing
10 changed files
with
187 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/api/pipelines/github.com/estafette/estafette-ci-api/releases/POST.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const { delay, type, file } = require('connect-api-mocker/helpers') | ||
const path = require('path') | ||
|
||
module.exports = [delay(500), type('application/json'), file(path.join(__dirname, './post.json'))] |
4 changes: 4 additions & 0 deletions
4
docs/api/pipelines/github.com/estafette/estafette-ci-api/releases/post.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"code": 403, | ||
"message": "Release not allowed on this branch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
mocks/api/pipelines/github.com/estafette/estafette-ci-api/releases/POST.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { | ||
type, | ||
file | ||
} = require('connect-api-mocker/helpers') | ||
const path = require('path') | ||
|
||
module.exports = function (req, res) { | ||
type('application/json')(req, res, () => { | ||
if (req.body && req.body.releaseVersion.includes('-main-')) { | ||
res.statusCode = 201 | ||
file(path.join(__dirname, './post-201.json'))(req, res) | ||
} else { | ||
res.statusCode = 403 | ||
file(path.join(__dirname, './post-403.json'))(req, res) | ||
} | ||
}) | ||
} |
16 changes: 16 additions & 0 deletions
16
mocks/api/pipelines/github.com/estafette/estafette-ci-api/releases/post-201.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "tooling-estafette", | ||
"action": "release", | ||
"id": "12313", | ||
"repoSource": "github.com", | ||
"repoOwner": "estafette", | ||
"repoName": "estafette-ci-api", | ||
"releaseVersion": "xyz", | ||
"releaseStatus": "succeeded", | ||
"triggerEvents": [], | ||
"insertedAt": "2006-01-02 15:04:05.999999999 -0700 MST", | ||
"startedAt": "2006-01-02 15:04:05.999999999 -0700 MST", | ||
"updatedAt": "2006-01-02 15:04:05.999999999 -0700 MST", | ||
"duration": 30000, | ||
"pendingDuration": 0 | ||
} |
12 changes: 12 additions & 0 deletions
12
mocks/api/pipelines/github.com/estafette/estafette-ci-api/releases/post-403.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"code": "Forbidden", | ||
"error": { | ||
"cluster": "abc1", | ||
"message": "Release not allowed on this branch", | ||
"repositoryReleaseControl": { | ||
"allowed": [ | ||
"main" | ||
] | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters