fix: resolve status identity through one resolver for every path #856

Merged
hexajon merged 2 commits from issue-460-one-identity-resolver into main 2026-10-21 02:46:29 +00:00
Owner

Summary

@/scratch/pr-460.md

Closes #460

## Summary @/scratch/pr-460.md Closes #460
Status now answers "which repo is this?" with one function for the dir= path
and the cwd path, so host, owner, and repo come from one source.

- The host is the host of the forge that the resolution chain picks for the
  repo: MADTEA_URL, the repo's own madtea.url, its origin host, then the
  global madtea.url. There is no separate origin read for the host, and the
  --repo / MADTEA_REPO override uses the same chain.
- On the cwd path the override sets owner/repo. A dir= target ignores the
  override, because dir= moves the tree and the identity together.
- The override relabels the identity only. Branch, HEAD, and ahead/behind
  still describe the local tree.
- The text line now shows host/owner/repo, not only owner/repo.

Closes #460
fix: take the status host from the API forge resolution
Some checks failed
drift / govulncheck (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 2m12s
drift / forgejo-smoke (pull_request) Has been skipped
drift / govulncheck (push) Has been skipped
drift / surface-diff (push) Successful in 1m34s
drift / forgejo-smoke (push) Has been skipped
ci / gate (pull_request) Successful in 37m33s
ci / gate (push) Failing after 24m1s
4607be511b
Status .host now names the forge that API calls reach for the repo. API
calls use MADTEA_URL only when MADTEA_TOKEN is also set, so MADTEA_URL
alone no longer sets the host.

- config: envOverrideURL holds the one MADTEA_URL plus MADTEA_TOKEN rule,
  and getConfigFromEnv uses it. APIForgeURLForDir returns the API forge
  URL for a dir without loading credentials. GetConfigForDir and
  APIForgeURLForDir share dirResolveGitChainURL for the git steps.
- status uses APIForgeURLForDir in place of the report chain winner.
- The override tests pin literal hosts for the env, origin, and global
  cases, and a new test covers MADTEA_URL without MADTEA_TOKEN.
- The status text line builds the identity first and keeps one format
  string.

Refs #460
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!856
No description provided.