How to Guide: Flagsmith GitHub Integration

By
Pradumna Saraf
on
June 26, 2024

We’re really excited to announce Flagsmith’s integration with GitHub! As an open source feature flag company, this is a big integration that we can’t wait for you to benefit from.

In the software development lifecycle (SDLC), automation helps make tasks safer and faster. To make feature flag management much smoother, we’ve integrated with GitHub

This means you can view updates on your Flagsmith feature flags/features as comments in GitHub Issues and Pull Requests. This helps you easily track features through the SDLC—from the issue you are trying to solve, right up to the merge/deployment of a PR.

Why We Built It

We built this integration because we work in GitHub a lot, like many of our users. We wanted the ability to link the things we are working on (issues/PR’s) to how we are releasing things (features/flags). That way, we have visibility across our repo on what is released directly in GitHub, and we can see the status of a linked GitHub Issue/PR or navigate to it from the Flagsmith dashboard.

Plus, we're open source. A lot of the engineers who love using Flagsmith are as well. If you're managing features, you're probably working in GitHub also, so it doesn't make sense to go dark and lose track of feature updates when you're working in open source. 

Tl;Dr: Feature flags are one part of your development process. Now, you can easily see how the issues/PR’s you’re working on in GitHub are progressing to release. This helps detach releases from deployment and increase visibility across your company!

Use Cases

This integration lets you track the lifecycle of a feature by linking a Flagsmith feature with a GitHub PR or Issue. This allows users to navigate between Flagsmith and GitHub and between flags/features and issues/PRs. The integration will also create comments automatically in linked issues/PRs anytime a flag is updated. 

In a future release, we will also allow events on the GitHub side to create tags in the corresponding feature flag in Flagsmith automatically. These events will include merging, closing, marking as a draft, or reopening PRs or issues, making the integration bidirectional. 

Some of the use cases depend on which platform you are on:

On the Flagsmith dashboard:

  1. Associate feature flags with code changes by linking the feature to a Pull Request and GitHub Issues
  2. Help remove the stale flags
  3. Tag Git progress of a feature flag
  4. See the references of feature flags in the linked Pull Request when removing feature flags

On GitHub:

  1. See the active state of feature flags associated with a GitHub issue, PR or feature request
  2. Check if there is a closed PR or issue where a feature flag is yet to be enabled
  3. Check if the feature is deployed to a subset of users

How to Set Up the Flagsmith GitHub Integration

You can enable this integration from the Flagsmith dashboard or by installing the Flagsmith app directly from GitHub. We will use the GitHub way in this tutorial.

Prerequisites

  • A Flagsmith account and a GitHub account (it's free to start)
  • A GitHub repository to install the integration on
  1. Let’s first install the Flagsmith app from the GitHub Marketplace.
screenshot of GitHub text about the flagsmith integration

2. Select your organisation and the repositories where you want to install the app. You can choose to install it on all of your repos or select a particular repo.

screenshot of github showing flagsmith install from integration

3. After this is installed, you will be redirected back to the Flagsmith app to finish the integration setup.

4. Select the Flagsmith organisation and project you want to associate with the repository where the app was installed to create the integration and save the config.

screenshot of github showing flagsmith integration configuration setup

5. After that, you will be redirected to the Features dashboard. You can link existing flags with the GitHub issue/pull request or create a new feature. We are going to create a new one with the name 'test'.

screenshot of github showing flagsmith integration

6. To link this test feature flag with an existing issue or a pull request, click on the flag name, and a side menu will pop up from the right. Then, choose the 'Link' tab.

screenshot of github showing flagsmith integration

7. Now, we choose an issue from the drop-down menu and select it. It will automatically fetch all the issues from the GitHub repo that we have linked. Then, we click on 'save'.

screenshot of github showing flagsmith integration

8. All your issues and pull requests linked to this flag are visible here. We can verify whether the issue is linked or not by clicking on the arrow icon.

screenshot of flagsmith showing github integration

9. When we click on the arrow icon, it will navigate us to the issue on GitHub, where we can see that the Flagsmith GitHub App has commented below the GitHub Issue with all the necessary details, such as environment, enabled value, etc.

screenshot of github showing flagsmith integration

That’s it. That is how it’s simple to integrate Flagsmith with GitHub.

Benefits

  • Effortless monitoring: Stay on top of changes to your feature flags without having to manually track each modification.
  • More visibility: Easily track the status of your features across different environments, ensuring consistency and reliability in your development process.

More Reading/Next Steps

  • Check out the Flagsmith GitHub repo. This is where you can track integration updates and let us know what else you'd like to see. Don't forget to give it a star to show your support.
  • Check out the other Flagsmith integrations or via the Integrations tab in your Flagsmith dashboard 
screenshot of the flagsmith integrations dashboard

About the Author

Pradumna is passionate about open source. He is known in developer communities and on social media for his open source tips and contributions. Apart from creating content on social media and writing technical blogs, he enjoys delivering talks in person.

Quote

Subscribe

Learn more about CI/CD, AB Testing and all that great stuff

Success!
We'll keep you up to date with the latest Flagsmith news.
Must be a valid email
Illustration Letter