CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Github bot updates
Pages: [1]

Author Topic: Github bot updates  (Read 562 times)

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Github bot updates
August 10, 2015, 12:19:50 am
To date, we've had a Jenkins bot which executes the test suite whenever a PR is submitted to `civicrm-core`. I've added another bot to handle some more administrative duties:

  • If you submit a PR which modifies one of the messiest/worst functions in CiviCRM (eg there are a couple functions which are 1000-lines long), then the bot will exhort you to read http://wiki.civicrm.org/confluence/display/CRM/Toxic+Code+Protocol .
  • If you reference a JIRA issue (CRM-1234, INFRA-1234, VOL-1234, etc) in the title or body, the bot will post crosslinks between the Github discussion and JIRA.
  • The bot will apply a colored label based on the target branch (e.g. 4.6 or master).

I've enabled the bot for civicrm-core. If there aren't any major problems, we can enable it for the other repos (civicrm-drupal, civicrm-joomla, civicrm-wordpress, etc).

There are a couple limitations to be aware of (in the near term) which hopefully won't be problematic (in the long term):

  • The list of messy/bad/toxic functions is stored directly in the repo (.toxic.json). This should make it easier to update going forward, but it means that pre-existing PRs/branches don't have the list. They won't get a warning.
  • Github notifies the bot when creating or closing a PR, adding a new comment, or updating the code. However, it doesn't seem to send a hook when editing the title or description. This means the JIRA-Github crosslinks won't update on edit. (They will eventually update, though, if we receive one of the other hooks.)

The bot code is, of course, posted publicly -- https://github.com/civicrm/civicrm-botdylan

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Github bot updates
August 10, 2015, 09:41:13 am
Very cool. One nitpick: my PR script always creates a link to the jira issue for me, then the bot adds two more.
Example: https://github.com/civicrm/civicrm-core/pull/6465
Maybe it could refrain from creating a link if the source it's grepping from is already a link?
« Last Edit: August 10, 2015, 09:42:55 am by Coleman Watts »
Try asking your question on the new CiviCRM help site.

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Github bot updates
August 10, 2015, 04:23:26 pm
Agree the JIRA crosslinker should check for an existing link in the body. Also, the implementation has been a bit noisy -- you sometimes get two email notices (depending on race condition among concurrent hooks). For JIRA crosslinks, it's kind of silly to send the emails.

I've updated and deployed changes. New links should now show up in the description of the PR (if they're not already there) and should avoid extra email notifications.

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Github bot updates
August 13, 2015, 08:24:29 pm
The bot is now enabled on more repos:

    "civicrm/civicrm-buildkit"
    "civicrm/civicrm-core"
    "civicrm/civicrm-cxn-rpc"
    "civicrm/civicrm-community-messages"
    "civicrm/civicrm-drupal"
    "civicrm/civicrm-joomla"
    "civicrm/civicrm-packages"
    "civicrm/civicrm-wordpress"
    "civicrm/civistrings"
    "civicrm/org.civicrm.volunteer "

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Github bot updates

This forum was archived on 2017-11-26.