feat(#4976): store mint and inference settings in per-repo config - #5976
feat(#4976): store mint and inference settings in per-repo config#5976fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Add mint_url, inference_provider, inference_project, inference_region, and inference_wif_provider fields to per-repo config (ADR 0069 Decision 1). These fields make the layered config the source of truth for values previously supplied only via CLI flags and repo variables/secrets. Schema: new flat YAML fields on perRepoConfig with omitempty tags. Field names avoid the org-mode detection keys (dispatch, inference) in IsPerRepoYAML. Accessors: ConfigMintURL(), ConfigInferenceProvider(), ConfigInferenceProject(), ConfigInferenceRegion(), ConfigInferenceWIFProvider() on PerRepoConfigReader with layered fallback (overlay -> base -> code defaults). Corresponding setters on PerRepoConfigWriter. Installer wiring (fullsend github setup): - No preset: mint/inference values from flags go into config.yaml. - With preset: flag-specified values go into the overlay; the base layer stays identical to the fetched preset. Unspecified flags inherit from the base layer. Backward compatibility: repo variable/secret writes (FULLSEND_MINT_URL, FULLSEND_GCP_REGION, FULLSEND_GCP_PROJECT_ID, FULLSEND_GCP_WIF_PROVIDER) are preserved so existing workflows continue to read from vars/secrets. Note: pre-commit could not run in the sandbox (network error). The post-script runs pre-commit authoritatively on the runner. Closes #4976
|
🤖 Finished Review · ✅ Success · Started 12:13 PM UTC · Completed 12:28 PM UTC |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Low
Labels: PR modifies per-repo config schema and CLI setup for mint/inference settings |
There was a problem hiding this comment.
See the review comment for full details.
Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:
internal/cli/github.go:298: [medium] architectural-coherence
SetInferenceProvider("vertex") is hard-coded in the non-preset setup path with no corresponding --inference-provider CLI flag. Unlike the other four mint/inference settings, users cannot specify this value via the command line. Functionally correct today (only one valid provider), but creates flag-set asymmetry and prevents users from selecting a different provider if one is added to ValidProviders().
Suggested fix: Add --inference-provider flag defaulting to "vertex", and include "inference-provider" in buildPresetOverlay's flagNames list.
internal/cli/github.go:300: [low] data-exposure
GCP project ID and WIF provider resource name are now written to both .fullsend/config.yaml (plaintext) and GitHub repo secrets. These are resource identifiers (not credentials), and dual storage is likely transitional for backward compatibility, but the authoritative source should be clarified.
internal/config/config.go:773: [low] input-validation
Validate() checks inference_provider against ValidProviders() but does not validate mint_url (HTTPS), inference_wif_provider (format), or other new fields when loaded from disk. CLI validates at the flag level, but configs loaded via LoadConfig bypass those checks.
Suggested fix: Consider adding HTTPS validation for mint_url and pattern validation for inference_wif_provider in Validate().
internal/config/config.go(file-level): Line 206 · [low] design-smell
Comment claims field names are 'prefixed to avoid colliding with org-mode detection keys' but names avoid collision by specificity (inference_provider vs inference), not by a shared prefix.
Suggested fix: Update comment to accurately reflect the naming convention.
internal/config/interfaces.go(file-level): Line 375 · [low] pattern-inconsistency
Section comment block explaining the fallback pattern is more verbose than equivalent sections for existing scalar getters.
internal/config/interfaces.go(file-level): Line 346 · [low] comment-style
ADR reference in interface getter doc comments inconsistent with other getters in the file which don't include ADR references.
internal/config/defaults.go:40: [low] comment-style
Default getter comments more verbose than established concise pattern used by other default methods.
Summary
mint_url,inference_provider,inference_project,inference_region, andinference_wif_providerfields to per-repo config schema (ADR 0069 Decision 1)ConfigMintURL(),ConfigInferenceProvider(), etc.) onPerRepoConfigReaderwith layered fallback (overlay → base → code defaults) and corresponding setters onPerRepoConfigWriterfullsend github setupto populate mint/inference values in config: flag values go into config.yaml (no preset) or overlay (with preset), while the base layer stays identical to the fetched presetDesign
Schema fields: Flat YAML keys on
perRepoConfig(mint_url,inference_provider,inference_project,inference_region,inference_wif_provider). Field names are prefixed to avoid colliding with the org-mode detection keys inIsPerRepoYAML(dispatch,inference).Accessor pattern: Follows the existing scalar fallback convention (e.g.,
ConfigRuntime(),ConfigForge()): local value → parent → empty string. Code defaults inperRepoDefaultsreturn""for all mint/inference fields — callers that need a fallback (e.g., the CLI) useDefaultMintURL.Installer wiring: When
--config(preset) is provided, flag-specified values go into the overlay; unspecified flags inherit from the base layer via the accessor chain. ThechangedFlagsmap records which CLI flags were explicitly set.Backward compatibility: Existing repo variable/secret writes (
FULLSEND_MINT_URL,FULLSEND_GCP_REGION,FULLSEND_GCP_PROJECT_ID,FULLSEND_GCP_WIF_PROVIDER) are preserved so existing workflow templates continue to read from vars/secrets when config fields are absent.Testing
IsPerRepoYAMLcorrectly identifies config with new fields as per-repo (not org)buildPresetOverlaycorrectly writes only flag-changed valuesinference_providervaluesCloses #4976
Post-script verification
agent/4976-mint-inference-config)fac93d227b4e30eaa553b16d059eac6624ec9fc2..HEAD)