Files
solutions/README.md

54 lines
1.9 KiB
Markdown
Raw Normal View History

[Russian version](README-rus.md)
2026-03-11 19:48:23 +01:00
# Setting Up a Technical Account for Code Review
2026-03-11 19:48:23 +01:00
## 1. Create a Local User in Gitea
2026-03-11 19:48:23 +01:00
Create a local user in Gitea with the recommended name: `kodobot`
2026-03-11 19:48:23 +01:00
## 2. Save the Temporary Password
2026-03-11 19:48:23 +01:00
When creating the user, set a temporary password and store it in a secure location.
2026-03-11 19:48:23 +01:00
## 3. Generate a PAT with Minimal Permissions
2026-03-11 19:48:23 +01:00
Generate a Personal Access Token (PAT) with the minimum required permissions using the PowerShell script `Create-PAT.ps1`.<br>
Save the returned PAT value in a secure location.
2026-03-11 19:48:23 +01:00
## 4. Change the Password of the Created User
2026-03-11 19:48:23 +01:00
After successfully creating the PAT, change the password of the created user for security.
2026-03-11 19:48:23 +01:00
## 5. Configure Organization Secrets and Variables
At the organization level, define the secrets and variables necessary for the Code Reviewer to function.
2026-03-11 19:48:23 +01:00
### Secrets
- `CC_GITEATOKEN` — PAT of the `reviewer` user
- `CC_API_KEY` — authorization key for LLM OpenAI API (`sk-***`)
2026-03-11 19:48:23 +01:00
### Variables
- `CC_BASE_URL` — URL of LiteLLM Proxy (default: `http://llm.developertools.com`)
- `CC_MODEL` — default model (default: `/int/reviewer/default`)
2026-03-12 14:23:17 +01:00
### Applying Settings
2026-03-12 14:23:17 +01:00
Configure secrets and variables at the organization level using the script `Set-GiteaOrgActionItem.ps1`.<br>
First, define the environment variable: `$Env:AdminGiteaManagePAT`
2026-03-12 14:23:17 +01:00
**Example PowerShell command:**
2026-03-11 19:48:23 +01:00
2026-03-12 14:23:17 +01:00
```powershell
$Env:AdminGiteaManagePAT = "your-token"
$Org = "wyn-core"
.\Set-GiteaOrgActionItem.ps1 -Org $Org -VarName "CC_BASE_URL" -Value "https://llm.developertools.pro/"
.\Set-GiteaOrgActionItem.ps1 -Org $Org -VarName "CC_MODEL" -Value "/int/reviewer/default"
.\Set-GiteaOrgActionItem.ps1 -Org $Org -VarName "CC_GITEATOKEN" -Password "f79....c1c"
.\Set-GiteaOrgActionItem.ps1 -Org $Org -VarName "CC_API_KEY" -Password "sk-F..6-k..g"
```
2026-03-11 19:48:23 +01:00
## 6. Grant Access to the `kodobot` User
Add the user at the organization level to the Developers group or at the repository level to Collaborators with write permissions