Skip to content

fix: support user account all-target runs#5

Merged
osolmaz merged 1 commit into
mainfrom
fix-user-all
Jul 8, 2026
Merged

fix: support user account all-target runs#5
osolmaz merged 1 commit into
mainfrom
fix-user-all

Conversation

@osolmaz

@osolmaz osolmaz commented Jul 8, 2026

Copy link
Copy Markdown
Member

Opened on behalf of Onur Solmaz (osolmaz).

Summary

github-sane-defaults plan OWNER --all only worked for organizations.
User accounts were routed through the organization repositories endpoint and failed with a 404.
This change makes --all owner-aware, so the same command works for both organizations and user accounts.

What Changed

The CLI now treats targets as owners instead of organizations internally.
It keeps --org as a compatibility alias and adds --owner as the clearer spelling.

  • Resolve the target with GET /users/{owner} and branch on the GitHub account type.
  • Use /orgs/{org}/repos?type=all for organization owners.
  • Use /user/repos?visibility=all&affiliation=owner,collaborator for user owners, then filter by repo.owner.login.
  • Add a shared REST pagination helper based on GitHub Link headers.
  • Rename app-level target selection from org to owner.
  • Update README usage and tests for owner-wide runs.

Testing

I tested the parser, planner, apply path, REST client behavior, docs conventions, and a live plan-only user-account scan.
The live scan verified that osolmaz --all no longer calls the organization-only endpoint.

  • npm run check
  • npx -y @simpledoc/simpledoc check
  • git diff --check
  • node dist/src/cli/main.js plan osolmaz --all --token "$(gh auth token)"

Risks

The main behavior change is limited to repository discovery for --all.
Single-repository targets continue to use the same /repos/{owner}/{repo} path.

  • User-account scans only include repositories visible to the authenticated token.
  • --org remains supported for existing automation.

@osolmaz

osolmaz commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

Final report:

  • Implemented owner-aware --all repository discovery for organizations and user accounts.
  • Kept --org as a compatibility alias and added --owner.
  • Added Link-header pagination and REST client coverage for organization and user-account discovery.
  • Updated README usage and target-selection tests.

Validation:

  • npm run check passed.
  • npx -y @simpledoc/simpledoc check passed.
  • git diff --check passed.
  • node dist/src/cli/main.js plan osolmaz --all --token "$(gh auth token)" passed and planned 152 repositories.
  • codex review --base main reported no discrete correctness issues.
  • GitHub Actions test passed.

@osolmaz osolmaz merged commit 0cfa7ac into main Jul 8, 2026
1 check passed
@osolmaz osolmaz deleted the fix-user-all branch July 8, 2026 11:00
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