From e6f170581eddc84da845d4f2e511f4776848e9f7 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 13 Jan 2021 06:10:25 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- Gemfile | 2 +- Gemfile.lock | 5 +++-- changelogs/unreleased/id-bump-grape-helpers.yml | 5 +++++ changelogs/unreleased/mk-remove-extra-space.yml | 5 +++++ .../test-and-deploy-ruby-application-to-heroku.md | 10 +++++----- doc/user/project/canary_deployments.md | 4 ++-- doc/user/project/deploy_boards.md | 2 +- lib/api/helpers.rb | 2 +- spec/requests/api/users_spec.rb | 12 ++++++------ 9 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 changelogs/unreleased/id-bump-grape-helpers.yml create mode 100644 changelogs/unreleased/mk-remove-extra-space.yml diff --git a/Gemfile b/Gemfile index ef98260d997..d3e4293d500 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem 'default_value_for', '~> 3.3.0' gem 'pg', '~> 1.1' gem 'rugged', '~> 0.28' -gem 'grape-path-helpers', '~> 1.5' +gem 'grape-path-helpers', '~> 1.6.1' gem 'faraday', '~> 1.0' gem 'marginalia', '~> 1.10.0' diff --git a/Gemfile.lock b/Gemfile.lock index a3c7616f1a6..9c0896891a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -499,10 +499,11 @@ GEM grape-entity (0.7.1) activesupport (>= 4.0) multi_json (>= 1.3.2) - grape-path-helpers (1.5.0) + grape-path-helpers (1.6.1) activesupport grape (~> 1.3) rake (> 12) + ruby2_keywords (~> 0.0.2) grape_logging (1.8.3) grape rack @@ -1373,7 +1374,7 @@ DEPENDENCIES gpgme (~> 2.0.19) grape (~> 1.5.1) grape-entity (~> 0.7.1) - grape-path-helpers (~> 1.5) + grape-path-helpers (~> 1.6.1) grape_logging (~> 1.7) graphiql-rails (~> 1.4.10) graphlient (~> 0.4.0) diff --git a/changelogs/unreleased/id-bump-grape-helpers.yml b/changelogs/unreleased/id-bump-grape-helpers.yml new file mode 100644 index 00000000000..f2b7c2673ac --- /dev/null +++ b/changelogs/unreleased/id-bump-grape-helpers.yml @@ -0,0 +1,5 @@ +--- +title: Update grape-path-helpers gem version +merge_request: 51320 +author: +type: other diff --git a/changelogs/unreleased/mk-remove-extra-space.yml b/changelogs/unreleased/mk-remove-extra-space.yml new file mode 100644 index 00000000000..baef661133b --- /dev/null +++ b/changelogs/unreleased/mk-remove-extra-space.yml @@ -0,0 +1,5 @@ +--- +title: Remove extra space in API 403 Forbidden error message +merge_request: 50016 +author: +type: changed diff --git a/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md b/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md index 089d72852bb..1204a1ae837 100644 --- a/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md +++ b/doc/ci/examples/test-and-deploy-ruby-application-to-heroku.md @@ -28,16 +28,16 @@ test: staging: stage: deploy script: - - gem install dpl - - dpl --provider=heroku --app=gitlab-ci-ruby-test-staging --api-key=$HEROKU_STAGING_API_KEY + - gem install dpl --pre + - dpl heroku api --app=gitlab-ci-ruby-test-staging --api-key=$HEROKU_STAGING_API_KEY only: - master production: stage: deploy script: - - gem install dpl - - dpl --provider=heroku --app=gitlab-ci-ruby-test-prod --api-key=$HEROKU_PRODUCTION_API_KEY + - gem install dpl --pre + - dpl heroku api --app=gitlab-ci-ruby-test-prod --api-key=$HEROKU_PRODUCTION_API_KEY only: - tags ``` @@ -50,7 +50,7 @@ This project has three jobs: ## Store API keys -You'll need to create two variables in your project's **Settings > CI/CD > Environment variables**: +You'll need to create two variables in your project's **Settings > CI/CD > Environment variables** and do not check **Protect variable** and **Mask variable**: - `HEROKU_STAGING_API_KEY` - Heroku API key used to deploy staging app. - `HEROKU_PRODUCTION_API_KEY` - Heroku API key used to deploy production app. diff --git a/doc/user/project/canary_deployments.md b/doc/user/project/canary_deployments.md index bb11b8f50ea..85ac641f6e4 100644 --- a/doc/user/project/canary_deployments.md +++ b/doc/user/project/canary_deployments.md @@ -7,7 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w # Canary Deployments **(CORE)** > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1659) in [GitLab Premium](https://about.gitlab.com/pricing/) 9.1. -> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) to GitLab Core in 13.7. +> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) to GitLab Core in 13.8. A popular [Continuous Deployment](https://en.wikipedia.org/wiki/Continuous_deployment) strategy, where a small portion of the fleet is updated to the new version of @@ -72,7 +72,7 @@ can easily notice them. ### Advanced traffic control with Canary Ingress > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/215501) in [GitLab Premium](https://about.gitlab.com/pricing/) 13.6. -> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) to Core in GitLab 13.7. +> - [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/212320) to Core in GitLab 13.8. Canary deployments can be more strategic with [Canary Ingress](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary), which is an advanced traffic routing service that controls incoming HTTP diff --git a/doc/user/project/deploy_boards.md b/doc/user/project/deploy_boards.md index 3d4ec83c587..831a8803622 100644 --- a/doc/user/project/deploy_boards.md +++ b/doc/user/project/deploy_boards.md @@ -8,7 +8,7 @@ type: howto, reference # Deploy Boards **(CORE)** > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1589) in [GitLab Premium](https://about.gitlab.com/pricing/) 9.0. -> - [Moved]() to GitLab Core in 13.7. +> - [Moved]() to GitLab Core in 13.8. GitLab Deploy Boards offer a consolidated view of the current health and status of each CI [environment](../../ci/environments/index.md) running on [Kubernetes](https://kubernetes.io), displaying the status diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 99dd0c5e9ec..79af9c37378 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -372,7 +372,7 @@ module API def forbidden!(reason = nil) message = ['403 Forbidden'] - message << " - #{reason}" if reason + message << "- #{reason}" if reason render_api_error!(message.join(' '), 403) end diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index e253cda8325..3ca4956c397 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -2368,7 +2368,7 @@ RSpec.describe API::Users do activate expect(response).to have_gitlab_http_status(:forbidden) - expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated') + expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated') expect(user.reload.state).to eq('blocked') end end @@ -2382,7 +2382,7 @@ RSpec.describe API::Users do activate expect(response).to have_gitlab_http_status(:forbidden) - expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated') + expect(json_response['message']).to eq('403 Forbidden - A blocked user must be unblocked to be activated') expect(user.reload.state).to eq('ldap_blocked') end end @@ -2439,7 +2439,7 @@ RSpec.describe API::Users do deactivate expect(response).to have_gitlab_http_status(:forbidden) - expect(json_response['message']).to eq("403 Forbidden - The user you are trying to deactivate has been active in the past #{::User::MINIMUM_INACTIVE_DAYS} days and cannot be deactivated") + expect(json_response['message']).to eq("403 Forbidden - The user you are trying to deactivate has been active in the past #{::User::MINIMUM_INACTIVE_DAYS} days and cannot be deactivated") expect(user.reload.state).to eq('active') end end @@ -2467,7 +2467,7 @@ RSpec.describe API::Users do deactivate expect(response).to have_gitlab_http_status(:forbidden) - expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API') + expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API') expect(user.reload.state).to eq('blocked') end end @@ -2481,7 +2481,7 @@ RSpec.describe API::Users do deactivate expect(response).to have_gitlab_http_status(:forbidden) - expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API') + expect(json_response['message']).to eq('403 Forbidden - A blocked user cannot be deactivated by the API') expect(user.reload.state).to eq('ldap_blocked') end end @@ -2493,7 +2493,7 @@ RSpec.describe API::Users do deactivate expect(response).to have_gitlab_http_status(:forbidden) - expect(json_response['message']).to eq('403 Forbidden - An internal user cannot be deactivated by the API') + expect(json_response['message']).to eq('403 Forbidden - An internal user cannot be deactivated by the API') end end