App Connect

 View Only

Using IBM® App Connect to interact with GitHub

By Shahmini Arumugam posted Mon December 05, 2022 12:51 AM

  

Co-author – Srihari Ananda Kumar 

 

GitHub is an internet Git repository hosting service for software development and versioning. It offers distributed revision control and source code management (SCM) functionality of Git, access control, bug tracking, software feature requests, task management, continuous integration, and wikis for every project.

Building a flow in IBM App Connect with GitHub

Use App Connect to build flows that integrate with GitHub and other applications. The connector is displayed as GitHub on the App Connect User Interface (UI). 

To allow App Connect to connect to your GitHub account, you need to fill in the connection fields that you see in the App Connect Designer Catalog page or flow editor.

For more information on connection fields and Templates gallery, see How to use App Connect with GitHub.

GitHub objects

The following are the GitHub objects that can be run in App Connect.

Objects

Description

Branches

A branch is a copy of a code branch that you create from an existing branch. It allows you to develop features, fix bugs, or safely experiment with new ideas in a contained area of your repository before they are merged into the mainstream.

Issues

Issues enable you to track work on GitHub such as track ideas, feedback, tasks, or bugs.

Organizations

Organizations are shared accounts where businesses and open source projects can collaborate across many projects at once, with security and administrative features.

Pull requests 

The changes you have pushed to a branch in a repository on GitHub.

Repositories

A repository contains all your project's files and each file's revision history.

*The GitHub standard objects and user-defined custom objects can be viewed by expanding the Show more option from the object list once you have connected App Connect to your GitHub account.


Scenario 1: Create a repository or issue in GitHub when a new issue is created in Jira

Consider this scenario; a repository or an issue is created in GitHub whenever an issue is created in Jira, based on the issue type. A GitHub repository is created when a new Jira issue of type Epic is created in the specified Jira project. Otherwise, if a Jira issue is created with any other issue type in the specified Jira project, a GitHub issue is created.


In this flow:

  1. The event-driven flow is triggered whenever a new issue is created in the specified Jira project.
  2. If the Jira issue is created as type Epic, GitHub creates a new repository in the specified organization with the relevant information from the Jira issue. A Slack message gets sent to the intended channel to notify that the repository has been created for the Jira Epic.
  3. Else, if the Jira issue is created as any other type such as Story, Task, or Bug, GitHub creates a new issue in the specified repository with the relevant information from the Jira issue. Then, a Slack message gets sent to the intended channel.

    For example, if the Jira issue is created as type Story, GitHub creates a new issue in the specified repository with the relevant information from the Jira issue.
    A Slack message gets sent to the intended channel to notify that the issue has been created for the Jira Story.


Scenario 2: Trigger a Jenkins build for a new commit on GitHub

Consider this scenario; whenever a new commit is made in GitHub, a Jenkins build is triggered. A Slack message is then sent to the intended channel.

In this flow:

  1. The event-driven flow is triggered whenever a new commit is made on GitHub.
    For example, you committed a file that you had updated in your working repository.

    Note:  A commit records changes to one or more files in your working branch or repository.

  2. A Jenkins build is started. The Jenkins build is run to save the changes made to the file in the local repository.
  3. A Slack message gets sent to the intended channel to notify the recipient that the Jenkins build for the commit has started.


    Resources

    Try out our templates

    You can view the following use cases in the Templates gallery in your App Connect Designer instance.

    • Create a repository or issue in GitHub when a new issue is created in Jira
      Template URL: https://<your-instance-id>/templates/Create%20a%20repository%20or%20issue%20in%20GitHub%20when%20a%20new%20issue%20is%20created%20in%20Jira

    • Trigger a Jenkins build for a new commit on GitHub
      Template URL: https://<your-instance-id>/templates/Trigger%20a%20Jenkins%20build%20for%20a%20new%20commit%20on%20GitHub

    You must enable the Designer AI features in your containerized environment in order to access the App Connect templates. For more information, see The preloaded IBM App Connect templates.

    You can also import these use cases directly into your App Connect Designer. These templates are added to a public GitHub repository at https://github.com/ot4i/app-connect-templates/tree/cp4i-templates/resources.

    0 comments
    103 views

    Permalink