No commit activity in last 3 years
No release in over 3 years
Synchronizes information between Jira and GitHub
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
~> 2.14
= 3.0.7
>= 0
~> 10.0
~> 3.4
>= 0
~> 0.9.20

Runtime

 Project Readme

danger-jira_sync

Jira and GitHub should be friends, and Danger brings them closer together with jira_sync

Installation

Add danger-jira_sync to your Gemfile

gem "danger-jira_sync"

Or, without bundler

$ gem install danger-jira_sync

Usage

You must always configure jira_sync before it can access the Jira REST API

jira_sync.configure(
  jira_url: "https://myjirainstance.atlassian.net",
  jira_username: "test@example.com",
  jira_api_token: "ABC123",
)

Automatically label Pull Requests with the associated Jira issue's component names and project key

jira_sync.autolabel_pull_request(%w(DEV))

Methods

configure(jira_url:, jira_username:, jira_api_token:)

Configures the Jira Client with your credentials

Params

Returns

  • [JIRA::Client] - The underlying JIRA::Client instance

autolabel_pull_request(issue_prefixes)

Labels the Pull Request with Jira Project Keys and Component Names

autolabel_pull_request(issue_prefixes, project: true, components: true, labels: true)

Labels the Pull Request with Jira Project Keys, Component Names, and Labels

Params

  • issue_prefixes [Array<String>] - An array of issue key prefixes; this is often the project key. These must be present in the title or body of the Pull Request

Returns

  • [Array<String>, nil] - The list of project & component labels that were applied or nil if no issue or labels were found

Development

  1. Create a Jira Cloud developmnet environment
  2. Clone this repo
  3. Run bundle install to setup dependencies
  4. Copy .env.sample to .env and fill in settings for GitHub and your Jira Cloud development environment
  5. Run bundle exec rake spec to run the tests
  6. Use bundle exec guard to automatically have tests run as you make changes
  7. Make your changes

⚠️ Do not commit fixtures with your credentials in them ⚠️

Before committing, check to see if you have created or changed any fixtures in /spec/fixtures/vcr_cassettes. If you have, it is possible that the changed file contains your credentials. Manually remove your credentials from these fixture files

When a new HTTP request is made that VCR hasn't seen before, it will record the response from the server and play it back in subsequent HTTP requests to the same URL with the same headers. This means that if a new request is made in the tests, it will actually make a request to the server in order to record the response. For this reason, development should be done within testing environments in GitHub and Jira Cloud