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

Add lock and unlock actions #22

Merged
merged 1 commit into from
Oct 11, 2016
Merged

Add lock and unlock actions #22

merged 1 commit into from
Oct 11, 2016

Conversation

bkeepers
Copy link
Contributor

@bkeepers bkeepers commented Oct 10, 2016

Given these rules in .probot.yml:

  # Lock closed issues
  - on: issues.closed
    then:
      lock: true

  # Unlock reopened issues
  - on: issues.reopened
    then:
      unlock: true

Here it is in action:

testing_locking_and_unlocking_ _issue__19_ _bkeepers-inc_test


This PR brings up a couple issues/concerns:

  1. Some actions are really simple. I'm starting to wonder if there's a more declarative way to define actions that hit the GitHub API.
  2. I'm not sure how to write tests for these kinds of actions. The existing action tests (e.g. this) just mock out the GitHub API and check that the right params are passed to it. This feels pretty silly for actions that are just calling the API and nothing else.
  3. There's a lot of duplication in extracting the issue params from the payload, which can probably be moved into some helper methods.

@bkeepers bkeepers merged commit 0e5cd68 into master Oct 11, 2016
@bkeepers bkeepers deleted the lock branch October 11, 2016 02:19
@bkeepers bkeepers mentioned this pull request Oct 11, 2016
44 tasks
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.

None yet

1 participant