How to Simplify CI with JIRA and GitHub Plugins?

TL;DR: Using GitHub and JIRA updater plugins to validate pull requests and get workflow status updates on pull requests.

10 months ago   •   4 min read

By Rupin Solanki

Introduction

Continuous Integration (CI) is a crucial part of the modern software development process. It allows developers to quickly and efficiently test code changes and catch issues before they make it to production. But managing multiple CI pipelines for multiple applications can be time-consuming and complex, especially when these pipelines are intertwined with custom scripting.

Why need plugins?

To ease the troubles that developers face, we have micro tools called plugins, which is an add-on component that extends the functionality of a CI tool. It allows users to customize their CI pipeline by adding new features, integrating with external tools, and automating tasks.

Benefits of relying on Plugins

Plugins help solve various challenges that developers face while building, testing, and deploying. Challenges that plugins solve:

  • Flexibility and customization: CI plugins provide a way to customize and extend the CI tool to meet specific needs.
  • Integration with external system: CI plugins enable seamless integration with external systems like bug tracking systems, testing frameworks, development tools, etc.
  • Notification and alerts: CI plugins allow notifications and alerts to be sent to team members and managers when a build or test fails, or specific events occur in CI/CD pipeline.

CI Plugins on Devtron

Devtron comes with some pre/post-build plugins that can be used to execute tasks such as running k6 load testing, static code quality check with sonarqube, and much more, as shown in the below image. By using plugins, we can extend the CI system's capabilities and automate processes that would otherwise be time-consuming and error-prone.

The CI mechanism allows you to add multiple pre and post-CI steps, making it easier to customize your workflow to fit your needs. Refer to this list of available preset plugins that can be extended depending on the requirements.

Let us focus on  JIRA and Github plugins that we introduced recently. With JIRA plugins, you can validate pull request titles to ensure they contain a valid and open JIRA ticket and update the JIRA ticket with the build status. This helps prevent errors and saves you time by automatically starting the build step in CI if the JIRA ID is valid. And the GitHub plugin allows you to update pull requests automatically, saving you time and ensuring that your pull requests always reflect the latest code and build changes.

Getting Started with JIRA

Pre-requisite: To get started with the JIRA plugin, you'll first need to create a workflow and add a filter with the key as title and value as

^(?P<jira_Id>([a-zA-Z0-9-].*))/ 

This regex will filter out the JIRA ID from the title. You should also ensure the source type is set as a pull request.

Plugin setup in pre-ci
Plugin setup in pre-ci

Steps to integrate JIRA with Devtron

Step 1 Next, you must provide the plugin with your JIRA username, password (API key or token), and JIRA base URL. Once this is done, the plugin will automatically validate the JIRA ID that's fetched from the pull request title using the regex. If the JIRA ID is valid and open, the build step in CI will start. If not, an error will be displayed.

Step 2 : Once you have provided the required details for the plugin, you can start the build from the build and deploy page.

Step 3 Similarly, we can set up the JIRA issue updater plugin that updates the build status in the JIRA ticket.

Build status update in JIRA ticket
Build status update in JIRA ticket

Getting Started with GitHub

Pre-requisite: To use the GitHub plugin, you must first ensure that the source type is set as a pull request. You'll also need to provide the GitHub access token to the plugin. This ensures that the plugin has the necessary permissions to access your repository and update pull requests.

These features allow you to add additional information to your pull requests, such as the Docker image ID used in the build or the status of the build itself.

Plugin updating PR with the current status of the build and deploy

By integrating GitHub with the CI build pipeline, you can streamline your workflows and ensure that your pull requests always reflect the latest code changes. This saves you time and effort, allowing you to focus on writing great code and building great software.

Conclusion

You can streamline your CI process and reduce errors with JIRA and GitHub plugins. Integrating JIRA and GitHub with our CI Build Pipeline lets you catch issues early, thoroughly test your code changes, and keep your pull requests up-to-date. Explore the readily available  JIRA and GitHub plugins for integration to simplify your CI process and reduce errors.

Spread the word

Keep reading