Prerequisites
- Connect the repository to Gitar and confirm Jenkins reports build results to its PRs, with links to the builds.
- Use a Gitar organization Admin account to configure the integration.
- For GitHub, multibranch pipelines using GitHub Branch Source can report statuses automatically. Other jobs can use the Set GitHub commit status publisher from the GitHub plugin. For other Git providers, configure the corresponding Jenkins status-reporting integration.
- Confirm Gitar can reach your Jenkins server over HTTPS with a valid certificate. If it is reachable only through a VPN or private network, contact Gitar to confirm connectivity. IP allowlisting alone does not create a connection to a private network.
- Create or use a Jenkins account with the read permissions below. A dedicated account keeps access separate from an individual team member. Ask a Jenkins administrator to create it and grant access if needed.
Setup
1
Create an API token
- Sign in as the Jenkins user whose access Gitar should use.
- Open your user menu and select Security.
- Under API Token, select Add new Token and name it
Gitar. If Jenkins offers an expiration setting, choose it according to your organization’s policy before generating the token. - Select Generate, copy the token, and store it securely. Jenkins shows the generated value once.
Enter that user’s login name and API token together in Gitar. The token belongs to that user, so a different username will not work. Gitar uses the token rather than the account’s sign-in password.
2
Grant read access
Ask a Jenkins administrator to grant Overall/Read for Jenkins and Job/Read on the jobs Gitar should analyze. Overall/Read allows basic access to Jenkins. Job/Read allows access to a job and its build logs.These are the required read permissions. An account with broader access can also work, but Gitar does not need permission to start builds or change jobs. The administrator should use your installation’s authorization settings to limit job access. Granting read access globally can include every job; granting it through selected folders or jobs limits the scope.
3
Check the Jenkins URL
Ask a Jenkins administrator to open Manage Jenkins > System > Jenkins Location and confirm Jenkins URL is the address Gitar can reach.If Jenkins opens at
https://example.com/jenkins, include /jenkins. Use this server address in Gitar, not a job or build-page URL. Jenkins uses this setting to construct links it publishes; an internal-only address can leave Gitar unable to open them.4
Enter the credentials in Gitar
- Go to your Gitar organization settings.
- Open Integrations.
- Find Jenkins and click Connect.
- Enter the user’s login in Jenkins Username and the token in Jenkins API Token.
- Set Jenkins URL to the value you confirmed in the previous step, including
https://and any path such as/jenkins. - Wait for the credential checks, then select Connect to save.
Connect (or Update for an existing connection) is disabled while checking or after a credential or permission rejection. If Jenkins cannot be reached, saving may remain available, but access is unverified. Follow Verify log access.
Jenkins URL is required so Gitar knows which server the credentials apply to. Gitar compares the server name in each build link with the configured URL and ignores statuses pointing to another server.
Optional plugins
Gitar uses these when they are installed. Neither is required.
If stage logs are unavailable, Gitar falls back to the build’s console log. The JUnit test report is optional and can supplement either source.
Verify log access
Check the next failing Jenkins build reported on the PR’s latest commit. Follow its status link and confirm that it opens the expected build. Check the PR’s dashboard comment for Gitar’s analysis. Repeat for jobs or folders with different access permissions. A successful credential check does not verify build-status reporting or access to every build’s logs. If no analysis appears, use the troubleshooting checks below.What Gitar reads and fixes
Gitar reads logs from failing builds and posts its analysis in the PR’s dashboard comment. It ignores failure events for older commits after new commits arrive. With auto-apply enabled, Gitar can push code fixes for failures confirmed as caused by the PR. With auto-apply disabled, commentGitar fix CI to request a fix. See CI failure analysis for fix conditions and recovery behavior.
Gitar does not start or retry Jenkins builds. A code fix may start another build if your pipeline runs after a push.
Replace or revoke the token
Sign in as the same Jenkins user and create another API token from Security > API Token. In Gitar, open Settings > Integrations, find Jenkins, and select Configure. Replace Jenkins API Token, wait for the checks, and select Update. Verify log access before revoking the old token. To revoke the old token, return to the Jenkins user’s Security > API Token section, use the Revoke action beside it, and confirm. To stop Gitar’s access, revoke the token Gitar is using. Revoking an old token after saving a replacement does not revoke access through the replacement.Troubleshooting
Gitar does not comment on a failed build
Gitar does not comment on a failed build
Confirm that the repository is connected to Gitar and check the PR’s latest commit for a Jenkins status, usually
continuous-integration/jenkins/pr-head or pr-merge on GitHub. Follow its link and confirm that it opens the expected build, including a build number.If there is no status, Jenkins is not reporting to your Git provider. For a multibranch pipeline, check the GitHub Branch Source plugin and the credential it uses, which needs permission to write statuses on the repository.For other GitHub jobs, check the Set GitHub commit status publisher. On other Git providers, check the Jenkins integration that reports build results.If the status is there, check that the server name in Jenkins URL matches the build link. Gitar ignores statuses pointing to another server. Keep any path such as /jenkins in the saved URL.If automatic processing is disabled, follow that setting’s instructions to start Gitar. For an earlier failure, comment Gitar fix CI to request analysis.The status link opens an internal address
The status link opens an internal address
Ask a Jenkins administrator to update Manage Jenkins > System > Jenkins Location > Jenkins URL to the address Gitar can reach. Then run another build in Jenkins and check the newly published status link. Changing the setting does not rewrite statuses already published.
Log fetching fails on a build that exists
Log fetching fails on a build that exists
Check that Jenkins Username is the login name of the account that owns the token, rather than its display name. A rejected username/token pair does not identify which value is wrong. If the token has expired or been revoked, follow Replace or revoke the token.If authentication succeeds, sign in as that Jenkins user and open the affected build’s console log. Ask an administrator to check Overall/Read and Job/Read on the job and any containing folders if access is denied. Changing permissions does not require a new API token. A credential check that finds another readable job does not verify this one.
Connection checks fail for a Jenkins URL containing a path
Connection checks fail for a Jenkins URL containing a path
If Jenkins is hosted at an address such as
https://example.com/jenkins and connection checks fail despite working credentials, keep /jenkins in Jenkins URL and contact Gitar. If saving remains available, verify access using a failing build.A branch name contains a slash
A branch name contains a slash
Keep the build URL exactly as Jenkins publishes it. For example,
feature/my-branch may appear with encoded characters in the URL. Do not replace those characters with slashes; Gitar reads the published URL.Jenkins is on a private network
Jenkins is on a private network
Access from your browser over a VPN does not prove that Gitar can reach Jenkins. If Jenkins is reachable only on a private network, contact Gitar to confirm connectivity before setup. Saving credentials after an unsuccessful connection check does not verify log access.See Network access.
Security notes
- Gitar encrypts credentials and stores them in AWS Secrets Manager.
- Prefer a dedicated user’s token over a personal one, so access survives people leaving.
- Overall/Read and Job/Read are read-only. Gitar writes nothing to Jenkins.
- Gitar compares the server name in each build link with the configured Jenkins URL before fetching logs.
- To revoke Gitar’s access, revoke the token it is using under the Jenkins user’s Security > API Token section. See Replace or revoke the token.