Expand description
Hosting and issue-tracker API clients: GitHub, GitLab, Gitea/Forgejo, Azure DevOps, Bitbucket, Gerrit, Jira, Trello, Linear, YouTrack, Redmine and local Markdown issues, including self-managed instances.
Two jobs:
- List the projects a token can see, and clone straight from that
list.
HostingClient::list_projectsreturns a normalizedHostedProjectwhichever host produced it, andHostedProject::clone_urlhands the chosen row’s URL toGitBackend::clone. - Generate an SSH key and upload it.
ssh_keymakes the pair in process (nossh-keygendependency, no prompt), andHostingClient::upload_ssh_keyregisters the public half.
Every network call goes through http::HttpTransport, so the crate
is testable with no network (http::RecordedTransport); only
ReqwestTransport, behind the default network feature, opens a socket.
An integration is a base URL plus a token reference, and the API root
is derived from the base URL (see Integration::api_base) rather
than configured separately, because two keys that must agree can
disagree.
Re-exports§
pub use account::AccountCache;pub use account::AccountIssue;pub use account::AccountItems;pub use account::AccountPr;pub use account::AccountQuery;pub use account::CachedAccount;pub use account::ACCOUNT_TTL;pub use account::ACCOUNT_TTL_SECS;pub use auth::auth_headers;pub use auth::git_username;pub use client::client_for;pub use client::issue_web_url;pub use client::pull_request_edit_url;pub use client::pull_request_head_ref;pub use client::pull_request_web_url;pub use client::token_create_url;pub use client::web_base as integration_web_base;pub use client::CreatedIssue;pub use client::CreatedPullRequest;pub use client::HostingClient;pub use client::NewIssue;pub use client::NewPullRequest;pub use client::UnsupportedClient;pub use conditional::ConditionalTransport;pub use github::GitHubClient;pub use gitlab::GitLabClient;pub use http::ReqwestTransport;pub use http::HttpBytes;pub use http::HttpRequest;pub use http::HttpResponse;pub use http::HttpTransport;pub use http::Method;pub use http::RecordedTransport;pub use issue_flow::CreatedBranch;pub use issue_flow::IssueLinks;pub use issue_flow::NewIssueBranch;pub use metadata::list_delta;pub use metadata::HostedLabel;pub use metadata::HostedMilestone;pub use metadata::IssueEdit;pub use metadata::ItemMeta;pub use metadata::MetaKind;pub use metadata::PrEdit;pub use model::best_pull_request;pub use model::excess_scopes;pub use model::is_dangerous_scope;pub use model::ChecksState;pub use model::Choice;pub use model::HostedUser;pub use model::IssueCreateOptions;pub use model::IssueFilter;pub use model::IssueState;pub use model::IssueSummary;pub use model::PrFilter;pub use model::PullRequestState;pub use model::PullRequestSummary;pub use model::StateFilter;pub use model::TokenCheck;pub use model::TokenFlavor;pub use request_actions::request_actions;pub use request_actions::strip_draft_prefix;pub use request_actions::MergeMethod;pub use request_actions::RequestActions;pub use resolve::resolve_for_repo;pub use resolve::suggest_for_repo;pub use resolve::Resolution;pub use resolve::ResolveRemote;pub use resolve::Suggestion;pub use review::review_base_ref;pub use review::review_base_refspec;pub use review::review_compare_ref;pub use review::review_compare_refspec;pub use review::review_head_ref;pub use review::review_head_refspec;pub use review::review_head_refspec_at;pub use review::DiffSide;pub use review::FileStatus;pub use review::MergeState;pub use review::PatchSet;pub use review::PendingComment;pub use review::PullRequestDetail;pub use review::ReviewCapabilities;pub use review::ReviewComment;pub use review::ReviewEvent;pub use review::ReviewFile;pub use review::ReviewOutcome;pub use review::ReviewState;pub use review::ReviewSubmission;pub use review::ReviewThread;pub use review::ReviewVote;pub use review::SubmittedReview;pub use review::VoteLabel;pub use review::VoteValue;pub use scope::install as install_repo_scopes;pub use scope::RepoScopes;pub use spec::CheckoutSource;pub use spec::spec_for;pub use spec::FamilySpec;pub use spec::RemoteRef;pub use trust::Account;pub use trust::TrustGate;pub use trust::TrustProblem;pub use trust::TrustSubject;
Modules§
- account
- Account-wide lists: the requests waiting for my review, every open request of my namespaces and the issues assigned to me, across every repository of a host rather than the one folder a scope is about.
- auth
- Which request headers carry a token, per integration kind. Pure: no I/O, so every scheme is a table-test row.
- azure_
devops - Azure DevOps (Services and Server) hosting client: repositories, pull requests and Boards work items (the “issues” half), over a personal access token.
- bitbucket
- Bitbucket Cloud hosting client (slice S4).
- board
- The Kanban board’s column logic (slice L2): which columns an issue source has, which column each issue sits in, what a move changes, and the board filters. Pure data in, pure data out: no IO and no UI, so the TUI, a CLI and a provider added later (Linear, YouTrack) share it.
- cache_
search - The workspace search’s hosting kinds: pull/merge requests and issues
found in a repository’s on-disk hosting cache (
hosting-cache.json, the snapshot the TUI keeps besiderepo-state.toml), never from a host. - client
- The provider-agnostic hosting port and its plumbing.
- conditional
- Conditional requests and rate-limit back-off, as a transport decorator.
- conversation
- Reading and writing the conversation of an issue or a pull / merge request: its header, comments, system events and code threads, and posting, replying, editing and deleting as the identity the token has.
- flow_
engine - Host-driven flows, the shared engine of the CLI, the MCP server and the
TUI: create the issue, make the branch on the host, find what the host or a
bot made for an issue, wait for it. Everything here is a function over a
HostingClient, so a fake transport tests it and the three frontends cannot drift apart. The loops (sleeping, cancelling, drawing a spinner) are the frontend’s: it asksfind_for_issueagain afterbackoff. - gerrit
- Gerrit Code Review client (slice T3): the review view’s host for
patch-set based review. Review only: Gerrit has no issues, and a change
is created by pushing to
refs/for/<branch>, never by an API call. - gitea
- Gitea and Forgejo (incl. Codeberg) hosting client (integrations wave 2,
slice G). One client for both kinds: Forgejo is a Gitea fork whose REST
API (
/api/v1) stayed compatible. - github
- The GitHub client (github.com and GitHub Enterprise Server).
- gitlab
- The GitLab client (gitlab.com and self-managed).
- http
- The HTTP seam.
- issue_
flow - Host-driven flows (slice W4): what the host can make from an issue and
what it already made for one. The types are provider-agnostic; the
providers fill them (
gitlab_flow.rs,github_flow.rs,gitea/flow.rs). - jira
- Jira (Cloud and Data Center) issue-tracker client (slice S5).
- linear
- Linear issue-tracker client (slice T1).
- list_
cache - A saved copy of an integration’s repository list, so the Clone dialog shows it at once while a fresh request runs.
- local_
markdown - Local Markdown issues (slice L1): a folder of notes, one per issue, usable with an Obsidian vault. No token and no network.
- markup
- Markup conversion for issue and pull-request text (plan
conversations). - metadata
- Assignees, reviewers, labels and milestones: the host-agnostic shapes
the pickers (TUI),
pr edit/issue edit(CLI/MCP) and the create forms speak. GitHub and GitLab fill them (github_meta,gitlab_meta); every other provider keeps theUnsupporteddefaults of the trait and nothing about it shows in a UI. - model
- Host-agnostic shapes for the account, pull/merge request and issue queries. Normalised here, once, so the TUI/CLI/MCP never see whether a row came from GitHub or GitLab.
- protection
- What a host protects (S23 of the history rewrite): the branches a rewrite must not force-push unless the user lifts the protection first.
- redmine
- Redmine issue-tracker client (slice T2).
- refs
- References in commit messages and branch names (plan D7).
- request_
actions - Merging and closing a pull / merge request on the host.
- resolve
- Which configured profile answers questions about a repository.
- review
- In-app code review of pull / merge requests (GitHub incl. Enterprise,
GitLab incl. self-managed): reading a request, its changed files, its
threads and conversation; commenting, replying, resolving; submitting a
review. The diff itself comes from git, not from here (see
model’s module docs for how positions map onto it). - scope
- 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.
- spec
- The per-family descriptor table (plan
more-providers.md, D1). - ssh_key
- Generating an SSH key pair, in process.
- trello
- Trello issue-tracker client (slice S6).
- trust
- Integration trust: what a token (or an AI key) may be sent to.
- updates
- Looking for a newer GitPoulpi release (the updates-and-install design, slice A).
- xrefs
- Cross references in issue and pull-request text (plan
conversations, 4c). - youtrack
- YouTrack (Cloud and Server) issue-tracker client (slice T1).
Structs§
- Default
Token Source - The default resolution order, per profile:
- Hosted
Project - Hosted
SshKey - An SSH public key as the host holds it.
- Integration
- One configured profile.
token_refis a key intogitpoulpi-secrets, never a token. - Pull
Request Form - What the “new pull / merge request” form is prefilled with.
- Static
Token - A token held in memory. For tests, and for a CLI invocation that was handed one on the command line.
Enums§
- Error
- Integration
Kind - Which product a profile talks to. Spellings are
snake_caseand pinned by tests: they are written to disk.
Constants§
- MAX_
URL_ LEN - Longest URL produced; browsers and hosts refuse far less than ~8 kB (GitHub answers 414 above it), so the description is cut to fit.
- TRUNCATION_
NOTE - Appended to a description that had to be cut.
Traits§
- Token
Source - Where a token comes from. A trait so the clients can be tested with a canned token and the resolution order can change without touching a client.
Functions§
- match_
integration - Which configured instance a remote URL belongs to, so a repository’s
origincan be linked back to the integration that can answer questions about it. - new_
issue_ form_ url - The provider’s “new issue” form for
project, prefilled. - new_
pull_ request_ form_ url - The provider’s “new pull / merge request” form, prefilled.
- new_
pull_ request_ url - Builds the “open a compare/new pull-request page” URL by hand: the
no-token fallback, and what a token-holding flow opens on success too
(see
client::HostingClient::create_pull_request). - percent_
encode_ component - Percent-encodes a query component: everything but RFC 3986 unreserved.
- remote_
web_ base - Splits a git remote URL into the host’s web base (
https://host, never the API root) and the project path (group/sub/proj), for building a pull/merge-request URL by hand. - resolve_
local_ folder - A repository-relative folder made absolute; an absolute one is kept and
~/is expanded. How a local Markdown issue source’s folder is read. - token_
env_ var - The environment variable an integration’s token can be supplied in (CI, a one-off shell), without writing it to disk.
- web_
base_ for web_base(fromremote_web_base), moved to the address the matched profile says the server lives at when it is the same host: an ssh remote of a server configured ashttp://host:3000opens its web pages there, not onhttps://host.- well_
known_ kind - The two hosts recognized with no configuration at all:
github.com/gitlab.com(or a*.github.com/*.gitlab.comsubdomain), so a remote with no matching[[integrations]]entry still gets a usable compare/new-request URL.