Skip to content

Commit 8fc91ad

Browse files
committed
fix(git-node): do not parse PR-URL from backport PR description
1 parent 22f1f71 commit 8fc91ad

2 files changed

Lines changed: 2 additions & 9 deletions

File tree

lib/metadata_gen.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default class MetadataGenerator {
3131
const parser = new LinkParser(owner, repo, op);
3232
const fixes = parser.getFixes();
3333
const refs = parser.getRefs().filter(f => f !== prUrl);
34-
const altPrUrl = parser.getAltPrUrl();
3534

3635
const meta = [];
3736

@@ -44,12 +43,7 @@ export default class MetadataGenerator {
4443
meta.push(...refs.map((ref) => `Refs: ${ref}`));
4544
}
4645
const backport = this.argv ? this.argv.backport : undefined;
47-
if (backport) {
48-
meta.unshift(`Backport-PR-URL: ${prUrl}`);
49-
meta.unshift(`PR-URL: ${altPrUrl}`);
50-
} else {
51-
meta.unshift(`PR-URL: ${prUrl}`);
52-
}
46+
meta.unshift(`${backport ? 'Backport-' : ''}PR-URL: ${prUrl}`);
5347
meta.push(
5448
...reviewedBy.map((r) => `Reviewed-By: ${r.reviewer.getContact()}`)
5549
);

test/unit/metadata_gen.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ const backportArgv = {
4141
}
4242
};
4343
const backportData = Object.assign({}, data, { pr: backportPR }, backportArgv);
44-
const backportExpected = `PR-URL: https://github.com/nodejs/node/pull/29995
45-
Backport-PR-URL: https://github.com/nodejs/node/pull/30072
44+
const backportExpected = `Backport-PR-URL: https://github.com/nodejs/node/pull/30072
4645
Fixes: https://github.com/nodejs/build/issues/1961
4746
Refs: https://github.com/nodejs/node/commit/53ca0b9ae145c430842bf78e553e3b6cbd2823aa#commitcomment-35494896
4847
Reviewed-By: Foo User <foo@example.com>

0 commit comments

Comments
 (0)