fix: status --json reports the auth-target host, not the repo's own remote host #429
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#429
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?
Summary
madtea status --jsonsets.hostto the host of the configured/authenticated server, not the host of the current repo's own remote. When the working repo'soriginpoints at a different Forgejo/Gitea instance than the one madtea is authenticated against,.hostis wrong.Repro
forge-a.example).cdinto a clone whoseoriginpoints at forge B (hostforge-b.example).madtea status --json.Observed:
.host=forge-a.example(the auth target)..ownerand.repoare correct for forge B (parsed from the local remote).Expected:
.host=forge-b.example(the repo's actual remote host).The data is available; only
statususes the wrong sourceTwo other surfaces resolve the correct remote host for the same repo:
madtea repo view --jsonreturnsclone_urlandhtml_urlonforge-b.example.madt_statustool (dir-targeted) returns"host": "forge-b.example"and"foreignPrimary": true.So the local remote is parsed correctly elsewhere. Only
status --json .hostreports the auth target.Why it matters
.hostis the natural token-free field for "which forge does this repo live on". A caller that trusts it to gate per-forge behavior gets the auth target for every repo, so every repo looks like it lives on the configured server.repo viewneeds a network round trip; a correct local.hostwould avoid that.Suggested fix
Make
status .hostreport the host parsed from the repo's own remote, the same valuemadt_statusandrepo viewalready return. If the auth-target host is also useful, expose it under a separate field.Version
madtea version v0.18.4