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

Fix #217: Removes PR from Blocking Bugs Milestone #249

Closed
wants to merge 18 commits into from

Conversation

SAEb-ai
Copy link
Contributor

@SAEb-ai SAEb-ai commented Apr 6, 2021

Explanation

Fixes #217. It removes PR from Blocking Bugs Milestone

Checklist

  • I have successfully deployed my own instance of Oppiabot.
    • You can find instructions for doing this here.
  • I have manually tested all the changes made in this PR following the manual tests matrix.

@SAEb-ai SAEb-ai marked this pull request as ready for review April 8, 2021 07:57
@SAEb-ai
Copy link
Contributor Author

SAEb-ai commented Apr 8, 2021

@jameesjohn @vojtechjelinek PTAL. I just want to get the confirmation that the method which I have adopted to remove milestone from PR looks good or not and then I will try to work on the failure of frontend tests.
Thanks!

@vojtechjelinek
Copy link
Member

The approach looks correct.

Copy link
Contributor

@jameesjohn jameesjohn left a comment

Choose a reason for hiding this comment

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

Thanks, @SAEb-ai!
I took the first pass.

@@ -31,8 +31,10 @@ const {
oppiaDevWorkflowTeam,
serverJobAdmins,
} = require('../userWhitelist.json');
const { Octokit } = require('probot');
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

index.js Outdated
case constants.prMilestoneCheck:
callable.push(
checkPullRequestLabelsModule.checkForMilestone(context)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
)
);

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

@@ -143,6 +144,7 @@ module.exports.issuesLabelCheck = issuesLabelCheck;
module.exports.issuesAssignedCheck = issuesAssignedCheck;
module.exports.datastoreLabelCheck = datastoreLabelCheck;
module.exports.prLabelCheck = prLabelCheck;
module.exports.prMilestoneCheck = prMilestoneCheck;
Copy link
Contributor

Choose a reason for hiding this comment

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

You should probably add the milestoned event and specify that the prMilestoneCheck be run.
See how other events like the openEvent were done.

oppiabot/constants.js

Lines 71 to 74 in ec404f4

'oppia': {
[openEvent]: [
claCheck,
changelogCheck,

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

@@ -110,6 +110,11 @@ const runChecks = async (context, checkEvent) => {
checkPullRequestLabelsModule.checkForIssueLabel(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this feature listens for a new event, there should be an entry where oppiabot listens for the event. Similar to

oppiabot/index.js

Lines 237 to 241 in ec404f4

oppiabot.on('pull_request.labeled', async (context) => {
if (checkWhitelistedAccounts(context) && checkAuthor(context)) {
await runChecks(context, constants.PRLabelEvent);
}
});

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

const commentBody =
'Hi @' + user.login + ', the ' + milestone.title +
' milestone should only be ' +
'used on issues, and Im removing the milestone. Thanks!';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'used on issues, and Im removing the milestone. Thanks!';
'used on issues, and I'm removing the milestone. Thanks!';

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

@oppiabot
Copy link

oppiabot bot commented Apr 16, 2021

Hi @SAEb-ai. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

@SAEb-ai SAEb-ai requested a review from jameesjohn April 16, 2021 19:15
@SAEb-ai SAEb-ai removed their assignment Apr 16, 2021
@SAEb-ai
Copy link
Contributor Author

SAEb-ai commented Apr 16, 2021

@jameesjohn @vojtechjelinek PTAL

Copy link
Member

@vojtechjelinek vojtechjelinek left a comment

Choose a reason for hiding this comment

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

Thanks! Left two comments.

@@ -33,6 +33,7 @@ const {
} = require('../userWhitelist.json');
const DEFAULT_CHANGELOG_LABEL = 'REVIEWERS: Please add changelog label';
const PR_LABELS = ['dependencies', 'stale', DEFAULT_CHANGELOG_LABEL];
const MILESTONES = ['Blocking Bugs'];
Copy link
Member

Choose a reason for hiding this comment

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

Can we get the milestones from GitHub? If not this should be probably added as a constant in constants.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it in constants.js. Done!

const commentBody =
'Hi @' + user.login + ', the ' + milestone.title +
' milestone should only be ' +
'used on issues, and I’m removing the milestone. Thanks!';
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
'used on issues, and I’m removing the milestone. Thanks!';
'used for issues. I’m removing the milestone from this PR. Thanks!';

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

@SAEb-ai
Copy link
Contributor Author

SAEb-ai commented Aug 26, 2021

@vojtechjelinek @jameesjohn @gp201 PTAL.Thanks!

@oppiabot oppiabot bot assigned gp201, jameesjohn and vojtechjelinek and unassigned SAEb-ai Aug 26, 2021
@oppiabot
Copy link

oppiabot bot commented Aug 26, 2021

Unassigning @SAEb-ai since a re-review was requested. @SAEb-ai, please make sure you have addressed all review comments. Thanks!

Comment on lines +143 to +145
const milestones = ['Regressions (August 2021)',
'Hotlist (August 2021)',
'Py3 Migration QA (June 2021)'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jameesjohn Can we extract the milestones of a repository from github API because this doesn't look to be an optimal solution?

Copy link
Member

Choose a reason for hiding this comment

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

Comment on lines +380 to +381
* This function checks that a milestone has not been added to a
* Pull Request.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* This function checks that a milestone has not been added to a
* Pull Request.
* This function ensures that a milestone has not been added to a
* Pull Request.

@@ -464,6 +465,42 @@ describe('Pull Request Label Check', () => {
});
});

describe('when a pr is milestoned', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Can you also write a test to make sure nothing happens when a milestone is not added?

Comment on lines +143 to +145
const milestones = ['Regressions (August 2021)',
'Hotlist (August 2021)',
'Py3 Migration QA (June 2021)'];
Copy link
Member

Choose a reason for hiding this comment

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

@oppiabot oppiabot bot unassigned gp201 Aug 26, 2021
@oppiabot
Copy link

oppiabot bot commented Aug 26, 2021

Unassigning @gp201 since the review is done.

@oppiabot
Copy link

oppiabot bot commented Aug 26, 2021

Hi @SAEb-ai, it looks like some changes were requested on this pull request by @gp201. PTAL. Thanks!

This reverts commit fe40e2b.
@oppiabot
Copy link

oppiabot bot commented Oct 4, 2021

Hi @SAEb-ai. Due to recent changes in the "develop" branch, this PR now has a merge conflict. Please follow this link if you need help resolving the conflict, so that the PR can be merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oppiabot should remove the PR from the blocking bugs milestone
4 participants