ADR 0025 T5: per-dir and per-URL config resolution entry points #31
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add
internal/config/resolve_dir.go:GetConfigForDir(ctx, dir) (*Config, error)— chain against the repo at dir: env → dir-local--localmadtea.url →OriginForgeURL(dir)→ global fallback; per-dir cache, never touches the process cache;ClearCache()clears it too.GetConfigForURL(ctx, forgeURL) (*Config, error)— credentials for a known forge URL via the host-keyed backend.no credentials for <host> — run madtea auth login…;cannot determine the forge for <dir>….testingConfigGuard()before any git/origin read; env short-circuit first.Also (follow-up from T4 review): make
IsConfigured(internal/config/config.go:98) origin-aware — an origin-only repo with resolvable credentials must count as configured (it currently reads merged madtea.url only; consumers: setup.go, mcp/context.go).Tests: dir with codeberg origin resolves codeberg while process cache stays on the cwd forge; dir-local override wins; cache isolation. Table-driven, temp repos,
GIT_CONFIG_GLOBALunder temp.Acceptance:
go test ./internal/config/green; chain-order tests from T4 untouched.Part of #30.