Skip to content

Commit 731818c

Browse files
authored
fix: compliance ADR #9 (#93)
1 parent 5d71cc0 commit 731818c

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

lib/actions/pullRequest.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ exports.validatePR = async function validatePR({ pullRequest, issue }) {
2929
!baseRef.match(/^hotfix\//)
3030
) {
3131
throw new Error(
32-
`As this pull request is based on “${baseRef}”, its name should start with “${baseRef}--”. See https://www.notion.so/mobsuccess/Git-Guidelines-41996ef576cb4f29b7737772b74289c5#f9cadc10d949498dbe38c0eed08fd4f8`
32+
`As this pull request is based on “${baseRef}”, its name should start with “${baseRef}--”. See https://github.com/mobsuccess-devops/rfc/blob/master/docs/decisions/0009-convention-nommage-branch-pr.md`
3333
);
3434
}
3535

3636
if (!isBranchNameValid(headRef)) {
3737
throw new Error(
38-
`This pull request is based on a branch with in invalid name: “${headRef}”. See https://github.com/mobsuccess-devops/rfc/blob/master/docs/decisions/0009-convention-nommage-branch-pr.md and https://www.notion.so/mobsuccess/Git-Guidelines-41996ef576cb4f29b7737772b74289c5#f9cadc10d949498dbe38c0eed08fd4f8`
38+
`This pull request is based on a branch with in invalid name: “${headRef}”. See https://github.com/mobsuccess-devops/rfc/blob/master/docs/decisions/0009-convention-nommage-branch-pr.md`
3939
);
4040
}
4141

4242
if (!isPullRequestTitleValid(title)) {
4343
throw new Error(
44-
`The title of this pull request is invalid, please edit: “${title}”. See https://www.notion.so/mobsuccess/Git-Guidelines-41996ef576cb4f29b7737772b74289c5#4ac148fd42a04141a528a87013ea5c57`
44+
`The title of this pull request is invalid, please edit: “${title}”. See https://github.com/mobsuccess-devops/rfc/blob/master/docs/decisions/0009-convention-nommage-branch-pr.md`
4545
);
4646
}
4747

lib/branch.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
function isBranchNameValid(branchName) {
22
return (
3-
// The following are the older branch prefixes, that are still valid, with
4-
// discussions pending on the ADR #9 with a PR #35 still active at the time
5-
// of writing, to maybe deprecate them. In the meantime we still have to
6-
// allow branches using these prefixes, as no active ADR disallows their
7-
// use.
8-
!!branchName.match(
9-
/^(core|feature|fix|hotfix|asset|rework|documentation)\/([a-z][a-z0-9._-]*)$/
10-
) ||
113
!!branchName.match(
124
/^(feat|fix|chore|docs|refactor|test|revert|ci|perf|style|build|change|remove|poc|mobsuccessbot|dependabot)\/([a-z][a-z0-9._-]*)$/
135
) ||

lib/branch.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ describe("branch", () => {
2020
});
2121
// Some tests were commented out, see #92.
2222
test.each([
23-
// "core/foo--bar",
24-
// "core/foo--bar--z",
23+
"core/foo--bar",
24+
"core/foo--bar--z",
2525
"foo/foo-bar",
26-
// "feature/foo",
27-
// "hotfix/foo",
28-
// "core/foo",
29-
// "asset/foo",
30-
// "documentation/foo",
26+
"feature/foo",
27+
"hotfix/foo",
28+
"core/foo",
29+
"asset/foo",
30+
"documentation/foo",
3131
"chore",
3232
"chore/",
3333
"chore/FOO",

0 commit comments

Comments
 (0)