Project

jira_cache

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Fetches data from JIRA and caches it in a local database.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
>= 0
>= 0
~> 10.0

Runtime

 Project Readme

JiraCache

JiraCache enables storing JIRA issues fetched from the API in a local storage for easier and faster processing. This allows you to build applications performing complex operations on a large number of JIRA content without the JIRA's API latency.

Build Status Code Climate Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'jira_cache'

And then execute:

$ bundle

Or install it yourself as:

$ gem install jira_cache

Usage

Inside of bin/console:

# Basic usage (relies on environment variables to configure the client,
# see .env.example for details)
JiraCache.sync_issue('ISSUE_KEY')

# Using customized client and logger
logger = Logger.new(STDOUT)
logger.level = Logger::DEBUG
client = JiraCache::Client.new(
  domain: 'example.atlassian.net',
  username: 'username',
  password: 'password',
  logger: logger
)
JiraCache.sync_issue('ISSUE_KEY', client: client)

Advanced use

Getting notified on sync events

When you trigger a project sync with JiraCache.sync_project_issues(<project_key>), you can get notifications on every issue fetched by providing a notifier instance to JiraCache::Client:

JiraCache::Client.set_notifier(MyNotifier.new)

Your notifier class must implement the #publish(event_name, data) method. See JiraCache::Notifier class for more details.

Your notifier's #publish method will get called synchronously on every issue fetch. Your responsible of making it being processed in the background if you don't want to slow down the fetching process. Also, beware that fetchs can be performed in multiple threads concurrently (by default 5, you can override it by setting JiraCache::THREAD_POOL_SIZE).

Currently notified events are:

  • fetched_issue

Contributing

  1. Fork it ( https://github.com/rchampourlier/jira_cache/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Check the code of conduct.