diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-04 00:11:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-04 00:11:58 +0300 |
commit | cd353f0da2c1c9a6cdfe0a92f5f3236971ffaf9f (patch) | |
tree | d519b567aae239bc9f71f8bd98ecf9ed422158f2 | |
parent | f475f21f78faa82b9a2781b37ff9d0b63b23a512 (diff) |
Add latest changes from gitlab-org/gitlab@master
-rw-r--r-- | doc/api/packages.md | 64 | ||||
-rw-r--r-- | doc/user/storage_management_automation.md | 4 | ||||
-rwxr-xr-x | scripts/regenerate-schema | 30 | ||||
-rw-r--r-- | spec/features/merge_request/user_merges_merge_request_spec.rb | 5 |
4 files changed, 56 insertions, 47 deletions
diff --git a/doc/api/packages.md b/doc/api/packages.md index 0a2bfa3c30f..21d8d6f5a21 100644 --- a/doc/api/packages.md +++ b/doc/api/packages.md @@ -8,11 +8,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w > [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. -This is the API documentation of [GitLab Packages](../administration/packages/index.md). +The API documentation of [GitLab Packages](../administration/packages/index.md). ## List packages -### Within a project +### For a project Get a list of project packages. All package types are included in results. When accessed without authentication, only packages of public projects are returned. @@ -23,16 +23,16 @@ packages. GET /projects/:id/packages ``` -| Attribute | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) | -| `order_by`| string | no | The field to use as order. One of `created_at` (default), `name`, `version`, or `type`. | -| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. | -| `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_) -| `package_name` | string | no | Filter the project packages with a fuzzy search by name. (_Introduced in GitLab 12.9_) -| `package_version` | string | no | Filter the project packages by version. (_[Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6_) -| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. (_Introduced in GitLab 13.8_) -| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. (_Introduced in GitLab 13.9_) +| Attribute | Type | Required | Description | +|:----------------------|:---------------|:---------|:------------| +| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding). | +| `order_by` | string | no | The field to use as order. One of `created_at` (default), `name`, `version`, or `type`. | +| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. | +| `package_type` | string | no | Filter the returned packages by type. One of `conan`, `maven`, `npm`, `pypi`, `composer`, `nuget`, `helm`, `terraform_module`, or `golang`. | +| `package_name` | string | no | Filter the project packages with a fuzzy search by name. | +| `package_version` | string | no | Filter the project packages by version. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6. | +| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. | +| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. | ```shell 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] Although you can filter packages by status, working with packages that have a `processing` status can result in malformed data or broken packages. -### Within a group - -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18871) in GitLab 12.5. +### For a group Get a list of project packages at the group level. When accessed without authentication, only packages of public projects are returned. @@ -90,27 +88,22 @@ packages. GET /groups/:id/packages ``` -| Attribute | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `id` | integer/string | yes | ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding). | -| `exclude_subgroups` | boolean | false | If the parameter is included as true, packages from projects from subgroups are not listed. Default is `false`. | -| `order_by`| string | no | The field to use as order. One of `created_at` (default), `name`, `version`, `type`, or `project_path`. | -| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. | -| `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_) | -| `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_) -| `package_version` | string | no | Filter the returned packages by version. (_[Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6_) -| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. (_Introduced in GitLab 13.8_) -| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. (_Introduced in GitLab 13.9_) +| Attribute | Type | Required | Description | +|:----------------------|:---------------|:---------|:------------| +| `id` | integer/string | yes | ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding). | +| `exclude_subgroups` | boolean | false | If the parameter is included as true, packages from projects from subgroups are not listed. Default is `false`. | +| `order_by` | string | no | The field to use as order. One of `created_at` (default), `name`, `version`, `type`, or `project_path`. | +| `sort` | string | no | The direction of the order, either `asc` (default) for ascending order or `desc` for descending order. | +| `package_type` | string | no | Filter the returned packages by type. One of `conan`, `maven`, `npm`, `pypi`, `composer`, `nuget`, `helm`, or `golang`. | +| `package_name` | string | no | Filter the project packages with a fuzzy search by name. | +| `package_version` | string | no | Filter the returned packages by version. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349065) in GitLab 16.6. | +| `include_versionless` | boolean | no | When set to true, versionless packages are included in the response. | +| `status` | string | no | Filter the returned packages by status. One of `default` (default), `hidden`, `processing`, `error`, or `pending_destruction`. | ```shell curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/packages?exclude_subgroups=false" ``` -> **Deprecation:** -> -> 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. -> 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. - Example response: ```json @@ -197,11 +190,6 @@ GET /projects/:id/packages/:package_id curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/packages/:package_id" ``` -> **Deprecation:** -> -> 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. -> 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. - Example response: ```json @@ -215,7 +203,7 @@ Example response: "delete_api_path": "/namespace1/project1/-/packages/1" }, "created_at": "2019-11-27T03:37:38.711Z", - "last_downloaded_at": "2022-09-07T07:51:50.504Z" + "last_downloaded_at": "2022-09-07T07:51:50.504Z", "pipelines": [ { "id": 123, @@ -427,8 +415,6 @@ deleting a package can introduce a [dependency confusion risk](../user/packages/ ## Delete a package file -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/32107) in GitLab 13.12. - WARNING: Deleting a package file may corrupt your package making it unusable or unpullable from your package manager client. When deleting a package file, be sure that you understand what you're doing. diff --git a/doc/user/storage_management_automation.md b/doc/user/storage_management_automation.md index 6edc695ffc3..a83af4ab6c6 100644 --- a/doc/user/storage_management_automation.md +++ b/doc/user/storage_management_automation.md @@ -780,7 +780,7 @@ default: ## Manage Container Registries storage -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. +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. ### List container registries @@ -894,7 +894,7 @@ You can optimize container images to reduce the image size and overall storage c ## Manage Package Registry storage -Package registries are available [in a project](../api/packages.md#within-a-project) or [in a group](../api/packages.md#within-a-group). +Package registries are available [for projects](../api/packages.md#for-a-project) or [for groups](../api/packages.md#for-a-group). ### List packages and files diff --git a/scripts/regenerate-schema b/scripts/regenerate-schema index 697177c0c0f..75ee0c33bea 100755 --- a/scripts/regenerate-schema +++ b/scripts/regenerate-schema @@ -34,12 +34,28 @@ class SchemaRegenerator def execute Dir.chdir(File.expand_path('..', __dir__)) do + # Note: `db:drop` must run prior to hiding migrations. + # + # Executing a Rails DB command e.g., `reset`, `drop`, etc. triggers running the initializers. + # During the initialization, the default values for `application_settings` need to be set. + # Depending on the presence of migrations, the default values are either faked or inserted. + # + # 1. If no migration is detected, all the necessary columns are in place from `db/structure.sql`. + # The default values can be inserted into `application_settings` table. + # + # 2. If a migration is detected, at least one column may be missing from `db/structure.sql` + # and needs to be added through the detected migration. In this case, the default values are faked. + # If not, an error would be raised e.g., "NoMethodError: undefined method `some_setting`" + # + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/135085#note_1628210334 for more info. + # + drop_db checkout_ref checkout_clean_schema hide_migrations remove_schema_migration_files stop_spring - reset_db + setup_db unhide_migrations migrate rollback if @rollback_testing @@ -162,9 +178,15 @@ class SchemaRegenerator end ## - # Run rake task to reset the database. - def reset_db - run %q(bin/rails db:reset RAILS_ENV=test) + # Run rake task to drop the database. + def drop_db + run %q(bin/rails db:drop RAILS_ENV=test) + end + + ## + # Run rake task to setup the database. + def setup_db + run %q(bin/rails db:setup RAILS_ENV=test) end ## diff --git a/spec/features/merge_request/user_merges_merge_request_spec.rb b/spec/features/merge_request/user_merges_merge_request_spec.rb index ede686cc700..111204a7105 100644 --- a/spec/features/merge_request/user_merges_merge_request_spec.rb +++ b/spec/features/merge_request/user_merges_merge_request_spec.rb @@ -3,7 +3,7 @@ require "spec_helper" RSpec.describe "User merges a merge request", :js, feature_category: :code_review_workflow do - let_it_be(:user) { create(:user, :no_super_sidebar) } + let_it_be(:user) { create(:user) } before do sign_in(user) @@ -21,7 +21,8 @@ RSpec.describe "User merges a merge request", :js, feature_category: :code_revie end end - context 'sidebar merge requests counter' do + # Pending re-implementation: https://gitlab.com/gitlab-org/gitlab/-/issues/429268 + xcontext 'sidebar merge requests counter' do let_it_be(:project) { create(:project, :public, :repository, namespace: user.namespace) } let!(:merge_request) { create(:merge_request, source_project: project) } |