Repository navigation
Expand file tree
/
Copy pathcodegoose-setup.yaml
More file actions
199 lines (180 loc) · 8.34 KB
/
Copy pathcodegoose-setup.yaml
File metadata and controls
199 lines (180 loc) · 8.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
version: "1.0.0"
title: "CodeGoose CI Setup"
description: >
If this repo has no goose AI code review CI, create the config file for the
selected platform; if one exists, update it to match the chosen options.
CI platform (github/gitlab/gitea/teamcity), review comment language, PR comment
style, and LLM provider are all chosen via dropdowns. Based on the official
goose CI/CD tutorial (https://goose-docs.ai/docs/tutorials/cicd).
The generated config is rendered deterministically from templates in
soolmuk/CodeGoose (scripts/render.py), NOT authored by the LLM.
parameters:
- key: ci_platform
input_type: select
requirement: required
description: CI platform to set up (goose reviews pull requests / MRs there)
options:
- github
- gitlab
- gitea
- teamcity
- key: output_language
input_type: select
requirement: required
description: Language for review comments and the setup report
options:
- Korean
- English
- Japanese
- Chinese
- key: review_style
input_type: select
requirement: required
description: What the CI posts on the pull request
options:
- graded-review
- changes-summary
- key: ci_provider
input_type: select
requirement: required
description: LLM provider used by goose in CI
options:
- ollama_cloud
- anthropic
- openai
- openrouter
- fireworks-ai
- key: goose_model
input_type: string
requirement: required
description: Model name for GOOSE_MODEL in the CI config
(e.g. glm-5.3 for ollama_cloud, claude-sonnet-4-5 for anthropic,
gpt-4o for openai, anthropic/claude-sonnet-4 for openrouter,
accounts/fireworks/models/deepseek-v4-flash-0731 for fireworks-ai)
- key: goose_verify_model
input_type: string
requirement: optional
default: ""
description: >
Optional model for the verification (reflection) pass only.
Leave empty to reuse goose_model for both passes (default).
Example for fireworks-ai:
accounts/fireworks/models/glm-5p3-flash
- key: verification_gate
input_type: select
requirement: required
description: >
Review verification gate (issue #10). After the first review pass, a
single reflection pass re-checks every finding (0-10 validity score)
and a deterministic merge gate keeps/demotes/drops findings.
on = gate enforced; shadow = gate outcomes recorded in CI logs only
(posted review is the unmodified first pass); off = no verification
step. Cost: on/shadow roughly doubles the LLM spend per review.
options:
- "on"
- "off"
- shadow
- key: verify_gate_profile
input_type: select
requirement: required
description: >
Gate profile. conservative = unmatched findings are kept, P0/P1
findings with a 4-6 validity score are demoted to Warnings.
strict = unmatched findings are dropped, and the same thresholds
apply to every priority (score <= 4 drop, 5-7 demote, >= 8 keep).
Keep the default unless shadow measurements justify tightening.
options:
- conservative
- strict
extensions:
- type: builtin
name: developer
settings:
temperature: 0.1
prompt: |
You are a CI/CD setup specialist for goose. Set up goose AI code review CI for
THIS repository (the current working directory) on {{ ci_platform }}.
## CRITICAL: You are a driver, not an author.
Do NOT write CI YAML by hand. The rendered configs are PRODUCED by the shared
pipeline in soolmuk/CodeGoose: a python renderer downloads platform
templates from that repo and substitutes parameters deterministically.
Your job: (1) select parameters, (2) RUN the scripts, (3) report. Never
hand-edit the generated config; if something is wrong, fix the templates in
soolmuk/CodeGoose instead.
## Parameters (chosen by the user via this recipe)
- ci_platform: {{ ci_platform }}
- output_language: {{ output_language }}
- review_style: {{ review_style }}
- ci_provider: {{ ci_provider }}
- goose_model: {{ goose_model }}
- goose_verify_model: {{ goose_verify_model }} (empty = same as goose_model)
- verification_gate: {{ verification_gate }}
- verify_gate_profile: {{ verify_gate_profile }}
(Provider -> secret name: ollama_cloud=OLLAMA_CLOUD_API_KEY,
anthropic=ANTHROPIC_API_KEY, openai=OPENAI_API_KEY, openrouter=OPENROUTER_API_KEY,
fireworks-ai=FIREWORKS_API_KEY)
## Step 1 — Inspect (read-only)
Check for existing CI configs: github `.github/workflows/*.yml`,
gitlab `.gitlab-ci.yml`, gitea `.gitea/workflows/*.yml`, teamcity `.teamcity/*.kts`.
If an existing config was rendered by this pipeline before (it carries the
marker comment `Rendered by soolmuk/CodeGoose`), it will be overwritten
by the same renderer — that is expected drift control.
## Step 2 — Download and run the renderer ({{ ci_platform }})
```bash
curl -fsSL https://github.com/soolmuk/CodeGoose/releases/latest/download/render.py -o /tmp/render.py
python3 /tmp/render.py {{ ci_platform }} \
--provider {{ ci_provider }} \
--model {{ goose_model }} \
--style {{ review_style }} \
--language {{ output_language }} \
--verification {{ verification_gate }} \
--verify-profile {{ verify_gate_profile }}
```
Note for teamcity: the renderer produces `.teamcity/settings.kts`; the review
text is published as the build artifact `pr_review.txt` (TeamCity cannot post
forge comments without extra REST setup).
For gitea: the user must also add a `REVIEW_TOKEN` secret (Gitea access token
with write permission) — include that in the report.
## Step 3 — Verify (the script's exit code is the contract)
```bash
curl -fsSL https://github.com/soolmuk/CodeGoose/releases/latest/download/verify.py -o /tmp/verify_ci.py
python3 /tmp/verify_ci.py {{ ci_platform }} <rendered-config-path>
```
Expected RESULT: PASS. If FAIL, report the failing checks; do NOT hand-patch
the config. Fixes belong in soolmuk/CodeGoose templates/scripts.
## Step 4 — Report (in {{ output_language }})
- Status (created/updated) + config file path, and that it was rendered by the
deterministic pipeline (not authored by the LLM).
- GOOSE_MODEL: {{ goose_model }} (hardcoded into the config by the renderer).
- Verification model: {{ goose_verify_model }} — the model the reflection
pass uses. GITHUB ONLY: the renderer rejects --verify-model on
gitlab/gitea/teamcity (exit 2), so if {{ ci_platform }} is not github
and the user set a value, report the constraint and RE-RUN WITHOUT the
flag instead of passing it. If the user left it empty, run the Step 2
command exactly as written (both passes then use GOOSE_MODEL; never
pass an empty --verify-model value — it would swallow the next flag).
If set AND the platform is github, ADD one line into the Step 2 command
right after --model:
--verify-model {{ goose_verify_model }} \\
(keep the trailing \\ continuation; must be a model from the SAME
provider {{ ci_provider }} — the rewritten config keeps the review
provider).
- Provider secret that the user must add, e.g. for {{ ci_provider }} the
required repo secret name from the mapping above.
- How to trigger: open/update a pull request; CI posts the {{ review_style }}
result in {{ output_language }}.
- For graded reviews the CI also posts up to 10 diff-anchored inline comments
(like CodeRabbit): each finding is validated against the PR/MR diff before
posting, and findings that cannot be anchored are recapped in the summary
comment instead — nothing is silently dropped.
- Verification gate ({{ verification_gate }} profile {{ verify_gate_profile }}):
when on/shadow, every finding is re-verified by a second goose pass
(reflection) before posting; refuted findings are removed, plausible-but-
unverified blockers are demoted to Warnings, and the verdict is recomputed.
The posted review notes how many findings were kept/demoted/dropped; the
dropped details live in the CI job log (dropped.json artifact), never
silently lost. Shadow mode records outcomes without changing the post.
Cost note: on/shadow ≈ 2x LLM spend per review; choose off to disable.
- Reminder: if this repo already has a CodeGoose-rendered CI config, this
run re-renders it in place (that is the intended drift control).
Do NOT git commit or push. Do NOT touch other files.