Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PRChecker: support new label fast-track #104

Merged
merged 3 commits into from
Nov 23, 2017

Conversation

priyank-p
Copy link
Contributor

Now core has the label fast-track and a PR that uses that label so i think it is time to add support for new label that @joyeecheung opened a issue for.

@codecov
Copy link

codecov bot commented Nov 10, 2017

Codecov Report

Merging #104 into master will increase coverage by 0.17%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   91.11%   91.28%   +0.17%     
==========================================
  Files          14       14              
  Lines         540      551      +11     
==========================================
+ Hits          492      503      +11     
  Misses         48       48
Impacted Files Coverage Δ
lib/pr_checker.js 97.14% <100%> (+0.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b22d056...41cc603. Read the comment docs.

@refack
Copy link
Contributor

refack commented Nov 10, 2017

Optional: still emit a warning that it's a fast-tracked PR and the lander should double check, and use discretion.

@priyank-p
Copy link
Contributor Author

@refack i think that was a good suggestion to add warn msg for fast-track commits. done

@joyeecheung
Copy link
Member

Hmmm, do we need to warn about that tho? Maybe info?

@joyeecheung
Copy link
Member

(This reminds me I forgot to open the PR to update collaborator's guide!....)

Copy link
Member

@joyeecheung joyeecheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably wait until the label is actually documented in the collaborator guide..

(labels.length === 1 && labels[0].name === 'doc');

if (isFastTrack) {
cli.warn('No wait time! "fast-track" labelled PR.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just: This PR is being fast-tracked, they can always look up the labels in the logIntro() messages. Also I prefer an info over warning.

@@ -164,6 +172,11 @@ class PRChecker {
return false;
}

function isFast(label) {
isFastTrack = label === 'fast-track';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a closure here? All the checks can be done in the function passed to labels.some()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung To check afterwards if the label was fast-track and log the message out.

Copy link
Member

@joyeecheung joyeecheung Nov 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cPhost But now that we don't log that in the messages...we don't really need this right? All we need is

const fast = labels.some(l => ['code-and-learn', 'fast-track'].includes(l.name)) ||
  (labels.length === 1 && labels[0].name === 'doc');
if (fast) {
  cli.info(...)
  return true;
}

Copy link
Contributor Author

@priyank-p priyank-p Nov 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung Oh i though we do not count code-and-learn fixing it right now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@priyank-p
Copy link
Contributor Author

@joyeecheung fixed it.

@priyank-p
Copy link
Contributor Author

priyank-p commented Nov 11, 2017

Adding do-not-land label until the PR is ready to get merged.

(I though the label was ready to go in core. But it seems like it not yet!)

@priyank-p priyank-p added the do not land PR's that are on hold, and shouldn't land label Nov 11, 2017
@joyeecheung
Copy link
Member

BTW: nodejs/node#17056 has landed, the current rule is:

When a pull request is deemed suitable to be fast-tracked, label it with fast-track. The pull request can be landed once 2 or more collaborators approve both the pull request and the fast-tracking request, and the necessary CI testing is done.

@priyank-p priyank-p added Work In Progress PR's that are in progress and removed do not land PR's that are on hold, and shouldn't land labels Nov 18, 2017
@priyank-p
Copy link
Contributor Author

@joyeecheung just want to know if the code-and-learn and/or doc PRs counts as fast-tracked because we currently count them as being fast-tracked.

BTW this is what i currently have:

# if it can be fast-tracked, have two approvals a CI cli.info
This PR is being fast-tracked
# else if missing approvals or ci or both cli.warn
This PR is being fast-tracked, but awaiting approvals of 2 contributors # or
This PR is being fast-tracked, but awaiting a CI run # or
This PR is being fast-tracked, but awaiting approvals of 2 contributors and a CI run

and so it will warn if there is CI for docs (IIRC there is no CI testing for docs or maybe its linter)

@joyeecheung
Copy link
Member

@cPhost I would suggest to skip the code-and-learn and doc rules and just check for fast-track. If it should be fast-tracked, people should label it.

@priyank-p priyank-p removed the Work In Progress PR's that are in progress label Nov 21, 2017
@priyank-p
Copy link
Contributor Author

@joyeecheung done.

@joyeecheung joyeecheung merged commit 4932d07 into nodejs:master Nov 23, 2017
@priyank-p priyank-p deleted the fast-track-label branch November 23, 2017 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants