Enable Codeac Static Analysis on Pull Requests
Connect Codeac to a test repository, verify check statuses and inline comments on a draft PR, then tune severity gating before blocking merges.
18 Sept 2025, 12:22 UTC

Problem and useful takeaway
Teams merging pull requests without automated static analysis can merge style violations, potential bugs, or risky patterns into the main branch. Codeac is a CI-integrated static analysis service that comments on pull requests and reports check statuses. Enabling it means connecting a Git provider, selecting repositories, and tuning severity thresholds so legitimate changes are not blocked.
Useful takeaway: connect Codeac to a test repository first, trigger a scan on a draft pull request containing a known issue, confirm the check status and inline comments appear, then adjust gating before applying it to active repositories.
Prerequisites
- Admin or owner access to the Git provider organization, such as GitHub, GitLab, or Bitbucket.
- A Codeac account with permission to add integrations.
- One non-production repository for initial testing.
- Confirmation of which languages your Codeac plan supports. Do not assume coverage for a specific language.
Connect your Git provider to Codeac
- In Codeac organization settings, open Integrations or Connected accounts.
- Select your Git provider and authorize Codeac to read repository metadata and write check statuses.
- Review the requested scopes. Write access to check statuses lets Codeac report pass or fail on pull requests. Read access to repository contents lets it analyze code.
Select a test repository and enable analysis
- In Codeac, add the repository you want to analyze.
- Enable pull request analysis.
- Choose the branches to scan, typically the default branch and pull request target branches.
Configure severity and fail-on-threshold gating
Static analysis rules flag patterns such as unused variables, hard-coded secrets, or complex functions. Severity determines which findings count as failures. Fail-on-threshold gating blocks a merge when findings exceed a limit.
In Codeac repository settings:
- Open Severity or Quality gate.
- Set the threshold for errors and warnings.
- Enable Block merge on threshold exceeded if your plan supports it.
Start with warning-only mode. This creates comments and check statuses without blocking merges while you calibrate thresholds.
Trigger a scan on a draft pull request
Run these commands in a local terminal where you have write access to the test repository:
git checkout -b codeac-test-branch
git commit --allow-empty -m "test: trigger Codeac static analysis"
git push origin codeac-test-branch
Then open a draft pull request from that branch against the default branch. Codeac should start analysis automatically.
Expected checks and diagnostic decisions
| Result | Meaning | Action |
|---|---|---|
| Check pending | Codeac is still analyzing the pull request. | Wait for the status to change before merging. |
| Check success | Findings are below the configured threshold. | Merge is allowed by Codeac. |
| Check failure | Findings exceed the threshold. | Fix issues or adjust the threshold in Codeac settings. |
If no check appears, confirm the repository is selected in Codeac and the Git provider integration has check-status write permissions. If comments appear but the check passes, review whether the threshold is set too high. If legitimate pull requests fail, lower the severity or exclude specific rule IDs, if supported by your plan.
Rollback and recovery options
Enabling Codeac changes repository state by writing check statuses and comments. To stop new analysis:
- Remove the repository from Codeac or disable the integration in organization settings.
- Delete the test branch and close the test pull request.
- Revert any threshold changes to their previous values.
This prevents new comments on future pull requests. Existing comments remain unless manually deleted.
Limitations and practical verification
- Supported languages, rule sets, and gating behavior depend on the Codeac plan and integration version. Verify coverage for your language before relying on results.
- Do not use Codeac as the only security gate. Combine it with dependency scanning, secret detection, and manual review.
- Misconfigured severity can block legitimate pull requests or let issues pass silently.
Practical way to check the result: create another draft pull request with a known issue pattern, such as a deliberately unused import or a hard-coded placeholder secret, and confirm Codeac reports it. Then remove the issue and confirm the check returns to success.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.