feat: MCP support for profiles.json v2 contexts schema with enabled enforcement #120
Reference in New Issue
Block a user
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?
Problem
The merged v2 parser (#103) implements
version: 2asenvironments → services → identities. The canonical live config at~/.config/gitea-tools/profiles.jsonuses the contexts shape (contexts/profiles/projects/rules) withenabledflags. Result today:gitea_config.load_config()rejects the live file (version 2 config requires a non-empty 'environments' object).gitea_auth.get_auth_header()swallows theConfigErrorand silently falls back to env/keychain auth — violating theno_silent_fallbackrule.enabledflag is not understood anywhere in the parser.Required behavior
profiles.jsonversion 2 in the contexts shape:contexts,profiles,projects, per-contextservices,rules.enabledflags: refuse to select/act with disabled profiles, contexts, projects, or services. Disabled entries are reported in audits but never used.GITEA_MCP_PROFILE.GITEA_MCP_CONFIGis set and the config or selected profile is unusable, fail closed with a clear, secret-free error.Tests (acceptance)
GITEA_MCP_PROFILE.Notes
https://git.dadeschools.netas a temporary endpoint — intentional; carry adescriptionnoting it should be replaced with the final GlitchTip URL later. Not a blocker.