Expand description
Uniform access to github and gitlab
Currently, listing and creating merge requests is suppored.
Start by creating a Forge
, probably by initialising a
Config
with default
-based a literal and calling Setup::forge
.
§Terminology and model
-
Repository. A single git tree that can contain code, and has other things associated with it such as issues and merge requests. (GitHub, GitLab: project.)
Identified in the
gitforge
API by a string, which is typically the path suffix. -
Merge Request. A request to incorporate changes from a source repository and branch into a target repository and branch. Forges typically associate merge requsts primarily with the target repository. A merge request typically has an associated discussion.
(GitHub: a pull request.)
-
Issue. A feature request or bug report, associated with a repository, and an associated discussion. *Not currently supported by this library.
-
Merge request or issue Number. A (usually short) string which uniquely identifies a merge request or issue within a repository.
-
User. An individual user, or possibly, organisation. Represented as a string, being the username (as used, eg, as a slug in the forge’s URLs).
-
Branch. A git branch (on the server), ie a remote ref named
refs/heads/BRANCH
. Identified by the stringBRANCH
.
See the individual forge module docs for the mapping.
§Non-exhaustive structs
Some structs in this api have fields named _non_exhaustive
.
This indicates that the struct may be extended with additional
fields in future, and that this won’t be considered a semver
breaking change.
Do not explicitly initialise such a field. Instead, use
..
syntax to initialise all the fields you are not naming.
Typically, you would write ..Default::default()
.
This rule is in addition to some (other) structs being marked
#[non_exhaustive]
.
§Non-exhaustive enums
Some enums have variants named _NonExhaustive
. This indicates
that the enum may be extended with additional variants in future,
and that this won’t be considered a semver breaking change.
Do not construct such an enum variant. The library will panic if it finds one.
This rule is in addition to some (other) enums being marked
#[non_exhaustive]
.
Structs§
- Config
- Instructions for how to connect to a forge
- Issue
MrState - Overall state of an Issue or Merge Request
- Repo
Branch - Repository and branch
- Req_
Create Merge Request - Create a new merge request.
- Req_
Merge Requests - Search for merge requests.
- Resp_
Merge Request - Merge request, in a response
- Token
- Secret access token.
Enums§
- Error
- Errors accessing forges
- Issue
MrLocked - Whether an Issue or Merge Request is locked
- Issue
MrStatus - Issue or Merge Request status
- Kind
- What protocol to use to access a forge. Don’t hardcode.
- Remote
Object Kind - Kind of a thing on a forge. Used mostly in errors.
- Req
- Request (command) to a forge
- Resp
- Response from a forge
- Token
Config - Instructions for how to obtain an access token
Traits§
- Forge
- Main trait; forge objects are
Box<dyn Forge>
- Forge
Methods - Main entrypoints once a
Forge
has been constructed.