Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-03-12 00:07:24 +00:00
parent e09df167d9
commit ab897e851c
19 changed files with 99 additions and 81 deletions

View File

@ -24,10 +24,6 @@
.decomposed-database-rspec:
extends: .decomposed-database
variables:
# For decomposition phase 3, uncomment line below:
# GITLAB_LOAD_BALANCING_REUSE_PRIMARY_ci: "main"
GITLAB_USE_MODEL_LOAD_BALANCING: "true"
.rspec-base:
extends:
@ -381,6 +377,8 @@ db:migrate:reset decomposed:
- db:migrate:reset
- .decomposed-database
- .rails:rules:decomposed-databases
variables:
GITLAB_USE_MODEL_LOAD_BALANCING: "false"
db:migrate-from-previous-major-version:
extends: .db-job-base
@ -389,6 +387,7 @@ db:migrate-from-previous-major-version:
SETUP_DB: "false"
PROJECT_TO_CHECKOUT: "gitlab-foss"
TAG_TO_CHECKOUT: "v13.12.9"
GITLAB_USE_MODEL_LOAD_BALANCING: "false"
before_script:
- !reference [.default-before_script, before_script]
- '[[ -d "ee/" ]] || export PROJECT_TO_CHECKOUT="gitlab"'

View File

@ -1,8 +1,4 @@
---
GraphQL/FieldMethod:
Exclude:
- app/graphql/types/ci/job_type.rb
- app/graphql/types/merge_request_type.rb
- app/graphql/types/metrics/dashboards/annotation_type.rb
- app/graphql/types/packages/package_details_type.rb
- app/graphql/types/project_type.rb

View File

