diff --git a/config/feature_flags/development/api_redirect_moved_projects.yml b/config/feature_flags/development/api_redirect_moved_projects.yml deleted file mode 100644 index 56c01d3862b0d3cc4ff87a75616185d03329a4c6..0000000000000000000000000000000000000000 --- a/config/feature_flags/development/api_redirect_moved_projects.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: api_redirect_moved_projects -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128642 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/421992 -milestone: '16.3' -type: development -group: group::source code -default_enabled: false diff --git a/doc/api/rest/index.md b/doc/api/rest/index.md index fd98952185b93e7c011c3ef6e27a4157c262f9a2..be878ca2bcf908525876c162eb51b5c778ac8b47 100644 --- a/doc/api/rest/index.md +++ b/doc/api/rest/index.md @@ -347,12 +347,8 @@ The following table shows the possible return codes for API requests. ## Redirects -> Introduced in GitLab 16.4 [with a flag](../../user/feature_flags.md) named `api_redirect_moved_projects`. Disabled by default. - -FLAG: -On GitLab.com, this feature is not available. -On self-managed GitLab, by default this feature is not available. To make it available, -an administrator can [enable the feature flag](../../user/feature_flags.md) named `api_redirect_moved_projects`. +> - Introduced in GitLab 16.4 [with a flag](../../user/feature_flags.md) named `api_redirect_moved_projects`. Disabled by default. +> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/137578) in GitLab 16.7. Feature flag `api_redirect_moved_projects` removed. REST API can respond with a redirect and users should be able to handle such responses. The users should follow the redirect and repeat the request to the URI specified in the `Location` header. diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index bb94d5d14d07b844ad810727e9f918eff3c8bf7c..7c57666b843919069175f918067ce2b364549b67 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -146,7 +146,7 @@ def find_project(id) if id.is_a?(Integer) || id =~ INTEGER_ID_REGEX projects.find_by(id: id) elsif id.include?("/") - projects.find_by_full_path(id, follow_redirects: Feature.enabled?(:api_redirect_moved_projects)) + projects.find_by_full_path(id, follow_redirects: true) end end # rubocop: enable CodeReuse/ActiveRecord @@ -905,7 +905,6 @@ def sanitize_id_param(id) end def project_moved?(id, project) - return false unless Feature.enabled?(:api_redirect_moved_projects) return false unless id.is_a?(String) && id.include?('/') return false if project.blank? || project.full_path.casecmp?(id) return false unless params[:id] == id diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index e9319d514aab58d09459ff7058b845dbe9f9b22e..364c5720346ccf2971ffb2a5bba1f25169f12632 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -2852,16 +2852,6 @@ def failure_message(diff) expect(response).to have_gitlab_http_status(:not_found) end end - - context 'when api_redirect_moved_projects is disabled' do - it 'returns a 404 error' do - stub_feature_flags(api_redirect_moved_projects: false) - - perform_request - - expect(response).to have_gitlab_http_status(:not_found) - end - end end it 'returns a 404 error if not found' do