CHANGELOG.md 24.3 KB
Newer Older
Brad King's avatar
Brad King committed
1
# v0.1508.0
2
3
4
5
6

## Additions

  * Add API endpoint `api::projects::merge_requests::approval_rules`.

Brad King's avatar
Brad King committed
7
# v0.1507.0
8
9
10
11

## Additions

  * Implement `Clone` for structs that implement `Endpoint`.
12
  * Support for container registry endpoints.
13
  * Support `/project/:project/repository/archive` endpoint.
14

Brad King's avatar
Brad King committed
15
16
17
18
# v0.1506.0

  * No changes needed for GitLab 15.6.

Brad King's avatar
Brad King committed
19
20
21
22
# v0.1505.0

  * No changes needed for GitLab 15.5.

Brad King's avatar
Brad King committed
23
# v0.1504.0
24
25
26
27
28

## Additions

  * API endpoints for user impersonation tokens.

Brad King's avatar
Brad King committed
29
# v0.1503.0
Emelie Graven's avatar
Emelie Graven committed
30
31
32
33
34
35

## Additions

  * `types::GroupHook` has been added.
  * New endpoints for:
    - Creating, getting, editing, listing and deleting group hooks.
36
  * Support for `Push` branch protections when creating groups.
37
  * Support for sorting project search results by `Similarity`.
38
39
40
  * Support for setting group shared runner settings, `path`,
    `prevent_sharing_groups_outside_hierarchy`,
    `prevent_forking_outside_group`, and `file_template_project_id`.
41
42
  * Support for `invite_source`, `tasks_to_be_done`, and `tasks_project_id`
    when adding a member to a group or project.
43
  * Support `skip_subresources` when deleting group memberships.
44
45
  * Support for filtering on `epic_id` when listing issues.
  * Support for issue types when creating, editing, and filtering issues.
46
  * Support sorting merge requests by title.
47
  * Support requesting retried jobs when requesting pipeline jobs.
48
  * Support pipeline status states `Preparing` and `WaitingForResource`.
49
50
  * Support setting the `security_and_compliance_access_level` when creating
    and editing projects.
51
52
  * Support editing the `mr_default_target_self` and `ci_separated_caches`
    project fields.
53
  * Support setting variables when playing manual jobs.
54
55
  * Support `merge_request_diff_sha` when editing and creating MR notes
    (required for the `/merge` command).
56
  * Support filtering pipelines by their source.
57
  * Support allowing force pushes when protecting branches.
58
59
  * Support including HTML descriptions in project releases.
  * Support sorting parameters for project releases.
60
  * Support including trailers in commit queries.
61
62
  * Support `execute_filemode` and `last_commit_id` when editing files through
    the API.
63
  * Support querying custom attributes of users.
64
  * Support `without_project_bots` and `saml_provider_id` when listing users.
65
  * Support for filtering projects based on import status and topics.
66
  * Support for finer-grained creation rules for protected tags.
67
  * Support filters when updating project pipeline variables.
68
  * Keyset pagination is now supported for group searches ordered by name.
69
  * Support filtering groups based on custom attributes.
70
  * The `all` project membership endpoints have been split out.
Emelie Graven's avatar
Emelie Graven committed
71

72
73
74
75
76
77
## Deprecations

  * `api::issues::IssueOrderBy::WeightFields` is now
    `api::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 to `weight` instead of `weight_fields`.
78
79
80
81
  * `api::projects::{CreateProject, EditProject}::container_registry_enabled`
    is deprecated in favor of `container_registry_access_level`.
  * `api::projects::{CreateProject, EditProject}::{tag, tags}` are deprecated
    in favor of `topic` and `topics`.
82
83
84
85
  * `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.
86
87
  * `api::projects::pipelines::Pipelines::name` is deprecated; GitLab never
    supported such a parameter.
88
89
90
  * `api::projects::members::{ProjectMember, ProjectMembers}::all_members` is
    deprecated. The `all` endpoints have different parameters, so merging them
    doesn't work anymore.
