Skip to content
Snippets Groups Projects
Commit a570beca authored by John Jarvis's avatar John Jarvis
Browse files

Merge branch '11-9-stable-patch-5' into '11-9-stable'

Prepare 11.9.5 release

See merge request gitlab-org/gitlab-ce!26866
parents 47339506 9a969fe4
No related branches found
No related tags found
No related merge requests found
Showing
with 64 additions and 46 deletions
Loading
Loading
@@ -315,7 +315,7 @@ cloud-native-image:
variables:
GIT_DEPTH: "1"
cache: {}
when: always
when: manual
script:
- gem install gitlab --no-document
- CNG_PROJECT_PATH="gitlab-org/build/CNG" BUILD_TRIGGER_TOKEN=$CI_JOB_TOKEN ./scripts/trigger-build cng
Loading
Loading
Loading
Loading
@@ -128,9 +128,6 @@ export default {
isModeChanged() {
return this.diffFile.viewer.name === diffViewerModes.mode_changed;
},
showExpandDiffToFullFileEnabled() {
return gon.features.expandDiffFullFile && !this.diffFile.is_fully_expanded;
},
},
mounted() {
polyfillSticky(this.$refs.header);
Loading
Loading
@@ -258,7 +255,7 @@ export default {
<icon name="external-link" />
</gl-button>
<gl-button
v-if="showExpandDiffToFullFileEnabled"
v-if="!diffFile.is_fully_expanded"
class="expand-file js-expand-file"
@click="toggleFullDiff(diffFile.file_path)"
>
Loading
Loading
Loading
Loading
@@ -16,11 +16,6 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
before_action :authenticate_user!, only: [:assign_related_issues]
before_action :check_user_can_push_to_source_branch!, only: [:rebase]
 
before_action only: [:show] do
push_frontend_feature_flag(:diff_tree_filtering, default_enabled: true)
push_frontend_feature_flag(:expand_diff_full_file)
end
def index
@merge_requests = @issuables
 
Loading
Loading
Loading
Loading
@@ -57,7 +57,7 @@ class DiffFileEntity < DiffFileBaseEntity
diff_file.diff_lines_for_serializer
end
 
expose :is_fully_expanded, if: -> (diff_file, _) { Feature.enabled?(:expand_diff_full_file, default_enabled: true) && diff_file.text? } do |diff_file|
expose :is_fully_expanded, if: -> (diff_file, _) { diff_file.text? } do |diff_file|
diff_file.fully_expanded?
end
 
Loading
Loading
Loading
Loading
@@ -9,7 +9,7 @@ module Projects
end
 
def execute
Projects::HousekeepingService.new(@project).execute do
Projects::HousekeepingService.new(@project, :gc).execute do
repository.delete_all_refs_except(RESERVED_REF_PREFIXES)
end
rescue Projects::HousekeepingService::LeaseTaken => e
Loading
Loading
Loading
Loading
@@ -18,8 +18,9 @@ module Projects
end
end
 
def initialize(project)
def initialize(project, task = nil)
@project = project
@task = task
end
 
def execute
Loading
Loading
@@ -69,6 +70,8 @@ module Projects
end
 
def task
return @task if @task
if pushes_since_gc % gc_period == 0
:gc
elsif pushes_since_gc % full_repack_period == 0
Loading
Loading
---
title: Force to recreate all MR diffs on import
merge_request: 26480
author:
type: fixed
---
title: Fix API /project/:id/branches not returning correct merge status
merge_request: 26785
author:
type: fixed
---
title: Avoid excessive recursive calls with Rugged TreeEntries
merge_request: 26813
author:
type: fixed
---
title: Force a full GC after importing a project
merge_request: 26803
author:
type: performance
Loading
Loading
@@ -523,7 +523,7 @@ Parameters:
| `username` | string | yes | The username of the user created to be used with GitLab/JIRA. |
| `password` | string | yes | The password of the user created to be used with GitLab/JIRA. |
| `active` | boolean | no | Activates or deactivates the service. Defaults to false (deactivated). |
| `jira_issue_transition_id` | integer | no | The ID of a transition that moves issues to a closed state. You can find this number under the JIRA workflow administration (**Administration > Issues > Workflows**) by selecting **View** under **Operations** of the desired workflow of your project. The ID of each state can be found inside the parenthesis of each transition name under the **Transitions (id)** column ([see screenshot][trans]). By default, this ID is set to `2`. |
| `jira_issue_transition_id` | string | no | The ID of a transition that moves issues to a closed state. You can find this number under the JIRA workflow administration (**Administration > Issues > Workflows**) by selecting **View** under **Operations** of the desired workflow of your project. The ID of each state can be found inside the parenthesis of each transition name under the **Transitions (id)** column ([see screenshot][trans]). By default, this ID is set to `2`. |
 
### Delete JIRA service
 
Loading
Loading
Loading
Loading
@@ -34,11 +34,11 @@ module API
repository = user_project.repository
 
branches = BranchesFinder.new(repository, declared_params(include_missing: false)).execute
branches = ::Kaminari.paginate_array(branches)
branches = paginate(::Kaminari.paginate_array(branches))
merged_branch_names = repository.merged_branch_names(branches.map(&:name))
 
present(
paginate(branches),
branches,
with: Entities::Branch,
current_user: current_user,
project: user_project,
Loading
Loading
Loading
Loading
@@ -15,12 +15,23 @@ module Gitlab
override :tree_entries
def tree_entries(repository, sha, path, recursive)
if Feature.enabled?(:rugged_tree_entries)
tree_entries_from_rugged(repository, sha, path, recursive)
tree_entries_with_flat_path_from_rugged(repository, sha, path, recursive)
else
super
end
end
 
def tree_entries_with_flat_path_from_rugged(repository, sha, path, recursive)
tree_entries_from_rugged(repository, sha, path, recursive).tap do |entries|
# This was an optimization to reduce N+1 queries for Gitaly
# (https://gitlab.com/gitlab-org/gitaly/issues/530). It
# used to be done lazily in the view via
# TreeHelper#flatten_tree, so it's possible there's a
# performance impact by loading this eagerly.
rugged_populate_flat_path(repository, sha, path, entries)
end
end
def tree_entries_from_rugged(repository, sha, path, recursive)
current_path_entries = get_tree_entries_from_rugged(repository, sha, path)
ordered_entries = []
Loading
Loading
@@ -32,13 +43,6 @@ module Gitlab
ordered_entries.concat(tree_entries_from_rugged(repository, sha, entry.path, true))
end
end
# This was an optimization to reduce N+1 queries for Gitaly
# (https://gitlab.com/gitlab-org/gitaly/issues/530). It
# used to be done lazily in the view via
# TreeHelper#flatten_tree, so it's possible there's a
# performance impact by loading this eagerly.
rugged_populate_flat_path(repository, sha, path, ordered_entries)
end
 
def rugged_populate_flat_path(repository, sha, path, entries)
Loading
Loading
Loading
Loading
@@ -38,7 +38,6 @@ module Gitlab
end
# rubocop: enable CodeReuse/ActiveRecord
 
# rubocop: disable CodeReuse/ActiveRecord
def insert_or_replace_git_data(merge_request, source_branch_sha, target_branch_sha, already_exists = false)
# These fields are set so we can create the correct merge request
# diffs.
Loading
Loading
@@ -47,24 +46,21 @@ module Gitlab
 
merge_request.keep_around_commit
 
# We force to recreate all diffs to replace all existing data
# We use `.all` as otherwise `dependent: :nullify` (the default)
# takes an effect
merge_request.merge_request_diffs.all.delete_all if already_exists
# MR diffs normally use an "after_save" hook to pull data from Git.
# All of this happens in the transaction started by calling
# create/save/etc. This in turn can lead to these transactions being
# held open for much longer than necessary. To work around this we
# first save the diff, then populate it.
diff =
if already_exists
merge_request.merge_request_diffs.take ||
merge_request.merge_request_diffs.build
else
merge_request.merge_request_diffs.build
end
diff = merge_request.merge_request_diffs.build
diff.importing = true
diff.save
diff.save_git_content
end
# rubocop: enable CodeReuse/ActiveRecord
end
end
end
Loading
Loading
@@ -29,7 +29,10 @@ namespace :gitlab do
# If MySQL, turn off foreign key checks
connection.execute('SET FOREIGN_KEY_CHECKS=0') if Gitlab::Database.mysql?
 
tables = connection.data_sources
# connection.tables is deprecated in MySQLAdapter, but in PostgreSQLAdapter
# data_sources returns both views and tables, so use #tables instead
tables = Gitlab::Database.mysql? ? connection.data_sources : connection.tables
# Removes the entry from the array
tables.delete 'schema_migrations'
# Truncate schema_migrations to ensure migrations re-run
Loading
Loading
Loading
Loading
@@ -14,7 +14,7 @@ module QA
 
def personal_access_token
@personal_access_token ||= begin
# you can set the environment variable PERSONAL_ACCESS_TOKEN
# you can set the environment variable GITLAB_QA_ACCESS_TOKEN
# to use a specific access token rather than create one from the UI
Runtime::Env.personal_access_token ||= create_personal_access_token
end
Loading
Loading
Loading
Loading
@@ -53,7 +53,7 @@ module QA
 
# specifies token that can be used for the api
def personal_access_token
@personal_access_token ||= ENV['PERSONAL_ACCESS_TOKEN']
@personal_access_token ||= ENV['GITLAB_QA_ACCESS_TOKEN']
end
 
def remote_grid
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
require_relative '../../qa'
 
# This script deletes all subgroups of a group specified by ENV['GROUP_NAME_OR_PATH']
# Required environment variables: PERSONAL_ACCESS_TOKEN and GITLAB_ADDRESS
# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS
# Optional environment variable: GROUP_NAME_OR_PATH (defaults to 'gitlab-qa-sandbox-group')
# Run `rake delete_subgroups`
 
Loading
Loading
@@ -14,9 +14,9 @@ module QA
 
def initialize
raise ArgumentError, "Please provide GITLAB_ADDRESS" unless ENV['GITLAB_ADDRESS']
raise ArgumentError, "Please provide PERSONAL_ACCESS_TOKEN" unless ENV['PERSONAL_ACCESS_TOKEN']
raise ArgumentError, "Please provide GITLAB_QA_ACCESS_TOKEN" unless ENV['GITLAB_QA_ACCESS_TOKEN']
 
@api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['PERSONAL_ACCESS_TOKEN'])
@api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['GITLAB_QA_ACCESS_TOKEN'])
end
 
def run
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ require 'securerandom'
require 'faker'
require_relative '../../qa'
# This script generates testdata for Performance Testing.
# Required environment variables: PERSONAL_ACCESS_TOKEN and GITLAB_ADDRESS
# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS
# This job creates a urls.txt which contains a hash of all the URLs needed for Performance Testing
# Run `rake generate_perf_testdata`
 
Loading
Loading
@@ -15,9 +15,9 @@ module QA
 
def initialize
raise ArgumentError, "Please provide GITLAB_ADDRESS" unless ENV['GITLAB_ADDRESS']
raise ArgumentError, "Please provide PERSONAL_ACCESS_TOKEN" unless ENV['PERSONAL_ACCESS_TOKEN']
raise ArgumentError, "Please provide GITLAB_QA_ACCESS_TOKEN" unless ENV['GITLAB_QA_ACCESS_TOKEN']
 
@api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['PERSONAL_ACCESS_TOKEN'])
@api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'], personal_access_token: ENV['GITLAB_QA_ACCESS_TOKEN'])
@group_name = "gitlab-qa-perf-sandbox-#{SecureRandom.hex(8)}"
@project_name = "my-test-project-#{SecureRandom.hex(8)}"
@urls = {}
Loading
Loading
Loading
Loading
@@ -90,13 +90,13 @@ describe QA::Runtime::Env do
described_class.instance_variable_set(:@personal_access_token, nil)
end
 
context 'when PERSONAL_ACCESS_TOKEN is set' do
context 'when GITLAB_QA_ACCESS_TOKEN is set' do
before do
stub_env('PERSONAL_ACCESS_TOKEN', 'a_token')
stub_env('GITLAB_QA_ACCESS_TOKEN', 'a_token_too')
end
 
it 'returns specified token from env' do
expect(described_class.personal_access_token).to eq 'a_token'
expect(described_class.personal_access_token).to eq 'a_token_too'
end
end
 
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