pub struct Client { /* private fields */ }Expand description
A forge CLI bound to one project.
Implementations§
Source§impl Client
impl Client
Sourcepub fn resolve(
forge: Forge,
target: &Utf8Path,
repo: &str,
) -> Result<Self, RkError>
pub fn resolve( forge: Forge, target: &Utf8Path, repo: &str, ) -> Result<Self, RkError>
The client for forge, run from target, for project repo.
§Errors
The resolution’s refusal, which names the client, where no usable binary resolves.
Sourcepub fn api(&self, method: &str, path: &str, body: Option<&Value>) -> Api
pub fn api(&self, method: &str, path: &str, body: Option<&Value>) -> Api
One api call, with a JSON body where one is given.
Sourcepub fn open_request(
&self,
base: &str,
branch: &str,
) -> Result<Option<u64>, RkError>
pub fn open_request( &self, base: &str, branch: &str, ) -> Result<Option<u64>, RkError>
The open request whose head is branch against base, by number.
§Errors
A refusal where the forge does not answer.
Sourcepub fn merges_request(
&self,
sha: &str,
base: &str,
branch: &str,
) -> Result<bool, RkError>
pub fn merges_request( &self, sha: &str, base: &str, branch: &str, ) -> Result<bool, RkError>
Whether sha is the merge or squash commit of a merged request
whose head is branch and whose base is base.
SATISFIES release-engine:a-final-version-releases-at-its-request
§Errors
A refusal where the forge does not answer.
Sourcepub fn release(&self, tag: &str) -> Result<Option<Release>, RkError>
pub fn release(&self, tag: &str) -> Result<Option<Release>, RkError>
The release of tag, a draft included, where one exists.
§Errors
A refusal where the forge does not answer.
Sourcepub fn tag(&self, tag: &str) -> TagAt
pub fn tag(&self, tag: &str) -> TagAt
The commit tag names, in three states: present, absent, and a
read that failed.
Sourcepub fn package_files(&self, version: &str) -> Result<Vec<Asset>, RkError>
pub fn package_files(&self, version: &str) -> Result<Vec<Asset>, RkError>
Every file the GitLab generic package release holds at version,
with its SHA-256.
§Errors
A refusal where the forge does not answer.
Sourcepub fn identity(&self) -> Result<(String, String), RkError>
pub fn identity(&self) -> Result<(String, String), RkError>
The name and the email of the account the client’s credential names.
SATISFIES bot-identity:the-bot-identity-reaches-one-project
GitHub answers the App’s bot account as the viewer of its installation token, and its email is the account’s noreply address. GitLab answers the token’s user, and a user with no public email takes its username’s noreply address on the instance.
§Errors
A refusal where the forge does not answer.
Sourcepub fn create_request(
&self,
base: &str,
branch: &str,
title: &str,
body: &str,
) -> Result<u64, RkError>
pub fn create_request( &self, base: &str, branch: &str, title: &str, body: &str, ) -> Result<u64, RkError>
Sourcepub fn arm(&self, number: u64, form: MergeForm) -> Result<bool, RkError>
pub fn arm(&self, number: u64, form: MergeForm) -> Result<bool, RkError>
Arm the request to merge itself once its checks pass. On GitLab an
arm the forge cannot take yet, before the request’s first pipeline
starts, answers false and waits for the next refresh.
§Errors
GitHub’s refusal.
Sourcepub fn create_draft(
&self,
tag: &str,
sha: &str,
notes: &str,
candidate: bool,
) -> Result<String, RkError>
pub fn create_draft( &self, tag: &str, sha: &str, notes: &str, candidate: bool, ) -> Result<String, RkError>
Create an unpublished draft release of tag at sha, which
creates no tag, and answer its id.
§Errors
The forge’s refusal.
Sourcepub fn upload(
&self,
tag: &str,
files: &[Utf8PathBuf],
clobber: bool,
) -> Result<(), RkError>
pub fn upload( &self, tag: &str, files: &[Utf8PathBuf], clobber: bool, ) -> Result<(), RkError>
Upload files to the GitHub release of tag, replacing a same-name
asset where clobber says so.
§Errors
The forge’s refusal.
Sourcepub fn package_url(&self, version: &str, name: &str) -> String
pub fn package_url(&self, version: &str, name: &str) -> String
The URL a GitLab generic package file is served from.