91

92
93
94
## Breaking changes

  * `api::deploy_keys::DeployKeys::public` is now private.
95
96
97
  * `api::projects::{CreateProject, EditProject}::requirements_access_level` do
    not support `Public`, so they now uses `api::FeatureAccessLevel` instead of
    `api::FeatureAccessLevelPublic`.
98
99
  * `api::users::Users::external` is now a `()` instead of `bool` because
    GitLab doesn't actually support `external=false`.
100
101
  * `api::projects::repository::Tree` now uses keyset pagination and requires
    GitLab 15.0. Page-based iteration has been deprecated by GitLab.
102
103
  * `api::projects::variables::ProjectVariableFilter::environment_scope` is now
    private.
104

Brad King's avatar
Brad King committed
105
# v0.1502.0
106
107
108
109
110

## Changes

  * `graphql_client` has been updated to 0.11.

Brad King's avatar
Brad King committed
111
# v0.1501.0
112

derjones's avatar
derjones committed
113
114
115
116
117
## Changes

  * `api::projects::merge_requests::MergeRequestPipelines` and associated
    structures have been moved to `api::projects::merge_requests::pipelines`.

118
119
120
121
122
## Fixes

  * `api::projects::edit::EditProject` fixes a typo from
    `printing_merge_requests_link_enabled` to
    `printing_merge_request_link_enabled`
123
  * `api::projects::protected_branches::ProtectedBranches` is now paginated.
124

125
126
127
## Additions

  * `types::UserState::Deactivated` has been added.
128
129
130
  * New endpoints for:
    - Sharing and unsharing groups
    - Listing shared projects in a group
131
    - Sharing and unsharing projects
132
    - Creating a pipeline on a merge request
133
134
135
136
137
138
139
140
141
142
143
  * 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`
144
145
146
  * New fields on `types::ProjectHook`:
    - `deployment_events`
    - `releases_events`
147
148
149
  * New fields on `types::Project`:
    - `build_git_strategy`
    - `ci_default_git_depth`
150
151
152
  * New fields on `webhooks::MergeRequestHook`:
    - `changes`
  * New `webhooks::MergeRequestChanges` structure
153

Brad King's avatar
Brad King committed
154
155
156
157
# v0.1500.0

  * No changes needed for GitLab 15.0.

Brad King's avatar
Brad King committed
158
159
160
161
# v0.1410.0

  * No changes needed for GitLab 14.10.

derjones's avatar
derjones committed
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
-------
# v0.1409.1 (unreleased)

## Additions
  * 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` to `api::projects::merge_requests::pipelines::pipelines`
  * Add api endpoint `api::projects::merge_requests::pipelines::create`
  * Fix parameters for editing projects:
    - printing_merge_request_link_enabled
-------

Brad King's avatar
Brad King committed
190
191
192
193
# v0.1409.0

  * No changes needed for GitLab 14.9.

Brad King's avatar
Brad King committed
194
# v0.1408.0
Arne Beer's avatar
Arne Beer committed
195
196
197
198
199
200

## Additions

  * Added the `api::projects::merge_trains` endpoint to get merge trains
    for a specific project.

Brad King's avatar
Brad King committed
201
# v0.1407.0
202

derjones's avatar
derjones committed
203
204
205
206
## Breaking changes

  * `types::RepoCommit::parent_ids` is now an `Option`.

207
208
209
210
## Fixes

  * Protected tags with special URL characters (namely `/`) are now handled
    properly with `api::projects::protected_tags::ProtectedTag`.
derjones's avatar
derjones committed
211
  * Tags on a repository are now pageable.
212
  * The `types::DiscussionNoteType::Note` variant has been added.
213

214
215
216
## Additions

  * Groups can now be edited via `EditGroup`.
217
  * New `rustls` feature to support static linking (no OpenSSL).
218
219
220
221
222
223
224
  * New type definitions for:
    - `MergeRequestCommit`
    - `ProjectVariable`
    - `ProtectedTagAccessLevel`
    - `ProtectedTag`
    - `ReleaseTag`
    - `Tag`
225
226
  * New endpoints for:
    - Creating, updating, and inspecting project-level pipeline variables.
227
    - Deleting project hooks.
228
    - Getting tree object from projects.
derjones's avatar
derjones committed
229
    - Updating a file in a project.
230
    - Getting merge requests associated with a commit.
derjones's avatar
derjones committed
231
    - Getting commits of a merge request.
232
    - Deleting a file from the repository.
233
    - Deploy keys
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
  * 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`
252
  * Repository branches are now pageable
253

254
255
256
257
## Changes

  * Use explicit type for referencing associated items for rustc 1.57

Brad King's avatar
Brad King committed
258
259
260
261
# v0.1406.0

  * No changes needed for GitLab 14.6.

Brad King's avatar
Brad King committed
262
263
264
265
# v0.1405.1

  * No functional changes.  Only documentation and tests were updated.

266
# v0.1405.0
267
268
269
270
271

## Additions

  * Missing `Builder` type exports have been added.

272
273
274
275
## Breaking changes

  * The error types from `Builder` instances are now distinct per builder type.

Brad King's avatar
Brad King committed
276
# v0.1404.0
Ben Boeckel's avatar
Ben Boeckel committed
277
278

## Additions
279
280

  * Added the `first_contributors` field to `api::projects::merge_requests::MergeRequest`
281
282
  * Added the `api::projects::merge_requests::pipelines` endpoint to get
    the pipelines attached to a merge request
283
284
  * Added the `api::projects::merge_requests::changes` endpoint to get
    information about a merge request along with diffs
285
286
287
  * Made field `code_owner_approval_required` in `types::ProtectedRepoBranch`
    an `Option<bool>` instead of `bool` as the field is only present in
    Gitlab premium
Ben Boeckel's avatar
Ben Boeckel committed
288
289
  * Added `Paged::iter_async` returning a paginated asynchronous stream
    analogous to `Pages::iter`.
dureuill's avatar
dureuill committed
290
291
  * Added the `api::groups::issues::Issues` endpoint to get issues associated
    with a group.
292
  * Added support for TLS-authenticated clients to `GitlabBuilder`
293

Brad King's avatar
Brad King committed
294
295
296
297
# v0.1403.0

  * No changes needed for GitLab 14.3.

Brad King's avatar
Brad King committed
298
# v0.1402.0
299
300
301
302
303

## Additions

  * Added the `api::projects::merge_requests::approvals::MergeRequestApprovals`
    endpoint to get approvals of a merge request.
Liam F's avatar
Liam F committed
304
  * Added graphql requests to the async client.
305
  * The `Gitlab` client now supports unauthenticated connections.
306

307
308
309
310
311
312
## New features

  * Clients may be wrapped by `api::retry::Client` in order to perform
    exponential backoff for service-side errors. Backoff parameters are
    configurable via the `api::retry::Backoff` structure.

Brad King's avatar
Brad King committed
313
# v0.1401.0
314
315
316
317
318

## Breaking changes

  * `types::MergeRequest::source_project_id` is now an `Option<ProjectId>`

Brad King's avatar
Brad King committed
319
# v0.1400.0
320
321
322
323
324

## Changes

  * A new `RestClient` trait has been refactored from `Client` and
    `AsyncClient`.
325
326
327
  * 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.
328
  * Added a `confidential` parameter for `api::projects::issues::EditIssue`
329
330
331
  * 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.
332

Brad King's avatar
Brad King committed
333
# v0.1312.0
334
335
336
337
338
339

## Breaking changes

  * Allow arbitrary strings for the UID of `ExternalProvider` matching what the
    API expects and allows.

Ben Boeckel's avatar
Ben Boeckel committed
340
# v0.1311.2
341
342
343
344
345

## Additions

  * Project hooks can now be edited via `EditHook`.

346
347
348
349
# v0.1311.1

## Breaking changes

Ben Boeckel's avatar
Ben Boeckel committed
350
  * Upgraded `reqwest` and `bytes` which use tokio 1.0.
351

Brad King's avatar
Brad King committed
352
# v0.1311.0
353
354
355
356
357

## Additions

  * Added the `api::projects::releases::ProjectReleases` endpoint to list all
    releases for a project.
lfn3's avatar
lfn3 committed
358
  * Added tags related api endpoints under `api::projects::repository::tags`
359
  * Listing commits in a repository can now be done via `Commits`
360
361
  * Added asynchronous API for query `api::AsyncQuery` and client `api::AsyncClient`.
  * Added asynchronous client `AsyncGitlab` (created by `GitlabBuilder::build_async`).
362

Brad King's avatar
Brad King committed
363
364
365
366
367
368
# v0.1310.0

## Additions

  * `types::{Pipeline,PipelineBasic}` now have a `project_id` member.

Brad King's avatar
Brad King committed
369
# v0.1309.0
370

371
372
373
374
## Breaking changes

  * `ParamValue::as_value` now takes its value as `&self` rather than `self`.
    This was required in order to implement `CommaSeparatedList` reliably.
375
376
  * 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.
377

Ben Boeckel's avatar
Ben Boeckel committed
378
379
380
381
## Additions

  * `api::common::CommaSeparatedList` now exists for easy use of
    comma-separated values.
382
  * Project members can now be removed via `RemoveProjectMember`.
383
  * Group members can now be edited via `EditGroupMember`.
384
  * Project members can now be edited via `EditProjectMember`.
Ben Boeckel's avatar
Ben Boeckel committed
385

386
387
388
389
## Deprecations

  * `EditIssue::remove_labels` is deprecated in favor of the better
    `clear_labels` wording.
390
391
  * `EditMergeRequest::remove_labels` is deprecated in favor of the better
    `clear_labels` wording.
392

393
394
395
## Changes

  * API bindings for the `"minimal"` access level.
396
  * Groups can have "inherit" set as their shared runner minute limit.
397
  * Listing groups can now be set to only return top-level groups.
398
399
  * Searching for projects within a group can now be sorted by a similarity
    score based on the search criteria.
400
401
  * Project container expiration policies can now use an arbitrary "keep n"
    count.
402
403
  * Project container expiration policies now have `name_regex_delete`
    (replacing the now-deprecated `name_regex`) and `name_regex_keep`.
404
405
  * Projects can now be created and edited with `operations_access_level`
    settings.
406
407
  * Projects can now be created and edited with `requirements_access_level`
    settings.
408
409
  * Projects can now be created and edited with `analytics_access_level`
    settings.
410
411
  * Projects can now be created and edited with `show_default_award_emojis`
    settings.
412
413
  * Projects can now be created and edited with
    `restrict_user_defined_variables` settings.
414
415
  * Projects can now be created and edited with
    `allow_merge_on_skipped_pipeline` settings.
416
  * Projects can now be edited with `ci_forward_deployment_enabled` settings.
417
  * Environments can now be filtered by their deployment state.
418
419
  * Project hooks can now be registered for events related to confidential
    notes, deployments, and releases.
420
  * Issues can now be edited with incremental label changes.
421
422
  * Issues can now be filtered by iterations, due dates, and search queries can
    now be scoped.
423
  * Issue notes can now be created and edited with the confidential flag.
424
  * Project labels can be filtered by search queries.
425
  * Project members can now be edited in batch (using multiple IDs).
426
  * Merge requests can now be created and edited with reviewer settings.
427
428
  * Merge requests can now be created with the `approvals_before_merge`
    setting.
429
  * Merge request discussions can now be created on a specific commit.
430
  * Merge requests can now be edited with incremental label changes.
431
  * Merge requests can now be filtered by search scopes.
432
  * Merge requests can now trigger merge status rechecks when listing.
433
  * Merge requests can now be filtered by reviewer.
434
  * Merge requests can now be filtered by environment status.
435
  * API bindings for the `"scheduled"` pipeline status.
436
  * Projects can now be sorted by various resource sizes.
437
  * Projects can now be filtered by storage backend.
438
439
  * Users can now be filtered by GitLab-internal users and administrator
    status.
440
  * Group member removal can now specify to unassign issuables.
441

Brad King's avatar
Brad King committed
442
443
444
445
# v0.1308.0

  * No changes needed for GitLab 13.8.

Brad King's avatar
Brad King committed
446
# v0.1307.0
Ben Boeckel's avatar
Ben Boeckel committed
447
448
449
450

## Additions

  * Added `api::projects::repository::files::FileRaw`
451
452
  * Added `api::projects::merge_requests::approval_state::MergeRequestApprovalState`
    query to access the approval rules state of a particular merge request.
Ben Boeckel's avatar
Ben Boeckel committed
453

Brad King's avatar
Brad King committed
454
455
# v0.1306.0

Ben Boeckel's avatar
Ben Boeckel committed
456
457
  * No changes needed for GitLab 13.6.

Ben Boeckel's avatar
Ben Boeckel committed
458
# v0.1305.1
459
460
461
462
463

## Changes

  * Changed `ci_config_path` to `Option<String>` in `gitlab::webhooks::PipelineHookAttrs`

Brad King's avatar
Brad King committed
464
# v0.1305.0
465
466
467

## Additions

468
  * Added `head_pipeline_id` field to `gitlab::webhooks::MergeRequestHookAttrs`
469

Brad King's avatar
Brad King committed
470
# v0.1304.0
Ben Boeckel's avatar
Ben Boeckel committed
471
472
473
474
475

## Changes

  * Error types now use `#[non_exhaustive]`

