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

Fixes #3464 - Only reject an issue for action==closed #3465

Merged
merged 4 commits into from
Aug 24, 2020
Merged

Conversation

miketaylr
Copy link
Member

Without this fix, it's possible to reject a previously closed issue, which is not what we want.

@miketaylr
Copy link
Member Author

Thinking of how to add a test for this.

@miketaylr
Copy link
Member Author

r? @karlcow

(Note: i've tested this on staging, the latest version of this branch is deployed there if you'd also like to test)

Copy link
Member

@karlcow karlcow left a comment

Choose a reason for hiding this comment

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

@miketaylr Thanks for the fix.

Could we give better comments for each of the if in process issues actions.
Where we clearly explain what we do.

Also in the initial design, we were making sure that we could not by mistakes publish something which was rejected. Is it still the case?

  • closing meant rejected
  • milestone meant accepted.

@karlcow
Copy link
Member

karlcow commented Aug 24, 2020

Also in the initial design, we were making sure that we could not by mistakes publish something which was rejected. Is it still the case?

Still the case. Cool.

elif (scope == 'private' and self.action == 'closed' and
self.milestone == 'unmoderated'):
# private issue has been closed. It is rejected
# We need to patch with a template.
try:
self.close_public_issue(reason='rejected')
except HTTPError as e:
msg_log('public rejection failed', self.number)
return oops()
else:
# we didn't get exceptions, so it's safe to close it
self.close_private_issue()
return make_response('Moderated issue rejected', 200)

@miketaylr
Copy link
Member Author

Thanks Karl. Will add some comments then merge.

@miketaylr miketaylr merged commit 3448e1b into master Aug 24, 2020
@miketaylr miketaylr deleted the issues/3464/1 branch August 24, 2020 19:48
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.

2 participants