Skip to main content

Module github

Module github 

Source
Expand description

GitHub, built in: its REST and GraphQL APIs, over TLS, as the person — a token from the environment or the one speccoder auth login kept in the credential store. No gh needed. Reading is free (issues, a branch’s pull request); writing is pr, which a person confirms. github.com and Enterprise hosts alike: the host is the remote’s.

Modules§

auth
Who speccoder is on GitHub: a token from the environment (CI: GH_TOKEN, GITHUB_TOKEN; an Enterprise host: GH_ENTERPRISE_TOKEN), else the one speccoder auth login kept in the operating system’s credential store (service speccoder, account github:<host>). Never a file; never printed.
http
GitHub’s documented REST and GraphQL APIs, over rustls, within a time limit, every failure said in words with what to do. Blocking for the caller (the runtime’s commands are); one small runtime per call.

Structs§

Ctx
How speccoder reaches GitHub: where its API answers and whose token it uses. Commands take it from the environment (Ctx::from_env); tests point it at a stand-in (Ctx::fixed).
Issue
One issue, read in full.
Pull
A branch’s pull request.
Repo
A repository on a GitHub host, as a git remote names it.
Status
What GitHub is to this repository.

Enums§

Announced
What announce did.

Functions§

announce
Comments on issue number that feature is being specified from it (once per feature), and assigns it to the person when assign.
announcement
The comment that tells an issue a feature is being specified from it; the hidden marker keeps it said once per feature.
auth_status
speccoder auth status: who speccoder is on host (default: the repository’s, else github.com).
comment
speccoder issue comment N [--assign]: tells issue reference that the current feature (or feature) is being specified from it.
description
What a feature started from issue is asked to specify: its title, its text, and its address — which the spec keeps, so pr can close it.
issue
One issue by number, #n or address.
issue_number
The issue number in reference (42, #42, its address).
issue_urls
GitHub issue addresses in text (a spec), in order, once each.
issues
The repository’s open issues (pull requests aside), assigned to the person first, then the most recently updated; features maps an issue URL to the feature whose spec names it.
list
speccoder issue: the open issues.
login_with_token
speccoder auth login --with-token: checks token against host, then keeps it in the credential store.
logout
speccoder auth logout: forgets host’s token.
open_draft
Opens a draft pull request from head into base: its number and address.
pr_for
The pull request whose head is branch, if there is one.
pr_in
pr_for in r (the repository a given remote names).
reach
Whether the signed-in account can see the repository at root — after a sign-in through the app, whether the app is installed there. None: it can; else what to do.
refused
A GitHub failure as a result: its code and fix.
repo
The repository remote (default origin, else the first) names.
started
The issue URLs each feature’s spec names: issue URL → feature.
status
Whether speccoder can reach this repository on GitHub, and as whom.
update
Brings pull request number’s title and description up to date.