Skip to content

Commit 3f51502

Browse files
committed
Revert "feat(ncu-ci): check for request-ci label (nodejs#806)"
This reverts commit 6cc2b1a.
1 parent 4a03216 commit 3f51502

11 files changed

+1
-209
lines changed

lib/ci/run_ci.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class RunPRJob {
2727
this.certifySafe =
2828
certifySafe ||
2929
Promise.all([this.prData.getReviews(), this.prData.getPR()]).then(() =>
30-
new PRChecker(cli, this.prData, request, {}).checkCommitsAfterReviewOrLabel()
30+
new PRChecker(cli, this.prData, request, {}).checkCommitsAfterReview()
3131
);
3232
}
3333

lib/pr_checker.js

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -524,32 +524,6 @@ export default class PRChecker {
524524
return true;
525525
}
526526

527-
async checkCommitsAfterReviewOrLabel() {
528-
if (this.checkCommitsAfterReview()) return true;
529-
530-
await Promise.all([this.data.getLabeledEvents(), this.data.getCollaborators()]);
531-
532-
const {
533-
cli, data, pr
534-
} = this;
535-
536-
const { updatedAt } = pr.timelineItems;
537-
const requestCiLabels = data.labeledEvents.findLast(
538-
({ createdAt, label: { name } }) => name === 'request-ci' && createdAt > updatedAt
539-
);
540-
if (requestCiLabels == null) return false;
541-
542-
const { actor: { login } } = requestCiLabels;
543-
const collaborators = Array.from(data.collaborators.values(),
544-
(c) => c.login.toLowerCase());
545-
if (collaborators.includes(login.toLowerCase())) {
546-
cli.info('request-ci label was added by a Collaborator after the last push event.');
547-
return true;
548-
}
549-
550-
return false;
551-
}
552-
553527
checkCommitsAfterReview() {
554528
const {
555529
commits, reviews, cli, argv

lib/pr_data.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
} from './user_status.js';
66

77
// lib/queries/*.gql file names
8-
const LABELED_EVENTS_QUERY = 'PRLabeledEvents';
98
const PR_QUERY = 'PR';
109
const REVIEWS_QUERY = 'Reviews';
1110
const COMMENTS_QUERY = 'PRComments';
@@ -34,7 +33,6 @@ export default class PRData {
3433
this.comments = [];
3534
this.commits = [];
3635
this.reviewers = [];
37-
this.labeledEvents = [];
3836
}
3937

4038
getThread() {
@@ -92,14 +90,6 @@ export default class PRData {
9290
]);
9391
}
9492

95-
async getLabeledEvents() {
96-
const { prid, owner, repo, cli, request, prStr } = this;
97-
const vars = { prid, owner, repo };
98-
cli.updateSpinner(`Getting labels from ${prStr}`);
99-
this.labeledEvents = (await request.gql(LABELED_EVENTS_QUERY, vars))
100-
.repository.pullRequest.timelineItems.nodes;
101-
}
102-
10393
async getComments() {
10494
const { prid, owner, repo, cli, request, prStr } = this;
10595
const vars = { prid, owner, repo };

lib/queries/PRLabeledEvents.gql

Lines changed: 0 additions & 19 deletions
This file was deleted.

test/fixtures/data.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,3 @@ for (const subdir of readdirSync(path('./jenkins'))) {
134134
readJSON(`./jenkins/${subdir}/${item}`);
135135
}
136136
};
137-
138-
export const labeledEvents = {};
139-
140-
for (const item of readdirSync(path('./labeled_events'))) {
141-
if (!item.endsWith('.json')) {
142-
continue;
143-
}
144-
labeledEvents[basename(item, '.json')] = readJSON(`./labeled_events/${item}`);
145-
}

test/fixtures/first_timer_pr.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
}
2323
]
2424
},
25-
"timelineItems": { "updatedAt": "2017-10-24T11:13:43Z" },
2625
"title": "test: awesome changes",
2726
"baseRefName": "main",
2827
"headRefName": "awesome-changes"

test/fixtures/labeled_events/no-request-ci.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/fixtures/labeled_events/old-request-ci-collaborator.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/fixtures/labeled_events/recent-request-ci-collaborator.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/fixtures/labeled_events/recent-request-ci-non-collaborator.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)