Skip to content

Make the GitHub client README match the public API - #126

Merged
shadetheory merged 1 commit into
masterfrom
cursor/front-page-ready-67b4
Oct 15, 2026
Merged

shadetheory merged 1 commit into
masterfrom
cursor/front-page-ready-67b4

Conversation

@shadetheory

Copy link
Copy Markdown
Owner

Summary

A hiring manager landing from the portfolio would have copied the README and hit methods that do not exist. This PR makes the README, docs, config, and badges describe the code on master.

Readiness: 4/10 before, 8/10 after. The package already had a real Saloon client, Pest coverage, and a Packagist release. The first README snippet called repos()->get() with a string, the resource table listed pullRequests()->commits, files()->get, files()->contents, and releases()->create, and dependency injection used a GithubConnectorInterface that is not in the repo. Docs described Spatie Data objects, withRateLimiting(), and Github::fake(). The test badge tracked main. The default branch is master. PHPStan on master was failing because phpstan-baseline.neon ignored errors the analyser no longer reports.

What changed

  • Rewrote the README and docs/ so every example matches a real method and return type. tests/DocumentationExamplesTest.php runs the issue, pull request, and repository examples.
  • Pointed the test badge at master and added a PHPStan badge for phpstan.yml.
  • Removed the empty github_client_table migration, the commented factory, and the empty view. The service provider no longer publishes them.
  • OAuth throws AuthenticationException when the client id, secret, or redirect URL is missing, and getAuthorizationUrl() accepts a state argument. The package still does not store or check that state.
  • Token lookup reads config('github-client.token'), then config('github-client.gh_token'), then gh auth token. Unused config keys (base URL, auto retry, CLI preference, OAuth scopes, installation id) are gone because the code never read them.
  • Cleared the stale PHPStan baseline. vendor/bin/phpstan analyse reports no errors. vendor/bin/pest reports 229 passed.
  • Test and PHPStan workflows also run on pull requests.
  • Dropped the conduit-ui Composer keyword.

composer require jordanpartridge/github-client still installs Packagist v3.0.0. The core examples (repos, issues, pull requests, commits, releases, Actions) match that tag and this branch. Github::forInstallation(), Github::withApp(), and installations() are on this branch only.

Suggested GitHub description

Laravel client for the GitHub REST API, built with Saloon. Typed responses for repositories, issues, pull requests, commits, releases, and Actions.

Suggested topics

Keep api, github, laravel, laravel-package. Add php, github-api, saloon, api-client.

Left for Jordan

  • Set the repository description and topics above. This PR cannot change them.
  • Tag a release so Packagist picks up Saloon 4, Laravel 13, JWT 7, the GitHub App helpers, and this README. Until then, composer require installs v3.0.0.
  • The GitHub wiki still describes an older client (PHP 8.1, Spatie-style "typed responses"). Update it or turn it off so it does not contradict the README.
  • The public API is uneven on purpose in this PR: repos()->get() takes a Repo value object, several methods return a Saloon response instead of a DTO, comments()->forPullRequest() requires a repository filter, and PullRequestResourceEnhanced is not registered on Github. DTOs need a full GitHub payload. files()->all() returns a commit tree response, not file contents. There is no retry and no custom API base URL.
  • OAuth generates state when the caller does not pass one, and does not persist or verify it.
Open in Web Open in Cursor 

The README and docs named methods, return types, and a connector interface the package does not have, and the test badge tracked main while the default branch is master.

Co-authored-by: Jordan Partridge <jordan@partridge.rocks>

@lexi-chief-of-staff lexi-chief-of-staff Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it after the two constructor/priority nits are verified on the branch.

  • Matches every public method and return type in the README, docs, and tests/DocumentationExamplesTest.php.
  • Removes dead migration/factory/view, stale PHPStan baseline, and unused config keys.
  • OAuth now throws on missing credentials and accepts an explicit state.
  • Token order updated to config → GH_TOKEN → CLI.
  • CI now runs on PRs; badges point at master.

Two small drift items flagged inline; otherwise the patch is consistent and the tests pass.

@shadetheory
shadetheory merged commit f12741b into master Oct 15, 2026
22 checks 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.

2 participants