Skip to content

Commit 557b3c4

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent f09198c commit 557b3c4

File tree

24 files changed

+119
-203
lines changed

24 files changed

+119
-203
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Instructions on how to start GitLab and how to run the tests can be found in the
8282
GitLab is a Ruby on Rails application that runs on the following software:
8383

8484
- Ubuntu/Debian/CentOS/RHEL/OpenSUSE
85-
- Ruby (MRI) 2.7.5
85+
- Ruby (MRI) 2.7.7
8686
- Git 2.33+
8787
- Redis 5.0+
8888
- PostgreSQL 12+

app/assets/javascripts/diffs/components/tree_list.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { GlTooltipDirective, GlIcon } from '@gitlab/ui';
33
import { mapActions, mapGetters, mapState } from 'vuex';
44
import micromatch from 'micromatch';
5+
import { MODIFIER_KEY } from '~/constants';
56
import { s__, sprintf } from '~/locale';
67
import FileTree from '~/vue_shared/components/file_tree.vue';
78
import DiffFileRow from './diff_file_row.vue';
@@ -65,8 +66,8 @@ export default {
6566
this.search = '';
6667
},
6768
},
68-
searchPlaceholder: sprintf(s__('MergeRequest|Search (e.g. *.vue) (%{modifier_key}P)'), {
69-
modifier_key: /Mac/i.test(navigator.userAgent) ? '' : 'Ctrl+',
69+
searchPlaceholder: sprintf(s__('MergeRequest|Search (e.g. *.vue) (%{MODIFIER_KEY}P)'), {
70+
MODIFIER_KEY,
7071
}),
7172
DiffFileRow,
7273
};

app/assets/javascripts/pages/projects/compare/show/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ import Diff from '~/diff';
22
import GpgBadges from '~/gpg_badges';
33
import { initDiffStatsDropdown } from '~/init_diff_stats_dropdown';
44
import initCompareSelector from '~/projects/compare';
5+
import syntaxHighlight from '~/syntax_highlight';
56

67
initCompareSelector();
78

89
new Diff(); // eslint-disable-line no-new
910
const paddingTop = 16;
1011
initDiffStatsDropdown(document.querySelector('.navbar-gitlab').offsetHeight - paddingTop);
1112
GpgBadges.fetch();
13+
14+
syntaxHighlight([document.querySelector('.files')]);

app/models/commit_collection.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def each(&block)
2525
end
2626

2727
def committers
28-
emails = without_merge_commits.map(&:committer_email).uniq
28+
emails = without_merge_commits.filter_map(&:committer_email).uniq
2929

3030
User.by_any_email(emails)
3131
end

app/models/integrations/flowdock.rb

-20
This file was deleted.

app/models/merge_request.rb

+6
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@ def self.available_state_names
193193
merge_request.merge_error = nil
194194
end
195195

196+
before_transition any => :merged do |merge_request|
197+
if ::Feature.enabled?(:reset_merge_error_on_transition, merge_request.project)
198+
merge_request.merge_error = nil
199+
end
200+
end
201+
196202
after_transition any => :opened do |merge_request|
197203
merge_request.run_after_commit do
198204
UpdateHeadPipelineForMergeRequestWorker.perform_async(merge_request.id)
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
name: ci_refactoring_external_mapper
3-
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106408
4-
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/385179
5-
milestone: '15.7'
2+
name: reset_merge_error_on_transition
3+
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106942
4+
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/385859
5+
milestone: '15.8'
66
type: development
7-
group: group::pipeline authoring
7+
group: group::code review
88
default_enabled: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
# Warning: gitlab.GitLabFlavoredMarkdown
3+
#
4+
# Checks for unclear use of GLFM or GLM instead of GitLab/GitHub Flavored Markdown
5+
#
6+
# For a list of all options, see https://vale.sh/docs/topics/styles/
7+
extends: substitution
8+
message: "Use '%s' instead of '%s' when possible."
9+
link: https://docs.gitlab.com/ee/development/documentation/styleguide/word_list.html
10+
level: warning
11+
ignorecase: true
12+
swap:
13+
GLFM: "GitLab Flavored Markdown"
14+
GFM: "GitLab Flavored Markdown' or 'GitHub Flavored Markdown"

doc/.vale/gitlab/SubstitutionWarning.yml

-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ swap:
2626
ex: "for example"
2727
file name: "filename"
2828
filesystem: "file system"
29-
GLFM: "GitLab Flavored Markdown"
30-
GFM: "GitLab Flavored Markdown' or 'GitHub Flavored Markdown"
3129
info: "information"
3230
it is recommended: "you should"
3331
n/a: "not applicable"

doc/api/merge_requests.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ Supported attributes:
652652
| `latest_build_finished_at` | datetime | Timestamp of when the latest build for the merge request finished. |
653653
| `latest_build_started_at` | datetime | Timestamp of when the latest build for the merge request started. |
654654
| `merge_commit_sha` | string | SHA of the merge request commit. Returns `null` until merged. |
655-
| `merge_error` | string | Error message due to a merge error. |
655+
| `merge_error` | string | Error message shown when a merge has failed. To check mergeability, use `detailed_merge_status` instead |
656656
| `merge_user` | object | The user who merged this merge request, the user who set it to merge when pipeline succeeds, or `null`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/349031) in GitLab 14.7. |
657657
| `merge_status` | string | Status of the merge request. Can be `unchecked`, `checking`, `can_be_merged`, `cannot_be_merged`, or `cannot_be_merged_recheck`. Affects the `has_conflicts` property. For important notes on response data, read [Single merge request response notes](#single-merge-request-response-notes). [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/3169#note_1162532204) in GitLab 15.6. Use `detailed_merge_status` instead. |
658658
| `merge_when_pipeline_succeeds` | boolean | Indicates if the merge has been set to be merged when its pipeline succeeds. |

doc/ci/runners/configure_runners.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -637,13 +637,12 @@ test:
637637
- pwd
638638
```
639639

640-
The `GIT_CLONE_PATH` has to always be within `$CI_BUILDS_DIR`. The directory set in `$CI_BUILDS_DIR`
640+
The `GIT_CLONE_PATH` must always be within `$CI_BUILDS_DIR`. The directory set in `$CI_BUILDS_DIR`
641641
is dependent on executor and configuration of [runners.builds_dir](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runners-section)
642642
setting.
643643

644644
This can only be used when `custom_build_dir` is enabled in the
645645
[runner's configuration](https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnerscustom_build_dir-section).
646-
This is the default configuration for the `docker` and `kubernetes` executors.
647646

648647
#### Handling concurrency
649648

doc/development/gitlab_flavored_markdown/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ group: Editor
44
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
55
---
66

7+
<!-- vale gitlab.GitLabFlavoredMarkdown = NO -->
8+
79
# GitLab Flavored Markdown (GLFM) developer documentation **(FREE)**
810

911
This page contains the MVC for the developer documentation for GitLab Flavored Markdown (GLFM).

doc/development/gitlab_flavored_markdown/specification_guide/index.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ group: Editor
44
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
55
---
66

7+
<!-- vale gitlab.GitLabFlavoredMarkdown = NO -->
8+
79
# GitLab Flavored Markdown (GLFM) Specification Guide **(FREE)**
810

911
## Summary

lib/gitlab/ci/config/external/file/base.rb

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ def to_hash
4747
end
4848

4949
def validate!
50-
context.check_execution_time! if ::Feature.disabled?(:ci_refactoring_external_mapper, context.project)
5150
validate_location!
5251
validate_context! if valid?
5352
fetch_and_validate_content! if valid?

lib/gitlab/ci/config/external/mapper.rb

+1-149
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ module External
77
class Mapper
88
include Gitlab::Utils::StrongMemoize
99

10-
# Will be removed with FF ci_refactoring_external_mapper
11-
FILE_CLASSES = [
12-
External::File::Local,
13-
External::File::Project,
14-
External::File::Remote,
15-
External::File::Template,
16-
External::File::Artifact
17-
].freeze
18-
19-
# Will be removed with FF ci_refactoring_external_mapper
20-
FILE_SUBKEYS = FILE_CLASSES.map { |f| f.name.demodulize.downcase }.freeze
21-
2210
Error = Class.new(StandardError)
2311
AmbigiousSpecificationError = Class.new(Error)
2412
TooManyIncludesError = Class.new(Error)
@@ -32,11 +20,7 @@ def process
3220
return [] if @locations.empty?
3321

3422
context.logger.instrument(:config_mapper_process) do
35-
if ::Feature.enabled?(:ci_refactoring_external_mapper, context.project)
36-
process_without_instrumentation
37-
else
38-
legacy_process_without_instrumentation
39-
end
23+
process_without_instrumentation
4024
end
4125
end
4226

@@ -57,138 +41,6 @@ def process_without_instrumentation
5741

5842
files
5943
end
60-
61-
# This and the following methods will be removed with FF ci_refactoring_external_mapper
62-
def legacy_process_without_instrumentation
63-
@locations
64-
.map(&method(:normalize_location))
65-
.filter_map(&method(:verify_rules))
66-
.flat_map(&method(:expand_project_files))
67-
.flat_map(&method(:expand_wildcard_paths))
68-
.map(&method(:expand_variables))
69-
.map(&method(:select_first_matching))
70-
.each(&method(:verify!))
71-
end
72-
73-
# convert location if String to canonical form
74-
def normalize_location(location)
75-
if location.is_a?(String)
76-
expanded_location = expand_variables(location)
77-
normalize_location_string(expanded_location)
78-
else
79-
location.deep_symbolize_keys
80-
end
81-
end
82-
83-
def verify_rules(location)
84-
logger.instrument(:config_mapper_rules) do
85-
verify_rules_without_instrumentation(location)
86-
end
87-
end
88-
89-
def verify_rules_without_instrumentation(location)
90-
return unless Rules.new(location[:rules]).evaluate(context).pass?
91-
92-
location
93-
end
94-
95-
def expand_project_files(location)
96-
return location unless location[:project]
97-
98-
Array.wrap(location[:file]).map do |file|
99-
location.merge(file: file)
100-
end
101-
end
102-
103-
def expand_wildcard_paths(location)
104-
logger.instrument(:config_mapper_wildcards) do
105-
expand_wildcard_paths_without_instrumentation(location)
106-
end
107-
end
108-
109-
def expand_wildcard_paths_without_instrumentation(location)
110-
# We only support local files for wildcard paths
111-
return location unless location[:local] && location[:local].include?('*')
112-
113-
context.project.repository.search_files_by_wildcard_path(location[:local], context.sha).map do |path|
114-
{ local: path }
115-
end
116-
end
117-
118-
def normalize_location_string(location)
119-
if ::Gitlab::UrlSanitizer.valid?(location)
120-
{ remote: location }
121-
else
122-
{ local: location }
123-
end
124-
end
125-
126-
def select_first_matching(location)
127-
logger.instrument(:config_mapper_select) do
128-
select_first_matching_without_instrumentation(location)
129-
end
130-
end
131-
132-
def select_first_matching_without_instrumentation(location)
133-
matching = FILE_CLASSES.map do |file_class|
134-
file_class.new(location, context)
135-
end.select(&:matching?)
136-
137-
if matching.one?
138-
matching.first
139-
elsif matching.empty?
140-
raise AmbigiousSpecificationError, "`#{masked_location(location.to_json)}` does not have a valid subkey for include. Valid subkeys are: `#{FILE_SUBKEYS.join('`, `')}`"
141-
else
142-
raise AmbigiousSpecificationError, "Each include must use only one of: `#{FILE_SUBKEYS.join('`, `')}`"
143-
end
144-
end
145-
146-
def verify!(location_object)
147-
verify_max_includes!
148-
location_object.validate!
149-
expandset.add(location_object)
150-
end
151-
152-
def verify_max_includes!
153-
if expandset.count >= context.max_includes
154-
raise TooManyIncludesError, "Maximum of #{context.max_includes} nested includes are allowed!"
155-
end
156-
end
157-
158-
def expand_variables(data)
159-
logger.instrument(:config_mapper_variables) do
160-
expand_variables_without_instrumentation(data)
161-
end
162-
end
163-
164-
def expand_variables_without_instrumentation(data)
165-
if data.is_a?(String)
166-
expand(data)
167-
else
168-
transform(data)
169-
end
170-
end
171-
172-
def transform(data)
173-
data.transform_values do |values|
174-
case values
175-
when Array
176-
values.map { |value| expand(value.to_s) }
177-
when String
178-
expand(values)
179-
else
180-
values
181-
end
182-
end
183-
end
184-
185-
def expand(data)
186-
ExpandVariables.expand(data, -> { context.variables_hash })
187-
end
188-
189-
def masked_location(location)
190-
context.mask_variables_from(location)
191-
end
19244
end
19345
end
19446
end

locale/gitlab.pot

+1-1
Original file line numberDiff line numberDiff line change
@@ -26235,7 +26235,7 @@ msgstr ""
2623526235
msgid "MergeRequest|No files found"
2623626236
msgstr ""
2623726237

26238-
msgid "MergeRequest|Search (e.g. *.vue) (%{modifier_key}P)"
26238+
msgid "MergeRequest|Search (e.g. *.vue) (%{MODIFIER_KEY}P)"
2623926239
msgstr ""
2624026240

2624126241
msgid "MergeTopics|%{sourceTopic} will be removed"

qa/qa/specs/features/api/1_manage/user_inherited_access_spec.rb

+12
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ module QA
8686
raise
8787
end.not_to raise_error
8888
end
89+
90+
after do
91+
parent_group_user.remove_via_api!
92+
sub_group_project.remove_via_api!
93+
sub_group.remove_via_api!
94+
end
8995
end
9096

9197
context 'when added to sub-group' do
@@ -161,6 +167,12 @@ module QA
161167
end.to raise_error(Resource::ApiFabricator::ResourceFabricationFailedError,
162168
/403 Forbidden - You are not allowed to push into this branch/)
163169
end
170+
171+
after do
172+
sub_group_user.remove_via_api!
173+
parent_group_project.remove_via_api!
174+
sub_group.remove_via_api!
175+
end
164176
end
165177
end
166178
end

0 commit comments

Comments
 (0)