Skip to content

Commit 8dd07bc

Browse files
committed
remove ci flag
1 parent f08a048 commit 8dd07bc

7 files changed

Lines changed: 19 additions & 16 deletions

File tree

DESIGN-zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export ZADIG_REVIEW_MODEL_API_KEY=...
145145

146146
`config show` 会隐藏 API Key;`config get model.api_key` 返回真实值。正式 review 检测到默认模型占位值时返回配置错误,preview 不要求模型配置。
147147

148-
`--ci` 默认将控制台模式切换为 `summary`,显式 `--console` 可覆盖。审查控制、模型协议/名称/Endpoint/Timeout 和输出设置可通过 review flags 覆盖;API Key 只通过配置文件或环境变量传入。
148+
审查控制、模型协议/名称/Endpoint/Timeout 和输出设置可通过 review flags 覆盖;API Key 只通过配置文件或环境变量传入。
149149

150150
## 5. Rules
151151

DESIGN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ built-in defaults < config file < ZADIG_REVIEW_MODEL_* < review flags
112112

113113
Environment variables are `ZADIG_REVIEW_MODEL_PROTOCOL`, `ZADIG_REVIEW_MODEL_NAME`, `ZADIG_REVIEW_MODEL_ENDPOINT`, `ZADIG_REVIEW_MODEL_TIMEOUT`, and `ZADIG_REVIEW_MODEL_API_KEY`.
114114

115-
`config show` redacts API keys, while `config get model.api_key` returns the actual value. A real review rejects the placeholder default model; preview does not require model configuration. `--ci` selects summary console output unless an explicit `--console` overrides it. API keys can only come from configuration or the environment, not review flags.
115+
`config show` redacts API keys, while `config get model.api_key` returns the actual value. A real review rejects the placeholder default model; preview does not require model configuration. Review controls, model settings, and output settings can be overridden by review flags. API keys can only come from configuration or the environment, not review flags.
116116

117117
## 5. Rules
118118

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ help:
2424
@echo " clean Remove build output"
2525

2626
fmt:
27-
gofmt -w cmd internal
27+
gofmt -w main.go internal
2828

2929
fmt-check:
30-
@test -z "$$(gofmt -l cmd internal)" || (gofmt -l cmd internal && exit 1)
30+
@test -z "$$(gofmt -l main.go internal)" || (gofmt -l main.go internal && exit 1)
3131

3232
verify:
3333
go mod verify

README-en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ zadig-review-agent rules check internal/reviewer/reviewer.go
139139

140140
## CI usage
141141

142-
The `--ci` flag selects concise console output. Explicit report paths are convenient for CI artifacts:
142+
In CI, use `--console summary` for concise final output and explicit report paths for convenient artifact upload:
143143

144144
```bash
145145
zadig-review-agent review \
146146
--from origin/main \
147147
--to HEAD \
148-
--ci \
148+
--console summary \
149149
--output-json "$PWD/review-report.json" \
150150
--output-md "$PWD/review-report.md"
151151
```

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ zadig-review-agent rules check internal/reviewer/reviewer.go
139139

140140
## CI 用法
141141

142-
`--ci` 会启用精简控制台输出。在 CI 中显式指定报告路径便于上传制品
142+
在 CI 中可使用 `--console summary` 精简最终结果,并显式指定报告路径以便上传制品
143143

144144
```bash
145145
zadig-review-agent review \
146146
--from origin/main \
147147
--to HEAD \
148-
--ci \
148+
--console summary \
149149
--output-json "$PWD/review-report.json" \
150150
--output-md "$PWD/review-report.md"
151151
```

internal/cli/cli.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func runReview(ctx context.Context, args []string, stdout, stderr io.Writer) (in
5959
commit := fs.String("commit", "", "commit sha to review")
6060
rulePath := fs.String("rule", "", "path to Zadig review rules JSON")
6161
preview := fs.Bool("preview", false, "print file filtering and rule resolution without invoking the model")
62-
ciMode := fs.Bool("ci", false, "use CI-friendly console output")
6362
concurrency := fs.Int("concurrency", 0, "max concurrent file reviews")
6463
contextLines := fs.Int("context-lines", 0, "context lines around changes")
6564
maxToolRounds := fs.Int("max-tool-rounds", 0, "max main tool-loop request rounds")
@@ -88,7 +87,6 @@ func runReview(ctx context.Context, args []string, stdout, stderr io.Writer) (in
8887
}
8988
visited := visitedFlags(fs)
9089
if err := applyCLIOverrides(&cfg, visited, cliOverrides{
91-
ciMode: *ciMode,
9290
concurrency: *concurrency,
9391
contextLines: *contextLines,
9492
maxToolRounds: *maxToolRounds,
@@ -575,7 +573,6 @@ func usage(w io.Writer) {
575573
}
576574

577575
type cliOverrides struct {
578-
ciMode bool
579576
concurrency int
580577
contextLines int
581578
maxToolRounds int
@@ -603,9 +600,6 @@ func visitedFlags(fs *flag.FlagSet) map[string]bool {
603600
}
604601

605602
func applyCLIOverrides(cfg *config.Config, visited map[string]bool, o cliOverrides) error {
606-
if visited["ci"] && o.ciMode {
607-
cfg.Output.Console = "summary"
608-
}
609603
if visited["concurrency"] {
610604
if o.concurrency < 1 {
611605
return fmt.Errorf("--concurrency must be a positive integer")

internal/cli/cli_test.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ func TestRepositoryPathGroupingUsesFlattenedFullPath(t *testing.T) {
189189
}
190190
}
191191

192+
func TestReviewCIFlagRejected(t *testing.T) {
193+
var stdout, stderr bytes.Buffer
194+
code, err := Run(context.Background(), []string{"review", "--ci", "--preview"}, &stdout, &stderr)
195+
if err == nil || code == 0 {
196+
t.Fatalf("expected --ci to be rejected, code=%d stdout=%s stderr=%s", code, stdout.String(), stderr.String())
197+
}
198+
if !strings.Contains(stderr.String(), "flag provided but not defined") {
199+
t.Fatalf("unexpected stderr: %s", stderr.String())
200+
}
201+
}
202+
192203
func TestReviewBaseFlagRejected(t *testing.T) {
193204
var stdout, stderr bytes.Buffer
194205
code, err := Run(context.Background(), []string{"review", "--base", "origin/main", "--preview"}, &stdout, &stderr)
@@ -278,7 +289,6 @@ func TestConfigSetHelpListsKeys(t *testing.T) {
278289
func TestApplyCLIOverrides(t *testing.T) {
279290
cfg := config.Default()
280291
visited := map[string]bool{
281-
"ci": true,
282292
"concurrency": true,
283293
"context-lines": true,
284294
"max-tool-rounds": true,
@@ -297,7 +307,6 @@ func TestApplyCLIOverrides(t *testing.T) {
297307
"progress": true,
298308
}
299309
err := applyCLIOverrides(&cfg, visited, cliOverrides{
300-
ciMode: true,
301310
concurrency: 8,
302311
contextLines: 12,
303312
maxToolRounds: 3,

0 commit comments

Comments
 (0)