feat(repos): surface a mirror's upstream source (original_url + last sync) in get output #467

Open
opened 2026-09-04 16:28:46 +00:00 by hexajon · 0 comments
Owner

When a repo is a mirror, madt_repos action=get reports mirror: true but not WHERE it mirrors from. To learn the upstream source I have to drop to the raw API escape hatch:

madt_api_call GET /repos/search?q=<name>&mode=mirror
  jq '.data[] | {full_name, original_url, mirror_updated}'

The get formatted output already holds the full repo object. It just does not print the two fields that answer "what does this mirror track, and is it current":

  • original_url - the upstream source URL the mirror clones from
  • mirror_updated - the last successful sync time

Repro

madt_repos action=get owner_repo=<org>/<a-github-mirror> prints:

<org>/<repo> (TypeScript) [private: false, fork: false, mirror: true]
Created: ... | Updated: ... | Default branch: dev
Clone: https://<forge>/.../<repo>.git | SSH: ... | URL: https://<forge>/.../<repo>
Stars: 0 | Forks: 0 | Issues: 0 | Size: ...

The output says the repo IS a mirror, but never says the GitHub source it mirrors, nor when it last synced. Both live on the same object I just fetched.

Ask

When mirror is true, add the upstream source and last sync to the formatted get output, for example:

Mirror of: https://github.com/owner/repo (last synced 2026-09-03T02:09Z)

Acceptance

  • madt_repos action=get on a mirror prints original_url (the source) and mirror_updated in the formatted text.
  • A non-mirror repo is unchanged: no empty "Mirror of:" line.
  • Learning a mirror's upstream needs no raw madt_api_call.

Optional follow-on

Surface the same "mirror of X" line in madt_status, since that is the other place the question "what is this checkout" gets asked.

When a repo is a mirror, `madt_repos action=get` reports `mirror: true` but not WHERE it mirrors from. To learn the upstream source I have to drop to the raw API escape hatch: ``` madt_api_call GET /repos/search?q=<name>&mode=mirror jq '.data[] | {full_name, original_url, mirror_updated}' ``` The `get` formatted output already holds the full repo object. It just does not print the two fields that answer "what does this mirror track, and is it current": - `original_url` - the upstream source URL the mirror clones from - `mirror_updated` - the last successful sync time ### Repro `madt_repos action=get owner_repo=<org>/<a-github-mirror>` prints: ``` <org>/<repo> (TypeScript) [private: false, fork: false, mirror: true] Created: ... | Updated: ... | Default branch: dev Clone: https://<forge>/.../<repo>.git | SSH: ... | URL: https://<forge>/.../<repo> Stars: 0 | Forks: 0 | Issues: 0 | Size: ... ``` The output says the repo IS a mirror, but never says the GitHub source it mirrors, nor when it last synced. Both live on the same object I just fetched. ### Ask When `mirror` is true, add the upstream source and last sync to the formatted `get` output, for example: ``` Mirror of: https://github.com/owner/repo (last synced 2026-09-03T02:09Z) ``` ### Acceptance - `madt_repos action=get` on a mirror prints `original_url` (the source) and `mirror_updated` in the formatted text. - A non-mirror repo is unchanged: no empty "Mirror of:" line. - Learning a mirror's upstream needs no raw `madt_api_call`. ### Optional follow-on Surface the same "mirror of X" line in `madt_status`, since that is the other place the question "what is this checkout" gets asked.
Sign in to join this conversation.
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#467
No description provided.