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.
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+)
Scheduled Jobs
Repository reindexing
JOB DESCRIPTION
When the repository reindexing job runs, the Git Integration for Jira app performs the following operations:
-
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.
-
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
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.
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
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:
-
On your Jira dashboard menu Git ➜ Indexing queue.
-
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
Upgrades and migrations within same servver
Scheduling jobs (this page)