Commit 849d5fca authored by Alper Akgun's avatar Alper Akgun

Merge branch '10io-cleanup-generic-packages' into 'master'

Remove the generic_packages feature flag

See merge request gitlab-org/gitlab!80886
parents 6eefbe43 a6b06521
---
name: generic_packages
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40045
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/239133
milestone: '13.4'
type: development
group: group::release
default_enabled: true
...@@ -6,12 +6,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w ...@@ -6,12 +6,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# GitLab Generic Packages Repository **(FREE)** # GitLab Generic Packages Repository **(FREE)**
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/4209) in GitLab 13.5. > - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/4209) in GitLab 13.5 [with a flag](../../../administration/feature_flags.md) named `generic_packages`. Enabled by default.
> - It's [deployed behind a feature flag](../../../user/feature_flags.md), enabled by default. > - Generally available in GitLab 14.8. [Feature flag `generic_packages`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80886) removed.
> - It's enabled on GitLab.com.
> - It's able to be enabled or disabled per-project.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-generic-packages-in-the-package-registry).
Publish generic files, like release binaries, in your project's Package Registry. Then, install the packages whenever you need to use them as a dependency. Publish generic files, like release binaries, in your project's Package Registry. Then, install the packages whenever you need to use them as a dependency.
...@@ -194,31 +190,6 @@ upload: ...@@ -194,31 +190,6 @@ upload:
- Invoke-RestMethod -Headers @{ "JOB-TOKEN"="$CI_JOB_TOKEN" } -InFile path/to/file.txt -uri "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/my_package/0.0.1/file.txt" -Method put - Invoke-RestMethod -Headers @{ "JOB-TOKEN"="$CI_JOB_TOKEN" } -InFile path/to/file.txt -uri "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/my_package/0.0.1/file.txt" -Method put
``` ```
### Enable or disable generic packages in the Package Registry
Support for generic packages is under development but ready for production use.
It is deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can opt to disable it.
To enable it:
```ruby
# For the instance
Feature.enable(:generic_packages)
# For a single project
Feature.enable(:generic_packages, Project.find(<project id>))
```
To disable it:
```ruby
# For the instance
Feature.disable(:generic_packages)
# For a single project
Feature.disable(:generic_packages, Project.find(<project id>))
```
### Generic package sample project ### Generic package sample project
The [Write CI-CD Variables in Pipeline](https://gitlab.com/guided-explorations/cfg-data/write-ci-cd-variables-in-pipeline) project contains a working example you can use to create, upload, and download generic packages in GitLab CI/CD. The [Write CI-CD Variables in Pipeline](https://gitlab.com/guided-explorations/cfg-data/write-ci-cd-variables-in-pipeline) project contains a working example you can use to create, upload, and download generic packages in GitLab CI/CD.
......
...@@ -14,8 +14,6 @@ module API ...@@ -14,8 +14,6 @@ module API
before do before do
require_packages_enabled! require_packages_enabled!
authenticate_non_get! authenticate_non_get!
require_generic_packages_available!
end end
params do params do
...@@ -113,10 +111,6 @@ module API ...@@ -113,10 +111,6 @@ module API
include ::API::Helpers::PackagesHelpers include ::API::Helpers::PackagesHelpers
include ::API::Helpers::Packages::BasicAuthHelpers include ::API::Helpers::Packages::BasicAuthHelpers
def require_generic_packages_available!
not_found! unless Feature.enabled?(:generic_packages, project, default_enabled: true)
end
def project def project
authorized_user_project authorized_user_project
end end
......
...@@ -170,17 +170,6 @@ RSpec.describe API::GenericPackages do ...@@ -170,17 +170,6 @@ RSpec.describe API::GenericPackages do
end end
end end
context 'generic_packages feature flag is disabled' do
it 'responds with 404 Not Found' do
stub_feature_flags(generic_packages: false)
project.add_developer(user)
authorize_upload_file(workhorse_headers.merge(personal_access_token_header))
expect(response).to have_gitlab_http_status(:not_found)
end
end
def authorize_upload_file(request_headers, package_name: 'mypackage', file_name: 'myfile.tar.gz') def authorize_upload_file(request_headers, package_name: 'mypackage', file_name: 'myfile.tar.gz')
url = "/projects/#{project.id}/packages/generic/#{package_name}/0.0.1/#{file_name}/authorize" url = "/projects/#{project.id}/packages/generic/#{package_name}/0.0.1/#{file_name}/authorize"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment