Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-07-05 03:08:33 +00:00
parent 2e74e7299b
commit f49266f20b
20 changed files with 66 additions and 24 deletions

View File

@ -1 +1 @@
293518c0125d37fd692850f1c6865058ef7e4fb1
e48e575179544159732c490280f4f40b8dbf43a5

View File

@ -246,7 +246,7 @@ query {
nodes {
destinationUrl
id
headers {
headers {
nodes {
key
value

View File

@ -123,11 +123,11 @@ For example, to enable the [`:product_analytics`](../operations/product_analytic
Feature.enable(:product_analytics, Project.find(1234))
```
`Feature.enable` and `Feature.disable` always return `nil`, this is not an indication that the command failed:
`Feature.enable` and `Feature.disable` always return `true`, even if the application doesn't use the flag:
```ruby
irb(main):001:0> Feature.enable(:my_awesome_feature)
=> nil
=> true
```
When the feature is ready, GitLab removes the feature flag, and the option for

View File

@ -39,7 +39,7 @@ Example response:
"revision": "c401a659d0c",
"kas": {
"enabled": true,
"externalUrl": "grpc://gitlab.example.com:8150",
"externalUrl": "grpc://gitlab.example.com:8150",
"version": "15.0.0"
}
}

View File

@ -107,6 +107,13 @@ determining whether existing indexes are still required. More information on
the meaning of the various columns can be found at
<https://www.postgresql.org/docs/current/monitoring-stats.html>.
To determine if an index is still being used on production, use the following
Thanos query with your index name:
```sql
sum(rate(pg_stat_user_indexes_idx_tup_read{env="gprd", indexrelname="index_ci_name", type="patroni-ci"}[5m]))
```
Because the query output relies on the actual usage of your database, it
may be affected by factors such as:

View File

@ -483,7 +483,7 @@ const useSomeLogic = () => {
```
```javascript
const done = () => emit('done');
const done = () => emit('done');
const useSomeLogic = (done) => {
doSomeLogic();

View File

@ -577,6 +577,12 @@ class MyMigration < Gitlab::Database::Migration[2.0]
end
```
Verify the index is not being used anymore with this Thanos query:
```sql
sum(rate(pg_stat_user_indexes_idx_tup_read{env="gprd", indexrelname="index_ci_name", type="patroni-ci"}[5m]))
```
Note that it is not necessary to check if the index exists prior to
removing it, however it is required to specify the name of the
index that is being removed. This can be done either by passing the name

View File

@ -37,7 +37,7 @@ flowchart LR
subgraph backend
be["Backend code"]--tested with-->rspec
end
be--generates-->fixtures["frontend fixtures"]
fixtures--used in-->jest
```

View File

@ -67,11 +67,11 @@ pactWith(
(provider) => {
describe('Merge Request Discussions Endpoint', () => {
beforeEach(() => {
});
it('return a successful body', () => {
});
});
},

View File

@ -24,7 +24,7 @@ require_relative '../../../spec_helper'
module Provider
module DiscussionsHelper
Pact.service_provider 'Merge Request Discussions Endpoint' do
end
end
end
@ -41,7 +41,7 @@ module Provider
module DiscussionsHelper
Pact.service_provider 'Merge Request Discussions Endpoint' do
honours_pact_with 'MergeRequest#show' do
end
end
end
@ -61,9 +61,9 @@ module Provider
module DiscussionsHelper
Pact.service_provider 'Merge Request Discussions Endpoint' do
app { Environment::Test.app }
honours_pact_with 'MergeRequest#show' do
end
end
end
@ -81,7 +81,7 @@ module Provider
module DiscussionsHelper
Pact.service_provider 'Merge Request Discussions Endpoint' do
app { Environment::Test.app }
honours_pact_with 'MergeRequest#show' do
pact_uri '../contracts/project/merge_request/show/mergerequest#show-merge_request_discussions_endpoint.json'
end
@ -152,7 +152,7 @@ In the `provider_states_for` block, you then define the state the test data is f
```ruby
Pact.provider_states_for "MergeRequest#show" do
provider_state "a merge request with discussions exists" do
end
end
```

View File

@ -220,7 +220,7 @@ For example, if you encapsulate some actions and expectations in a private metho
it "has Owner role with Owner permissions" do
Page::Dashboard::Projects.perform do |projects|
projects.filter_by_name(project.name)
expect(projects).to have_project_with_access_role(project.name, 'Owner')
end

View File

@ -265,7 +265,7 @@ Use the Admin Area to delete users.
1. Select **Delete user**.
NOTE:
You can only delete a user if there are inherited or direct owners of a group. You cannot delete a user if they are the only group owner.
You can only delete a user if there are inherited or direct owners of a group. You cannot delete a user if they are the only group owner.
You can also delete a user and their contributions, such as merge requests, issues, and groups of which they are the only group owner.

View File

@ -928,7 +928,7 @@ logging.basicConfig(filename=log_file_path, level=logging.DEBUG)
def get_auth_response():
authorization_url = 'https://authorization.service/api/get_api_token'
return requests.get(
f'{authorization_url}',
f'{authorization_url}',
auth=(os.environ.get('AUTH_USER'), os.environ.get('AUTH_PWD'))
)

View File

@ -877,7 +877,7 @@ logging.basicConfig(filename=log_file_path, level=logging.DEBUG)
def get_auth_response():
authorization_url = 'https://authorization.service/api/get_api_token'
return requests.get(
f'{authorization_url}',
f'{authorization_url}',
auth=(os.environ.get('AUTH_USER'), os.environ.get('AUTH_PWD'))
)

View File

@ -210,7 +210,7 @@ In the second workflow, the `release` job runs in multiple pipelines. To prevent
```yaml
release_job:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_TAG
when: never # Do not run this job in a tag pipeline
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Run this job when commits are pushed or merged to the default branch
script:

View File

@ -104,7 +104,14 @@ module Feature
def enable(key, thing = true)
log(key: key, action: __method__, thing: thing)
with_feature(key) { _1.enable(thing) }
return_value = with_feature(key) { _1.enable(thing) }
# rubocop:disable Gitlab/RailsLogger
Rails.logger.warn('WARNING: Understand the stability and security risks of enabling in-development features with feature flags.')
Rails.logger.warn('See https://docs.gitlab.com/ee/administration/feature_flags.html#risks-when-enabling-features-still-in-development for more information.')
# rubocop:enable Gitlab/RailsLogger
return_value
end
def disable(key, thing = false)

View File

@ -1,7 +1,11 @@
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
RSpec.describe 'Create', quarantine: {
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/366839',
type: :test_environment,
only: { job: 'review-qa-*' }
} do
context 'Design Management' do
let(:issue) { Resource::Issue.fabricate_via_api! }
let(:design_filename) { 'banana_sample.gif' }

View File

@ -1,7 +1,11 @@
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
RSpec.describe 'Create', quarantine: {
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/366839',
type: :test_environment,
only: { job: 'review-qa-*' }
} do
context 'Design Management' do
let(:first_design) { Resource::Design.fabricate! }

View File

@ -1,7 +1,11 @@
# frozen_string_literal: true
module QA
RSpec.describe 'Create' do
RSpec.describe 'Create', quarantine: {
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/366839',
type: :test_environment,
only: { job: 'review-qa-*' }
} do
context 'Design Management' do
let(:design) do
Resource::Design.fabricate_via_browser_ui! do |design|

View File

@ -512,6 +512,11 @@ RSpec.describe Feature, stub_feature_flags: false do
let(:expected_extra) { { "extra.thing" => "true" } }
end
# This is documented to return true, modify doc/administration/feature_flags.md if it changes
it 'returns true' do
expect(subject).to be true
end
context 'when thing is an actor' do
let(:thing) { create(:project) }
@ -533,6 +538,11 @@ RSpec.describe Feature, stub_feature_flags: false do
let(:expected_extra) { { "extra.thing" => "false" } }
end
# This is documented to return true, modify doc/administration/feature_flags.md if it changes
it 'returns true' do
expect(subject).to be true
end
context 'when thing is an actor' do
let(:thing) { create(:project) }