Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
875a8babaa | ||
|
|
90b8e6f2a4 |
@@ -1,51 +0,0 @@
|
||||
name: AI Code Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [ labeled, synchronize ]
|
||||
|
||||
jobs:
|
||||
ai-review:
|
||||
if: >-
|
||||
(github.event.action == 'synchronized' && contains(toJSON(github.event.pull_request.labels), 'ai-review')) || contains(toJSON(gitea.event.changes.added_labels), 'ai-review')
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
AI_REVIEW_CONFIG_FILE_YAML: ./shared-prompts/iac/.ai-review.yaml
|
||||
# VCS configuration
|
||||
VCS__PROVIDER: GITEA
|
||||
VCS__PIPELINE__OWNER: ${{ github.repository_owner }}
|
||||
VCS__PIPELINE__REPO: ${{ github.event.repository.name }}
|
||||
VCS__PIPELINE__PULL_NUMBER: ${{ github.event.pull_request.number }}
|
||||
VCS__HTTP_CLIENT__API_URL: https://git.forteapps.net/api/v1
|
||||
VCS__HTTP_CLIENT__API_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }}
|
||||
# Review — disable fallback to see real Gitea API errors
|
||||
REVIEW__INLINE_COMMENT_FALLBACK: "false"
|
||||
# LLM configuration
|
||||
LLM__PROVIDER: CLAUDE
|
||||
LLM__META__MODEL: claude-sonnet-5-5
|
||||
LLM__META__REASONING__EFFORT: high
|
||||
LLM__META__MAX_TOKENS: "4096"
|
||||
LLM__HTTP_CLIENT__API_URL: https://api.anthropic.com
|
||||
LLM__HTTP_CLIENT__API_TOKEN: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.AI_REVIEW_TOKEN }}
|
||||
|
||||
- name: Update submodules to remote
|
||||
run: git submodule update --remote --merge
|
||||
|
||||
- name: Run inline review
|
||||
uses: docker://nikitafilonov/ai-review:v1.4.0
|
||||
with:
|
||||
args: ai-review run-inline
|
||||
|
||||
- name: Run summary review
|
||||
uses: docker://nikitafilonov/ai-review:v1.4.0
|
||||
with:
|
||||
args: ai-review run-summary
|
||||
@@ -1,210 +0,0 @@
|
||||
❯ Plan and implement ai-git-bot based on the documentation https://github.com/tmseidel/ai-git-bot for Gitea. It should be hosted as a separate helm deployment on "upc-dev" overlay, with secrets ready to be sealed and added by me. I will also configure Gitea webhook myself afterwards.
|
||||
|
||||
Ran 1 shell command
|
||||
|
||||
● Fetch(https://github.com/tmseidel/ai-git-bot)
|
||||
Received 463.7KB (200 OK)
|
||||
|
||||
Read 1 file, ran 2 shell commands
|
||||
|
||||
● Auto mode lets Claude handle permission prompts automatically — Claude checks each tool call for risky actions and prompt injection before executing. Actions Claude identifies as safe are executed, while actions Claude identifies as risky are blocked and Claude may try a different approach. Ideal for long-running tasks. Sessions are slightly more expensive. Claude can make mistakes that allow harmful commands to run, it's recommended to only use in isolated environments. Shift+Tab to change mode.
|
||||
|
||||
I've reviewed the ai-git-bot deployment docs — it's a Spring Boot app on :8080 needing Postgres and an APP_ENCRYPTION_KEY, with the rest configured how existing apps in this repo are wired(charts, ingress, TLS, secrets) to match the pattern.
|
||||
|
||||
Searched for 1 pattern, listed 1 directory, ran 3 shell commands
|
||||
|
||||
Got the conventions down: Argo multi-source apps, Traefik + cert-manager ingress, SealedSecrets, and plaintext
|
||||
templates in gitignored private/upc-dev/. Chext, then writing the chart.
|
||||
|
||||
Ran 2 shell commands
|
||||
|
||||
No official Helm chart exists, just Docker C local chart for this repo — I'll also flagthat /setup is publicly accessible until the first admin is created. Writing the chart now.
|
||||
|
||||
Ran 2 shell commands
|
||||
|
||||
The shell heredoc tripped on quoting; I'll write the files directly instead.
|
||||
|
||||
● Write(apps\charts\ai-git-bot\Chart.yaml)
|
||||
Wrote 6 lines to apps\charts\ai-git-bot\C
|
||||
apiVersion: v2
|
||||
name: ai-git-bot
|
||||
description: AI-Git-Bot (https://github.com/tmseidel/ai-git-bot) - AI code review and coding agent for Gi
|
||||
tea, with a bundled PostgreSQL
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.27.0"
|
||||
|
||||
● Write(apps\charts\ai-git-bot\values.yaml)
|
||||
Wrote 90 lines to apps\charts\ai-git-bot\
|
||||
# Default values for ai-git-bot.
|
||||
# Everything except the database conn providers, Git
|
||||
# integrations, bots, prompts) is configured in the web UI and stored in PostgreSQL.
|
||||
|
||||
image:
|
||||
repository: tmseidel/ai-git-bot
|
||||
tag: "1.27.0"
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
# Existing Secret with the app credeno the app as an
|
||||
… +80 lines
|
||||
|
||||
● Write(apps\charts\ai-git-bot\templates\_helpers.tpl)
|
||||
Wrote 33 lines to apps\charts\ai-git-bot\
|
||||
{{- define "ai-git-bot.fullname" -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuf
|
||||
{{- end -}}
|
||||
|
||||
{{- define "ai-git-bot.labels" -}}
|
||||
helm.sh/chart: {{ printf "%s-%s" .Char
|
||||
app.kubernetes.io/version: {{ .Values.image.tag | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Rele
|
||||
{{- end -}}
|
||||
… +23 lines
|
||||
|
||||
● Write(apps\charts\ai-git-bot\templates\deplo
|
||||
Wrote 124 lines to apps\charts\ai-git-bot\templates\deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "ai-git-bot.fullname" . }}
|
||||
labels:
|
||||
{{- include "ai-git-bot.labels" . | nindent 4 }}
|
||||
{{- include "ai-git-bot.selectorL
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }
|
||||
# Recreate: agent sessions run in-process and Flyway migrations must not race
|
||||
… +116 lines
|
||||
|
||||
● Write(apps\charts\ai-git-bot\templates\servi
|
||||
Wrote 15 lines to apps\charts\ai-git-bot\templates\service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "ai-git-bot.fullname" . }}
|
||||
labels:
|
||||
{{- include "ai-git-bot.labels" . | nindent 4 }}
|
||||
{{- include "ai-git-bot.selectorL
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
… +5 lines
|
||||
|
||||
● Write(apps\charts\ai-git-bot\templates\ingre
|
||||
Wrote 33 lines to apps\charts\ai-git-bot\templates\ingress.yaml
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- if not .Values.ingress.host }}
|
||||
{{- fail "ingress.host is required wh}
|
||||
{{- end }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "ai-git-bot.fullname" . }}
|
||||
labels:
|
||||
{{- include "ai-git-bot.labels" . | nindent 4 }}
|
||||
… +23 lines
|
||||
|
||||
● Write(apps\charts\ai-git-bot\templates\postg
|
||||
Wrote 98 lines to apps\charts\ai-git-bot\templates\postgresql.yaml
|
||||
{{- if .Values.postgresql.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "ai-git-bot.postgr
|
||||
labels:
|
||||
{{- include "ai-git-bot.labels" .
|
||||
{{- include "ai-git-bot.postgresql.selectorLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: data
|
||||
spec:
|
||||
… +88 lines
|
||||
|
||||
● Update(apps\charts\ai-git-bot\templates\depl
|
||||
Added 2 lines, removed 2 lines
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "ai-git-bot.sele
|
||||
{{- if .Values.prometheus.enabled }}
|
||||
annotations:
|
||||
{{- if .Values.prometheus.enabled }}
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "8080"
|
||||
prometheus.io/path: /actuato
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
|
||||
● Write(apps\overlays\upc-dev\ai-git-bot\ai-git-bot.yaml)
|
||||
Wrote 48 lines to apps\overlays\upc-dev\a
|
||||
apiVersion: argoproj.io/v1alpha1
|
||||
kind: Application
|
||||
metadata:
|
||||
name: ai-git-bot
|
||||
namespace: argocd
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "1"
|
||||
labels:
|
||||
app.kubernetes.io/name: ai-git-bot
|
||||
app.kubernetes.io/part-of: apps
|
||||
… +38 lines
|
||||
|
||||
● Write(apps\overlays\upc-dev\ai-git-bot\values.yaml)
|
||||
Wrote 21 lines to apps\overlays\upc-dev\a
|
||||
# upc-dev values for apps/charts/ai-git-bot
|
||||
# AI providers, the Gitea integrationre configured
|
||||
# in the web UI after the first login; see apps/overlays/upc-dev/ai-git-bot/README.md.
|
||||
|
||||
existingSecret: ai-git-bot-secrets
|
||||
|
||||
ingress:
|
||||
host: ai-git-bot.forteapps.net
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: l
|
||||
… +11 lines
|
||||
|
||||
● Write(apps\overlays\upc-dev\ai-git-bot\kustomization.yaml)
|
||||
Wrote 7 lines to apps\overlays\upc-dev\ai
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ai-git-bot.yaml
|
||||
# Uncomment once the secret has been sealed (see README.md in this directory).
|
||||
# Until then the pods wait in CreateCo
|
||||
# - ai-git-bot-secrets-sealed.yaml
|
||||
|
||||
Now the plaintext secret (in gitignored private/upc-dev/, with freshly generated random values) and the README.
|
||||
|
||||
Searched for 1 pattern, ran 1 shell command
|
||||
|
||||
"Development" group already exists. Now the README and wiring into the upc-dev overlay.
|
||||
|
||||
● Write(apps\overlays\upc-dev\ai-git-bot\README.md) Wrote 63 lines to apps\overlays\upc-dev\a
|
||||
# ai-git-bot (upc-dev)
|
||||
[AI-Git-Bot](https://github.com/tmseidel/ai-git-bot) reviews Gitea pull requests and can implement issues as a coding agent. IHelm chart
|
||||
`apps/charts/ai-git-bot` (app + bundled PostgreSQL 17) into the `ai-git-bot` namespace.
|
||||
| | | |---|---|
|
||||
| URL | https://ai-git-bot.forteapps.net | | Chart | `apps/charts/ai-git-bot` |
|
||||
… +54 lines
|
||||
● Update(apps\overlays\upc-dev\kustomization.yaml) Added 1 line
|
||||
- forte-drop-postgresql - forte-drop
|
||||
- forte-drop-mcp - ai-git-bot
|
||||
# No patches needed — base apps alree paths
|
||||
# (upc-dev is the default/base cluster).
|
||||
● Update(apps\overlays\upc-dev\kustomization.yaml) Added 1 line
|
||||
# forte-drop (postgres + web + mcp) and dbunk-demo are upc-dev-only apps — their # values hardcode upc-dev hosts (drot not sync to
|
||||
# upc-prod, so they live here in the overlay rather than in apps/base/. # ai-git-bot is upc-dev-only as well-bot).
|
||||
lidating: helm lint/template with the upc-uild of the overlay.
|
||||
n 2 shell commands
|
||||
-git-bot is set up as its own Helm deploymt file is ready for you to seal. helm lint,helm template and kubectl kustomize apps/overlays/upc-dev all pass. Nothing has been deployed to the cluster yet,thing is committed.
|
||||
at I built
|
||||
- The upstream project only provides Docker Compose, not a Helm chart, so I wrote a small chart at apps/charts/ai-git-bot/. It runs the app (:1.27.0) plus its own PostgreSQL 17 databasewith 5Gi storage, set so Argo won't delete the volume. It also includes the web address and TLS certificate, anhealth checks. The bot runs one pod, whichlapped on updates. Repo clones and agentbuilds use a 10Gi temporary volume. apps/overlays/upc-dev/ai-git-bot/ holds thattern as vaultwarden), the upc-dev settingsand a README with the setup steps. I added it to apps/overlays/upc-dev/kustomization.yaml. The address is https://ai-git-bot.forteapp homepage under "Development". This assumesthe *.forteapps.net DNS record covers the new name.
|
||||
Secrets ivate/upc-dev/ai-git-bot-secrets.yaml is gASE_USERNAME, plus a freshly generatedDATABASE_PASSWORD and APP_ENCRYPTION_KEY. To seal it: beseal --format=yaml --namespace=ai-git-bo
|
||||
< private/upc-dev/ai-git-bot-secrets.yaml \ > apps/overlays/upc-dev/ai-git-bot/ai-git-
|
||||
Then uncomment the line for that file in apps/overlays/upc-dev/ai-git-bot/kustomization.yaml. If you push before is, the pods will just wait for the secretack up APP_ENCRYPTION_KEY (for example inVaultwarden): it encrypts the API keys and Gitea tokens stored in the database, and losing it makes them unreadab
|
||||
Before you set up the webhook Create the admin account straight after this public until an admin exists, and whoeveropens it first becomes admin. You can open it through kubectl -n ai-git-bot port-forward svc/ai-git-bot 8080:80instead.
|
||||
- Everything else is configured in the bot's web interface, not in Helm: the Anthropic key, the Gitea connection (https://git.forteapps.net and the bot useselves. Each bot gets a webhook URL likehttps://ai-git-bot.forteapps.net/api/webhook/<secret>. Set a webhook signing secret on the bot and enter the same value in Gitea. The README lists the Gitea
|
||||
- The login is a username and password by default. Keycloak login (id.forteapps.net) is built in but off; turning it on is one setting plus two secret keys, de
|
||||
- The image is several GB because it bundles build tools for the agent, so the first start will be slow. Metrics are
|
||||
off; Prometheus would need a new scrape co
|
||||
|
||||
✻ Brewed for 4m 34s · done 14:04
|
||||
@@ -5,6 +5,9 @@ metadata:
|
||||
namespace: argocd
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "1"
|
||||
notifications.argoproj.io/subscribe.on-sync-succeeded.slack: ""
|
||||
notifications.argoproj.io/subscribe.on-sync-failed.slack: ""
|
||||
notifications.argoproj.io/subscribe.on-degraded.slack: ""
|
||||
labels:
|
||||
app.kubernetes.io/name: ai-git-bot
|
||||
app.kubernetes.io/part-of: apps
|
||||
|
||||
@@ -29,7 +29,12 @@ spec:
|
||||
topologyKey: kubernetes.io/hostname
|
||||
initContainers:
|
||||
- name: gitea-dump
|
||||
image: gitea/gitea:28.0.0
|
||||
# MUST match the running server's Gitea version (chart gitea 12.7.0 ->
|
||||
# appVersion 1.27.0, see infra/base/gitea/gitea.yaml). `gitea dump` reads
|
||||
# the schema its own binary knows about, so a newer binary dumps tables
|
||||
# the server has not migrated yet and dies on the first missing one.
|
||||
# Bump this only together with the chart, never on its own.
|
||||
image: gitea/gitea:1.27.0
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
@@ -49,25 +54,36 @@ spec:
|
||||
mountPath: /tmp/gitea-dump
|
||||
containers:
|
||||
- name: upload
|
||||
image: minio/mc:latest
|
||||
# Was minio/mc:latest until MinIO made the mc repository private -
|
||||
# every tag now returns 401 on Docker Hub and quay.io, so the pod
|
||||
# died in ImagePullBackOff. rclone is a public, pinned equivalent:
|
||||
# `delete --min-age` replaces `mc rm --older-than`.
|
||||
image: rclone/rclone:1.75.2
|
||||
env:
|
||||
- name: HOME
|
||||
value: /tmp
|
||||
- name: RCLONE_CONFIG_S3_TYPE
|
||||
value: s3
|
||||
- name: RCLONE_CONFIG_S3_PROVIDER
|
||||
value: Other
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
mc alias set s3 "${S3_ENDPOINT}" "${AWS_ACCESS_KEY_ID}" "${AWS_SECRET_ACCESS_KEY}"
|
||||
set -e
|
||||
export RCLONE_CONFIG_S3_ENDPOINT="${S3_ENDPOINT}"
|
||||
export RCLONE_CONFIG_S3_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}"
|
||||
export RCLONE_CONFIG_S3_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}"
|
||||
|
||||
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
|
||||
KEY="gitea-dump-${TIMESTAMP}.zip"
|
||||
echo "Uploading ${KEY}..."
|
||||
mc cp /backup/gitea-dump.zip "s3/${S3_BUCKET}/${KEY}" && \
|
||||
rclone copyto /backup/gitea-dump.zip "s3:${S3_BUCKET}/${KEY}"
|
||||
echo "Upload complete."
|
||||
|
||||
# Prune backups older than 7 days
|
||||
echo "Pruning backups older than 7 days..."
|
||||
mc rm --older-than 7d --force "s3/${S3_BUCKET}/" 2>&1 || true
|
||||
rclone delete --min-age 7d "s3:${S3_BUCKET}/" || true
|
||||
echo "Pruning complete."
|
||||
envFrom:
|
||||
- secretRef:
|
||||
|
||||
@@ -50,6 +50,12 @@
|
||||
"matchDepNames": ["/forteapps\\.net/"],
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"description": "The gitea-dump image is not an independent dependency - it must stay on the exact version the Gitea chart deploys, or `gitea dump` fails against an older schema. Bump it by hand together with infra/base/gitea.",
|
||||
"matchFileNames": ["cluster-resources/gitea-backup-cronjob.yaml"],
|
||||
"matchPackageNames": ["gitea/gitea"],
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"description": "Platform chart majors usually carry values-schema or CRD breaks - flag them for a careful read.",
|
||||
"matchFileNames": ["infra/**"],
|
||||
|
||||
Reference in New Issue
Block a user