Git Integration for Jira Self-Managed (Data Center/Server) Documentation

Contact Support
GitKraken Status  

Scheduling Jobs

Introduction

Scheduling jobs in the Git Integration for Jira app for Jira Server and Data Center (in the General settings page) gives Jira administrators control over when jobs run.

Scheduled jobs showing repository indexing and garbage collection

Scheduling rule types
The Git Integration for Jira app for Jira Server and Jira Data Center uses the Atlassian Jira Scheduling API for scheduling jobs. These jobs can be scheduled in two ways:

  • Scanning interval: Schedule jobs on a regular interval in minutes. If the job is still running, the job will be skipped (and not added to a job queue).
  • Cron expression: Schedule jobs via cron expression to schedule the jobs to run at specific times on specific days. (Available starting in Git Integration version 3.7+)

We recommend that scheduled jobs be given sufficient time to run completely on a regular basis. Please see section, How to find out how long jobs are running.

Scheduled Jobs

Repository reindexing

JOB DESCRIPTION
When the repository reindexing job runs, the Git Integration for Jira app performs the following operations:

  1. Auto-Connect integrations (GitHub, GitLab, etc).

    a. Perform API call to git server requesting a list of available repositories;

    b. Clone/remove repositories based on a response from a git server;

    c. Git fetch changes for existing repositories;

    d. An API call requesting pull/merge requests; and lastly,

    e. Index commits from all repositories in the integration.

  2. Plain git repositories (single repository connections).

    a. Perform a git fetch changes for each enabled git repository; and then

    b. Index commits.

DEFAULT VALUE: 5 minutes

Job name in Jira Administration ➜ Scheduler Details:
com.bigbrassband.jira.git.jiraservices.jobs.RevisionIndexJob

Recommendations
We recommend that repository reindexing be scheduled no more often than necessary. Ideally, a repository reindexing is scheduled less often (1-2 times a day) and Webhooks are configured to trigger indexing of individual repositories. Reindexing can also be triggered using the Reindexing API.

For the most control over when reindexing jobs occur, disable webhooks and schedule the reindexing job using a cron expression for the desired time(s) of day.

 

Garbage collection and Revision validation checkers

JOB DESCRIPTION
The garbage collection job performs the ‘git gc’ calls on the cloned repositories copies. It also performs some cleanup and validation routines.

DEFAULT VALUE: 1440 minutes (once a day)

Job name in Jira Administration ➜ Scheduler Details:
com.bigbrassband.jira.git.jiraservices.jobs.GarbageCollectionJob

Recommendations
We recommend the Garbage collection and Revision validation checker’s job be run approximately once a day. Some of you may decide to run it less often and during a specific quiet period for your Jira server. Ideally, the job would be scheduled when other significant jobs are not scheduled.

 

How to find out how long the job takes to run?

To understand how long the above jobs take to run, use the Indexing queue viewer:

  1. On your Jira dashboard menu Git ➜ Indexing queue.

  2. Look for the information displayed on the indexing queue dashboard.


 

Data Center considerations

Job scheduling for the Git Integration app for Jira Data Center is generally the same compared to Jira Server, except for the following differences:

  • The reindexing job runs on a single Jira Data Center node (including API requests, git fetch requests, etc) and stores this data in the Jira Shared Storage (sharedhome). Then, each Jira Data Center node is notified to index the changes.

  • The Git Integration app schedules the jobs with the Atlassian Jira Scheduler. The Jira Scheduler controls which node carries out the reindexing job.

 

More related Administration articles

General settings

Upgrades and migrations within same servver

Migration to another server

Scheduling jobs (this page)

Recommended Jira memory settings

Plugin Data Storage

Indexing queue explainer

Have feedback about this article? Did we miss something? Let us know!
On this page