Skip to content

Commit b6ed55e

Browse files
authored
Merge pull request #916 from semantic-release/add/warn
chore(deps): bump minimum peer dependency bound with `semantic-release`
2 parents 39aa5b5 + 5bef865 commit b6ed55e

12 files changed

+126
-48
lines changed

README.md

+33-33
Large diffs are not rendered by default.

lib/fail.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export default async function fail(pluginConfig, context, { Octokit }) {
3232

3333
if (failComment === false || failTitle === false) {
3434
logger.log("Skip issue creation.");
35-
// TODO: use logger.warn() instead of logger.log()
36-
logger.log(
35+
logger.warn(
3736
`DEPRECATION: 'false' for 'failComment' or 'failTitle' is deprecated and will be removed in a future major version. Use 'failCommentCondition' instead.`,
3837
);
3938
} else if (failCommentCondition === false) {

lib/success.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export default async function success(pluginConfig, context, { Octokit }) {
6262
logger.log("No commits found in release");
6363
}
6464
logger.log("Skip commenting on issues and pull requests.");
65-
// TODO: use logger.warn() instead of logger.log()
66-
logger.log(
65+
logger.warn(
6766
`DEPRECATION: 'false' for 'successComment' is deprecated and will be removed in a future major version. Use 'successCommentCondition' instead.`,
6867
);
6968
} else if (successCommentCondition === false) {
@@ -387,6 +386,8 @@ const baseFields = `
387386
url
388387
name
389388
color
389+
description
390+
isDefault
390391
}
391392
}
392393
milestone {
@@ -522,7 +523,16 @@ function buildIssuesOrPRsFromResponseNode(responseNodes, type = "ISSUE") {
522523
number: node.number,
523524
title: node.title,
524525
body: node.body,
525-
labels: node.labels?.nodes.map((label) => label.name),
526+
labels: node.labels?.nodes.map((label) => {
527+
return {
528+
id: label.id,
529+
url: label.url,
530+
name: label.name,
531+
color: label.color,
532+
description: label.description,
533+
default: label.isDefault,
534+
};
535+
}),
526536
html_url: node.url,
527537
created_at: node.createdAt,
528538
updated_at: node.updatedAt,

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
]
102102
},
103103
"peerDependencies": {
104-
"semantic-release": ">=20.1.0"
104+
"semantic-release": ">=24.1.0"
105105
},
106106
"publishConfig": {
107107
"access": "public",

test/add-channel.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ test.beforeEach((t) => {
1212
// Mock logger
1313
t.context.log = sinon.stub();
1414
t.context.error = sinon.stub();
15-
t.context.logger = { log: t.context.log, error: t.context.error };
15+
t.context.warn = sinon.stub();
16+
t.context.logger = {
17+
log: t.context.log,
18+
error: t.context.error,
19+
warn: t.context.warn,
20+
};
1621
});
1722

1823
test("Update a release", async (t) => {

test/fail.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ test.beforeEach((t) => {
1414
// Mock logger
1515
t.context.log = sinon.stub();
1616
t.context.error = sinon.stub();
17-
t.context.logger = { log: t.context.log, error: t.context.error };
17+
t.context.warn = sinon.stub();
18+
t.context.logger = {
19+
log: t.context.log,
20+
error: t.context.error,
21+
warn: t.context.warn,
22+
};
1823
});
1924

2025
test("Open a new issue with the list of errors", async (t) => {

test/find-sr-issue.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ test.beforeEach((t) => {
1010
// Mock logger
1111
t.context.log = sinon.stub();
1212
t.context.error = sinon.stub();
13-
t.context.logger = { log: t.context.log, error: t.context.error };
13+
t.context.warn = sinon.stub();
14+
t.context.logger = {
15+
log: t.context.log,
16+
error: t.context.error,
17+
warn: t.context.warn,
18+
};
1419
});
1520

1621
test("Filter out issues without ID", async (t) => {

test/integration.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ test.beforeEach(async (t) => {
1414
// Stub the logger
1515
t.context.log = sinon.stub();
1616
t.context.error = sinon.stub();
17-
t.context.logger = { log: t.context.log, error: t.context.error };
17+
t.context.warn = sinon.stub();
18+
t.context.logger = {
19+
log: t.context.log,
20+
error: t.context.error,
21+
warn: t.context.warn,
22+
};
1823
});
1924

2025
test("Verify GitHub auth", async (t) => {

test/publish.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ test.beforeEach((t) => {
1515
// Mock logger
1616
t.context.log = sinon.stub();
1717
t.context.error = sinon.stub();
18-
t.context.logger = { log: t.context.log, error: t.context.error };
18+
t.context.warn = sinon.stub();
19+
t.context.logger = {
20+
log: t.context.log,
21+
error: t.context.error,
22+
warn: t.context.warn,
23+
};
1924
});
2025

2126
test("Publish a release without creating discussion", async (t) => {

test/success.test.js

+41-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ test.beforeEach((t) => {
1616
// Mock logger
1717
t.context.log = sinon.stub();
1818
t.context.error = sinon.stub();
19-
t.context.logger = { log: t.context.log, error: t.context.error };
19+
t.context.warn = sinon.stub();
20+
t.context.logger = {
21+
log: t.context.log,
22+
error: t.context.error,
23+
warn: t.context.warn,
24+
};
2025
});
2126

2227
test("Add comment and labels to PRs associated with release commits and issues solved by PR/commits comments", async (t) => {
@@ -125,6 +130,8 @@ test("Add comment and labels to PRs associated with release commits and issues s
125130
url: "label_url",
126131
name: "label_name",
127132
color: "ededed",
133+
description: "this is a label description",
134+
isDefault: false,
128135
},
129136
],
130137
},
@@ -159,6 +166,8 @@ test("Add comment and labels to PRs associated with release commits and issues s
159166
url: "label_url",
160167
name: "label_name",
161168
color: "ededed",
169+
description: "this is a label description",
170+
isDefault: false,
162171
},
163172
],
164173
},
@@ -432,6 +441,8 @@ test("Add comment and labels to PRs associated with release commits and issues (
432441
url: "label_url",
433442
name: "label_name",
434443
color: "ededed",
444+
description: "this is a label description",
445+
isDefault: false,
435446
},
436447
],
437448
},
@@ -466,6 +477,8 @@ test("Add comment and labels to PRs associated with release commits and issues (
466477
url: "label_url",
467478
name: "label_name",
468479
color: "ededed",
480+
description: "this is a label description",
481+
isDefault: false,
469482
},
470483
],
471484
},
@@ -685,6 +698,8 @@ test("Add comment and labels to PRs associated with release commits and issues c
685698
url: "label_url",
686699
name: "label_name",
687700
color: "ededed",
701+
description: "this is a label description",
702+
isDefault: false,
688703
},
689704
],
690705
},
@@ -719,6 +734,8 @@ test("Add comment and labels to PRs associated with release commits and issues c
719734
url: "label_url",
720735
name: "label_name",
721736
color: "ededed",
737+
description: "this is a label description",
738+
isDefault: false,
722739
},
723740
],
724741
},
@@ -1578,6 +1595,8 @@ test("Do not add comment and labels to PR/issues from other repo", async (t) =>
15781595
url: "label_url",
15791596
name: "label_name",
15801597
color: "ededed",
1598+
description: "this is a label description",
1599+
isDefault: false,
15811600
},
15821601
],
15831602
},
@@ -1758,6 +1777,8 @@ test("Ignore missing and forbidden issues/PRs", async (t) => {
17581777
url: "label_url",
17591778
name: "label_name",
17601779
color: "ededed",
1780+
description: "this is a label description",
1781+
isDefault: false,
17611782
},
17621783
],
17631784
},
@@ -1792,6 +1813,8 @@ test("Ignore missing and forbidden issues/PRs", async (t) => {
17921813
url: "label_url",
17931814
name: "label_name",
17941815
color: "ededed",
1816+
description: "this is a label description",
1817+
isDefault: false,
17951818
},
17961819
],
17971820
},
@@ -1826,6 +1849,8 @@ test("Ignore missing and forbidden issues/PRs", async (t) => {
18261849
url: "label_url",
18271850
name: "label_name",
18281851
color: "ededed",
1852+
description: "this is a label description",
1853+
isDefault: false,
18291854
},
18301855
],
18311856
},
@@ -3478,7 +3503,7 @@ test('Add comment and label to found issues/associatedPR using the "successComme
34783503
failTitle,
34793504
// Issues with the label "semantic-release-relevant" will be commented and labeled
34803505
successCommentCondition:
3481-
"<% return issue.labels.includes('semantic-release-relevant'); %>",
3506+
"<% return issue.labels?.some((label) => { return label.name === ('semantic-release-relevant'); }); %>",
34823507
};
34833508
const options = {
34843509
repositoryUrl: `https://github.com/${owner}/${repo}.git`,
@@ -3527,6 +3552,8 @@ test('Add comment and label to found issues/associatedPR using the "successComme
35273552
url: "https://github.com/babblebey/sr-github/labels/released",
35283553
name: "semantic-release-relevant",
35293554
color: "ededed",
3555+
description: "This issue is relevant to semantic-release",
3556+
isDefault: false,
35303557
},
35313558
],
35323559
},
@@ -3575,6 +3602,8 @@ test('Add comment and label to found issues/associatedPR using the "successComme
35753602
url: "https://github.com/babblebey/sr-github/labels/released",
35763603
name: "released",
35773604
color: "ededed",
3605+
description: "this is a label description",
3606+
isDefault: false,
35783607
},
35793608
],
35803609
},
@@ -3773,6 +3802,8 @@ test('Does not comment/label associatedPR and relatedIssues created by "Bots"',
37733802
url: "label_url",
37743803
name: "label_name",
37753804
color: "ededed",
3805+
description: "this is a label description",
3806+
isDefault: false,
37763807
},
37773808
],
37783809
},
@@ -3819,6 +3850,8 @@ test('Does not comment/label associatedPR and relatedIssues created by "Bots"',
38193850
url: "label_url",
38203851
name: "label_name",
38213852
color: "ededed",
3853+
description: "this is a label description",
3854+
isDefault: false,
38223855
},
38233856
],
38243857
},
@@ -3910,6 +3943,8 @@ test('Does not comment/label associatedPR and relatedIssues created by "Bots"',
39103943
url: "label_url",
39113944
name: "label_name",
39123945
color: "ededed",
3946+
description: "this is a label description",
3947+
isDefault: false,
39133948
},
39143949
],
39153950
},
@@ -3944,6 +3979,8 @@ test('Does not comment/label associatedPR and relatedIssues created by "Bots"',
39443979
url: "label_url",
39453980
name: "label_name",
39463981
color: "ededed",
3982+
description: "this is a label description",
3983+
isDefault: false,
39473984
},
39483985
],
39493986
},
@@ -4158,6 +4195,8 @@ test('Does not comment/label "associatedPR" when "successCommentCondition" disab
41584195
url: "label_url",
41594196
name: "label_name",
41604197
color: "ededed",
4198+
description: "this is a label description",
4199+
isDefault: false,
41614200
},
41624201
],
41634202
},

test/verify.test.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ test.beforeEach((t) => {
1212
// Mock logger
1313
t.context.log = sinon.stub();
1414
t.context.error = sinon.stub();
15-
t.context.logger = { log: t.context.log, error: t.context.error };
15+
t.context.warn = sinon.stub();
16+
t.context.logger = {
17+
log: t.context.log,
18+
error: t.context.error,
19+
warn: t.context.warn,
20+
};
1621
});
1722

1823
test("Verify package, token and repository access", async (t) => {

0 commit comments

Comments
 (0)