Skip to content

Commit cd353f0

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent f475f21 commit cd353f0

File tree

4 files changed

+56
-47
lines changed

4 files changed

+56
-47
lines changed

doc/api/packages.md

+25-39
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w
88

99
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349418) support for [GitLab CI/CD job token](../ci/jobs/ci_job_token.md) authentication for the project-level API in GitLab 15.3.
1010
11-
This is the API documentation of [GitLab Packages](../administration/packages/index.md).
11+
The API documentation of [GitLab Packages](../administration/packages/index.md).
1212

1313
## List packages
1414

15-
### Within a project
15+
### For a project
1616

1717
Get a list of project packages. All package types are included in results. When
1818
accessed without authentication, only packages of public projects are returned.
@@ -23,16 +23,16 @@ packages.
2323
GET /projects/:id/packages
2424
```
2525

26-
| Attribute | Type | Required | Description |
27-
| --------- | ---- | -------- | ----------- |
28-
| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
29-
| `order_by`| string | no | The field to use as order. One of `created_at` (default), `name`, `version`, or `type`. |
30-
| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. |
31-
| `package_type` | string | no | Filter the returned packages by type. One of `conan`, `maven`, `npm`, `pypi`, `composer`, `nuget`, `helm`, `terraform_module`, or `golang`. (_Introduced in GitLab 12.9_)
32-
| `package_name` | string | no | Filter the project packages with a fuzzy search by name. (_Introduced in GitLab 12.9_)
33-
| `package_version` | string | no | Filter the project packages by version. (_[Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6_)
34-
| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. (_Introduced in GitLab 13.8_)
35-
| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. (_Introduced in GitLab 13.9_)
26+
| Attribute | Type | Required | Description |
27+
|:----------------------|:---------------|:---------|:------------|
28+
| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). |
29+
| `order_by` | string | no | The field to use as order. One of `created_at` (default), `name`, `version`, or `type`. |
30+
| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. |
31+
| `package_type` | string | no | Filter the returned packages by type. One of `conan`, `maven`, `npm`, `pypi`, `composer`, `nuget`, `helm`, `terraform_module`, or `golang`. |
32+
| `package_name` | string | no | Filter the project packages with a fuzzy search by name. |
33+
| `package_version` | string | no | Filter the project packages by version. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6. |
34+
| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. |
35+
| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. |
3636

3737
```shell
3838
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages"
@@ -77,9 +77,7 @@ By default, the `GET` request returns 20 results, because the API is [paginated]
7777
Although you can filter packages by status, working with packages that have a `processing` status
7878
can result in malformed data or broken packages.
7979

80-
### Within a group
81-
82-
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18871) in GitLab 12.5.
80+
### For a group
8381

8482
Get a list of project packages at the group level.
8583
When accessed without authentication, only packages of public projects are returned.
@@ -90,27 +88,22 @@ packages.
9088
GET /groups/:id/packages
9189
```
9290

93-
| Attribute | Type | Required | Description |
94-
| --------- | ---- | -------- | ----------- |
95-
| `id` | integer/string | yes | ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding). |
96-
| `exclude_subgroups` | boolean | false | If the parameter is included as true, packages from projects from subgroups are not listed. Default is `false`. |
97-
| `order_by`| string | no | The field to use as order. One of `created_at` (default), `name`, `version`, `type`, or `project_path`. |
98-
| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. |
99-
| `package_type` | string | no | Filter the returned packages by type. One of `conan`, `maven`, `npm`, `pypi`, `composer`, `nuget`, `helm`, or `golang`. (_Introduced in GitLab 12.9_) |
100-
| `package_name` | string | no | Filter the project packages with a fuzzy search by name. (_[Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/30980) in GitLab 13.0_)
101-
| `package_version` | string | no | Filter the returned packages by version. (_[Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6_)
102-
| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. (_Introduced in GitLab 13.8_)
103-
| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. (_Introduced in GitLab 13.9_)
91+
| Attribute | Type | Required | Description |
92+
|:----------------------|:---------------|:---------|:------------|
93+
| `id` | integer/string | yes | ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding). |
94+
| `exclude_subgroups` | boolean | false | If the parameter is included as true, packages from projects from subgroups are not listed. Default is `false`. |
95+
| `order_by` | string | no | The field to use as order. One of `created_at` (default), `name`, `version`, `type`, or `project_path`. |
96+
| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. |
97+
| `package_type` | string | no | Filter the returned packages by type. One of `conan`, `maven`, `npm`, `pypi`, `composer`, `nuget`, `helm`, or `golang`. |
98+
| `package_name` | string | no | Filter the project packages with a fuzzy search by name. |
99+
| `package_version` | string | no | Filter the returned packages by version. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6. |
100+
| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. |
101+
| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. |
104102

105103
```shell
106104
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/packages?exclude_subgroups=false"
107105
```
108106

109-
> **Deprecation:**
110-
>
111-
> The `pipeline` attribute in the response is deprecated in favor of `pipelines`, which was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44348) in GitLab 13.6. Both are available until 13.7.
112-
> The `build_info` attribute in the response is deprecated in favor of `pipeline`, which was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28040) in GitLab 12.10.
113-
114107
Example response:
115108

116109
```json
@@ -197,11 +190,6 @@ GET /projects/:id/packages/:package_id
197190
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages/:package_id"
198191
```
199192

200-
> **Deprecation:**
201-
>
202-
> The `pipeline` attribute in the response is deprecated in favor of `pipelines`, which was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/44348) in GitLab 13.6. Both are available until 13.7.
203-
> The `build_info` attribute in the response is deprecated in favor of `pipeline`, which was [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28040) in GitLab 12.10.
204-
205193
Example response:
206194

207195
```json
@@ -215,7 +203,7 @@ Example response:
215203
"delete_api_path": "/namespace1/project1/-/packages/1"
216204
},
217205
"created_at": "2019-11-27T03:37:38.711Z",
218-
"last_downloaded_at": "2022-09-07T07:51:50.504Z"
206+
"last_downloaded_at": "2022-09-07T07:51:50.504Z",
219207
"pipelines": [
220208
{
221209
"id": 123,
@@ -427,8 +415,6 @@ deleting a package can introduce a [dependency confusion risk](../user/packages/
427415

428416
## Delete a package file
429417

430-
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32107) in GitLab 13.12.
431-
432418
WARNING:
433419
Deleting a package file may corrupt your package making it unusable or unpullable from your package
434420
manager client. When deleting a package file, be sure that you understand what you're doing.

doc/user/storage_management_automation.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ default:
780780
781781
## Manage Container Registries storage
782782
783-
Container registries are available [in a project](../api/container_registry.md#within-a-project) or [in a group](../api/container_registry.md#within-a-group). You can analyze both locations to implement a cleanup strategy.
783+
Container registries are available [for projects](../api/container_registry.md#within-a-project) or [for groups](../api/container_registry.md#within-a-group). You can analyze both locations to implement a cleanup strategy.
784784
785785
### List container registries
786786
@@ -894,7 +894,7 @@ You can optimize container images to reduce the image size and overall storage c
894894

895895
## Manage Package Registry storage
896896

897-
Package registries are available [in a project](../api/packages.md#within-a-project) or [in a group](../api/packages.md#within-a-group).
897+
Package registries are available [for projects](../api/packages.md#for-a-project) or [for groups](../api/packages.md#for-a-group).
898898

899899
### List packages and files
900900

scripts/regenerate-schema

+26-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,28 @@ class SchemaRegenerator
3434

3535
def execute
3636
Dir.chdir(File.expand_path('..', __dir__)) do
37+
# Note: `db:drop` must run prior to hiding migrations.
38+
#
39+
# Executing a Rails DB command e.g., `reset`, `drop`, etc. triggers running the initializers.
40+
# During the initialization, the default values for `application_settings` need to be set.
41+
# Depending on the presence of migrations, the default values are either faked or inserted.
42+
#
43+
# 1. If no migration is detected, all the necessary columns are in place from `db/structure.sql`.
44+
# The default values can be inserted into `application_settings` table.
45+
#
46+
# 2. If a migration is detected, at least one column may be missing from `db/structure.sql`
47+
# and needs to be added through the detected migration. In this case, the default values are faked.
48+
# If not, an error would be raised e.g., "NoMethodError: undefined method `some_setting`"
49+
#
50+
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135085#note_1628210334 for more info.
51+
#
52+
drop_db
3753
checkout_ref
3854
checkout_clean_schema
3955
hide_migrations
4056
remove_schema_migration_files
4157
stop_spring
42-
reset_db
58+
setup_db
4359
unhide_migrations
4460
migrate
4561
rollback if @rollback_testing
@@ -162,9 +178,15 @@ class SchemaRegenerator
162178
end
163179

164180
##
165-
# Run rake task to reset the database.
166-
def reset_db
167-
run %q(bin/rails db:reset RAILS_ENV=test)
181+
# Run rake task to drop the database.
182+
def drop_db
183+
run %q(bin/rails db:drop RAILS_ENV=test)
184+
end
185+
186+
##
187+
# Run rake task to setup the database.
188+
def setup_db
189+
run %q(bin/rails db:setup RAILS_ENV=test)
168190
end
169191

170192
##

spec/features/merge_request/user_merges_merge_request_spec.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "spec_helper"
44

55
RSpec.describe "User merges a merge request", :js, feature_category: :code_review_workflow do
6-
let_it_be(:user) { create(:user, :no_super_sidebar) }
6+
let_it_be(:user) { create(:user) }
77

88
before do
99
sign_in(user)
@@ -21,7 +21,8 @@
2121
end
2222
end
2323

24-
context 'sidebar merge requests counter' do
24+
# Pending re-implementation: https://gitlab.com/gitlab-org/gitlab/-/issues/429268
25+
xcontext 'sidebar merge requests counter' do
2526
let_it_be(:project) { create(:project, :public, :repository, namespace: user.namespace) }
2627
let!(:merge_request) { create(:merge_request, source_project: project) }
2728

0 commit comments

Comments
 (0)