Repository navigation
[AI:zf-builder] refactor(server): remove dead ProductionEnvironment constant - #192
Conversation
Task: zf-z-74d33f39 refactor(server): remove dead ProductionEnvironment constant (Ponytail Rung 1)
Deploying zerohub with
|
| Latest commit: |
410dd73
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9414e96d.zerohub.pages.dev |
| Branch Preview URL: | https://task-zf-z-74d33f39.zerohub.pages.dev |
ntsd
left a comment
There was a problem hiding this comment.
[AI:zf-reviewer] [Reviewer Feedback] Round 1: Approved for human review.
Scope (Rung 7 — Minimum Viable Solution): Diff is exactly the proposed change: 2 lines deleted from server/pkg/config/config.go (comment + constant) and 1 line updated in server/pkg/config/config_test.go:78. No drive-by churn, no reformatting, no debug artifacts, no unrelated files.
Correctness & completeness: grep -rn ProductionEnvironment across the whole repo (all languages, including docs/openwiki) returns zero hits after the removal. The surviving DevelopEnvironment is still referenced in production logic (server/pkg/logger/logger.go:15) and in TestLoadConfigDefaults (config_test.go:46), so the enum pair reduction is asymmetric but intentional: "prod" is the implicit else-branch of the only environment check in the codebase.
Test adequacy: TestLoadConfigEnvOverrides remains a genuine round-trip assertion — it sets APP_ENVIRONMENT=prod via os.Setenv and verifies LoadConfig() parses it into App.Environment. Replacing the constant with the raw literal Environment("prod") is the minimal correct choice; the assertion is not tautological, so it was rightly kept rather than dropped.
Dependency veto (Rungs 3 & 5): No manifest changes, no new packages.
Ponytail (Rung 1 — YAGNI / dead code): The constant had zero non-test references; its only use was the test literal it documented. Deletion is the correct call. The task's "keep enum pairs as documentation" caveat is noted, but the anti-slop rule prevails and the task description itself prescribed this exact change.
Verification (all green on this branch):
go build ./...— passgo vet ./...— passgo test ./...— all packages pass (config 0.010s, handler 9.007s, hub 2.724s, peer 0.021s, storage 0.003s, zerohub 0.012s)- Mergeability: PR is MERGEABLE against
main(no conflicts)
CONVENTION: For ZeroHub dead-code removal PRs, grep the whole repo for the removed symbol (including non-Go/docs files) and gate on cd server && go build ./... && go vet ./... && go test ./... — the server Go suite is the only affected test surface.
[AI:zf-builder] Task: zf-z-74d33f39
refactor(server): remove dead ProductionEnvironment constant (Ponytail Rung 1)
Automated PR for task zf-z-74d33f39
Completed by: @zf-builder