Introduction to the PAT
To enable Kody to perform automatic Code Reviews, you need to generate a Personal Access Token (PAT) in GitLab. This token allows Kody to securely access your repositories and conduct code analysis in a controlled way.Generating the PAT (Personal Access Token)
Follow these steps to set up the token correctly:- Access GitLab and go to your profile settings:
-
Navigate to
Access Tokens:- In the left sidebar, scroll to find
Access Tokensand click on it.
- In the left sidebar, scroll to find
-
Add a new token:
- Click on the
Add new tokenbutton.
- Click on the
-
Set up the new token with the following specifications:
- Token Name: Choose an easily identifiable name, such as
kody_code_review. - Expiration Date: If possible, select a long expiration date, preferably at least 180 days.
- Permissions: Set the following permissions:
- api: Read access.
- read_api: Read access.
- read_user: Read access.
- read_repository: Read access.
- write_repository: Read access.
- Token Name: Choose an easily identifiable name, such as
-
Finalize and save the token:
- After configuring the permissions, click
Generate token. - Make sure to copy the generated token and store it securely, as you’ll need it to configure Kody.
- After configuring the permissions, click
Adding the Token to Kody
After generating the token, paste it into Kodus:- During onboarding: on Connect your Git tool, pick the Gitlab tab and click Connect via token.
- Later: in the sidebar, open Repositories, click Gitlab under Connect a provider, switch to the Token tab, paste the token and click Validate and save. For a self-managed GitLab, turn on Self-hosted and enter the Gitlab URL.