Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/pr_checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,11 @@ export default class PRChecker {
const labels = pr.labels.nodes.map((l) => l.name);

let isFastTracked = labels.includes('fast-track');
const isCodeAndLearn = labels.includes('code-and-learn');
const isSemverMajor = labels.includes('semver-major');
// NOTE: a semver-major PR with fast-track should have either one of
// these labels removed because that doesn't make sense
if (isFastTracked) {
cli.info('This PR is being fast-tracked');
} else if (isCodeAndLearn) {
cli.info('This PR is being fast-tracked because ' +
'it is from a Code and Learn event');
}

if (approved.length === 0 || requestedChanges.length > 0) {
Expand Down Expand Up @@ -273,7 +269,7 @@ export default class PRChecker {
};

if (approved.length >= 2) {
if (isFastTracked || isCodeAndLearn) {
if (isFastTracked) {
return true;
}
if (timeLeftMulti < 0) {
Expand Down
23 changes: 0 additions & 23 deletions test/fixtures/code_and_learn_pr.json

This file was deleted.

46 changes: 0 additions & 46 deletions test/unit/pr_checker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,52 +562,6 @@ describe('PRChecker', () => {
cli.assertCalledWith(expectedLogs);
});

it('should fast track code-and-learn PRs', () => {
const cli = new TestCLI();

const expectedLogs = {
ok:
[['Approvals: 4'],
['- Foo User (@foo): https://github.com/nodejs/node/pull/16438#pullrequestreview-71480624'],
['- Quux User (@Quux): LGTM'],
['- Baz User (@Baz): https://github.com/nodejs/node/pull/16438#pullrequestreview-71488236'],
['- Bar User (@bar) (TSC): lgtm']],
info:
[['This PR was created on Fri, 30 Nov 2018 17:50:44 GMT'],
['This PR is being fast-tracked because ' +
'it is from a Code and Learn event']
]
};

const pr = Object.assign({}, firstTimerPR, {
createdAt: LT_48H,
labels: {
nodes: [
{ name: 'code-and-learn' }
]
}
});

const data = {
pr,
reviewers: allGreenReviewers,
comments: commentsWithCI,
reviews: approvingReviews,
commits: [],
collaborators,
authorIsNew: () => true,
getThread() {
return PRData.prototype.getThread.call(this);
}
};
const checker = new PRChecker(cli, data, {}, argv);

cli.clearCalls();
const status = checker.checkReviewsAndWait(new Date(NOW));
assert(status);
cli.assertCalledWith(expectedLogs);
});

it('should check the last fast-track request comment', () => {
const cli = new TestCLI();

Expand Down
Loading