Skip to main content

Module scope

Module scope 

Source
Expand description

Per-repository decisions the hosting clients honour without every caller passing a repository: which token a repository’s host calls use (a token command, for a GitHub App bot) and whether assignment is blocked.

The hosting crate cannot read the repository’s stored settings (those live in crates that depend on it), so a higher crate installs one RepoScopes for the process. A client then asks it, per call, by the (integration id, project) pair every call already carries: no call site needs a repository handed to it, and a surface that forgets to register a repository simply gets the plain behaviour (personal token, assignment allowed) rather than a failure.

Constants§

ASSIGNMENT_BLOCKED
The reason shown wherever an assignment is refused or an assignee field is hidden. Also the marker a CLI answer is recognised by (exit code 2).

Traits§

RepoScopes
What a repository’s stored settings say about its host calls.

Functions§

acts_as_bot
Whether the repository’s host calls are made by an App bot.
assignment_blocked
Whether assignment is blocked for project of integration_id.
install
Installs the process’s scopes (the first call wins).
is_app_installation_token
Whether token is a GitHub App installation token (ghs_): it has no “me” and cannot call GET /user.
learn_login
Persists login as who the token posts as in project.
learned_login
The login learned from our first post in project, if any.
post_as
The configured “Post as” name of project, if any.