Brad King's avatar
Brad King committed
476
# v0.1303.0
Jonas Bulik's avatar
Jonas Bulik committed
477
478
479

## Additions

480
  * Added `gitlab::webhooks::PipelineHook`
Jonas Bulik's avatar
Jonas Bulik committed
481

Ben Boeckel's avatar
Ben Boeckel committed
482
# v0.1302.2
Grokafar's avatar
Grokafar committed
483
484
485

## Additions

486
  * `Id` types now implement `Hash`
Grokafar's avatar
Grokafar committed
487

Ben Boeckel's avatar
Ben Boeckel committed
488
# v0.1302.1
489

490
491
## Additions

492
493
  * Added `api::projects::issues::MergeRequestsClosing` and
    `api::projects::issues::MergeRequestsClosing`
494

495
496
497
498
499
## Fixes

  * GitLab 13.2 added the `approved` and `unapproved` merge request actions for
    CE.

Brad King's avatar
Brad King committed
500
# v0.1302.0
501
502
503
504
505
506
507
508

## Additions

  * 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.
509
510
  * Added the `api::projects::labels::DeleteLabel` endpoint to delete existing
    labels from a project.
511
512
  * Added the `api::projects::labels::PromoteLabel` endpoint to promote a project
    label to a group label.
Bradley Wood's avatar
Bradley Wood committed
513
  * Added the `api::projects:merge_requests::MergeMergeRequest` endpoint to
