Lesson 3 Integrating GitHub into a value stream
Provide GitHub repository data to the value stream.
Before you begin
About this task
In this lesson you integrate a Git repo into the tutorial value stream.
To modify the tutorial value stream, complete the following steps:
Procedure
- Click .
-
On the Plugins tab, click Add Integration for the
GitHub integration.
Integrations can be defined in several ways. You can define them directly in the JSON file's
"integrations"
array. You can also define an integration on the Plug-in page, and then reference it in the JSON file. In this lesson, we configure the integration on the Plug-in page. In a later lesson, we will associate the GitHub integration to the tutorial value stream. - Do Jira xxx
-
On the Add GitHub integration window, configure an integration by
completing the following steps:
The integration is listed on the Integrations page. If the integration is successful, the Status field displays
Online
. If the status is notOnline
, use the View log option to troubleshoot the integration. You can increase the logging level in the integration configuration if you need more troubleshooting information. - On the Value Streams page, select the value stream that you created earlier in the tutorial.
-
Click
.The tutorial.json file is downloaded to your computer.Note: After you modify the default value stream map file, the downloaded file name will reflect the name of the value stream.
-
In your text editor, open the tutorial.json file, and then add the Jira
integration to the
integrations
array in the JSON file.Because you already defined the Jira integrations, you can add it to the value stream by referencing its name, as shown in the following example:
Of course, use the name you assigned to the integration in Step 3."integrations": [ { "name":"GitHub tutorial" } ],
-
In the
linkRules
section in the JSON file, define the rules that associate Git pull requests with Jira issues.DQL queries assigned to a stage filter the information that appears in the stage, as shown in the following example:"linkRules": [ { "fromIntegrationName": "tutorial GitHub", "toIntegrationName": "tutorial Jira", "fromField": "pr.name", "toField": "issue.id", "pattern": "([A-Z]+-[0-9]+)" } ],
Link rules define how integrated tools relate to one another. To define a link rule, specify a field in the linked-from tool that you want to associate with a field in the linked-to tool, and a regular expression that defines the matching pattern. In this case, you are linking Git pull requests to Jira issues.
-
Add a query to the Merger stage, as shown in the following code example:
{ "name": "Development", "description": null, "stages": [ { "name": "In Progress", "query": "issue.status=\"In Progress\" AND deployment.env!=PROD ", "description": null, "wipLimit": null, "gates": null }, { "name": "Review", "query": "issue.status!=Done and pr.status=open", "description": null, "wipLimit": null, "gates": null }, { "name": "Merged", "query": "(pr.status=MERGED or pr.status=closed) AND build.status!=success AND deployment.env!=DEV and deployment.env!=PROD ", "description": null, "wipLimit": null, "gates": null },
- Save and then upload the modified JSON file.
Results
In this lesson, you integrated the external tool Git into the value stream and then linked it to Jira.