Skip to main content

Crate sandogasa_gitlab

Crate sandogasa_gitlab 

Source
Expand description

GitLab REST and GraphQL API client for issues and work items.

Structs§

Assignee
A GitLab user (assignee).
Client
Client for the GitLab REST API v4.
Event
One entry from the user-activity events endpoint. Fields are sparse — GitLab only populates the ones relevant to each action_name.
EventNote
Note payload attached to commented on events.
EventPushData
Push payload attached to pushed to / pushed new events.
GroupClient
Client for group-level GitLab API queries.
GroupProject
A project name returned by the GitLab group projects API.
Issue
A GitLab issue.
IssueUpdate
Parameters for editing an issue.
MergeRequest
A GitLab merge request (minimal fields).
ProjectSummary
Minimal project identity: what you need to filter events by path_with_namespace prefix and render a human-readable link.
Release
A GitLab Release as returned by /projects/:id/releases. Field selection follows the API’s snake_case names.
ReleaseAuthor
Author block on a Release. Username is the field most useful for cross-referencing with the calling user’s profile.
ReleaseLinks
_links block. The self link is the canonical web URL of the release page.
Tag
A tag as returned by /projects/:id/repository/tags. The fields kept here are the ones relevant to an activity-window match: the tag’s created_at (when the ref was pushed, distinct from the commit date) and the tag name.
User
A GitLab user as returned by /users?username=<name>.

Functions§

count_authored_commits
Count commits in project_id authored by author within [since, until] (inclusive). GitLab’s commits endpoint matches the author parameter against both name and email fields, so passing the GitLab username usually works; if the user authored commits under an email only, pass that email string instead.
list_archived_project_names
List the archived projects under a GitLab group, returning their names. GitLab’s archived=true filter narrows the listing server-side, so this is a cheap separate query rather than enriching every project in the main listing.
list_group_projects
List all projects under a GitLab group (public, no auth needed).
list_tags
List tags for a project, paginated. Returns an empty list on 404. Uses order_by=updated&sort=desc so newer tags come first — handy when the caller wants to short-circuit on the first tag older than its window of interest.
package_from_issue_url
Extract the package name from a GitLab issue or work item web_url.
parse_issue_url
Parse a GitLab issue / work-item URL into its components.
parse_mr_url
Parse a merge request URL into its components.
parse_project_url
Parse a GitLab project URL into (base_url, project_path).
project_path_from_issue_url
Extract the project path from a GitLab issue or work item web_url.
project_releases
List releases for a project. Returns an empty list on 404 (project gone) so callers can iterate over many projects without per-project error handling.
project_summary
Look up a project’s path_with_namespace from its numeric ID. Used to map event project_id → group-prefix filter.
user_by_username
Look up a user by username on a specific GitLab instance. Returns Ok(None) if the server returns 200 with an empty list (no user with that name on that instance).
user_events
Fetch a user’s activity events within [after, before) — GitLab’s event endpoint is half-open on both sides and rejects both-null. Results are paginated at 100/page; this follows every page until a short page arrives.
validate_token
Check whether a token is valid by calling GET /api/v4/user.