- Add
api::projects:repository::commits::CompareCommits
endpoint - Add
gitlab::Gitlab::new_self_signed
method
- Add
api::projects::DeleteProject
endpoint - Add
api::projects::deployments::CreateDeployment
endpoint - Add
api::projects::deployments::DeleteDeployment
endpoint - Add
api::projects::deployments::Deployment
endpoint - Add
api::projects::deployments::Deployments
endpoint - Add
api::projects::deployments::EditDeployment
endpoint
- Add
api::projects::access_tokens::CreateProjectAccessToken
endpoint - Add
api::projects::access_tokens::ProjectAccessToken
endpoint - Add
api::projects::access_tokens::ProjectAccessTokens
endpoint - Add
api::projects::access_tokens::RevokeProjectAccessToken
endpoint - Add
api::projects::access_tokens::RotateProjectAccessToken
endpoint
- Actually build the
/project/:project/issues/:issue_iid/related_merge_requests
endpoint. - Add
api::pipelines::PipelineTestReportSummary
endpoint
api::users::CreatePersonalAccessToken
now usesPersonalAccessTokenCreateScope
as this endpoint is actually quite limited compared to theCreatePersonalAccessTokenForUser
endpoint.
- Add
api::users::CreatePersonalAccessToken
endpoint - Add
api::users::CreatePersonalAccessTokenForUser
endpoint - Add
api::personal_access_tokens::PersonalAccessToken
endpoint - Add
api::personal_access_tokens::PersonalAccessTokenSelf
endpoint - Add
api::personal_access_tokens::PersonalAccessTokens
endpoint - Add
api::personal_access_tokens::RevokePersonalAccessToken
endpoint - Add
api::personal_access_tokens::RevokePersonalAccessTokenSelf
endpoint - Add
api::personal_access_tokens::RotatePersonalAccessToken
endpoint - Add
api::personal_access_tokens::RotatePersonalAccessTokenSelf
endpoint
- GraphQL support has been updated to use
graphql_client
0.14. - The
http
crate has been updated to 1.x.
- Add
api::projects::repository::commits::refs
endpoint - Add
api::pipelines::PipelineTestReport
endpoint
api::runners::EditRunner
can now editmaintenance_note
- The
types
module has been removed. Clients should define their own deserialization types. - Some
enum
types have been preserved forwebhooks
usage and are now exported from its module (thoughNoteableId
has changed internal definition to avoid*Id
types). - Hook type structures no longer
impl Serialize
as this crate is intended to parse hooks, not write them.
- Add
api::job::Job
endpoint
- Job token authentication is now compliant with its limited permissions.
- The
ProtectedTags
endpoint nowimpl Pageable
.
hooks
types no longer use thetypes::*Id
types for simple wrappers.
- The
types
module and its members have been deprecated. Migrate to defining types in client crates directly.
&Endpoint
now has animpl Endpoint
&Pageable
now has animpl Pageable
api::paged
now supportsinto_iter()
andinto_iter_async()
methods.- Add
api::runners::Runners
endpoint - Add
api::runners::AllRunners
endpoint - Add
api::projects::runners::ProjectRunners
endpoint - Add
api::projects::runners::EnableProjectRunner
endpoint - Add
api::projects::runners::DisableProjectRunner
endpoint - Add
api::groups::runners::GroupRunners
endpoint - Add
api::runners::Runner
endpoint - Add
api::runners::EditRunner
endpoint - Add
api::runners::CreateRunner
endpoint - Add
api::runners::DeleteRunner
endpoint - Add
api::runners::DeleteRunnerByToken
endpoint - Add
api::runners::ResetRunnerAuthenticationToken
endpoint - Add
api::runners::ResetRunnerAuthenticationTokenByToken
endpoint - Add
api::runners::VerifyRunner
endpoint - Add
api::runners::RunnerJobs
endpoint
api::paged
now requires that the item type be'static
(shouldn't break anything).api::Paged::into_iter
now returns aLazilyPagedIter
with&'a E
rather thanE
(shouldn't break anything).
- Add
From<&'a String>
impl forNameOrId<'a>
.
- No changes needed for GitLab 16.7.
api::projects::releases::CreateRelease
- Add
api::projects::repository::commits::signature
endpoint. - Add endpoints for groups/projects access requests
api::projects::access_requests::{access_requests,request,approve,deny}
andapi::groups::access_requests::{access_requests,request,approve,deny}
. - Add
api::users::CreateUser
- The
Endpoint::url_base
method may be used to select the base for the endpoint's URL. Current options includeUrlBase::ApiV4
andUrlBase::Instance
. api::RestClient::instance_endpoint
now has a default implementation of not supportingUrlBase::Instance
endpoints.ImpersonationClient
may now be switched to an OAuth2 token like the main builder can.
- Add
JsonEncoded
variant toBodyError
enum. - Add
JsonParams
helper to create JSON-bodied queries. - Update to use the 2021 edition; used in the test suite.
api::users::ExternalProvider
members are now private; use the associatedbuilder()
method to build an instance instead.
- Add missing endpoints to
api::projects::merge_requests::awards
andapi::projects::merge_requests::notes::awards
. - Add
api::projects::issues::awards
andapi::projects::issues::notes::awards
endpoints. - Add
api::users::projects::UserProjects
endpoint. - Add
api::projects::ArchiveProject
andapi::projects::UnarchiveProject
endpoints. - Support
emails_enabled
parameters when creating or editing groups and projects. - Support filtering groups based on the repository storage.
- Support enforcing expiration on service access tokens for group hooks.
- Support filtering group and project packages by version.
- Support enforcing committer name requirements for push rules.
- Support model experimentl access levels when creating or editng projects.
- Support
unidiff
requests for merge request diffs. - Support the
SecurityOrchestrationPolicy
for the pipeline source filter. - Support returning users marked as auditors when listing all users.
- Detect and notify of
301 Moved Permanently
responses. - Support editing
prevent_merge_without_jira_issue
when editing a project. - Support filtering projects by those that are hidden or are pending deletion.
- Support keyset pagination for the
/users
endpoint. - Support authentication with job tokens.
- Support
default_branch_protection_defaults
parameters when creating and editing groups. api::projects::releases::links::ListReleaseLinks
api::projects::releases::links::CreateReleaseLink
api::projects::releases::links::GetReleaseLink
api::projects::releases::links::UpdateReleaseLink
api::projects::releases::links::DeleteReleaseLink
- The
emails_disabled
parameter has been replaced byemails_enabled
when creating or editing groups and projects. - The
tasks_to_be_done
andtasks_project_id
parameters for group and project memberships have been removed upstream.
enum
types under theapi
module (with a few exceptions) have been marked as `#[non_exhaustive] with the intent to keep semver stability if/when GitLab enhances the API in ways that require these types to change.
- No changes needed for GitLab 16.6.
- Add
api::projects::packages::generic::UploadPackageFile
andapi::projects::packages::generic::GetPackageFile
endpoints.
- Fix "self" query used to verify authentication tokens (#96)
- Add Email Address to User Hook Attributes.
- Support managing group/project push rules.
- Add
api::projects::merge_requests::MergeRequestDiffs
endpoint. api::paged
iterators can be turned into asyncStream
s using theinto_async()
method.api::paged
iterators can now set the page number (1-indexed) for direct access.- Extend enum
systemhooks::ProjectEvent
withproject_update
api::retry::Client
now forwards the HTTP version for requests as well.
- Deprecate
api::projects::merge_requests::MergeRequestChanges
endpoint. Deprecated in GitLab 15.7; useMergeRequestDiffs
instead.
- No changes needed for GitLab 16.4.
- Support
/project/:project/issues/:issue_iid/related_merge_requests
endpoint.
- Switches
/api/projects/repository/tree
to use ordinary pagination.
- Minimum dependency build now requires 1.63 to avoid security advisories.
api::projects::protected_branches::ProtectBranch::allowed_to_unprotect
no longer supports theNoAccess
level as GitLab does not support it. Callers need to update to use theProtectedAccessLevelWithAccess
set of levels instead.
- Milestone filters for
api::issues::{Group,Project}Issues
now use the proper query parameter (milestone_id
).
- Add
api::groups::BranchProtection::PushExceptInitial
protection rule. - Support editing member rule IDs on group and project memberships.
- Support
Upcoming
andStarted
milestone queries for issues. - Support
skip_users
in group and project member list queries. - Support
show_seat_info
parameter when listing memberships. - Support
None
andAny
epic filters for project issues. - Support epic filters for group issues.
- Support filtering project and group issues by health status.
- Support
Any
,Today
, andTomorrow
issue due date filters. - Support sorting issue results by their title.
- Support filtering group issues by their type.
- Support filtering out external users when listing users.
- Support setting and editing the
raw
flag on project CI variables. - Support setting and editing the
description
field on project CI variables. - Support sorting tags by version number.
- Support filtering commits by author.
- Support filtering branches by regex.
- Support setting the
internal
flag for created issue and MR notes. - Support the
WaitingForResource
job scope when filtering jobs. - Support the
include_retried
field for project jobs. - Support filtering MRs by approver usernames.
- Support filtering MRs by whether they are approved or not.
- Support setting
merge_commit_template
when creating a project. - Support setting
mr_default_target_self
when creating a project. - Support IP restriction ranges when editing groups.
- Support wiki access level when editing groups.
- Support project download limit parameters when editing groups.
- Support filtering projects by last updated timestamps.
- Support skipping LDAP users when searching users.
- Support downloading raw file contents backed by LFS.
- Support setting and editing access levels for
releases
,environments
,feature flags
,infrastructure
, andmonitor
project features. - Support setting and editing the
only_allow_merge_if_all_status_checks_passed
flag on projects. - Support setting and editing group runner support on projects.
- Support editing
mirror_branch_regex
on projects. - Support editing
ci_allow_fork_pipelines_to_run_in_parent_project
,enforce_auth_checks_on_uploads
,issue_branch_template
,allow_pipeline_trigger_approve_deployment
, andci_forward_deployment_rollback_allowed
settings on projects.
- Deprecate
api::issues::{Group,Project}Issues::{without_milestone,any_milestone,milestone}
in preference formilestone_id
. With new enumerations possible, using the actual name for the parameter is best with the actual type exposed. - The
ref
parameter for raw file contents is no longer required. If not provided, the repository'sHEAD
commit will be used. - Deprecate including
tags
andtags_count
in project registry repository queries. Removed in GitLab 15.0. - Deprecate MR note creation and editing with
merge_request_diff_sha
fields. The documentation had a typo and it is only supported when creating an MR note. Usemerge_request_diff_head_sha
instead. - Deprecate
approvals_before_merge
in project creation and editing and MR creation. MR approval rules APIs (currently no bindings are provided) should be used instead. - Deprecate
confidential
for issue notes. Useinternal
instead, but note that it is only available at note creation and cannot be edited later. ProtectedAccess
is now a generic type in order to support different fields with different available access levels. Most call sites should not be affected.- Deprecate
build_coverage_regex
when creating and editing a project. This setting is now set via.gitlab-ci.yml
rather than at the project-level. - Deprecate
operations_access_level
for more granular feature selections.
- Pipeline schedule API endpoints added.
- Introduce the
draft
field to all MergeRequest structs.
- Deprecate the
work_in_progress
field on all MergeRequest structs.
api::projects::registry::RepositoryTags
is nowPageable
.
api::projects::Jobs
now supports keyset pagination.
- CI updates to publish via CI.
- Support for GET /projects/:id/repository/files/:file_path endpoint
- Add "title" to
webhooks::MergeRequestChanges
. - Support
/projects/:id/packages/:package_id
endpoint - Support
/projects/:id/packages/:package_id/package_files
endpoint - Support
/projects/:id/packages/:package_id/package_files/:package_file_id
endpoint - Support
/groups/:id/packages
endpoint. - New endpoints for creating commits with
gitlab::api::projects::repository::commits::CreateCommit
- Add "approval" and "unapproval" to
webhooks::MergeRequestAction
.
- Expose
RestError
at the crate root. - Add an
ImpersonationClient
type to use impersonation tokens with an existing client. - Support
/projects/:id/packages
endpoint.
- Add API endpoint
api::projects::merge_requests::approval_rules
.
- Implement
Clone
for structs that implementEndpoint
. - Support for container registry endpoints.
- Support
/project/:project/repository/archive
endpoint.
- No changes needed for GitLab 15.6.
- No changes needed for GitLab 15.5.
- API endpoints for user impersonation tokens.
types::GroupHook
has been added.- New endpoints for:
- Creating, getting, editing, listing and deleting group hooks.
- Support for
Push
branch protections when creating groups. - Support for sorting project search results by
Similarity
. - Support for setting group shared runner settings,
path
,prevent_sharing_groups_outside_hierarchy
,prevent_forking_outside_group
, andfile_template_project_id
. - Support for
invite_source
,tasks_to_be_done
, andtasks_project_id
when adding a member to a group or project. - Support
skip_subresources
when deleting group memberships. - Support for filtering on
epic_id
when listing issues. - Support for issue types when creating, editing, and filtering issues.
- Support sorting merge requests by title.
- Support requesting retried jobs when requesting pipeline jobs.
- Support pipeline status states
Preparing
andWaitingForResource
. - Support setting the
security_and_compliance_access_level
when creating and editing projects. - Support editing the
mr_default_target_self
andci_separated_caches
project fields. - Support setting variables when playing manual jobs.
- Support
merge_request_diff_sha
when editing and creating MR notes (required for the/merge
command). - Support filtering pipelines by their source.
- Support allowing force pushes when protecting branches.
- Support including HTML descriptions in project releases.
- Support sorting parameters for project releases.
- Support including trailers in commit queries.
- Support
execute_filemode
andlast_commit_id
when editing files through the API. - Support querying custom attributes of users.
- Support
without_project_bots
andsaml_provider_id
when listing users. - Support for filtering projects based on import status and topics.
- Support for finer-grained creation rules for protected tags.
- Support filters when updating project pipeline variables.
- Keyset pagination is now supported for group searches ordered by name.
- Support filtering groups based on custom attributes.
- The
all
project membership endpoints have been split out.
api::issues::IssueOrderBy::WeightFields
is nowapi::issues::IssueOrderBy::Weight
. The old name seems to come from a misreading of the documentation's list of supported fields. Its field name has also been fixed toweight
instead ofweight_fields
.api::projects::{CreateProject, EditProject}::container_registry_enabled
is deprecated in favor ofcontainer_registry_access_level
.api::projects::{CreateProject, EditProject}::{tag, tags}
are deprecated in favor oftopic
andtopics
.api::projects::merge_requests::MergeRequests::search_in
is deprecated because GitLab doesn't actually have such a query parameter.api::projects::merge_requests::MergeRequestSearchScope
is deprecated because GitLab doesn't actually have such a query parameter it represented.api::projects::pipelines::Pipelines::name
is deprecated; GitLab never supported such a parameter.api::projects::members::{ProjectMember, ProjectMembers}::all_members
is deprecated. Theall
endpoints have different parameters, so merging them doesn't work anymore.
api::deploy_keys::DeployKeys::public
is now private.api::projects::{CreateProject, EditProject}::requirements_access_level
do not supportPublic
, so they now usesapi::FeatureAccessLevel
instead ofapi::FeatureAccessLevelPublic
.api::users::Users::external
is now a()
instead ofbool
because GitLab doesn't actually supportexternal=false
.api::projects::repository::Tree
now uses keyset pagination and requires GitLab 15.0. Page-based iteration has been deprecated by GitLab.api::projects::variables::ProjectVariableFilter::environment_scope
is now private.
graphql_client
has been updated to 0.11.
api::projects::merge_requests::MergeRequestPipelines
and associated structures have been moved toapi::projects::merge_requests::pipelines
.
api::projects::edit::EditProject
fixes a typo fromprinting_merge_requests_link_enabled
toprinting_merge_request_link_enabled
api::projects::protected_branches::ProtectedBranches
is now paginated.
types::UserState::Deactivated
has been added.- New endpoints for:
- Sharing and unsharing groups
- Listing shared projects in a group
- Sharing and unsharing projects
- Creating a pipeline on a merge request
- New fields on
types::Hook
:push_events_branch_filter
issues_events
confidential_issues_events
merge_requests_events
note_events
confidential_note_events
repository_update_events
job_events
pipeline_events
wiki_page_events
- New fields on
types::ProjectHook
:deployment_events
releases_events
- New fields on
types::Project
:build_git_strategy
ci_default_git_depth
- New fields on
webhooks::MergeRequestHook
:changes
- New
webhooks::MergeRequestChanges
structure
- No changes needed for GitLab 15.0.
- No changes needed for GitLab 14.10.
- The
api::projects::repository::branches::Branches
endpoint is now pageable. - Entend type
webhooks::MergeRequestHook
with changes entry - The
api::projects::protected_branches::ProtectedBranches
endpoint is now pageable. - Extend UserState enum with Deactivated
- Extend Hook type with fields:
- push_events_branch_filter
- issues_events
- confidential_issues_events
- merge_requests_events
- note_events
- confidential_note_events
- job_events
- pipeline_events
- wiki_page_events
- repository_update_events
- Extend Project type with fields:
- build_git_strategy
- ci_default_git_depth
- Move api endpoint
api::projects::merge_requests::pipelines
toapi::projects::merge_requests::pipelines::pipelines
- Add api endpoint
api::projects::merge_requests::pipelines::create
- Fix parameters for editing projects:
- printing_merge_request_link_enabled
- No changes needed for GitLab 14.9.
- Added the
api::projects::merge_trains
endpoint to get merge trains for a specific project.
types::RepoCommit::parent_ids
is now anOption
.
- Protected tags with special URL characters (namely
/
) are now handled properly withapi::projects::protected_tags::ProtectedTag
. - Tags on a repository are now pageable.
- The
types::DiscussionNoteType::Note
variant has been added.
- Groups can now be edited via
EditGroup
. - New
rustls
feature to support static linking (no OpenSSL). - New type definitions for:
MergeRequestCommit
ProjectVariable
ProtectedTagAccessLevel
ProtectedTag
ReleaseTag
Tag
- New endpoints for:
- Creating, updating, and inspecting project-level pipeline variables.
- Deleting project hooks.
- Getting tree object from projects.
- Updating a file in a project.
- Getting merge requests associated with a commit.
- Getting commits of a merge request.
- Deleting a file from the repository.
- Deploy keys
- New parameters for creating projects:
container_registry_access_level
merge_pipelines_enabled
merge_trains_enabled
squash_option
topics
- New parameters for editing projects:
container_registry_access_level
merge_commit_template
squash_commit_template
issues_template
merge_requests_template
squash_option
merge_pipelines_enabled
merge_trains_enabled
printing_merge_requests_link_enabled
topics
keep_latest_artifact
- Repository branches are now pageable
- Use explicit type for referencing associated items for rustc 1.57
- No changes needed for GitLab 14.6.
- No functional changes. Only documentation and tests were updated.
- Missing
Builder
type exports have been added.
- The error types from
Builder
instances are now distinct per builder type.
- Added the
first_contributors
field toapi::projects::merge_requests::MergeRequest
- Added the
api::projects::merge_requests::pipelines
endpoint to get the pipelines attached to a merge request - Added the
api::projects::merge_requests::changes
endpoint to get information about a merge request along with diffs - Made field
code_owner_approval_required
intypes::ProtectedRepoBranch
anOption<bool>
instead ofbool
as the field is only present in Gitlab premium - Added
Paged::iter_async
returning a paginated asynchronous stream analogous toPages::iter
. - Added the
api::groups::issues::Issues
endpoint to get issues associated with a group. - Added support for TLS-authenticated clients to
GitlabBuilder
- No changes needed for GitLab 14.3.
- Added the
api::projects::merge_requests::approvals::MergeRequestApprovals
endpoint to get approvals of a merge request. - Added graphql requests to the async client.
- The
Gitlab
client now supports unauthenticated connections.
- Clients may be wrapped by
api::retry::Client
in order to perform exponential backoff for service-side errors. Backoff parameters are configurable via theapi::retry::Backoff
structure.
types::MergeRequest::source_project_id
is now anOption<ProjectId>
- A new
RestClient
trait has been refactored fromClient
andAsyncClient
. - The
api::paged
type now has an.iter()
method which may be used to iterate over paginated results using lazily fetched API results. This can be used to reduce memory usage for large result sets. - Added a
confidential
parameter forapi::projects::issues::EditIssue
- GitLab responses which do not return JSON (e.g., 5xx status codes) are now
caught as the
ApiError::GitlabService
error variant. Previously, the JSON deserialization would have been exposed.
- Allow arbitrary strings for the UID of
ExternalProvider
matching what the API expects and allows.
- Project hooks can now be edited via
EditHook
.
- Upgraded
reqwest
andbytes
which use tokio 1.0.
- Added the
api::projects::releases::ProjectReleases
endpoint to list all releases for a project. - Added tags related api endpoints under
api::projects::repository::tags
- Listing commits in a repository can now be done via
Commits
- Added asynchronous API for query
api::AsyncQuery
and clientapi::AsyncClient
. - Added asynchronous client
AsyncGitlab
(created byGitlabBuilder::build_async
).
types::{Pipeline,PipelineBasic}
now have aproject_id
member.
ParamValue::as_value
now takes its value as&self
rather thanself
. This was required in order to implementCommaSeparatedList
reliably.- Merge request discussions on code now have a more fine-grained API. This change was made by GitLab and is just being followed by the crate.
api::common::CommaSeparatedList
now exists for easy use of comma-separated values.- Project members can now be removed via
RemoveProjectMember
. - Group members can now be edited via
EditGroupMember
. - Project members can now be edited via
EditProjectMember
.
EditIssue::remove_labels
is deprecated in favor of the betterclear_labels
wording.EditMergeRequest::remove_labels
is deprecated in favor of the betterclear_labels
wording.
- API bindings for the
"minimal"
access level. - Groups can have "inherit" set as their shared runner minute limit.
- Listing groups can now be set to only return top-level groups.
- Searching for projects within a group can now be sorted by a similarity score based on the search criteria.
- Project container expiration policies can now use an arbitrary "keep n" count.
- Project container expiration policies now have
name_regex_delete
(replacing the now-deprecatedname_regex
) andname_regex_keep
. - Projects can now be created and edited with
operations_access_level
settings. - Projects can now be created and edited with
requirements_access_level
settings. - Projects can now be created and edited with
analytics_access_level
settings. - Projects can now be created and edited with
show_default_award_emojis
settings. - Projects can now be created and edited with
restrict_user_defined_variables
settings. - Projects can now be created and edited with
allow_merge_on_skipped_pipeline
settings. - Projects can now be edited with
ci_forward_deployment_enabled
settings. - Environments can now be filtered by their deployment state.
- Project hooks can now be registered for events related to confidential notes, deployments, and releases.
- Issues can now be edited with incremental label changes.
- Issues can now be filtered by iterations, due dates, and search queries can now be scoped.
- Issue notes can now be created and edited with the confidential flag.
- Project labels can be filtered by search queries.
- Project members can now be edited in batch (using multiple IDs).
- Merge requests can now be created and edited with reviewer settings.
- Merge requests can now be created with the
approvals_before_merge
setting. - Merge request discussions can now be created on a specific commit.
- Merge requests can now be edited with incremental label changes.
- Merge requests can now be filtered by search scopes.
- Merge requests can now trigger merge status rechecks when listing.
- Merge requests can now be filtered by reviewer.
- Merge requests can now be filtered by environment status.
- API bindings for the
"scheduled"
pipeline status. - Projects can now be sorted by various resource sizes.
- Projects can now be filtered by storage backend.
- Users can now be filtered by GitLab-internal users and administrator status.
- Group member removal can now specify to unassign issuables.
- No changes needed for GitLab 13.8.
- Added
api::projects::repository::files::FileRaw
- Added
api::projects::merge_requests::approval_state::MergeRequestApprovalState
query to access the approval rules state of a particular merge request.
- No changes needed for GitLab 13.6.
- Changed
ci_config_path
toOption<String>
ingitlab::webhooks::PipelineHookAttrs
- Added
head_pipeline_id
field togitlab::webhooks::MergeRequestHookAttrs
- Error types now use
#[non_exhaustive]
- Added
gitlab::webhooks::PipelineHook
Id
types now implementHash
- Added
api::projects::issues::MergeRequestsClosing
andapi::projects::issues::MergeRequestsClosing
- GitLab 13.2 added the
approved
andunapproved
merge request actions for CE.
- Added the
api::projects::protected_tags::ProtectTag
api::projects::protected_tags::UnprotectTag
api::projects::protected_tags::ProtectedTag
api::projects::protected_tags::ProtectedTags
endpoint to query, protect and unprotect a projects tags. - Added the
api::projects::labels::DeleteLabel
endpoint to delete existing labels from a project. - Added the
api::projects::labels::PromoteLabel
endpoint to promote a project label to a group label. - Added the
api::projects:merge_requests::MergeMergeRequest
endpoint to merge open merge requests. - Added the
api::projects:merge_requests::RebaseMergeRequest
endpoint to rebase open merge requests when using the fast-forward merge model. - Added the
api::projects:merge_requests::ApproveMergeRequest
endpoint to approve open merge requests. - Added the
api::projects:merge_requests::UnapproveMergeRequest
endpoint to unapprove approved merge requests.
- Updated
api::projects::members::ProjectMember[s]
to support the ability to include member details for those members that have access as a result of belonging to ancestor/enclosing groups, in addition to directly added members. - Allow a label via the
api::projects::labels::Label
endpoint to be queried by id or name.
- Added the
api::groups::projects::GroupProjects
endpoint to list a groups projects. - Added the
api::groups::subgroups::GroupSubgroups
endpoint to list a groups subgroups. - Added the
api::projects::protected_branches::ProtectedBranches
endpoint to list a projects protected branches. - Added the
api::projects::protected_branches::ProtectedBranch
endpoint to query a projects protected branch.
- Added pagination support to
api::projects::labels::Labels
- Keyset pagination also supports the to-be-removed (14.0)
Links
HTTP header.
- The REST endpoint methods on the
Gitlab
structure have been removed. Associated helper structures for resource creation endpoints have been removed as well:CreateMergeRequestParams
CreateMergeRequestParamsBuilder
CreateGroupParams
CreateGroupParamsBuilder
CreateProjectParams
CreateProjectParamsBuilder
MergeMethod
BuildGitStrategy
AutoDeployStrategy
WebhookEvents
CommitStatusInfo
MergeRequestStateFilter
RepoFile
ProjectFeatures
QueryParamSlice
QueryParamVec
- Now-impossible error conditions have been removed from
GitlabError
.
- All methods on the
Gitlab
structure now haveEndpoint
structures implemented. In a future release, these methods (and their support types) will be removed. - The
Serialize
implementations of the API types are deprecated (though marking them as such is difficult).
- The
api::projects::issues::Issues
endpoint'smilestone
field was changed to match the actual API exposed by GitLab (withNone
andAny
options). - The
api::projects::pipelines::PipelineVariables
endpoint is now pageable. - All
EnableState
fields may now be set usingbool
values. - The
api::projects::merge_requests::EditMergeRequest
endpoint now supports unlabeling a merge request. - The
api::Client
trait has been changed to use thehttp
crate types. This allows for clients to not be tied toreqwest
and for mocking and testing of the endpoints themselves. - GitLab errors now detect error objects returned from the API.
- The
min_access_level
field forapi::groups::Groups
and theaccess_level
forapi::projects::members::AddProjectMember
are now properly passed as integers to the API. (#42) - The path used for the project and group milestone endpoints has been fixed.
It was observed (#41) that the new API pattern was not handling POST
and
PUT
parameters properly. This has now been fixed.
In the process of updating the body handling, a simpler pattern for query parameters was also implemented.
Some additional merge status names for merge requests were missing and have been added.
- The
api::projects::environments::Environment
endpoint uses the correct path now. - The
api::groups::members::GroupMembers
,api::projects::members::ProjectMembers
, andapi::projects::repository::Branches
endpoints now accepts plain strings for theirquery
fields. - The
api::projects::protected_branches::UnprotectBranch
endpoint now properly escapes branch names with URL-special characters. - The
api::projects::repository::CreateFile
endpoint now properly upgrades the encoding when attempting to encode binary contents usingEncoding::Text
. - The
api::projects::CreateProject
andapi::projects::EditProject
endpoints now accepts plain strings in itsimport_url
field.
- The
api::projects::issues::EditIssue
now usesissue
rather thanissue_iid
for consistency.
A new pattern for API implementation is now underway. Instead of methods
directly on the Gitlab
instance, there are now structures which implement an
api::Endpoint
trait. This trait may be used to query any structure
implementing the api::Client
trait using the api::Query
trait. All
endpoints use the "builder" pattern to collect required and optional
parameters.
There are some adaptor functions to handle various use cases:
api::paged
: This may be used to handle pagination of any endpoint which supports it (checked at compile time).api::ignore
: This may be used to ignore the content of the response for any endpoint. HTTP and GitLab error messages are still captured.api::raw
: Instead of deserializing the contents of the result from GitLab into a structure, the raw bytes may be fetched instead using this function.api::sudo
: This function adapts any endpoint into being called as another user if the client is able to do so (basically, is an administrator).
The api::Query
trait deserializes the contents from GitLab into any structure
which implements the serde::DeserializeOwned
trait. This can be used to only
grab information of interest to the caller instead of extracting all of the
information available through the types
module.
If your endpoint is deprecated, it has been marked as such and you should migrate to the new pattern. Please see the docs for available endpoints.
All new endpoint implementations should use the new pattern rather than adding
methods to Gitlab
. Result structures do not need to be added to this crate
either. It is expected that they too will be deprecated at some point and
either not provided or moved to a dedicated crate.
use std::env;
use serde::Deserialize;
use gitlab::Gitlab;
use gitlab::api::{self, projects, Query};
#[derive(Debug, Deserialize)]
struct Project {
name: String,
}
fn example() {
// Create the client.
let client = Gitlab::new("gitlab.com", env::get("GITLAB_TOKEN").unwrap()).unwrap();
// Create a simple endpoint.
let endpoint = projects::Project::builder().project("gitlab-org/gitlab").build().unwrap();
// Get the information.
let project: Project = endpoint.query(&client).unwrap();
// Call it again, but ignore the response from GitLab.
let _: () = api::ignore(endpoint).query(&client).unwrap();
// Create an endpoint that supports pagination.
let pageable_endpoint = projects::Projects::builder().build().unwrap();
// Get just the first page (20 results).
let first_page: Vec<Project> = pageable_endpoint.query(&client).unwrap();
// Get 200 results instead.
let first_200_projects: Vec<Project> = api::paged(pageable_endpoint, api::Pagination::Limit(200)).query(&client).unwrap();
// Query `gitlab-org/gitlab` except by ID this time.
let endpoint = projects::Project::builder().project(278964).build().unwrap();
// Get the raw data from the response.
let raw_data: Vec<u8> = api::raw(endpoint).query(&client).unwrap();
}
- Include a changelog.