@ -1,5 +1,5 @@
query getSecurityTrainingVulnerability($id: ID!) {
vulnerability(id: $id) {
vulnerability(id: $id) @client {
id
identifiers {
externalType

View File

@ -16,7 +16,7 @@ export default {
},
computed: {
docsUrl() {
return helpPagePath('user/infrastructure/terraform_state');
return helpPagePath('user/infrastructure/iac/terraform_state');
},
},
};

View File

@ -61,7 +61,7 @@ module Types
field :coverage, GraphQL::Types::Float, null: true,
description: 'Coverage level of the job.'
field :created_by_tag, GraphQL::Types::Boolean, null: false,
description: 'Whether the job was created by a tag.'
description: 'Whether the job was created by a tag.', method: :tag?
field :detailed_status, Types::Ci::DetailedStatusType, null: true,
description: 'Detailed status of the job.'
field :downstream_pipeline, Types::Ci::PipelineType, null: true,
@ -173,10 +173,6 @@ module Types
object&.coverage
end
def created_by_tag
object.tag?
end
def manual_job
object.try(:action?)
end

View File

@ -179,7 +179,7 @@ module Types
description: 'Total time reported as spent on the merge request.'
field :approved_by, Types::UserType.connection_type, null: true,
description: 'Users who approved the merge request.'
description: 'Users who approved the merge request.', method: :approved_by_users
field :auto_merge_strategy, GraphQL::Types::String, null: true,
description: 'Selected auto merge strategy.'
field :available_auto_merge_strategies, [GraphQL::Types::String], null: true, calls_gitaly: true,
@ -208,10 +208,6 @@ module Types
markdown_field :title_html, null: true
markdown_field :description_html, null: true
def approved_by
object.approved_by_users
end
def user_notes_count
BatchLoader::GraphQL.for(object.id).batch(key: :merge_request_user_notes_count) do |ids, loader, args|
counts = Note.count_for_collection(ids, 'MergeRequest').index_by(&:noteable_id)

View File

@ -14,17 +14,14 @@ module Types
description: 'ID of the annotation.'
field :panel_id, GraphQL::Types::String, null: true,
description: 'ID of a dashboard panel to which the annotation should be scoped.'
description: 'ID of a dashboard panel to which the annotation should be scoped.',
method: :panel_xid
field :starting_at, Types::TimeType, null: true,
description: 'Timestamp marking start of annotated time span.'
field :ending_at, Types::TimeType, null: true,
description: 'Timestamp marking end of annotated time span.'
def panel_id
object.panel_xid
end
end
end
end

View File

@ -32,10 +32,10 @@ module Types
field :tag_list, GraphQL::Types::String, null: true,
deprecated: { reason: 'Use `topics`', milestone: '13.12' },
description: 'List of project topics (not Git tags).'
description: 'List of project topics (not Git tags).', method: :topic_list
field :topics, [GraphQL::Types::String], null: true,
description: 'List of project topics.'
description: 'List of project topics.', method: :topic_list
field :http_url_to_repo, GraphQL::Types::String, null: true,
description: 'URL to connect to the project via HTTPS.'
@ -461,14 +461,6 @@ module Types
object.service_desk_address
end
def tag_list
object.topic_list
end
def topics
object.topic_list
end
private
def project

View File

@ -0,0 +1,11 @@
- name: "htpasswd Authentication for the Container Registry"
announcement_milestone: "14.9"
announcement_date: "2022-03-22"
removal_milestone: "15.0"
removal_date: "2022-05-22"
breaking_change: true
reporter: trizzi
body: | # Do not modify this line, instead modify the lines below.
The Container Registry supports [authentication](https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/configuration.md#auth) with `htpasswd`. It relies on an [Apache `htpasswd` file](https://httpd.apache.org/docs/2.4/programs/htpasswd.html), with passwords hashed using `bcrypt`.
Since it isn't used in the context of GitLab (the product), `htpasswd` authentication will be deprecated in GitLab 14.9 and removed in GitLab 15.0.

View File

@ -13,7 +13,7 @@
At every major release of GitLab, the "latest version" template becomes the "major version" template, inheriting the "latest template" setup.
As we have added many new features to the Terraform integration, the new setup for the "major version" template can be considered a breaking change.
The latest template supports the [Terraform Merge Request widget](https://docs.gitlab.com/ee/user/infrastructure/mr_integration.html) and
doesn't need additional setup to work with the [GitLab managed Terraform state](https://docs.gitlab.com/ee/user/infrastructure/terraform_state.html).
The latest template supports the [Terraform Merge Request widget](https://docs.gitlab.com/ee/user/infrastructure/iac/mr_integration.html) and
doesn't need additional setup to work with the [GitLab managed Terraform state](https://docs.gitlab.com/ee/user/infrastructure/iac/terraform_state.html).
To check the new changes, see the [new "major version" template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml).

View File

@ -56,6 +56,20 @@ The [`custom_hooks_dir`](https://docs.gitlab.com/ee/administration/server_hooks.
**Planned removal milestone: 15.0 ()**
### htpasswd Authentication for the Container Registry
WARNING:
This feature will be changed or removed in 15.0
as a [breaking change](https://docs.gitlab.com/ee/development/contributing/#breaking-changes).
Before updating GitLab, review the details carefully to determine if you need to make any
changes to your code, settings, or workflow.
The Container Registry supports [authentication](https://gitlab.com/gitlab-org/container-registry/-/blob/master/docs/configuration.md#auth) with `htpasswd`. It relies on an [Apache `htpasswd` file](https://httpd.apache.org/docs/2.4/programs/htpasswd.html), with passwords hashed using `bcrypt`.
Since it isn't used in the context of GitLab (the product), `htpasswd` authentication will be deprecated in GitLab 14.9 and removed in GitLab 15.0.
**Planned removal milestone: 15.0 (2022-05-22)**
## 14.8
### Changes to the `CI_JOB_JWT`

View File

@ -569,8 +569,8 @@ As we continuously [develop GitLab's Terraform integrations](https://gitlab.com/
At every major release of GitLab, the "latest version" template becomes the "major version" template, inheriting the "latest template" setup.
As we have added many new features to the Terraform integration, the new setup for the "major version" template can be considered a breaking change.
The latest template supports the [Terraform Merge Request widget](https://docs.gitlab.com/ee/user/infrastructure/mr_integration.html) and
doesn't need additional setup to work with the [GitLab managed Terraform state](https://docs.gitlab.com/ee/user/infrastructure/terraform_state.html).
The latest template supports the [Terraform Merge Request widget](https://docs.gitlab.com/ee/user/infrastructure/iac/mr_integration.html) and
doesn't need additional setup to work with the [GitLab managed Terraform state](https://docs.gitlab.com/ee/user/infrastructure/iac/terraform_state.html).
To check the new changes, see the [new "major version" template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Terraform.gitlab-ci.yml).

View File

@ -7,61 +7,67 @@ type: reference
# Syntax Highlighting **(FREE)**
GitLab provides syntax highlighting on all files through the [Rouge](https://rubygems.org/gems/rouge) Ruby gem. It attempts to guess what language to use based on the file extension, which most of the time is sufficient.
GitLab provides syntax highlighting on all files through the
[Rouge](https://rubygems.org/gems/rouge) Ruby gem. It attempts to guess what language
to use based on the file extension, which most of the time is sufficient.
The paths here are Git's built-in [`.gitattributes` interface](https://git-scm.com/docs/gitattributes).
NOTE:
The [Web IDE](web_ide/index.md) and [Snippets](../snippets.md) use [Monaco Editor](https://microsoft.github.io/monaco-editor/)
for text editing, which internally uses the [Monarch](https://microsoft.github.io/monaco-editor/monarch.html)
library for syntax highlighting.
<!-- vale gitlab.Spelling = NO -->
## Override syntax highlighting for a file type
If GitLab is guessing wrong, you can override its choice of language using the
`gitlab-language` attribute in `.gitattributes`. For example, if you are working in a Prolog
project and using the `.pl` file extension (which would normally be highlighted as Perl),
you can add the following to your `.gitattributes` file:
NOTE:
The Web IDE [does not support `.gitattribute` files](https://gitlab.com/gitlab-org/gitlab/-/issues/22014).
<!-- vale gitlab.Spelling = YES -->
To override syntax highlighting for a file type:
1. If a `.gitattributes` file does not exist in the root directory of your project,
create a blank file with this name.
1. For each file type you want to modify, add a line to the `.gitattributes` file
declaring the file extension and your desired highlighting language:
```conf
# This extension would normally receive Perl syntax highlighting
# but if we also use Prolog, we may want to override highlighting for
# files with this extension:
*.pl gitlab-language=prolog
```
1. Commit, push, and merge your changes into your default branch.
After the changes merge into your [default branch](repository/branches/default.md),
all `*.pl` files in your project are highlighted in your preferred language.
You can also extend the highlighting with common gateway interface (CGI) options, such as:
``` conf
*.pl gitlab-language=prolog
```
<!-- vale gitlab.Spelling = NO -->
When you check in and push that change, all `*.pl` files in your project are highlighted as Prolog.
<!-- vale gitlab.Spelling = YES -->
The paths here are Git's built-in [`.gitattributes` interface](https://git-scm.com/docs/gitattributes). So, if you were to invent a file format called a `Nicefile` at the root of your project that used Ruby syntax, all you need is:
``` conf
/Nicefile gitlab-language=ruby
```
To disable highlighting entirely, use `gitlab-language=text`. Lots more fun shenanigans are available through common gateway interface (CGI) options, such as:
``` conf
# json with erb in it
# JSON file with .erb in it
/my-cool-file gitlab-language=erb?parent=json
# an entire file of highlighting errors!
# An entire file of highlighting errors!
/other-file gitlab-language=text?token=Error
```
These configurations only take effect when the `.gitattributes`
file is in your [default branch](repository/branches/default.md).
## Disable syntax highlighting for a file type
NOTE:
The Web IDE does not support `.gitattribute` files, but it's [planned for a future release](https://gitlab.com/gitlab-org/gitlab/-/issues/22014).
To disable highlighting entirely for a file type, follow the instructions for overriding
the highlighting for a file type, and use `gitlab-language=text`:
```conf
# Disable syntax highlighting for this file type
*.module gitlab-language=text
```
## Configure maximum file size for highlighting
You can configure the maximum size of the file to be highlighted.
By default, GitLab renders any file larger than 512 KB in plain text. To change this value:
The file size is measured in kilobytes, and is set to a default of `512 KB`. Any file _over_ the file size is rendered in plain text.
1. Open the [`gitlab.yml`](https://gitlab.com/gitlab-org/gitlab-foss/blob/master/config/gitlab.yml.example) configuration file.
1. Open the [`gitlab.yml`](https://gitlab.com/gitlab-org/gitlab-foss/blob/master/config/gitlab.yml.example)
configuration file for your project.
1. Add this section, replacing `maximum_text_highlight_size_kilobytes` with the value you want.
@ -72,3 +78,5 @@ The file size is measured in kilobytes, and is set to a default of `512 KB`. Any
## https://docs.gitlab.com/ee/user/project/highlighting.html
maximum_text_highlight_size_kilobytes: 512
```
1. Commit, push, and merge your changes into your default branch.

View File

@ -90,7 +90,8 @@ module Gitlab
def use_model_load_balancing?
# Cache environment variable and return env variable first if defined
use_model_load_balancing_env = Gitlab::Utils.to_boolean(ENV["GITLAB_USE_MODEL_LOAD_BALANCING"])
default_use_model_load_balancing_env = Gitlab.dev_or_test_env? || nil
use_model_load_balancing_env = Gitlab::Utils.to_boolean(ENV.fetch('GITLAB_USE_MODEL_LOAD_BALANCING', default_use_model_load_balancing_env))
unless use_model_load_balancing_env.nil?
return use_model_load_balancing_env

View File

@ -23,7 +23,9 @@ module Gitlab
end
end
execution_message do
if preferred_strategy = preferred_auto_merge_strategy(quick_action_target)
if params[:merge_request_diff_head_sha].blank?
_("Merge request diff sha parameter is required for the merge quick action.")
elsif preferred_strategy = preferred_auto_merge_strategy(quick_action_target)
_("Scheduled to merge this merge request (%{strategy}).") % { strategy: preferred_strategy.humanize }
else
_('Merged this merge request.')
@ -35,6 +37,8 @@ module Gitlab
merge_orchestration_service.can_merge?(quick_action_target)
end
command :merge do
next unless params[:merge_request_diff_head_sha].present?
@updates[:merge] = params[:merge_request_diff_head_sha]
end

View File

@ -23066,6 +23066,9 @@ msgstr ""
msgid "Merge request dependencies"
msgstr ""
msgid "Merge request diff sha parameter is required for the merge quick action."
msgstr ""
msgid "Merge request events"
msgstr ""

View File

@ -8,7 +8,7 @@ describe('EmptyStateComponent', () => {
const propsData = {
image: '/image/path',
};
const docsUrl = '/help/user/infrastructure/terraform_state';
const docsUrl = '/help/user/infrastructure/iac/terraform_state';
const findEmptyState = () => wrapper.findComponent(GlEmptyState);
const findLink = () => wrapper.findComponent(GlLink);

View File

@ -274,6 +274,8 @@ RSpec.describe Gitlab::Database::LoadBalancing::Setup do
end
before do
allow(Gitlab).to receive(:dev_or_test_env?).and_return(false)
# Rewrite `class_attribute` to use rspec mocking and prevent modifying the objects
allow_next_instance_of(described_class) do |setup|
allow(setup).to receive(:configure_connection)

View File

@ -799,10 +799,9 @@ RSpec.describe QuickActions::InterpretService do
let(:project) { repository_project }
let(:service) { described_class.new(project, developer, {}) }
it 'precheck passes and returns merge command' do
_, updates, _ = service.execute('/merge', merge_request)
expect(updates).to eq(merge: nil)
it_behaves_like 'failed command', 'Merge request diff sha parameter is required for the merge quick action.' do
let(:content) { "/merge" }
let(:issuable) { merge_request }
end
end