Skip to content
Snippets Groups Projects
Commit f78257cb authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent f500600a
No related branches found
No related tags found
No related merge requests found
Showing
with 180 additions and 22 deletions
Loading
Loading
@@ -4,7 +4,6 @@ entry.
 
## 12.8.4
 
- No changes.
### Fixed (8 changes)
 
- Fix Group Import API file upload when object storage is disabled. !25715
Loading
Loading
Loading
Loading
@@ -398,7 +398,7 @@ export default {
}"
>
<commit-widget v-if="commit" :commit="commit" />
<div v-if="isBatchLoading" class="loading"><gl-loading-icon /></div>
<div v-if="isBatchLoading" class="loading"><gl-loading-icon size="lg" /></div>
<template v-else-if="renderDiffFiles">
<diff-file
v-for="file in diffFiles"
Loading
Loading
Loading
Loading
@@ -89,6 +89,10 @@ module Ci
end
end
 
def parent_pipeline
pipeline if triggers_child_pipeline?
end
def triggers_child_pipeline?
yaml_for_downstream.present?
end
Loading
Loading
Loading
Loading
@@ -787,6 +787,10 @@ module Ci
.fabricate!
end
 
def find_job_with_archive_artifacts(name)
builds.latest.with_artifacts_archive.find_by_name(name)
end
def latest_builds_with_artifacts
# We purposely cast the builds to an Array here. Because we always use the
# rows if there are more than 0 this prevents us from having to run two
Loading
Loading
Loading
Loading
@@ -197,6 +197,8 @@ class Snippet < ApplicationRecord
end
 
def blobs
return [] unless repository_exists?
repository.ls_files(repository.root_ref).map { |file| Blob.lazy(self, repository.root_ref, file) }
end
 
Loading
Loading
Loading
Loading
@@ -4,6 +4,7 @@ module Projects
class UpdateRepositoryStorageService < BaseService
include Gitlab::ShellAdapter
 
Error = Class.new(StandardError)
RepositoryAlreadyMoved = Class.new(StandardError)
 
def initialize(project)
Loading
Loading
@@ -17,37 +18,45 @@ module Projects
# exception.
raise RepositoryAlreadyMoved if project.repository_storage == new_repository_storage_key
 
if mirror_repositories(new_repository_storage_key)
mark_old_paths_for_archive
mirror_repositories(new_repository_storage_key)
 
project.update(repository_storage: new_repository_storage_key, repository_read_only: false)
project.leave_pool_repository
project.track_project_repository
mark_old_paths_for_archive
 
enqueue_housekeeping
else
project.update(repository_read_only: false)
end
project.update(repository_storage: new_repository_storage_key, repository_read_only: false)
project.leave_pool_repository
project.track_project_repository
enqueue_housekeeping
success
rescue Error => e
project.update(repository_read_only: false)
Gitlab::ErrorTracking.track_exception(e, project_path: project.full_path)
error(s_("UpdateRepositoryStorage|Error moving repository storage for %{project_full_path} - %{message}") % { project_full_path: project.full_path, message: e.message })
end
 
private
 
def mirror_repositories(new_repository_storage_key)
result = mirror_repository(new_repository_storage_key)
mirror_repository(new_repository_storage_key)
 
if project.wiki.repository_exists?
result &&= mirror_repository(new_repository_storage_key, type: Gitlab::GlRepository::WIKI)
mirror_repository(new_repository_storage_key, type: Gitlab::GlRepository::WIKI)
end
result
end
 
def mirror_repository(new_storage_key, type: Gitlab::GlRepository::PROJECT)
return false unless wait_for_pushes(type)
unless wait_for_pushes(type)
raise Error, s_('UpdateRepositoryStorage|Timeout waiting for %{type} repository pushes') % { type: type.name }
end
 
repository = type.repository_for(project)
full_path = repository.full_path
raw_repository = repository.raw
checksum = repository.checksum
 
# Initialize a git repository on the target path
gitlab_shell.create_repository(new_storage_key, raw_repository.relative_path, full_path)
Loading
Loading
@@ -56,7 +65,15 @@ module Projects
raw_repository.gl_repository,
full_path)
 
new_repository.fetch_repository_as_mirror(raw_repository)
unless new_repository.fetch_repository_as_mirror(raw_repository)
raise Error, s_('UpdateRepositoryStorage|Failed to fetch %{type} repository as mirror') % { type: type.name }
end
new_checksum = new_repository.checksum
if checksum != new_checksum
raise Error, s_('UpdateRepositoryStorage|Failed to verify %{type} repository checksum from %{old} to %{new}') % { type: type.name, old: checksum, new: new_checksum }
end
end
 
def mark_old_paths_for_archive
Loading
Loading
Loading
Loading
@@ -77,6 +77,11 @@ class PostReceive # rubocop:disable Scalability/IdempotentWorker
 
return false unless user
 
# We can remove once we implement multi-file snippets
# https://gitlab.com/gitlab-org/gitlab/-/issues/39269
blob = snippet.blobs.first
snippet.update(file_name: blob.path, content: blob.data) if blob
# At the moment, we only expires the repository caches.
# In the future we might need to call ProjectCacheWorker
# (or the custom class we create) to update the snippet
Loading
Loading
---
title: Prevent editing weight to scroll to the top.
merge_request: 26613
author: Gilang Gumilar
type: fixed
---
title: Add vars to allow air-gapped usage of Retire.js (Dependency Scanning)
merge_request: 26463
author:
type: added
---
title: 'Create child pipelines dynamically using content from artifact as CI configuration'
merge_request: 23790
author:
type: fixed
---
title: Allow selecting all queues with sidekiq-cluster
merge_request: 26594
author:
type: added
---
title: Allow to disable inheritance of default job settings
merge_request: 25690
author:
type: added
---
title: Sync snippet after Git action
merge_request: 26565
author:
type: changed
---
title: Remove kubernetes workaround in container scanning
merge_request: 21188
author:
type: changed
---
title: Ensure checksums match when updating repository storage
merge_request: 26334
author:
type: changed
Loading
Loading
@@ -50,4 +50,14 @@ Rails.application.configure do
 
# BetterErrors live shell (REPL) on every stack frame
BetterErrors::Middleware.allow_ip!("127.0.0.1/0")
# Reassign some performance related settings when we profile the app
if Gitlab::Utils.to_boolean(ENV['RAILS_PROFILE'].to_s)
warn "Hot-reloading is disabled as you are running with RAILS_PROFILE enabled"
config.cache_classes = true
config.eager_load = true
config.active_record.migration_error = false
config.active_record.verbose_query_logs = false
config.action_view.cache_template_loading = true
end
end
Loading
Loading
@@ -17,7 +17,7 @@ members to the group in order to give them maintainer access to the project.
 
This project will be used for self monitoring your GitLab instance.
 
## Activating the self monitoring project
## Creating the self monitoring project
 
1. Navigate to **Admin Area > Settings > Metrics and profiling**, and expand the **Self monitoring** section.
1. Toggle the **Create Project** button on.
Loading
Loading
@@ -26,10 +26,11 @@ created, GitLab displays a message with a link to the project. The project
will also be linked in the help text above the **Create Project** button. You can also
find the project under **Projects > Your projects**.
 
## Deactivating the self monitoring project
## Deleting the self monitoring project
 
CAUTION: **Warning:**
If you deactivate the self monitoring project, it will be permanently deleted.
If you delete the self monitoring project, you will lose any changes made to the
project. If you create the project again, it will be created in its default state.
 
1. Navigate to **Admin Area > Settings > Metrics and profiling**, and expand the **Self monitoring** section.
1. Toggle the **Create Project** button off.
Loading
Loading
Loading
Loading
@@ -53,6 +53,20 @@ To start extra Sidekiq processes, you must enable `sidekiq-cluster`:
]
```
 
[In GitLab 12.9](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26594) and
later, the special queue name `*` means all queues. This starts two
processes, each handling all queues:
```ruby
sidekiq_cluster['queue_groups'] = [
"*",
"*"
]
```
`*` cannot be combined with concrete queue names - `*, mailers` will
just handle the `mailers` queue.
1. Save the file and reconfigure GitLab for the changes to take effect:
 
```shell
Loading
Loading
@@ -154,6 +168,10 @@ from highest to lowest precedence:
The operator precedence for this syntax is fixed: it's not possible to make AND
have higher precedence than OR.
 
[In GitLab 12.9](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26594) and
later, as with the standard queue group syntax above, a single `*` as the
entire queue group selects all queues.
### Example queries
 
In `/etc/gitlab/gitlab.rb`:
Loading
Loading
@@ -163,9 +181,11 @@ sidekiq_cluster['enable'] = true
sidekiq_cluster['experimental_queue_selector'] = true
sidekiq_cluster['queue_groups'] = [
# Run all non-CPU-bound queues that are high urgency
'resource_boundary!=cpu&urgency=high,
'resource_boundary!=cpu&urgency=high',
# Run all continuous integration and pages queues that are not high urgency
'feature_category=continuous_integration,pages&urgency!=high
'feature_category=continuous_integration,pages&urgency!=high',
# Run all queues
'*'
]
```
 
Loading
Loading
Loading
Loading
@@ -18,6 +18,26 @@ troubleshooting steps that will help you diagnose the bottleneck.
> may be using all available CPU, or have a Ruby Global Interpreter Lock,
> preventing other threads from continuing.
 
## Log arguments to Sidekiq jobs
If you want to see what arguments are being passed to Sidekiq jobs you can set
the `SIDEKIQ_LOG_ARGUMENTS` [environment variable](https://docs.gitlab.com/omnibus/settings/environment-variables.html) to `1` (true).
Example:
```
gitlab_rails['env'] = {"SIDEKIQ_LOG_ARGUMENTS" => "1"}
```
Please note: It is not recommend to enable this setting in production because some
Sidekiq jobs (such as sending a password reset email) take secret arguments (for
example the password reset token).
When using [Sidekiq JSON logging](../logs.md#sidekiqlog),
arguments logs are limited to a maximum size of 10 kilobytes of text;
any arguments after this limit will be discarded and replaced with a
single argument containing the string `"..."`.
## Thread dump
 
Send the Sidekiq process ID the `TTIN` signal and it will output thread
Loading
Loading
Loading
Loading
@@ -158,6 +158,42 @@ rspec 2.6:
script: bundle exec rspec
```
 
### `inherit`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/207484) in GitLab 12.9.
You can disable inheritance of globally defined defaults
and variables with the `inherit:` parameter.
In the example below:
- `rubocop` **will** inherit both the `before_script` and the variable `DOMAIN`.
- `rspec` **will not** inherit the `before_script` or the variable `DOMAIN`.
- `capybara` **will** inherit the `before_script`, but **will not** inherit the variable `DOMAIN`.
```yaml
default:
before_script:
- echo Hello World
variables:
DOMAIN: example.com
rubocop:
script: bundle exec rubocop
rspec:
inherit:
default: false
variables: false
script: bundle exec rspec
capybara:
inherit:
variables: false
script: bundle exec capybara
```
## Parameter details
 
The following are detailed explanations for parameters used to configure CI/CD pipelines.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment