Skip to content

fix(code): list repositories without an owner again - #232

Merged
arthware-dev merged 1 commit into
mainfrom
fix/code-repo-list
Oct 16, 2026
Merged

arthware-dev merged 1 commit into
mainfrom
fix/code-repo-list

Conversation

@arthware-dev

Copy link
Copy Markdown
Contributor

Summary

  • stack code repo list without an owner crashed with 'str' object has no attribute 'get'. Forgejo's /repos/search answers {"ok": true, "data": [...]} (the SearchResults schema), and ForgejoClient.list_repos returned that envelope as the list. It now returns data. The per-owner path (/users/{owner}/repos) is a bare array and was fine.
  • The command returns {"repos": [...]}, so --json prints the repositories instead of {}.
  • Module test drives the command against pytest-httpserver in both documented shapes, plus an empty result and a Forgejo error.

`stack code repo list` with no owner failed with "'str' object has no
attribute 'get'". Forgejo's repository search answers with an envelope,
`{"ok": true, "data": [...]}`, and the client returned that envelope as
the list, so the command walked its keys instead of the repositories.
The client now returns the `data` array. Listing one owner's
repositories was unaffected: that endpoint answers with a bare array.

The command also returns what it listed, so `--json` prints the
repositories instead of an empty object.
@arthware-dev
arthware-dev merged commit 03a3381 into main Oct 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant