Skip to content

Conversation

@migueldiascosta
Copy link
Member

No description provided.

@boegel boegel added this to the next release (3.5.2 or 3.6.0) milestone Feb 13, 2018
@migueldiascosta
Copy link
Member Author

there are quite a few ways this could be improved (e.g., in dry-run mode, show related PRs, whether it uses archived toolchain, date of last commit and comments, etc.), but that would involve even more code duplication with merge_pr and review_pr...

not sure if the best approach would be a common close/merge function or fleshing out (almost) identical code blocks...

@boegel boegel modified the milestones: 3.5.2, 3.6.0 Feb 22, 2018
@easybuilders easybuilders deleted a comment from boegelbot Mar 14, 2018
@easybuilders easybuilders deleted a comment from boegelbot Mar 14, 2018
g = RestClient(GITHUB_API_URL, username=github_user, token=github_token)
pull_url = g.repos[pr_target_account][pr_target_repo].pulls[pr]
body = {'state': 'closed'}
status, data = pull_url.post(body=body)
Copy link
Member

Choose a reason for hiding this comment

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

There's a lot of duplication here too, maybe time for a pr_action function that gets PR# + body as arguments (and github_token as optional argument)?

Copy link
Member

Choose a reason for hiding this comment

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

@migueldiascosta Does this suggestion still make sense, or not?

Copy link
Member Author

Choose a reason for hiding this comment

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

@boegel I don't know - each case is slightly different, but I may be missing an obvious generalization

Copy link
Member

Choose a reason for hiding this comment

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

Just took a look myself, it's indeed not entirely trivial, so let's leave it as is (for now).

@boegel boegel modified the milestones: 3.6.0, 3.x Mar 15, 2018
g = RestClient(GITHUB_API_URL, username=github_user, token=github_token)
pull_url = g.repos[pr_target_account][pr_target_repo].pulls[pr]
body = {'state': 'closed'}
status, data = pull_url.post(body=body)
Copy link
Member

Choose a reason for hiding this comment

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

@migueldiascosta Does this suggestion still make sense, or not?

@migueldiascosta migueldiascosta changed the title initial support for --close-pr (WIP) initial support for --close-pr (REVIEW) Apr 20, 2018
@boegel
Copy link
Member

boegel commented Aug 6, 2018

In the context of considering auto-closing of stale PRs (e.g. through @boegelbot), there are quite a bit of good/interesting ideas/viewpoints in spack/spack#8811 .

The main difference I guess is that our approach would be project-aware (or at least it could be).

@boegel
Copy link
Member

boegel commented Nov 19, 2018

@migueldiascosta Needs a sync with develop to fix merge conflict.

Other than that, do you think this is ready to go?

@boegel boegel modified the milestones: 3.x, 3.8.0 Nov 19, 2018
@boegel
Copy link
Member

boegel commented Nov 20, 2018

@migueldiascosta We should revisit this after #2400 gets merged, it's quite likely there will be a couple of merge conflicts to deal with...

@boegel
Copy link
Member

boegel commented Nov 22, 2018

@migueldiascosta Let's sync this branch with current develop now that #2400 is merged?

@boegel
Copy link
Member

boegel commented Nov 22, 2018

@migueldiascosta More conflicts, probably because of #2668?

@boegel
Copy link
Member

boegel commented Dec 10, 2018

@migueldiascosta Some code cleanup in migueldiascosta#6 (tests still pass).

One thing that is still missing is a dedicated test for close_pr and reasons_for_closing, but I'm not sure that's worth the trouble (certainly not for reasons_for_closing).

@boegel
Copy link
Member

boegel commented Dec 12, 2018

@migueldiascosta Tests added in migueldiascosta#7

@easybuilders easybuilders deleted a comment from boegelbot Dec 13, 2018
@boegel
Copy link
Member

boegel commented Dec 13, 2018

lgtm, github tests pass, so going in, thanks a lot @migueldiascosta!

@boegel boegel merged commit 9811f3c into easybuilders:develop Dec 13, 2018
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.

3 participants