Bradley Wood's avatar
Bradley Wood committed
514
515
516
    merge open merge requests.
  * Added the `api::projects:merge_requests::RebaseMergeRequest` endpoint to
    rebase open merge requests when using the fast-forward merge model.
Bradley Wood's avatar
Bradley Wood committed
517
518
  * Added the `api::projects:merge_requests::ApproveMergeRequest` endpoint to
    approve open merge requests.
Bradley Wood's avatar
Bradley Wood committed
519
520
  * Added the `api::projects:merge_requests::UnapproveMergeRequest` endpoint to
    unapprove approved merge requests.
521

Ben Boeckel's avatar
Ben Boeckel committed
522
# v0.1301.1
523

524
## Changes
525
526
527
528
529

  * 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.
530
531
  * Allow a label via the `api::projects::labels::Label` endpoint to be queried
    by id or name.
532

533
534
535
536
## Additions

  * Added the `api::groups::projects::GroupProjects` endpoint to list a groups
    projects.
537
538
  * Added the `api::groups::subgroups::GroupSubgroups` endpoint to list a
    groups subgroups.
539
540
  * Added the `api::projects::protected_branches::ProtectedBranches` endpoint
    to list a projects protected branches.
541
542
  * Added the `api::projects::protected_branches::ProtectedBranch` endpoint
    to query a projects protected branch.
