Skip to main content

Crate jouet_github

Crate jouet_github 

Source
Expand description

A small blocking GitHub client: finding a token that works, GraphQL, and the few REST reads GraphQL has no equivalent for.

Tokens are tried in order: JOUET_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN, then gh auth token. There is no separate probe: the first real request checks the token, and a 401 moves on to the next source, so a stale GH_TOKEN costs one rejected request rather than a failed command. JOUET_GITHUB_API_URL points the client at another API root, such as a GitHub Enterprise server or a test’s fake server.

Client::put is the REST write for the merge and update-branch endpoints GraphQL has no safe equivalent of; Client::write sends any other method, for routines.

Client::get sends If-None-Match when given an ETag, so an unchanged poll comes back as a 304 that costs nothing against the rate limit.

Modules§

entire
Entire (entire.io) on top of a PR: its “Entire Gates” check, and the review findings on the PR’s trail.
entire_forge
Repositories hosted on Entire itself (/et/PROJECT/REPO) behind Host, through the entire CLI (see crate::entire), which finds its own login: jouet never handles an Entire token.
forge
Which forge a host runs, where its API is, and which tokens it takes.
forgejo
Forgejo and Gitea pull requests behind Host, through the REST API (v1), which the two share.
gitlab
GitLab merge requests behind Host, through the REST API (v4).
host
The host trait: what jouet’s PR commands ask of a forge, answered by GitHub, GitLab, Forgejo or Entire in the same model types, so pr status, pr threads and the waits print the same output and exit the same way whichever forge a repository is on.
pr
Pull requests: naming and selecting them, what jouet pr status reports, what each needs next, landing them, and review threads.
rest
A blocking REST client for GitLab and Forgejo, shaped like Client: tokens tried in order, a 401 moving on to the next source, retries after a 5xx or a dropped connection, and pages followed through the Link header.
tls
TLS for jouet’s HTTP requests.

Structs§

Client
Rest
A REST response from Client::get. status is 304, with an empty body, when the ETag given still matches.

Enums§

Failure
Why a request got no usable response.
Method
The REST methods that write.

Functions§

next_page
The URL of the next page in a Link header, if it names one.