Pull Request Workflow in Holistics
This feature is under development and will be coming soon!
Introduction
In a typical development process, when you make changes in the development branch, you need to create a Pull Request (in GitHub) or a Merge Request (in GitLab) before publishing to production. This allows other users to review your changes and triggers the CI workflow for testing and validation.
This step is essential to ensure no downtime and maintain code quality in the production environment.
How to setup PR Workflow in Holistics
Holistics uses a GitHub Personal Access Token to:
- Create Pull Requests in your repository
- Monitor PR status (open, closed, or merged)
- Enable necessary actions based on PR status
You can use either:
- Personal Access Token (Classic)
- Fine-grained Access Token
Prerequisites
- You have connected to your GitHub repository to Holistics.
- You have admin permission to the repository that you have connected to Holistics.
Step 1: Enable PR workflow for your organization
- Navigate to Settings > Project Settings > Enable PR Workflow.
- Toggle on Enable PR Workflow button.
- You will then be prompted to add the GitHub Access Token.
Step 2: Create GitHub access token
- Using Personal Access Token (Classic)
- Using Fine-grained Access Token
Before creating a Personal Access Token (Classic), ensure that:
- You have admin or owner access to the repository. Learn more about repository roles
- Your organization has enabled Personal Access Tokens. Learn more about organization settings
Go to
GitHub Settings > Developer settings > Personal access tokens > Token (Classic)
and create new token (or you can visit this link from GitHub)Set the expiration date for your token (we recommend 90 days):
- Holistics PR Workflow cannot function properly if the token is expired. So make sure to set the expiration date for your token to be far enough in the future.
- 5 days before the token expires, you will see the inapp warning banner in Holistics.
Select scopes for your token
- repo
- repo:status
- public_repo
- admin:repo_hook
- write:repo_hook
- read:repo_hook
- repo
Click on Generate token
Copy the token and paste it in the Holistics dialog
Before creating a Fine-grained Access Token, ensure that:
- You have admin or owner access to the repository. Learn more about repository roles
- Your organization has enabled Fine-grained Access Tokens. You may need approval from your organization owner before submitting the token. Learn more about organization settings
- Go to
GitHub Settings > Developer settings > Personal access tokens > Fine-grained tokens
and create new token (or you can visit this link from GitHub) - Select the correct
resource owner
of your repository - Set the expiration date for your token (we recommend 90 days):
- Holistics PR Workflow cannot function properly if the token is expired. So make sure to set the expiration date for your token to be far enough in the future.
- 5 days before the token expires, you will see the inapp warning banner in Holistics.
- Select the Repository that you have connected to Holistics
- Set up Repository permissions:
Pull requests: Read only
-> this is necessary for Holistics to create Pull Request in your repository from HolisticsWebhooks: Read and Write
-> this is necessary for Holistics to check PR Status and set up Auto-Publish workflow
- Click on
Generate token
- Copy the token and paste it in the Holistics dialog
Step 3: Go back to Holistics, make changes, and create a PR
- Make changes to your files in Development Workspace. And then Commit
- Click on Create PR button in the top right corner
- After that, you will be redirected to GitHub to create a PR.
- Once the PR is created, back in Holistics, you will see the PR status has been updated in Holistics with
Open status
.
Step 4: Review, update, and approve the PR
- Once the PR is created, other people can review your PR and make comments.
- In the meantime, you can make changes to your PR in Holistics.
Step 5: Publish the PR
- Once the PR is approved and merged to
master
branch, the changes will be published to production automatically. - If somehow the Publish process failed, you can try to publish it manually by clicking on Publish button in Holistics.
- In case you want to customize the Publish logic (for e.g., don't publish to production in weekend), you can use our Publish API instead of our normal Auto-Publish workflow.