543

544
545
546
## Fixes

  * Added pagination support to `api::projects::labels::Labels`
547
548
  * Keyset pagination also supports the to-be-removed (14.0) `Links` HTTP
    header.
549

550
# v0.1301.0
Ben Boeckel's avatar
Ben Boeckel committed
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574

## Deprecations

  * 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`.

Ben Boeckel's avatar
Ben Boeckel committed
575
# v0.1300.0
576

577
578
579
580
581
## Deprecations

  * All methods on the `Gitlab` structure now have `Endpoint` structures
    implemented. In a future release, these methods (and their support types)
    will be removed.
582
583
  * The `Serialize` implementations of the API types are deprecated (though
    marking them as such is difficult).
584

585
586
587
588
589
## Changes

  * The `api::projects::issues::Issues` endpoint's `milestone` field was
    changed to match the actual API exposed by GitLab (with `None` and `Any`
    options).
590
  * The `api::projects::pipelines::PipelineVariables` endpoint is now pageable.
591
  * All `EnableState` fields may now be set using `bool` values.
592
593
  * The `api::projects::merge_requests::EditMergeRequest` endpoint now supports
    unlabeling a merge request.
594
595
596
  * The `api::Client` trait has been changed to use the `http` crate types.
    This allows for clients to not be tied to `reqwest` and for mocking and
    testing of the endpoints themselves.
597
  * GitLab errors now detect error objects returned from the API.
598

Ben Boeckel's avatar
Ben Boeckel committed
599
600
601
602
603
## Fixes

  * The `min_access_level` field for `api::groups::Groups` and the
    `access_level` for `api::projects::members::AddProjectMember` are now
    properly passed as integers to the API. (#42)
604
  * The path used for the project and group milestone endpoints has been fixed.
Ben Boeckel's avatar
Ben Boeckel committed
605

Ben Boeckel's avatar
Ben Boeckel committed
606
# v0.1210.2
Ben Boeckel's avatar
Ben Boeckel committed
607

608
609
610
611
612
## New request body handling

It was observed (#41) that the new API pattern was not handling `POST` and
`PUT` parameters properly. This has now been fixed.

613
614
615
616
617
## New request parameter handling

In the process of updating the body handling, a simpler pattern for query
parameters was also implemented.

Ben Boeckel's avatar
Ben Boeckel committed
618
619
620
621
622
## Additional merge status cases

Some additional merge status names for merge requests were missing and have
been added.

623
624
625
626
## Fixes

  * The `api::projects::environments::Environment` endpoint uses the correct
    path now.
627
628
  * The `api::groups::members::GroupMembers`,
    `api::projects::members::ProjectMembers`, and
629
630
    `api::projects::repository::Branches` endpoints now accepts plain strings
    for their `query` fields.
631
632
  * The `api::projects::protected_branches::UnprotectBranch` endpoint now
    properly escapes branch names with URL-special characters.
633
634
635
  * The `api::projects::repository::CreateFile` endpoint now properly upgrades
    the encoding when attempting to encode binary contents using
    `Encoding::Text`.
636
637
  * The `api::projects::CreateProject` and `api::projects::EditProject`
    endpoints now accepts plain strings in its `import_url` field.
638

639
640
641
642
643
## Changes

  * The `api::projects::issues::EditIssue` now uses `issue` rather than
    `issue_iid` for consistency.

Ben Boeckel's avatar
Ben Boeckel committed
644
# v0.1210.1
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720

## New API strategy

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.

### Examples:

```rust
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();
}
```

## Changes

  * Include a changelog.