Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-07-15 12:10:10 +00:00
parent 9bd7e5997e
commit 1a129420d6
60 changed files with 612 additions and 534 deletions

View File

@ -5,7 +5,7 @@ include:
- /ci/allure-report.yml
- /ci/knapsack-report.yml
.test_variables:
.test-variables:
variables:
QA_GENERATE_ALLURE_REPORT: "true"
COLORIZED_LOGS: "true"
@ -16,12 +16,20 @@ include:
GITLAB_QA_ADMIN_ACCESS_TOKEN: "${REVIEW_APPS_ROOT_TOKEN}"
GITHUB_ACCESS_TOKEN: "${REVIEW_APPS_QA_GITHUB_ACCESS_TOKEN}"
.bundle-base:
extends:
- .qa-cache
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3
before_script:
- export QA_GITLAB_URL="$(cat environment_url.txt)"
- cd qa && bundle install
.review-qa-base:
extends:
- .use-docker-in-docker
- .qa-cache
- .test_variables
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-2.7:bundler-2.3-git-2.33-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23
- .bundle-base
- .test-variables
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3-git-2.33-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23
stage: qa
needs:
- review-deploy
@ -32,11 +40,8 @@ include:
DOCKER_CERT_PATH: /certs/client
DOCKER_TLS_VERIFY: 1
WD_INSTALL_DIR: /usr/local/bin
before_script:
- export EE_LICENSE="$(cat $REVIEW_APPS_EE_LICENSE_FILE)"
- export QA_GITLAB_URL="$(cat environment_url.txt)"
- cd qa && bundle install
script:
- export EE_LICENSE="$(cat $REVIEW_APPS_EE_LICENSE_FILE)"
- qa_run_status=0
- |
bundle exec rake "knapsack:rspec[\
@ -75,15 +80,12 @@ include:
# Store knapsack report as artifact so the same report is reused across all jobs
download-knapsack-report:
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images/debian-bullseye-ruby-2.7:bundler-2.3-git-2.33-chrome-${CHROME_VERSION}
extends:
- .qa-cache
- .bundle-base
- .review:rules:review-qa-reliable
stage: prepare
variables:
QA_KNAPSACK_REPORTS: review-qa-reliable,review-qa-all
before_script:
- cd qa && bundle install
script:
- bundle exec rake "knapsack:download"
allow_failure: true
@ -171,8 +173,21 @@ allure-report-qa-all:
upload-knapsack-report:
extends:
- .generate-knapsack-report-base
- .bundle-base
stage: post-qa
variables:
# knapsack report upload uses gitlab-qa image with code already there
GIT_STRATEGY: none
QA_KNAPSACK_REPORT_FILE_PATTERN: $CI_PROJECT_DIR/qa/tmp/knapsack/*/*.json
delete-test-resources:
extends:
- .bundle-base
- .review:rules:review-qa-cleanup
stage: post-qa
variables:
QA_TEST_RESOURCES_FILE_PATTERN: $CI_PROJECT_DIR/qa/tmp/test-resources-*.json
GITLAB_QA_ACCESS_TOKEN: $REVIEW_APPS_ROOT_TOKEN
COLORIZED_LOGS: "true"
script:
- export GITLAB_ADDRESS="$QA_GITLAB_URL"
- bundle exec rake "test_resources:delete[$QA_TEST_RESOURCES_FILE_PATTERN]"
allow_failure: true

View File

@ -1722,6 +1722,10 @@
- when: on_success
- when: on_failure
.review:rules:review-qa-cleanup:
rules:
- when: always
.review:rules:review-cleanup:
rules:
- <<: *if-not-ee

View File

@ -49,10 +49,11 @@ export default {
};
},
update: (data) => {
const pipelines = data.project?.repository?.tree?.lastCommit?.pipelines?.edges;
const lastCommit = data.project?.repository?.paginatedTree?.nodes[0]?.lastCommit;
const pipelines = lastCommit?.pipelines?.edges;
return {
...data.project?.repository?.tree?.lastCommit,
...lastCommit,
pipeline: pipelines?.length && pipelines[0].node,
};
},

View File

@ -153,6 +153,12 @@ export default {
{{ workItemType }}
</li>
</ul>
<span
v-else
class="gl-font-weight-bold gl-text-secondary gl-mr-auto"
data-testid="work-item-type"
>{{ workItemType }}</span
>
<work-item-actions
:work-item-id="workItem.id"
:can-delete="canDelete"

View File

@ -4,43 +4,46 @@ query pathLastCommit($projectPath: ID!, $path: String, $ref: String!) {
id
repository {
__typename
tree(path: $path, ref: $ref) {
paginatedTree(path: $path, ref: $ref) {
__typename
lastCommit {
nodes {
__typename
id
sha
title
titleHtml
descriptionHtml
message
webPath
authoredDate
authorName
authorGravatar
author {
lastCommit {
__typename
id
name
avatarUrl
sha
title
titleHtml
descriptionHtml
message
webPath
}
signatureHtml
pipelines(ref: $ref, first: 1) {
__typename
edges {
authoredDate
authorName
authorGravatar
author {
__typename
node {
id
name
avatarUrl
webPath
}
signatureHtml
pipelines(ref: $ref, first: 1) {
__typename
edges {
__typename
id
detailedStatus {
node {
__typename
id
detailsPath
icon
tooltip
text
group
detailedStatus {
__typename
id
detailsPath
icon
tooltip
text
group
}
}
}
}

View File

@ -50,8 +50,7 @@ module Ci
def status_struct
strong_memoize(:status_struct) do
Gitlab::Ci::Status::Composite
.new(@jobs, project: project)
Gitlab::Ci::Status::Composite.new(@jobs)
end
end

View File

@ -142,7 +142,7 @@ module Ci
end
def latest_stage_status
statuses.latest.composite_status(project: project) || 'skipped'
statuses.latest.composite_status || 'skipped'
end
end
end

View File

@ -23,11 +23,9 @@ module Ci
UnknownStatusError = Class.new(StandardError)
class_methods do
# The parameter `project` is only used for the feature flag check, and will be removed with
# https://gitlab.com/gitlab-org/gitlab/-/issues/321972
def composite_status(project: nil)
def composite_status
Gitlab::Ci::Status::Composite
.new(all, with_allow_failure: columns_hash.key?('allow_failure'), project: project)
.new(all, with_allow_failure: columns_hash.key?('allow_failure'))
.status
end

View File

@ -10,7 +10,8 @@ module WorkItems
belongs_to :work_item
belongs_to :work_item_parent, class_name: 'WorkItem'
validates :work_item, :work_item_parent, presence: true
validates :work_item_parent, presence: true
validates :work_item, presence: true, uniqueness: true
validate :validate_child_type
validate :validate_parent_type
validate :validate_same_project

View File

@ -78,7 +78,7 @@ module Ci
def status_for_array(statuses, dag:)
result = Gitlab::Ci::Status::Composite
.new(statuses, dag: dag, project: pipeline.project)
.new(statuses, dag: dag)
.status
result || 'success'
end

View File

@ -3,13 +3,13 @@
module Issuable
module Clone
class BaseService < IssuableBaseService
attr_reader :original_entity, :new_entity, :target_project
attr_reader :original_entity, :new_entity
alias_method :old_project, :project
def execute(original_entity, target_project = nil)
def execute(original_entity, target_parent)
@original_entity = original_entity
@target_project = target_project
@target_parent = target_parent
# Using transaction because of a high resources footprint
# on rewriting notes (unfolding references)
@ -25,11 +25,13 @@ module Issuable
private
attr_reader :target_parent
def rewritten_old_entity_attributes(include_milestone: true)
Gitlab::Issuable::Clone::AttributesRewriter.new(
current_user,
original_entity,
target_project
target_parent
).execute(include_milestone: include_milestone)
end
@ -83,7 +85,7 @@ module Issuable
end
def relative_position
return if original_entity.project.root_ancestor.id != target_project.root_ancestor.id
return if original_entity.project.root_ancestor.id != target_parent.root_ancestor.id
original_entity.relative_position
end

View File

@ -2,7 +2,7 @@
= render 'preview'
= gitlab_ui_form_for [:admin, @broadcast_message], html: { class: 'broadcast-message-form js-quick-submit js-requires-input'} do |f|
= form_errors(@broadcast_message)
= form_errors(@broadcast_message, pajamas_alert: true)
.form-group.row.mt-4
.col-sm-2.col-form-label

View File

@ -1,6 +1,6 @@
- add_to_breadcrumbs _('Runners'), group_runners_path(@group)
- if Feature.enabled?(:group_runner_view_ui)
- if Feature.enabled?(:group_runner_view_ui, @group)
- title = "##{@runner.id} (#{@runner.short_sha})"
- breadcrumb_title title
- page_title title

View File

@ -4,7 +4,7 @@
.card-header.gl-font-weight-bold
= s_("ProtectedBranch|Protect a branch")
.card-body
= form_errors(@protected_branch)
= form_errors(@protected_branch, pajamas_alert: true)
.form-group.row
= f.label :name, s_('ProtectedBranch|Branch:'), class: 'col-sm-12'
.col-sm-12

View File

@ -6,7 +6,7 @@
.row.gl-mt-3
.col-lg-12
= gitlab_ui_form_for @project, url: project_settings_ci_cd_path(@project, anchor: 'js-general-pipeline-settings') do |f|
= form_errors(@project)
= form_errors(@project, pajamas_alert: true)
%fieldset.builds-feature
.form-group
= f.gitlab_ui_checkbox_component :public_builds,

View File

@ -0,0 +1,20 @@
- name: "Support for older browsers"
removal_date: July 22, 2022
removal_milestone: "15.2"
reporter: leipert
breaking_change: false
body: |
In GitLab 15.2, we are cleaning up and [removing old code](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86003) that was specific for browsers that we no longer support. This has no impact on users if they use one of our [supported web browsers](https://docs.gitlab.com/ee/install/requirements.html#supported-web-browsers).
Most notably, support for the following browsers has been removed:
- Apple Safari 14 and older.
- Mozilla Firefox 78.
The minimum supported browser versions are:
- Apple Safari 14.1.
- Mozilla Firefox 91.
- Google Chrome 92.
- Chromium 92.
- Microsoft Edge 92.

View File

@ -80,14 +80,14 @@ Nodes should be:
- Upgraded one node at a time.
Identify any existing health issues in the cluster by running the following command
within each node. The command returns an empty array if the cluster is healthy:
in each node. The command returns an empty array if the cluster is healthy:
```shell
curl "http://127.0.0.1:8500/v1/health/state/critical"
```
If the Consul version has changed, you see a notice at the end of `gitlab-ctl reconfigure`
informing you that Consul needs to be restarted for the new version to be used.
informing you that Consul must be restarted for the new version to be used.
Restart Consul one node at a time:
@ -96,7 +96,7 @@ sudo gitlab-ctl restart consul
```
Consul nodes communicate using the raft protocol. If the current leader goes
offline, there needs to be a leader election. A leader node must exist to facilitate
offline, there must be a leader election. A leader node must exist to facilitate
synchronization across the cluster. If too many nodes go offline at the same time,
the cluster loses quorum and doesn't elect a leader due to
[broken consensus](https://www.consul.io/docs/architecture/consensus).
@ -111,7 +111,7 @@ bundled Consul wasn't used by any process other than GitLab itself, you can
## Troubleshooting Consul
Below are some useful operations should you need to debug any issues.
Below are some operations should you debug any issues.
You can see any error logs by running:
```shell

View File

@ -11,8 +11,8 @@ traffic to the application servers. The specifics on which load balancer to use
or the exact configuration is beyond the scope of GitLab documentation. We hope
that if you're managing HA systems like GitLab you have a load balancer of
choice already. Some examples including HAProxy (open-source), F5 Big-IP LTM,
and Citrix Net Scaler. This documentation outlines what ports and protocols
you need to use with GitLab.
and Citrix NetScaler. This documentation outlines what ports and protocols
to use with GitLab.
## SSL
@ -40,7 +40,7 @@ Configure your load balancers to use the 'HTTP(S)' protocol rather than 'TCP'.
The load balancers is be responsible for managing SSL certificates and
terminating SSL.
Since communication between the load balancers and GitLab isn't secure,
Because communication between the load balancers and GitLab isn't secure,
there is some additional configuration needed. See
[NGINX Proxied SSL documentation](https://docs.gitlab.com/omnibus/settings/nginx.html#supporting-proxied-ssl)
for details.
@ -52,7 +52,7 @@ The load balancers is responsible for managing SSL certificates that
end users see.
Traffic is secure between the load balancers and NGINX in this
scenario. There is no need to add configuration for proxied SSL since the
scenario. There is no need to add configuration for proxied SSL because the
connection is secure all the way. However, configuration must be
added to GitLab to configure SSL certificates. See
[NGINX HTTPS documentation](https://docs.gitlab.com/omnibus/settings/nginx.html#enable-https)

View File

@ -9,7 +9,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
GitLab allows you to start multiple Sidekiq processes.
These processes can be used to consume a dedicated set
of queues. This can be used to ensure certain queues always have dedicated
workers, no matter the number of jobs that need to be processed.
workers, no matter the number of jobs to be processed.
NOTE:
The information in this page applies only to Omnibus GitLab.
@ -325,17 +325,16 @@ you'd use the following:
The `sidekiq-cluster` command does not terminate once it has started the desired
amount of Sidekiq processes. Instead, the process continues running and
forward any signals to the child processes. This makes it easy to stop all
Sidekiq processes as you simply send a signal to the `sidekiq-cluster` process,
forwards any signals to the child processes. This allows you to stop all
Sidekiq processes as you send a signal to the `sidekiq-cluster` process,
instead of having to send it to the individual processes.
If the `sidekiq-cluster` process crashes or receives a `SIGKILL`, the child
processes terminate themselves after a few seconds. This ensures you don't
end up with zombie Sidekiq processes.
All of this makes monitoring the processes fairly easy. Simply hook up
`sidekiq-cluster` to your supervisor of choice (for example, runit) and you're good to
go.
This allows you to monitor the processes by hooking up
`sidekiq-cluster` to your supervisor of choice (for example, runit).
If a child process died the `sidekiq-cluster` command signals all remaining
process to terminate, then terminate itself. This removes the need for

View File

@ -75,7 +75,7 @@ workers.
## Worker matching query
GitLab provides a simple query syntax to match a worker based on its
GitLab provides a query syntax to match a worker based on its
attributes. This query syntax is employed by both [Queue routing
rules](#queue-routing-rules) and [Queue
selector](extra_sidekiq_processes.md#queue-selector). A query includes two
@ -102,12 +102,8 @@ based on a subset of worker attributes:
quickly. Can be `high`, `low`, or `throttled`. For example, the
`authorized_projects` queue is used to refresh user permissions, and
is `high` urgency.
- `worker_name` - the worker name. The other attributes are typically more useful as
they are more general, but this is available in case a particular worker needs
to be selected.
- `name` - the queue name generated from the worker name. The other attributes
are typically more useful as they are more general, but this is available in
case a particular queue needs to be selected. Because this is generated from
- `worker_name` - the worker name. Use this attribute to select a specific worker.
- `name` - the queue name generated from the worker name. Use this attribute to select a specific queue. Because this is generated from
the worker name, it does not change based on the result of other routing
rules.
- `resource_boundary` - if the queue is bound by `cpu`, `memory`, or
@ -161,7 +157,7 @@ entire queue group selects all queues.
### Migration
After the Sidekiq routing rules are changed, administrators need to take care
After the Sidekiq routing rules are changed, administrators must take care
with the migration to avoid losing jobs entirely, especially in a system with
long queues of jobs. The migration can be done by following the migration steps
mentioned in [Sidekiq job

View File

@ -36,7 +36,7 @@ fio --randrepeat=1 --ioengine=libaio --direct=1 --gtod_reduce=1 --name=test --bs
```
This creates a 4GB file in `/path/to/git-data/testfile`. It performs
4KB reads and writes using a 75%/25% split within the file, with 64
4KB reads and writes using a 75%/25% split in the file, with 64
operations running at a time. Be sure to delete the file after the test
completes.
@ -72,7 +72,7 @@ operations per second.
### Simple benchmarking
NOTE:
This test is naive but may be useful if `fio` is not
This test is naive but can be used if `fio` is not
available on the system. It's possible to receive good results on this
test but still have poor performance due to read speed and various other
factors.
@ -83,7 +83,7 @@ executed, and then reads the same 1,000 files.
1. Change into the root of the appropriate
[repository storage path](../repository_storage_paths.md).
1. Create a temporary directory for the test so it's easy to remove the files later:
1. Create a temporary directory for the test so it can be removed later:
```shell
mkdir test; cd test

View File

@ -15,7 +15,7 @@ Keep your GitLab instance up and running smoothly.
by GitLab to another file system or another server.
- [Sidekiq MemoryKiller](sidekiq_memory_killer.md): Configure Sidekiq MemoryKiller
to restart Sidekiq.
- [Multiple Sidekiq processes](extra_sidekiq_processes.md): Configure multiple Sidekiq processes to ensure certain queues always have dedicated workers, no matter the number of jobs that need to be processed. **(FREE SELF)**
- [Multiple Sidekiq processes](extra_sidekiq_processes.md): Configure multiple Sidekiq processes to ensure certain queues always have dedicated workers, no matter the number of jobs that must be processed. **(FREE SELF)**
- [Sidekiq routing rules](extra_sidekiq_routing.md): Configure the routing rules to route a job from a worker to a desirable queue. **(FREE SELF)**
- [Puma](puma.md): Understand Puma and puma-worker-killer.
- Speed up SSH operations by [Authorizing SSH users via a fast,
@ -30,4 +30,4 @@ Keep your GitLab instance up and running smoothly.
Used for troubleshooting a problem or retrieving some data that can only be done through direct access to GitLab.
- [ChatOps Scripts](https://gitlab.com/gitlab-com/chatops): The GitLab.com Infrastructure team uses this repository to house
common ChatOps scripts they use to troubleshoot and maintain the production instance of GitLab.com.
These scripts are likely useful to administrators of GitLab instances of all sizes.
These scripts can be used by administrators of GitLab instances of all sizes.

View File

@ -11,9 +11,9 @@ A username should be passed as the second argument to the Rake task,
which becomes the owner of the project. You can resume an import
with the same command.
Bear in mind that the syntax is very specific. Remove any spaces within the argument block and
Bear in mind that the syntax is very specific. Remove any spaces in the argument block and
before/after the brackets. Also, some shells (for example, Zsh) can interpret the open/close brackets
(`[]`) separately. You may need to either escape the brackets or use double quotes.
(`[]`) separately. You may want to either escape the brackets or use double quotes.
## Caveats

View File

@ -63,7 +63,7 @@ sudo gitlab-ctl start puma
## Make the database read-only
If you want to allow users to use the GitLab UI, then you need to ensure that
If you want to allow users to use the GitLab UI, ensure that
the database is read-only:
1. Take a [GitLab backup](../raketasks/backup_restore.md)
@ -113,7 +113,7 @@ the database is read-only:
sudo gitlab-ctl restart postgresql
```
When you're ready to revert the read-only state, you need to remove the added
When you're ready to revert the read-only state, remove the added
lines in `/etc/gitlab/gitlab.rb`, and reconfigure GitLab and restart PostgreSQL:
```shell
@ -121,5 +121,5 @@ sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart postgresql
```
Once you verify all works as expected, you can remove the `gitlab_read_only`
After you verify all works as expected, remove the `gitlab_read_only`
user from the database.

View File

@ -12,7 +12,7 @@ multiple ways to configure Redis.
You can choose to install and manage Redis and Sentinel yourself, use a hosted
cloud solution, or you can use the ones that come bundled with the Omnibus GitLab
packages so you only need to focus on configuration. Pick the one that suits your needs.
packages so you can only focus on configuration. Pick the one that suits your needs.
## Redis replication and failover using Omnibus GitLab

View File

@ -7,7 +7,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Troubleshooting Redis **(FREE SELF)**
There are a lot of moving parts that needs to be taken care carefully
There are a lot of moving parts that must be taken care carefully
in order for the HA setup to work as expected.
Before proceeding with the troubleshooting below, check your firewall rules:

View File

@ -10,7 +10,7 @@ This page describes GitLab reference architecture for up to 1,000 users. For a
full list of reference architectures, see
[Available reference architectures](index.md#available-reference-architectures).
If you need to serve up to 1,000 users and you don't have strict availability
If you are serving up to 1,000 users and you don't have strict availability
requirements, a single-node solution with
[frequent backups](index.md#automated-backups) is appropriate for
many organizations.
@ -123,4 +123,4 @@ components are deployed in Kubernetes via our official [Helm Charts](https://doc
and _stateful_ components are deployed in compute VMs with Omnibus.
The [2k GitLab Cloud Native Hybrid](2k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) (non HA) and [3k GitLab Cloud Native Hybrid](3k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) (HA) reference architectures are the smallest we recommend in Kubernetes.
For environments that need to serve less users, you can lower the node specs. Depending on your user count, you can lower all suggested node specs as desired. However, it's recommended that you don't go lower than the [general requirements](../../install/requirements.md).
For environments that serve fewer users, you can lower the node specs. Depending on your user count, you can lower all suggested node specs as desired. However, it's recommended that you don't go lower than the [general requirements](../../install/requirements.md).

View File

@ -6,7 +6,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Set up Postfix for incoming email **(FREE SELF)**
This document will take you through the steps of setting up a basic Postfix mail
This document takes you through the steps of setting up a basic Postfix mail
server with IMAP authentication on Ubuntu, to be used with [incoming email](incoming_email.md).
The instructions make the assumption that you are using the email address `incoming@gitlab.example.com`, that is, username `incoming` on host `gitlab.example.com`. Don't forget to change it to your actual host when executing the example code snippets.
@ -46,7 +46,7 @@ The instructions make the assumption that you are using the email address `incom
sudo passwd incoming
```
Be sure not to forget this, you'll need it later.
Be sure not to forget this, you will need it later.
## Test the out-of-the-box setup

View File

@ -31,7 +31,7 @@ GitLab Rails application (Puma) as well as the other components, like:
### Omnibus GitLab restart
There may be times in the documentation where you are asked to _restart_
GitLab. In that case, you need to run the following command:
GitLab. To restart, run the following command:
```shell
sudo gitlab-ctl restart

View File

@ -13,7 +13,7 @@ PostgreSQL, and Gitaly instances.
By default, GitLab uses UNIX sockets and is not set up to communicate via TCP. To change this:
1. Edit the `/etc/gitlab/gitlab.rb` file on your GitLab instance and add the following:
1. Edit the `/etc/gitlab/gitlab.rb` file on your GitLab instance, and add the following:
```ruby
@ -23,7 +23,7 @@ By default, GitLab uses UNIX sockets and is not set up to communicate via TCP. T
postgresql['sql_user_password'] = 'POSTGRESQL_PASSWORD_HASH'
postgresql['listen_address'] = '0.0.0.0'
postgresql['port'] = 5432
# Add the Sidekiq nodes to PostgreSQL's trusted addresses.
# In the following example, 10.10.1.30/32 is the private IP
# of the Sidekiq server.
@ -142,11 +142,11 @@ Updates to example must be made at:
#### Redis ###
########################################
## Must be the same in every sentinel node.
## Must be the same in every sentinel node.
redis['master_name'] = 'gitlab-redis' # Required if you have setup redis cluster
## The same password for Redis authentication you set up for the master node.
redis['master_password'] = '<redis_master_password>'
### If redis is running on the main Gitlab instance and you have opened the TCP port as above add the following
gitlab_rails['redis_host'] = '<gitlab_host>'
gitlab_rails['redis_port'] = 6379

View File

@ -8,7 +8,7 @@ type: reference
# Diagnostics tools **(FREE SELF)**
These are some of the diagnostics tools the GitLab Support team uses during troubleshooting.
They are listed here for transparency, and they may be useful for users with experience
They are listed here for transparency, and for users with experience
with troubleshooting GitLab. If you are currently having an issue with GitLab, you
may want to check your [support options](https://about.gitlab.com/support/) first,
before attempting to use these tools.
@ -24,6 +24,6 @@ running on.
[strace-parser](https://gitlab.com/wchandler/strace-parser) is a small tool to analyze
and summarize raw `strace` data.
## kubesos
## `kubesos`
The [`kubesos`](https://gitlab.com/gitlab-com/support/toolbox/kubesos/) utility retrieves GitLab cluster configuration and logs from GitLab Cloud Native chart deployments.

View File

@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
This is the GitLab Support Team's collection of information regarding the GitLab Rails
console, for use while troubleshooting. It is listed here for transparency,
and it may be useful for users with experience with these tools. If you are currently
and for users with experience with these tools. If you are currently
having an issue with GitLab, it is highly recommended that you first check
our guide on [our Rails console](../operations/rails_console.md),
and your [support options](https://about.gitlab.com/support/), before attempting to use
@ -80,7 +80,7 @@ Notify.test_email(u.email, "Test email for #{u.name}", 'Test email').deliver_now
## Limiting output
Adding a semicolon(`;`) and a follow-up statement at the end of a statement prevents the default implicit return output. This is useful if you are already explicitly printing details and potentially have a lot of return output:
Adding a semicolon(`;`) and a follow-up statement at the end of a statement prevents the default implicit return output. This can be used if you are already explicitly printing details and potentially have a lot of return output:
```ruby
puts ActiveRecord::Base.descendants; :ok
@ -100,9 +100,9 @@ project.id
# => 2537
```
## Open object in irb
## Open object in `irb`
Sometimes it is easier to navigate through a method if you are within the context of the object. You can shim into the namespace of `Object` to let you open `irb` within the context of any object:
Sometimes it is easier to go through a method if you are in the context of the object. You can shim into the namespace of `Object` to let you open `irb` in the context of any object:
```ruby
Object.define_method(:irb) { binding.irb }
@ -311,7 +311,7 @@ end
### Bulk update push rules for _all_ projects
For example, enable **Check whether the commit author is a GitLab user** and **Do not allow users to remove Git tags with `git push`** checkboxes, and create a filter for allowing commits from a specific e-mail domain only:
For example, enable **Check whether the commit author is a GitLab user** and **Do not allow users to remove Git tags with `git push`** checkboxes, and create a filter for allowing commits from a specific email domain only:
``` ruby
Project.find_each do |p|
@ -443,7 +443,7 @@ p.create_wiki ### creates the wiki project on the filesystem
## Issue boards
### In case of issue boards not loading properly and it's getting time out. We need to call the Issue Rebalancing service to fix this
### In case of issue boards not loading properly and it's getting time out. Call the Issue Rebalancing service to fix this
```ruby
p = Project.find_by_full_path('<username-or-group>/<project-name>')
@ -515,7 +515,7 @@ If this all runs successfully, you see an output like the following before being
=> nil
```
The exported project is located within a `.tar.gz` file in `/var/opt/gitlab/gitlab-rails/uploads/-/system/import_export_upload/export_file/`.
The exported project is located in a `.tar.gz` file in `/var/opt/gitlab/gitlab-rails/uploads/-/system/import_export_upload/export_file/`.
If this fails, [enable verbose logging](../operations/rails_console.md#looking-up-database-persisted-objects),
repeat the above procedure after,
@ -636,7 +636,7 @@ User.billable.count
::HistoricalData.max_historical_user_count(from: 1.year.ago.beginning_of_day, to: Time.current.end_of_day)
```
Using cURL and jq (up to a max 100, see the [pagination docs](../../api/index.md#pagination)):
Using cURL and jq (up to a max 100, see [Pagination](../../api/index.md#pagination)):
```shell
curl --silent --header "Private-Token: ********************" \
@ -1111,7 +1111,7 @@ License.select(&TYPE).each(&:destroy!)
### Registry Disk Space Usage by Project
As a GitLab administrator, you may need to reduce disk space consumption.
As a GitLab administrator, you may want to reduce disk space consumption.
A common culprit is Docker Registry images that are no longer in use. To find
the storage broken down by each project, run the following in the
[GitLab Rails console](../operations/rails_console.md):
@ -1145,11 +1145,11 @@ end
### Run the Cleanup policy now
Find this content in the [Container Registry troubleshooting docs](../packages/container_registry.md#run-the-cleanup-policy-now).
Find this content in the [Container Registry troubleshooting documentation](../packages/container_registry.md#run-the-cleanup-policy-now).
## Sidekiq
This content has been moved to the [Troubleshooting Sidekiq docs](sidekiq.md).
This content has been moved to [Troubleshooting Sidekiq](sidekiq.md).
## Redis

View File

@ -9,7 +9,7 @@ type: reference
This is the GitLab Support Team's collection of information regarding Linux, that they
sometimes use while troubleshooting. It is listed here for transparency,
and it may be useful for users with experience with Linux. If you are currently
and for users with experience with Linux. If you are currently
having an issue with GitLab, you may want to check your [support options](https://about.gitlab.com/support/)
first, before attempting to use this information.

View File

@ -211,7 +211,7 @@ jq --raw-output 'select(.severity == "ERROR") | [.project_path, .message] | @tsv
### Parsing `gitaly/current`
The following examples are useful to [troubleshoot Gitaly](../gitaly/troubleshooting.md).
Use the following examples to [troubleshoot Gitaly](../gitaly/troubleshooting.md).
#### Find all Gitaly requests sent from web UI

View File

@ -9,7 +9,7 @@ type: reference
This page contains a list of common SSL-related errors and scenarios that you
may encounter while working with GitLab. It should serve as an addition to the
main SSL docs available here:
main SSL documentation:
- [Omnibus SSL Configuration](https://docs.gitlab.com/omnibus/settings/ssl.html).
- [Self-signed certificates or custom Certification Authorities for GitLab Runner](https://docs.gitlab.com/runner/configuration/tls-self-signed.html).
@ -246,7 +246,7 @@ If you're on Windows and get the following error:
Fatal: unable to access 'https://gitlab.domain.tld/group/project.git': schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted."
```
You may need to specify that Git should use OpenSSL:
You must specify that Git should use OpenSSL:
```shell
git config --system http.sslbackend openssl

View File

@ -15,7 +15,7 @@ The visibility level is determined by the `visibility` field in the project.
Values for the project visibility level are:
- `private`: project access must be granted explicitly for each user.
- `private`: project access must be granted explicitly to each user.
- `internal`: the project can be cloned by any signed-in user except [external users](../user/permissions.md#external-users).
- `public`: the project can be accessed without any authentication.
@ -28,11 +28,10 @@ There are three options for `merge_method` to choose from:
- `merge`: a merge commit is created for every merge, and merging is allowed if
there are no conflicts.
- `rebase_merge`: a merge commit is created for every merge, but merging is only
allowed if fast-forward merge is possible. This way you could make sure that
if this merge request would build, after merging to target branch it would
also build.
- `ff`: no merge commits are created and all merges are fast-forwarded, which
means that merging is only allowed if the branch could be fast-forwarded.
allowed if fast-forward merge is possible. You can make sure that the target
branch would build after this merge request builds and merges.
- `ff`: no merge commits are created and all merges are fast-forwarded. Merging
is only allowed if the branch could be fast-forwarded.
## List all projects
@ -81,17 +80,26 @@ for selected `order_by` options.
When `simple=true` or the user is unauthenticated this returns something like:
Example request:
```shell
curl --request GET "https://gitlab.example.com/api/v4/projects"
```
Example response:
```json
[
{
"id": 4,
"description": null,
"default_branch": "master",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
"web_url": "http://example.com/diaspora/diaspora-client",
"readme_url": "http://example.com/diaspora/diaspora-client/blob/master/README.md",
"tag_list": [ //deprecated, use `topics` instead
"name": "Diaspora Client",
"name_with_namespace": "Diaspora / Diaspora Client",
"path": "diaspora-client",
"path_with_namespace": "diaspora/diaspora-client",
"created_at": "2013-09-30T13:46:02Z",
"default_branch": "main",
"tag_list": [
"example",
"disapora client"
],
@ -99,21 +107,28 @@ When `simple=true` or the user is unauthenticated this returns something like:
"example",
"disapora client"
],
"name": "Diaspora Client",
"name_with_namespace": "Diaspora / Diaspora Client",
"path": "diaspora-client",
"path_with_namespace": "diaspora/diaspora-client",
"created_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"ssh_url_to_repo": "git@gitlab.example.com:diaspora/diaspora-client.git",
"http_url_to_repo": "https://gitlab.example.com/diaspora/diaspora-client.git",
"web_url": "https://gitlab.example.com/diaspora/diaspora-client",
"readme_url": "https://gitlab.example.com/diaspora/diaspora-client/blob/master/README.md",
"avatar_url": "https://gitlab.example.com/uploads/project/avatar/4/uploads/avatar.png",
"forks_count": 0,
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
"star_count": 0
"star_count": 0,
"last_activity_at": "2013-09-30T13:46:02Z",
"namespace": {
"id": 2,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora",
"parent_id": null,
"avatar_url": null,
"web_url": "https://gitlab.example.com/diaspora"
}
},
{
"id": 6,
"description": null,
"default_branch": "master",
...
...
}
```
When the user is authenticated and `simple` is not set this returns something like:
@ -123,12 +138,12 @@ When the user is authenticated and `simple` is not set this returns something li
{
"id": 4,
"description": null,
"default_branch": "master",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:diaspora/diaspora-client.git",
"http_url_to_repo": "http://example.com/diaspora/diaspora-client.git",
"web_url": "http://example.com/diaspora/diaspora-client",
"readme_url": "http://example.com/diaspora/diaspora-client/blob/master/README.md",
"name": "Diaspora Client",
"name_with_namespace": "Diaspora / Diaspora Client",
"path": "diaspora-client",
"path_with_namespace": "diaspora/diaspora-client",
"created_at": "2013-09-30T13:46:02Z",
"default_branch": "main",
"tag_list": [ //deprecated, use `topics` instead
"example",
"disapora client"
@ -137,204 +152,115 @@ When the user is authenticated and `simple` is not set this returns something li
"example",
"disapora client"
],
"owner": {
"id": 3,
"name": "Diaspora",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Diaspora Client",
"name_with_namespace": "Diaspora / Diaspora Client",
"path": "diaspora-client",
"path_with_namespace": "diaspora/diaspora-client",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, // deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"ssh_url_to_repo": "git@gitlab.example.com:diaspora/diaspora-client.git",
"http_url_to_repo": "https://gitlab.example.com/diaspora/diaspora-client.git",
"web_url": "https://gitlab.example.com/diaspora/diaspora-client",
"readme_url": "https://gitlab.example.com/diaspora/diaspora-client/blob/master/README.md",
"avatar_url": "https://gitlab.example.com/uploads/project/avatar/4/uploads/avatar.png",
"forks_count": 0,
"star_count": 0,
"last_activity_at": "2022-06-24T17:11:26.841Z",
"namespace": {
"id": 3,
"name": "Diaspora",
"path": "diaspora",
"kind": "group",
"full_path": "diaspora"
"full_path": "diaspora",
"parent_id": null,
"avatar_url": "https://gitlab.example.com/uploads/project/avatar/6/uploads/avatar.png",
"web_url": "https://gitlab.example.com/diaspora"
},
"import_status": "none",
"container_registry_image_prefix": "registry.gitlab.example.com/diaspora/diaspora-client",
"_links": {
"self": "https://gitlab.example.com/api/v4/projects/4",
"issues": "https://gitlab.example.com/api/v4/projects/4/issues",
"merge_requests": "https://gitlab.example.com/api/v4/projects/4/merge_requests",
"repo_branches": "https://gitlab.example.com/api/v4/projects/4/repository/branches",
"labels": "https://gitlab.example.com/api/v4/projects/4/labels",
"events": "https://gitlab.example.com/api/v4/projects/4/events",
"members": "https://gitlab.example.com/api/v4/projects/4/members",
"cluster_agents": "https://gitlab.example.com/api/v4/projects/4/cluster_agents"
},
"packages_enabled": true,
"empty_repo": false,
"archived": false,
"avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png",
"visibility": "public",
"resolve_outdated_diff_discussions": false,
"container_expiration_policy": {
"cadence": "1month",
"enabled": true,
"keep_n": 1,
"older_than": "14d",
"name_regex": "",
"name_regex_keep": ".*-main",
"next_run_at": "2022-06-25T17:11:26.865Z"
},
"issues_enabled": true,
"merge_requests_enabled": true,
"wiki_enabled": true,
"jobs_enabled": true,
"snippets_enabled": true,
"container_registry_enabled": true,
"service_desk_enabled": true,
"can_create_merge_request_in": true,
"issues_access_level": "enabled",
"repository_access_level": "enabled",
"merge_requests_access_level": "enabled",
"forking_access_level": "enabled",
"wiki_access_level": "enabled",
"builds_access_level": "enabled",
"snippets_access_level": "enabled",
"pages_access_level": "enabled",
"operations_access_level": "enabled",
"analytics_access_level": "enabled",
"container_registry_access_level": "enabled",
"security_and_compliance_access_level": "private",
"emails_disabled": null,
"shared_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
"ci_default_git_depth": 50,
"lfs_enabled": true,
"creator_id": 1,
"import_status": "none",
"open_issues_count": 0,
"ci_default_git_depth": 20,
"ci_forward_deployment_enabled": true,
"ci_job_token_scope_enabled": false,
"ci_separated_caches": true,
"public_jobs": true,
"build_timeout": 3600,
"auto_cancel_pending_pipelines": "enabled",
"build_coverage_regex": null,
"ci_config_path": "",
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"allow_merge_on_skipped_pipeline": null,
"restrict_user_defined_variables": false,
"request_access_enabled": true,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"remove_source_branch_after_merge": true,
"printing_merge_request_link_enabled": true,
"merge_method": "merge",
"squash_option": "default_on",
"autoclose_referenced_issues": true,
"squash_option": "default_off",
"enforce_auth_checks_on_uploads": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"marked_for_deletion_at": "2020-04-03", // Deprecated and will be removed in API v5 in favor of marked_for_deletion_on
"marked_for_deletion_on": "2020-04-03",
"statistics": {
"commit_count": 37,
"storage_size": 1038090,
"repository_size": 1038090,
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
},
"container_registry_image_prefix": "registry.example.com/diaspora/diaspora-client",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
"auto_devops_enabled": false,
"auto_devops_deploy_strategy": "continuous",
"autoclose_referenced_issues": true,
"keep_latest_artifact": true,
"runner_token_expiration_interval": null,
"external_authorization_classification_label": "",
"requirements_enabled": false,
"requirements_access_level": "enabled",
"security_and_compliance_enabled": false,
"compliance_frameworks": [],
"permissions": {
"project_access": null,
"group_access": null
}
},
{
"id": 6,
"description": null,
"default_branch": "master",
"visibility": "private",
"ssh_url_to_repo": "git@example.com:brightbox/puppet.git",
"http_url_to_repo": "http://example.com/brightbox/puppet.git",
"web_url": "http://example.com/brightbox/puppet",
"readme_url": "http://example.com/brightbox/puppet/blob/master/README.md",
"tag_list": [ //deprecated, use `topics` instead
"example",
"puppet"
],
"topics": [
"example",
"puppet"
],
"owner": {
"id": 4,
"name": "Brightbox",
"created_at": "2013-09-30T13:46:02Z"
},
"name": "Puppet",
"name_with_namespace": "Brightbox / Puppet",
"path": "puppet",
"path_with_namespace": "brightbox/puppet",
"issues_enabled": true,
"open_issues_count": 1,
"merge_requests_enabled": true,
"jobs_enabled": true,
"wiki_enabled": true,
"snippets_enabled": false,
"can_create_merge_request_in": true,
"resolve_outdated_diff_discussions": false,
"container_registry_enabled": false, // deprecated, use container_registry_access_level instead
"container_registry_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"created_at": "2013-09-30T13:46:02Z",
"last_activity_at": "2013-09-30T13:46:02Z",
"creator_id": 3,
"namespace": {
"id": 4,
"name": "Brightbox",
"path": "brightbox",
"kind": "group",
"full_path": "brightbox"
},
"import_status": "none",
"import_error": null,
"permissions": {
"project_access": {
"access_level": 10,
"notification_level": 3
},
"group_access": {
"access_level": 50,
"notification_level": 3
}
},
"archived": false,
"avatar_url": null,
"shared_runners_enabled": true,
"forks_count": 0,
"star_count": 0,
"runners_token": "b8547b1dc37721d05889db52fa2f02",
"ci_default_git_depth": 0,
"ci_forward_deployment_enabled": true,
"ci_separated_caches": true,
"public_jobs": true,
"shared_with_groups": [],
"only_allow_merge_if_pipeline_succeeds": false,
"allow_merge_on_skipped_pipeline": false,
"restrict_user_defined_variables": false,
"only_allow_merge_if_all_discussions_are_resolved": false,
"remove_source_branch_after_merge": false,
"request_access_enabled": false,
"merge_method": "merge",
"squash_option": "default_on",
"auto_devops_enabled": true,
"auto_devops_deploy_strategy": "continuous",
"repository_storage": "default",
"approvals_before_merge": 0,
"mirror": false,
"mirror_user_id": 45,
"mirror_trigger_builds": false,
"only_mirror_protected_branches": false,
"mirror_overwrites_diverged_branches": false,
"external_authorization_classification_label": null,
"packages_enabled": true,
"service_desk_enabled": false,
"service_desk_address": null,
"autoclose_referenced_issues": true,
"suggestion_commit_message": null,
"merge_commit_template": null,
"squash_commit_template": null,
"statistics": {
"commit_count": 12,
"storage_size": 2066080,
"repository_size": 2066080,
"wiki_size" : 0,
"lfs_objects_size": 0,
"job_artifacts_size": 0,
"pipeline_artifacts_size": 0,
"packages_size": 0,
"snippets_size": 0,
"uploads_size": 0
},
"container_registry_image_prefix": "registry.example.com/brightbox/puppet",
"_links": {
"self": "http://example.com/api/v4/projects",
"issues": "http://example.com/api/v4/projects/1/issues",
"merge_requests": "http://example.com/api/v4/projects/1/merge_requests",
"repo_branches": "http://example.com/api/v4/projects/1/repository_branches",
"labels": "http://example.com/api/v4/projects/1/labels",
"events": "http://example.com/api/v4/projects/1/events",
"members": "http://example.com/api/v4/projects/1/members",
"cluster_agents": "http://example.com/api/v4/projects/1/cluster_agents"
}
...
}
]
```
@ -368,6 +294,12 @@ You can filter by [custom attributes](custom_attributes.md) with:
GET /projects?custom_attributes[key]=value&custom_attributes[other_key]=other_value
```
Example request:
```shell
curl --globoff --request GET "https://gitlab.example.com/api/v4/projects?custom_attributes[location]=Antarctica&custom_attributes[role]=Developer"
```
### Pagination limits
In GitLab 13.0 and later, [offset-based pagination](index.md#offset-based-pagination)

View File

@ -353,7 +353,7 @@ while only booting up the tested service once.
```yaml
access-service:
stage: build
image: docker:19.03.1
image: docker:20.10.16
services:
- docker:dind # necessary for docker run
- tutum/wordpress:latest

View File

@ -401,6 +401,8 @@ Review all merge requests that introduce changes to the `.gitlab-ci.yml` file be
- [Run a pipeline in the parent project for a merge request submitted from a forked project](../pipelines/merge_request_pipelines.md#run-pipelines-in-the-parent-project).
- Merge the changes.
Review the `.gitlab-ci.yml` file of imported projects before you add files or run pipelines against them.
The following example shows malicious code in a `.gitlab-ci.yml` file:
```yaml

View File

@ -12,8 +12,7 @@ limits to GitLab.
## Documentation
First of all, you have to gather information and decide which are the different
limits that are set for the different GitLab tiers. You also need to
coordinate with others to [document](../administration/instance_limits.md)
limits that are set for the different GitLab tiers. Coordinate with others to [document](../administration/instance_limits.md)
and communicate those limits.
There is a guide about [introducing application
@ -206,6 +205,6 @@ rate limiting architecture:
1. Making it possible to define and override limits per namespace / per plan.
1. Automatically generating documentation about what limits are implemented and
what the defaults are.
1. Defining limits in a single place that is easy to find an explore.
1. Defining limits in a single place that can be found and explored.
1. Soft and hard limits, with support for notifying users when a limit is
approaching.

View File

@ -315,7 +315,7 @@ You can configure many Auto DevOps jobs to run in an [offline environment](../..
build:
image: "$REGISTRY_URL/docker/auto-build-image:v0.6.0"
services:
- name: "$REGISTRY_URL/greg/docker/docker:20.10.6-dind"
- name: "$REGISTRY_URL/greg/docker/docker:20.10.16-dind"
command: ['--tls=false', '--host=tcp://0.0.0.0:2375']
```

View File

@ -23,7 +23,7 @@ For a video walkthrough of this process, see [Offline GitLab Installation: Downl
You should [manually download the GitLab package](../../update/package/index.md#upgrade-using-a-manually-downloaded-package) and relevant dependencies using a server of the same operating system type that has access to the Internet.
If your offline environment has no local network access, you must manually transport across the relevant package files through physical media, such as a USB drive or writable DVD.
If your offline environment has no local network access, you must manually transport across the relevant package files through physical media, such as a USB drive, or writable DVD.
In Ubuntu, this can be performed on a server with Internet access using the following commands:
@ -70,7 +70,7 @@ sudo EXTERNAL_URL="http://my-host.internal" dpkg -i <gitlab_package_name>.deb
## Enabling SSL
Follow these steps to enable SSL for your fresh instance. Note that these steps reflect those for
Follow these steps to enable SSL for your fresh instance. These steps reflect those for
[manually configuring SSL in Omnibus's NGINX configuration](https://docs.gitlab.com/omnibus/settings/nginx.html#manually-configuring-https):
1. Make the following changes to `/etc/gitlab/gitlab.rb`:
@ -100,7 +100,7 @@ Follow these steps to enable SSL for your fresh instance. Note that these steps
## Enabling the GitLab Container Registry
Follow these steps to enable the container registry. Note that these steps reflect those for
Follow these steps to enable the container registry. These steps reflect those for
[configuring the container registry under an existing domain](../../administration/packages/container_registry.md#configure-container-registry-under-an-existing-gitlab-domain):
1. Make the following changes to `/etc/gitlab/gitlab.rb`:
@ -180,7 +180,7 @@ sudo docker run -d --restart always --name gitlab-runner -v /etc/gitlab-runner:/
### Authenticating the registry against the host OS
As noted in [Docker's registry authentication documentation](https://docs.docker.com/registry/insecure/#docker-still-complains-about-the-certificate-when-using-authentication),
As noted in [Docker registry authentication documentation](https://docs.docker.com/registry/insecure/#docker-still-complains-about-the-certificate-when-using-authentication),
certain versions of Docker require trusting the certificate chain at the OS level.
In the case of Ubuntu, this involves using `update-ca-certificates`:

View File

@ -54,7 +54,7 @@ There are also instructions when you want to
Editions.
In the past we used separate documents for the upgrading instructions, but we
have since switched to using a single document. The old upgrading guidelines
have switched to using a single document. The old upgrading guidelines
can still be found in the Git repository:
- [Old upgrading guidelines for Community Edition](https://gitlab.com/gitlab-org/gitlab-foss/tree/11-8-stable/doc/update)
@ -179,7 +179,7 @@ Expected batched background migration for the given configuration to be marked a
If you get this error, [check the batched background migration options](../user/admin_area/monitoring/background_migrations.md#database-migrations-failing-because-of-batched-background-migration-not-finished) to complete the upgrade.
### What do I do if my background migrations are stuck?
### What do you do if your background migrations are stuck?
WARNING:
The following operations can disrupt your GitLab performance. They run a number of Sidekiq jobs that perform various database or file updates.
@ -331,11 +331,11 @@ cd /home/git/gitlab
sudo -u git -H bundle exec rake gitlab:elastic:list_pending_migrations
```
### What do I do if my Advanced Search migrations are stuck?
### What do you do if your Advanced Search migrations are stuck?
See [how to retry a halted migration](../integration/advanced_search/elasticsearch.md#retry-a-halted-migration).
### What do I do for the error `Elasticsearch version not compatible`
### What do you do for the error `Elasticsearch version not compatible`
Confirm that your version of Elasticsearch or OpenSearch is [compatible with your version of GitLab](../integration/advanced_search/elasticsearch.md#version-requirements).
@ -361,7 +361,7 @@ It's also important to ensure that any [background migrations have been fully co
before upgrading to a new major version.
If you have enabled the [Elasticsearch integration](../integration/advanced_search/elasticsearch.md) **(PREMIUM SELF)**, then
[ensure all Advanced Search migrations are completed](#checking-for-pending-advanced-search-migrations) in the last minor version within
[ensure all Advanced Search migrations are completed](#checking-for-pending-advanced-search-migrations) in the last minor version in
your current version
before proceeding with the major version upgrade.
@ -425,7 +425,7 @@ Edition, follow the guides below based on the installation method:
### Enterprise to Community Edition
If you need to downgrade your Enterprise Edition installation back to Community
To downgrade your Enterprise Edition installation back to Community
Edition, you can follow [this guide](../downgrade_ee_to_ce/index.md) to make the process as smooth as
possible.
@ -442,7 +442,7 @@ At the end of major and minor release posts, there are three sections to look fo
These include:
- Steps you need to perform as part of an upgrade.
- Steps you must perform as part of an upgrade.
For example [8.12](https://about.gitlab.com/releases/2016/09/22/gitlab-8-12-released/#upgrade-barometer)
required the Elasticsearch index to be recreated. Any older version of GitLab upgrading to 8.12 or later would require this.
- Changes to the versions of software we support such as
@ -473,7 +473,7 @@ and [Helm Chart deployments](https://docs.gitlab.com/charts/). They come with ap
to avoid the database crashing.
- In GitLab 15.1.0, we are switching Rails `ActiveSupport::Digest` to use SHA256 instead of MD5.
This affects ETag key generation for resources such as raw Snippet file
downloads. In order to ensure consistent ETag key generation across multiple
downloads. To ensure consistent ETag key generation across multiple
web nodes when upgrading, all servers must first be upgraded to 15.1.Z before
upgrading to 15.2.0 or later:
@ -653,7 +653,7 @@ or [init scripts](upgrading_from_source.md#configure-sysv-init-script) by [follo
All merge request diff commits automatically incorporate these changes, and there are no
additional requirements to perform the upgrade.
Existing data in the `merge_request_diff_commits` table remains unpacked until you run `VACUUM FULL merge_request_diff_commits`.
But note that the `VACUUM FULL` operation locks and rewrites the entire `merge_request_diff_commits` table,
However, the `VACUUM FULL` operation locks and rewrites the entire `merge_request_diff_commits` table,
so the operation takes some time to complete and it blocks access to this table until the end of the process.
We advise you to only run this command while GitLab is not actively used or it is taken offline for the duration of the process.
The time it takes to complete depends on the size of the table, which can be obtained by using `select pg_size_pretty(pg_total_relation_size('merge_request_diff_commits'));`.
@ -1015,10 +1015,10 @@ GitLab 13.2.0 [remediates](https://gitlab.com/gitlab-org/gitlab/-/merge_requests
After upgrading, if some of your users are unexpectedly encountering 404 or 422 errors when signing in,
or "blocked" messages when using the command line,
their accounts may have been un-confirmed.
In that case, please ask them to check their email for a re-confirmation link.
In that case, ask them to check their email for a re-confirmation link.
For more information, see our discussion of [Email confirmation issues](../user/upgrade_email_bypass.md).
GitLab 13.2.0 relies on the `btree_gist` extension for PostgreSQL. For installations with an externally managed PostgreSQL setup, please make sure to
GitLab 13.2.0 relies on the `btree_gist` extension for PostgreSQL. For installations with an externally managed PostgreSQL setup, make sure to
[install the extension manually](https://www.postgresql.org/docs/11/sql-createextension.html) before upgrading GitLab if the database user for GitLab
is not a superuser. This is not necessary for installations using a GitLab managed PostgreSQL database.
@ -1065,7 +1065,7 @@ If you persist your own Rack Attack initializers between upgrades, you might
- The final patch release (12.10.14)
[has a regression affecting maven package uploads](https://about.gitlab.com/releases/2020/07/06/critical-security-release-gitlab-13-1-3-released/#maven-package-upload-broken-in-121014).
If you use this feature and need to stay on 12.10 while preparing to upgrade to 13.0:
If you use this feature and must stay on 12.10 while preparing to upgrade to 13.0:
- Upgrade to 12.10.13 instead.
- Upgrade to 13.0.14 as soon as possible.

View File

@ -63,7 +63,7 @@ The steps can be summed up to:
piped script, you can first
[check its contents](https://packages.gitlab.com/gitlab/gitlab-ee/install).
1. Next, install the `gitlab-ee` package. Note that this automatically
1. Install the `gitlab-ee` package. The install automatically
uninstalls the `gitlab-ce` package on your GitLab server. `reconfigure`
Omnibus right after the `gitlab-ee` package is installed. **Make sure that you
install the exact same GitLab version**:

View File

@ -31,6 +31,25 @@ For removal reviewers (Technical Writers only):
https://about.gitlab.com/handbook/marketing/blog/release-posts/#update-the-removals-doc
-->
## Removed in 15.2
### Support for older browsers
In GitLab 15.2, we are cleaning up and [removing old code](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/86003) that was specific for browsers that we no longer support. This has no impact on users if they use one of our [supported web browsers](https://docs.gitlab.com/ee/install/requirements.html#supported-web-browsers).
Most notably, support for the following browsers has been removed:
- Apple Safari 14 and older.
- Mozilla Firefox 78.
The minimum supported browser versions are:
- Apple Safari 14.1.
- Mozilla Firefox 91.
- Google Chrome 92.
- Chromium 92.
- Microsoft Edge 92.
## Removed in 15.0
### API: `stale` status returned instead of `offline` or `not_connected`

View File

@ -277,7 +277,7 @@ node throughout the process.
- To prevent `reconfigure` from automatically running database migrations, ensure that `gitlab_rails['auto_migrate'] = false` is set in `/etc/gitlab/gitlab.rb`.
**Postgres only nodes**
**PostgreSQL only nodes**
- Update the GitLab package
@ -416,7 +416,7 @@ following command to get address of current Redis primary
1. Get the address of one of the sentinel nodes specified as
`gitlab_rails['redis_sentinels']` in `/etc/gitlab/gitlab.rb`
1. Get the Redis master name specified as `redis['master_name']` in
1. Get the Redis main name specified as `redis['master_name']` in
`/etc/gitlab/gitlab.rb`
1. Run the following command

View File

@ -90,7 +90,7 @@ deploy:
services:
- name: docker:dind
alias: dind
image: docker:19.03.5
image: docker:20.10.16
stage: build
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY

View File

@ -208,10 +208,10 @@ should look:
```yaml
build:
image: docker:19.03.12
image: docker:20.10.16
stage: build
services:
- docker:19.03.12-dind
- docker:20.10.16-dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY/group/project/image:latest .
@ -222,10 +222,10 @@ You can also make use of [other CI/CD variables](../../../ci/variables/index.md)
```yaml
build:
image: docker:19.03.12
image: docker:20.10.16
stage: build
services:
- docker:19.03.12-dind
- docker:20.10.16-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
@ -248,9 +248,9 @@ when needed. Changes to `main` also get tagged as `latest` and deployed using
an application-specific deploy script:
```yaml
image: docker:19.03.12
image: docker:20.10.16
services:
- docker:19.03.12-dind
- docker:20.10.16-dind
stages:
- build
@ -323,9 +323,9 @@ Below is an example of what your `.gitlab-ci.yml` should look like:
```yaml
build:
image: $CI_REGISTRY/group/project/docker:19.03.12
image: $CI_REGISTRY/group/project/docker:20.10.16
services:
- name: $CI_REGISTRY/group/project/docker:19.03.12-dind
- name: $CI_REGISTRY/group/project/docker:20.10.16-dind
alias: docker
stage: build
script:
@ -333,7 +333,7 @@ build:
- docker run my-docker-image /script/to/run/tests
```
If you forget to set the service alias, the `docker:19.03.12` image is unable to find the
If you forget to set the service alias, the `docker:20.10.16` image is unable to find the
`dind` service, and an error like the following is thrown:
```plaintext
@ -353,7 +353,7 @@ Below is an example of what your `.gitlab-ci.yml` should look like:
```yaml
build:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:19.03.12
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:20.10.16
services:
- name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:18.09.7-dind
alias: docker
@ -363,7 +363,7 @@ build:
- docker run my-docker-image /script/to/run/tests
```
If you forget to set the service alias, the `docker:19.03.12` image is unable to find the
If you forget to set the service alias, the `docker:20.10.16` image is unable to find the
`dind` service, and an error like the following is thrown:
```plaintext
@ -438,10 +438,10 @@ stages:
- clean
build_image:
image: docker:19.03.12
image: docker:20.10.16
stage: build
services:
- docker:19.03.12-dind
- docker:20.10.16-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
@ -454,10 +454,10 @@ build_image:
- main
delete_image:
image: docker:19.03.12
image: docker:20.10.16
stage: clean
services:
- docker:19.03.12-dind
- docker:20.10.16-dind
variables:
IMAGE_TAG: $CI_PROJECT_PATH:$CI_COMMIT_REF_SLUG
REG_SHA256: ade837fc5224acd8c34732bf54a94f579b47851cc6a7fd5899a98386b782e228

View File

@ -152,17 +152,17 @@ FROM gitlab.example.com:443/my-group/dependency_proxy/containers/alpine:latest
```yaml
# .gitlab-ci.yml
image: docker:19.03.12
image: docker:20.10.16
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
services:
- docker:19.03.12-dind
- docker:20.10.16-dind
build:
image: docker:19.03.12
image: docker:20.10.16
before_script:
- docker login -u $CI_DEPENDENCY_PROXY_USER -p $CI_DEPENDENCY_PROXY_PASSWORD $CI_DEPENDENCY_PROXY_SERVER
script:
@ -301,7 +301,7 @@ hub_docker_quota_check:
### Dependency Proxy Connection Failure
If a service alias is not set the `docker:19.03.12` image is unable to find the
If a service alias is not set the `docker:20.10.16` image is unable to find the
`dind` service, and an error like the following is thrown:
```plaintext

View File

@ -34,7 +34,7 @@ In these types of setups it's recommended that the GitLab environment used match
Gitaly Cluster can notably improve large repository performance as it holds multiple replicas of the repository across several nodes. As a result, Gitaly Cluster can load balance read requests against those repositories and is also fault tolerant.
It's recommended for large repositories, however, Gitaly Cluster is a large solution with additional complexity of setup and management. Refer to the [Gitaly Cluster documentation for more information](../../../administration/gitaly/index.md), specifically the [Before deploying Gitaly Cluster](../../../administration/gitaly/index.md#before-deploying-gitaly-cluster) section.
It's recommended for large repositories, however, Gitaly Cluster is a large solution with additional complexity of setup, and management. Refer to the [Gitaly Cluster documentation for more information](../../../administration/gitaly/index.md), specifically the [Before deploying Gitaly Cluster](../../../administration/gitaly/index.md#before-deploying-gitaly-cluster) section.
## Keep GitLab up to date
@ -46,6 +46,6 @@ Large repositories tend to be monorepos. This in turn typically means that these
CI/CD loads tend to be concurrent as pipelines are scheduled during set times. As a result, the Git requests against the repositories can spike notably during these times and lead to reduced performance for both CI and users alike.
When designing CI/CD pipelines, it's advisable to reduce their concurrency by staggering them to run at different times, for example, a set running at one time and then another set running several minutes later.
When designing CI/CD pipelines, it's advisable to reduce their concurrency by staggering them to run at different times, for example, a set running at one time, and another set running several minutes later.
There's several other actions that can be explored to improve CI/CD performance with large repositories. Refer to the [Runner documentation for more information](../../../ci/large_repositories/index.md).

View File

@ -29,7 +29,7 @@ module Gitlab
response = Gitlab::HTTP.try_get(runner_releases_url)
@releases_by_minor = nil
unless response.success?
unless response&.success?
@backoff_expire_time = next_backoff.from_now
break nil
end

View File

@ -7,10 +7,7 @@ module Gitlab
include Gitlab::Utils::StrongMemoize
# This class accepts an array of arrays/hashes/or objects
#
# The parameter `project` is only used for the feature flag check, and will be removed with
# https://gitlab.com/gitlab-org/gitlab/-/issues/321972
def initialize(all_statuses, with_allow_failure: true, dag: false, project: nil)
def initialize(all_statuses, with_allow_failure: true, dag: false)
unless all_statuses.respond_to?(:pluck)
raise ArgumentError, "all_statuses needs to respond to `.pluck`"
end
@ -19,7 +16,6 @@ module Gitlab
@status_key = 0
@allow_failure_key = 1 if with_allow_failure
@dag = dag
@project = project
consume_all_statuses(all_statuses)
end

View File

@ -7,6 +7,8 @@ module Gitlab
attr_reader :current_user, :original_entity, :target_parent
def initialize(current_user, original_entity, target_parent)
raise ArgumentError, 'target_parent cannot be nil' if target_parent.nil?
@current_user = current_user
@original_entity = original_entity
@target_parent = target_parent

View File

@ -18,7 +18,7 @@ module Gitlab
# SAST and Secret Detection are always available, but this isn't
# reflected by our license model yet.
# TODO: https://gitlab.com/gitlab-org/gitlab/-/issues/333113
%i[sast sast_iac secret_detection].include?(type)
%i[sast sast_iac secret_detection container_scanning].include?(type)
end
def can_enable_by_merge_request?

View File

@ -30,7 +30,7 @@
* // window.location.href is now 'http://test.host/a/b/foo.html?bar=1#qux
*
* Both approaches also automatically update the rest of the properties on
* `window.locaton`. For instance:
* `window.location`. For instance:
*
* setWindowLocation('http://test.host/a/b/foo.html?bar=1#qux');
* // window.location.origin is now 'http://test.host'

View File

@ -1,179 +1,227 @@
import Vue, { nextTick } from 'vue';
import VueApollo from 'vue-apollo';
import { GlLoadingIcon } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import LastCommit from '~/repository/components/last_commit.vue';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import pathLastCommitQuery from 'shared_queries/repository/path_last_commit.query.graphql';
import { refMock } from '../mock_data';
let vm;
let wrapper;
let mockResolver;
function createCommitData(data = {}) {
const defaultData = {
sha: '123456789',
title: 'Commit title',
titleHtml: 'Commit title',
message: 'Commit message',
webPath: '/commit/123',
authoredDate: '2019-01-01',
author: {
name: 'Test',
avatarUrl: 'https://test.com',
webPath: '/test',
},
pipeline: {
const findPipeline = () => wrapper.find('.js-commit-pipeline');
const findTextExpander = () => wrapper.find('.text-expander');
const findUserLink = () => wrapper.find('.js-user-link');
const findUserAvatarLink = () => wrapper.findComponent(UserAvatarLink);
const findLastCommitLabel = () => wrapper.findByTestId('last-commit-id-label');
const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon);
const findCommitRowDescription = () => wrapper.find('.commit-row-description');
const findStatusBox = () => wrapper.find('.gpg-status-box');
const findItemTitle = () => wrapper.find('.item-title');
const defaultPipelineEdges = [
{
__typename: 'PipelineEdge',
node: {
__typename: 'Pipeline',
id: 'gid://gitlab/Ci::Pipeline/167',
detailedStatus: {
__typename: 'DetailedStatus',
id: 'id',
detailsPath: 'https://test.com/pipeline',
icon: 'failed',
icon: 'status_running',
tooltip: 'failed',
text: 'failed',
group: {},
group: 'failed',
},
},
};
return Object.assign(defaultData, data);
}
},
];
function factory(commit = createCommitData(), loading = false) {
vm = shallowMount(LastCommit, {
mocks: {
$apollo: {
queries: {
commit: {
loading: true,
const defaultAuthor = {
__typename: 'UserCore',
id: 'gid://gitlab/User/1',
name: 'Test',
avatarUrl: 'https://test.com',
webPath: '/test',
};
const defaultMessage = 'Commit title';
const createCommitData = ({
pipelineEdges = defaultPipelineEdges,
author = defaultAuthor,
descriptionHtml = '',
signatureHtml = null,
message = defaultMessage,
}) => {
return {
data: {
project: {
__typename: 'Project',
id: 'gid://gitlab/Project/6',
repository: {
__typename: 'Repository',
paginatedTree: {
__typename: 'TreeConnection',
nodes: [
{
__typename: 'Tree',
lastCommit: {
__typename: 'Commit',
id: 'gid://gitlab/CommitPresenter/123456789',
sha: '123456789',
title: 'Commit title',
titleHtml: 'Commit title',
descriptionHtml,
message,
webPath: '/commit/123',
authoredDate: '2019-01-01',
authorName: 'Test',
authorGravatar: 'https://test.com',
author,
signatureHtml,
pipelines: {
__typename: 'PipelineConnection',
edges: pipelineEdges,
},
},
},
],
},
},
},
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm.setData({ commit });
vm.vm.$apollo.queries.commit.loading = loading;
}
};
};
const emptyMessageClass = 'font-italic';
const createComponent = async (data = {}) => {
Vue.use(VueApollo);
const currentPath = 'path';
mockResolver = jest.fn().mockResolvedValue(createCommitData(data));
wrapper = shallowMountExtended(LastCommit, {
apolloProvider: createMockApollo([[pathLastCommitQuery, mockResolver]]),
propsData: { currentPath },
mixins: [{ data: () => ({ ref: refMock }) }],
});
};
afterEach(() => {
wrapper.destroy();
mockResolver = null;
});
describe('Repository last commit component', () => {
afterEach(() => {
vm.destroy();
});
it.each`
loading | label
${true} | ${'shows'}
${false} | ${'hides'}
`('$label when loading icon $loading is true', async ({ loading }) => {
factory(createCommitData(), loading);
`('$label when loading icon is $loading', async ({ loading }) => {
createComponent();
await nextTick();
if (!loading) {
await waitForPromises();
}
expect(vm.find(GlLoadingIcon).exists()).toBe(loading);
expect(findLoadingIcon().exists()).toBe(loading);
});
it('renders commit widget', async () => {
factory();
createComponent();
await waitForPromises();
await nextTick();
expect(vm.element).toMatchSnapshot();
expect(wrapper.element).toMatchSnapshot();
});
it('renders short commit ID', async () => {
factory();
createComponent();
await waitForPromises();
await nextTick();
expect(vm.find('[data-testid="last-commit-id-label"]').text()).toEqual('12345678');
expect(findLastCommitLabel().text()).toBe('12345678');
});
it('hides pipeline components when pipeline does not exist', async () => {
factory(createCommitData({ pipeline: null }));
createComponent({ pipelineEdges: [] });
await waitForPromises();
await nextTick();
expect(vm.find('.js-commit-pipeline').exists()).toBe(false);
expect(findPipeline().exists()).toBe(false);
});
it('renders pipeline components', async () => {
factory();
it('renders pipeline components when pipeline exists', async () => {
createComponent();
await waitForPromises();
await nextTick();
expect(vm.find('.js-commit-pipeline').exists()).toBe(true);
expect(findPipeline().exists()).toBe(true);
});
it('hides author component when author does not exist', async () => {
factory(createCommitData({ author: null }));
createComponent({ author: null });
await waitForPromises();
await nextTick();
expect(vm.find('.js-user-link').exists()).toBe(false);
expect(vm.find(UserAvatarLink).exists()).toBe(false);
expect(findUserLink().exists()).toBe(false);
expect(findUserAvatarLink().exists()).toBe(false);
});
it('does not render description expander when description is null', async () => {
factory(createCommitData({ descriptionHtml: null }));
createComponent();
await waitForPromises();
await nextTick();
expect(vm.find('.text-expander').exists()).toBe(false);
expect(vm.find('.commit-row-description').exists()).toBe(false);
expect(findTextExpander().exists()).toBe(false);
expect(findCommitRowDescription().exists()).toBe(false);
});
it('expands commit description when clicking expander', async () => {
factory(createCommitData({ descriptionHtml: 'Test description' }));
describe('when the description is present', () => {
beforeEach(async () => {
createComponent({ descriptionHtml: '&#x000A;Update ADOPTERS.md' });
await waitForPromises();
});
await nextTick();
it('strips the first newline of the description', () => {
expect(findCommitRowDescription().html()).toBe(
'<pre class="commit-row-description gl-mb-3">Update ADOPTERS.md</pre>',
);
});
vm.find('.text-expander').vm.$emit('click');
it('expands commit description when clicking expander', async () => {
findTextExpander().vm.$emit('click');
await nextTick();
await nextTick();
expect(vm.find('.commit-row-description').isVisible()).toBe(true);
expect(vm.find('.text-expander').classes('open')).toBe(true);
});
it('strips the first newline of the description', async () => {
factory(createCommitData({ descriptionHtml: '&#x000A;Update ADOPTERS.md' }));
await nextTick();
expect(vm.find('.commit-row-description').html()).toBe(
'<pre class="commit-row-description gl-mb-3">Update ADOPTERS.md</pre>',
);
expect(findCommitRowDescription().isVisible()).toBe(true);
expect(findTextExpander().classes()).toContain('open');
});
});
it('renders the signature HTML as returned by the backend', async () => {
factory(
createCommitData({
signatureHtml: `<a
class="btn gpg-status-box valid"
data-content="signature-content"
data-html="true"
data-placement="top"
data-title="signature-title"
data-toggle="popover"
role="button"
tabindex="0"
>
Verified
</a>`,
}),
);
createComponent({
signatureHtml: `<a
class="btn gpg-status-box valid"
data-content="signature-content"
data-html="true"
data-placement="top"
data-title="signature-title"
data-toggle="popover"
role="button"
tabindex="0"
>Verified</a>`,
});
await waitForPromises();
await nextTick();
expect(vm.find('.gpg-status-box').html()).toBe(
`<a class="btn gpg-status-box valid" data-content="signature-content" data-html="true" data-placement="top" data-title="signature-title" data-toggle="popover" role="button" tabindex="0">
Verified
</a>`,
expect(findStatusBox().html()).toBe(
`<a class="btn gpg-status-box valid" data-content="signature-content" data-html="true" data-placement="top" data-title="signature-title" data-toggle="popover" role="button" tabindex="0">Verified</a>`,
);
});
it('sets correct CSS class if the commit message is empty', async () => {
factory(createCommitData({ message: '' }));
createComponent({ message: '' });
await waitForPromises();
await nextTick();
expect(vm.find('.item-title').classes()).toContain(emptyMessageClass);
expect(findItemTitle().classes()).toContain('font-italic');
});
});

View File

@ -41,6 +41,7 @@ describe('WorkItemDetail component', () => {
const findParent = () => wrapper.find('[data-testid="work-item-parent"]');
const findParentButton = () => findParent().findComponent(GlButton);
const findCloseButton = () => wrapper.find('[data-testid="work-item-close"]');
const findWorkItemType = () => wrapper.find('[data-testid="work-item-type"]');
const createComponent = ({
isModal = false,
@ -169,18 +170,29 @@ describe('WorkItemDetail component', () => {
expect(findParent().exists()).toBe(false);
});
it('shows work item type if there is not a parent', async () => {
createComponent();
await waitForPromises();
expect(findWorkItemType().exists()).toBe(true);
});
describe('with parent', () => {
beforeEach(async () => {
beforeEach(() => {
const parentResponse = workItemResponseFactory(mockParent);
createComponent({ handler: jest.fn().mockResolvedValue(parentResponse) });
await waitForPromises();
return waitForPromises();
});
it('shows secondary breadcrumbs if there is a parent', () => {
expect(findParent().exists()).toBe(true);
});
it('does not show work item type', async () => {
expect(findWorkItemType().exists()).toBe(false);
});
it('sets the parent breadcrumb URL', () => {
expect(findParentButton().attributes().href).toBe('../../issues/5');
});

View File

@ -23,7 +23,7 @@ RSpec.describe Gitlab::Ci::RunnerReleases do
describe 'caching behavior', :use_clean_rails_memory_store_caching do
before do
allow(Gitlab::HTTP).to receive(:try_get).with(runner_releases_url).once { mock_http_response(response) }
allow(Gitlab::HTTP).to receive(:get).with(runner_releases_url, anything).once { mock_http_response(response) }
end
shared_examples 'requests that follow cache status' do |validity_period|
@ -34,7 +34,7 @@ RSpec.describe Gitlab::Ci::RunnerReleases do
releases
travel followup_request_interval do
expect(Gitlab::HTTP).not_to receive(:try_get)
expect(Gitlab::HTTP).not_to receive(:get)
if expected_releases
expected_result_by_minor = expected_releases.group_by(&:without_patch).transform_values(&:max)
@ -54,8 +54,8 @@ RSpec.describe Gitlab::Ci::RunnerReleases do
releases
travel followup_request_interval do
expect(Gitlab::HTTP).to receive(:try_get)
.with(runner_releases_url)
expect(Gitlab::HTTP).to receive(:get)
.with(runner_releases_url, anything)
.once { mock_http_response(followup_response) }
new_releases = (expected_releases || []) + [Gitlab::VersionInfo.new(14, 9, 2)]
@ -69,37 +69,16 @@ RSpec.describe Gitlab::Ci::RunnerReleases do
end
end
context 'when response is not nil' do
let(:response) { [{ 'name' => 'v14.9.1-beta1-ee' }, { 'name' => 'v14.9.0' }] }
let(:expected_releases) do
[
Gitlab::VersionInfo.new(14, 9, 0),
Gitlab::VersionInfo.new(14, 9, 1, '-beta1-ee')
]
end
let(:expected_releases_by_minor) do
{
Gitlab::VersionInfo.new(14, 9, 0) => Gitlab::VersionInfo.new(14, 9, 1, '-beta1-ee')
}
end
it_behaves_like 'requests that follow cache status', 1.day
end
context 'when response is nil' do
let(:response) { nil }
let(:expected_releases) { nil }
let(:expected_releases_by_minor) { nil }
it_behaves_like 'requests that follow cache status', 5.seconds
shared_examples 'a service implementing exponential backoff' do |opts|
it 'performs exponential backoff on requests', :aggregate_failures do
start_time = Time.now.utc.change(usec: 0)
http_call_timestamp_offsets = []
allow(Gitlab::HTTP).to receive(:try_get).with(runner_releases_url) do
allow(Gitlab::HTTP).to receive(:get).with(runner_releases_url, anything) do
http_call_timestamp_offsets << Time.now.utc - start_time
raise Net::OpenTimeout if opts&.dig(:raise_timeout)
mock_http_response(response)
end
@ -124,19 +103,55 @@ RSpec.describe Gitlab::Ci::RunnerReleases do
expect(http_call_timestamp_offsets).to eq([0, 5, 15, 35, 75, 155, 315, 635, 1275, 2555, 5115, 8715])
# Finally a successful HTTP request results in releases being returned
allow(Gitlab::HTTP).to receive(:try_get)
.with(runner_releases_url)
allow(Gitlab::HTTP).to receive(:get)
.with(runner_releases_url, anything)
.once { mock_http_response([{ 'name' => 'v14.9.1-beta1-ee' }]) }
travel 1.hour
expect(releases).not_to be_nil
expect(releases_by_minor).not_to be_nil
end
end
context 'when request results in timeout' do
let(:response) { }
let(:expected_releases) { nil }
let(:expected_releases_by_minor) { nil }
it_behaves_like 'requests that follow cache status', 5.seconds
it_behaves_like 'a service implementing exponential backoff', raise_timeout: true
end
context 'when response is nil' do
let(:response) { nil }
let(:expected_releases) { nil }
let(:expected_releases_by_minor) { nil }
it_behaves_like 'requests that follow cache status', 5.seconds
it_behaves_like 'a service implementing exponential backoff'
end
context 'when response is not nil' do
let(:response) { [{ 'name' => 'v14.9.1-beta1-ee' }, { 'name' => 'v14.9.0' }] }
let(:expected_releases) do
[
Gitlab::VersionInfo.new(14, 9, 0),
Gitlab::VersionInfo.new(14, 9, 1, '-beta1-ee')
]
end
let(:expected_releases_by_minor) do
{
Gitlab::VersionInfo.new(14, 9, 0) => Gitlab::VersionInfo.new(14, 9, 1, '-beta1-ee')
}
end
it_behaves_like 'requests that follow cache status', 1.day
end
end
describe '#releases', :use_clean_rails_memory_store_caching do
before do
allow(Gitlab::HTTP).to receive(:try_get).with(runner_releases_url).once { mock_http_response(response) }
allow(Gitlab::HTTP).to receive(:get).with(runner_releases_url, anything).once { mock_http_response(response) }
end
context 'when response is nil' do
@ -177,7 +192,7 @@ RSpec.describe Gitlab::Ci::RunnerReleases do
describe '#releases_by_minor', :use_clean_rails_memory_store_caching do
before do
allow(Gitlab::HTTP).to receive(:try_get).with(runner_releases_url).once { mock_http_response(response) }
allow(Gitlab::HTTP).to receive(:get).with(runner_releases_url, anything).once { mock_http_response(response) }
end
context 'when response is nil' do

View File

@ -11,6 +11,12 @@ RSpec.describe Gitlab::Issuable::Clone::AttributesRewriter do
let(:new_attributes) { described_class.new(user, original_issue, project2).execute }
context 'with missing target parent' do
it 'raises an ArgumentError' do
expect { described_class.new(user, original_issue, nil) }.to raise_error ArgumentError
end
end
context 'setting labels' do
it 'sets labels present in the new project and group labels' do
project1_label_1 = create(:label, title: 'label1', project: project1)

View File

@ -15,7 +15,7 @@ RSpec.describe ::Gitlab::Security::ScanConfiguration do
let(:configured) { true }
context 'with a core scanner' do
where(type: %i(sast sast_iac secret_detection))
where(type: %i(sast sast_iac secret_detection container_scanning))
with_them do
it { is_expected.to be_truthy }

View File

@ -9,8 +9,11 @@ RSpec.describe WorkItems::ParentLink do
end
describe 'validations' do
subject { build(:parent_link) }
it { is_expected.to validate_presence_of(:work_item) }
it { is_expected.to validate_presence_of(:work_item_parent) }
it { is_expected.to validate_uniqueness_of(:work_item) }
describe 'hierarchy' do
let_it_be(:project) { create(:project) }