ROpenSci :: Approve

This responder is used to approve a package. It performs a series of tasks:

  • Adds date-accepted to the body of the issue

  • Clears reviewers’ current_assignment in AirTable

  • Creates a new team named like the package-name and invites the creator of the issue to it (owner right needed)

  • Can reply with a template

  • Allows labeling

  • Closes the issue

  • If the submission-type is stats it checks if stasgrade is present and if so adds the proper label

Listens to

@botname approve package-name

Requirements

The package-name must be specified in the command, otherwise an error message will be sent as reply.

If the submission-type of the issue is stats, then for the responder to work there must be a valid value for a statsgrade variable (marked with HTML comments) in the body of the issue:

# the responder will add the label: '6/approved-silver'
<!--statsgrade-->silver<!--end-statsgrade-->

Settings key

ropensci_approve

Params

For the Airtable connection to work two parameters must be present in the env section of the settings file, configured using environment variable:

...
  env:
    airtable_api_key: <%= ENV['AIRTABLE_API_KEY'] %>
    airtable_base_id: <%= ENV['AIRTABLE_BASE_ID'] %>
...

For labeling the approved stats submissions an external service is used to get the proper versioned label. The url for the external service is by default: http://138.68.123.59:8000/stats_badge. This value can be changed using the optional :stats_badge_url param:

...
  responders:
    ropensci_approve:
      only: editors
      stats_badge_url: https://test.ropensci:3030
...

Examples

Simplest case:

...
  responders:
    ropensci_approve:
...

With labeling, template response, limiting access and only if there’s an editor already assigned:

...
  responders:
    ropensci_approve:
      only: editors
      template_file: approved.md
      data_from_issue:
        - reviewers-list
      remove_labels:
        - 5/awaiting-reviewer(s)-response
      add_labels:
        - 6/approved
...