refactor(#4913): github setup reads layered config for install - #7072
refactor(#4913): github setup reads layered config for install#7072fullsend-ai-coder[bot] wants to merge 6 commits into
Conversation
Move preset loading before inference validation so the preset base layer can satisfy --inference-project and --inference-wif-provider requirements without requiring flags. When a preset provides mint/inference values, the installer uses the layered config accessor chain (overlay flag -> base preset -> code defaults) to resolve effective values for dual-write vars/secrets. Changes: - Parse preset YAML early and build a PerRepoConfigReader before the inference-project/WIF-provider validation - Skip secret existence check when preset config provides the required values (configProject / configWIF flags) - Validate WIF format for preset-provided values - resolveEffectiveValue helper uses flag -> config -> code default resolution for dual-write vars and secrets - effectiveRuntime also resolves from preset when present - Tests covering config-driven (no flags), flag override, dry run, partial preset, and resolveEffectiveValue unit Closes #4913
|
🤖 Finished Review · ✅ Success · Started 9:06 AM UTC · Completed 9:25 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.63 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Risk Assessment: moderate (2/5) DetailsBot-authored layered-config refactor with Tier 1 signals unchanged from prior assessment (519 lines same 300-799 band, blast_radius still large, test_ratio still 0.20, no protected paths or dependency changes); Tier 2 github.go profile identical to prior (19 commits/30d, 8 authors/90d); composite 2.35 rounds to 2, consistent with prior moderate score. Previous runRisk Assessment: moderate (2/5) DetailsBot-authored layered-config refactor with Tier 1 signals unchanged from prior assessment (519 lines same 300-799 band, blast_radius still large, test_ratio still 0.20, no protected paths or dependency changes); Tier 2 confirms same github.go profile as prior (19 vs 18 commits/30d, 8 authors/90d); composite 2.37 rounds to 2, consistent with prior moderate score. Previous run (2)Risk Assessment: moderate (2/5) DetailsBot-authored refactor with unchanged signals from prior assessment (475->524 lines stays in same band, same blast radius large, same test ratio 0.20, same github.go churn of 18 commits/30d and 8 authors/90d); composite 1.87 rounds to 2, consistent with prior moderate score. Previous run (3)Risk Assessment: moderate (2/5) DetailsBot-authored refactor of moderate size (475 lines, 5 files) with suboptimal test coverage (ratio 0.20) on a high-churn, multi-author file (github.go: 18 commits/30d, 8 authors/90d, 20 fix commits/90d); Tier 1 (1.5), Tier 2 (2.11), Tier 3 (2.0) yield composite ~1.78, consistent with the prior moderate score of 2. Previous run (4)Risk Assessment: moderate (2/5) DetailsBot-authored refactor of moderate size (453 lines, 5 files) with acceptable but not exemplary test coverage (ratio 0.20) on a high-churn file (8 authors, 20 fix commits in 90d); low Tier 1 (1.5) and anchored Tier 2 (2.57) yield a composite of ~1.96, preserving the prior moderate score of 2. Previous run (5)Risk Assessment: moderate (2/5) DetailsLow Tier 1 (1.25) driven by small bot-authored PR with excellent test coverage offsets an elevated Tier 2 (2.57) caused by high churn and many fix commits in the actively-developed github.go file, yielding a moderate composite risk of 2. |
ReviewFindingsHigh
Next steps:
Previous runReviewFindingsLow
Next steps:
Previous run (2)ReviewFindingsLow
Next steps:
Previous run (3)ReviewFindingsMedium
Low
Next steps:
Previous run (4)ReviewFindingsLow
Next steps:
Previous run (5)ReviewFindingsMedium
Low
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 9:27 AM UTC · Completed 9:39 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.29 |
- Validate preset mint URL with validateMintURLHTTPS (symmetric with existing preset WIF validation) to prevent non-HTTPS or credentialed URLs from being written as FULLSEND_MINT_URL - Update docs/guides/getting-started/configuring-github.md vendor preset example to show minimal --config-only invocation - Update docs/guides/infrastructure/advanced-setup.md vendor preset example to remove now-optional flags - Update docs/cli/github.md intro and flags table to reflect that values can come from a vendor preset - Add negative tests for invalid preset WIF and mint URL validation - Add comment explaining intentional effectiveRuntime resolution asymmetry vs resolveEffectiveValue - Change StepDone to StepInfo for retrospective preset confirmations (no preceding StepStart) Note: pre-commit hooks were not run. `pre-commit` could not complete (infrastructure failure), and gofmt/go vet were run directly. Unrelated pre-existing test failures in TestStartFetchService_* and TestPostScriptEnv_* are not caused by these changes. Addresses #7072
🔧 Fix agent — iteration 1 (bot-triggered)Addressed all 8 review findings: added preset mint URL validation (security fix), updated 3 documentation pages for accuracy, added 2 negative tests, added explanatory comment for runtime resolution asymmetry, and fixed StepDone/StepInfo inconsistency. Fixed (8):
Tests: passedNext steps:
|
|
🤖 Review · ❌ Terminated · Started 9:41 AM UTC · Ended 9:56 AM UTC Commit: |
Site previewPreview: https://b139a8e7-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 9:41 AM UTC · Completed 9:56 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.03 |
|
🤖 Finished Fix · ✅ Success · Started 9:58 AM UTC · Completed 10:08 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.65 |
- Move Banner call before preset loading block so StepStart/StepDone/ StepFail progress indicators are emitted during preset fetch, hash validation, and YAML validation — restoring the in-flight feedback that was lost when preset loading was moved earlier in the function. - Rename configProject/configWIF to presetProvidesProject/ presetProvidesWIF for clarity — matches the predicate naming convention used by nearby booleans (reuseProject, reuseWIF). Addresses #7072
🔧 Fix agent — iteration 2 (bot-triggered)Addressed both review findings: restored in-flight progress feedback for preset fetch operations by moving the Banner call earlier, and renamed ambiguous boolean variables to predicate-style names matching existing conventions. Fixed (2):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:10 AM UTC · Completed 10:29 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $6.30 |
|
🤖 Finished Fix · ✅ Success · Started 10:31 AM UTC · Completed 10:41 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.78 |
Move preset WIF provider validation into the preset-loading block so it runs unconditionally (matching the mint URL pattern), preventing an invalid WIF from being committed as config.base.yaml when a valid flag overrides it. Add test covering the asymmetric-validation scenario. Document defensive empty-string guards on effectiveProject/effectiveWIF. Note: pre-commit hooks were not run. `pre-commit` could not complete (infrastructure failure), and the direct-execution fallback was used for gofmt/go vet instead. Addresses #7072
🔧 Fix agent — iteration 3 (bot-triggered)Fixed asymmetric preset validation (WIF provider now validated unconditionally in the preset-loading block, matching the mint URL pattern) and documented defensive empty-string guards. Added test covering the exact scenario the reviewer identified: preset with invalid WIF + valid flag override. Fixed (2):
Tests: passed Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 10:43 AM UTC · Completed 10:59 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.47 |
|
🤖 Finished Fix · ✅ Success · Started 11:01 AM UTC · Completed 11:12 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.69 |
- Remove unreachable dead-code guards around effectiveProject/effectiveWIF assignments; the control flow already guarantees non-empty values (strategy change: previous iterations added defensive comments, this iteration removes the guards entirely per reviewer feedback) - Trim preset loading section comment to scannable label with rationale on a separate line - Add descriptive message to assert.Equal for FULLSEND_PER_REPO_INSTALL Note: pre-commit hooks were not run. `pre-commit` could not complete (infrastructure failure), and the direct-execution fallback ran gofmt and go vet manually. TestPostScriptEnv_NoSchemaAppendedWhenNoValidationLoop failure is pre-existing (present on the branch before this commit). Addresses #7072
🔧 Fix agent — iteration 4 (bot-triggered)Addressed all 4 review findings: removed unreachable dead-code guards (strategy escalation from iteration 3), trimmed section comment to scannable label, added test assertion message. Disagreed with partial-scope finding as it's a project-management observation outside fix-agent scope. Fixed (3):
Disagreed (1):
Tests: passed
Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 11:14 AM UTC · Completed 11:31 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.52 |
|
🤖 Finished Fix · ✅ Success · Started 11:33 AM UTC · Completed 11:40 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.13 |
Replace Unicode logical-implication (⇒) and disjunction (∨) operators in invariant comments with plain-ASCII equivalents (=> and ||) for consistency with the rest of the Go codebase. Note: pre-commit hooks were not run. `pre-commit` could not complete (infrastructure failure / network-restricted sandbox). Addresses #7072
🔧 Fix agent — iteration 5 (bot-triggered)Replaced Unicode logical symbols with ASCII equivalents in invariant comments. Disagreed with partial-scope finding: the fix agent cannot edit PR bodies (forge mutation) and updating internal/repos/install.go is beyond fix scope. Fixed (1):
Disagreed (1):
Tests: passed
Decision points
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 11:42 AM UTC · Completed 12:00 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $5.68 |
|
🤖 Finished Fix · ❌ Failure (running pre-script: exit status 1) · Started 12:02 PM UTC · Completed 12:02 PM UTC Commit: Effort: high |
Summary
Refactors the
fullsend github setup <owner/repo>install path to prefer layered config accessors over CLI flags when a preset base layer provides mint/inference values (ADR 0069 Decision 1).Previously,
--inference-projectand--inference-wif-providerflags were always required (unless the corresponding repo secrets already existed). With this change, when a preset (--config) provides those values, the installer reads them from the preset's layered config accessors instead.Changes
resolveEffectiveValuehelper that resolves flag → config accessor → code default for dual-write vars/secretsTesting
TestRunGitHubSetupPerRepo_ConfigDriven_NoFlagsNeeded— preset provides all values, no flagsTestRunGitHubSetupPerRepo_ConfigDriven_FlagOverridesPreset— flag values override presetTestRunGitHubSetupPerRepo_ConfigDriven_DryRun— dry run with presetTestRunGitHubSetupPerRepo_ConfigDriven_PartialPreset— preset has mint/region, flags have project/WIFTestResolveEffectiveValue— unit tests for the resolution helperrunGitHubSetupPerRepo87%,resolveEffectiveValue100%Note: pre-commit hooks could not run in sandbox (network-restricted).
gofmt,go vet, and manual checks passed.Closes #4913
Post-script verification
agent/4913-install-layered-config)b45ea5d71f2ea3dc1d8a07e69ab13626067c5e7b..HEAD)