Skip to content

Commit 6078f74

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 026ef03 commit 6078f74

File tree

20 files changed

+196
-92
lines changed

20 files changed

+196
-92
lines changed

app/assets/javascripts/packages_and_registries/settings/group/components/packages_settings.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ export default {
100100
:duplicate-exception-regex-error="errors.mavenDuplicateExceptionRegex"
101101
:model-names="modelNames"
102102
:loading="isLoading"
103-
toggle-qa-selector="allow_duplicates_toggle"
104-
label-qa-selector="allow_duplicates_label"
103+
toggle-qa-selector="reject_duplicates_toggle"
104+
label-qa-selector="reject_duplicates_label"
105105
@update="updateSettings"
106106
/>
107107
</template>

app/models/key.rb

+6
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ def public_key
121121
@public_key ||= Gitlab::SSHPublicKey.new(key)
122122
end
123123

124+
def ensure_sha256_fingerprint!
125+
return if self.fingerprint_sha256
126+
127+
save if generate_fingerprint
128+
end
129+
124130
private
125131

126132
def generate_fingerprint

app/services/projects/move_deploy_keys_projects_service.rb

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ class MoveDeployKeysProjectsService < BaseMoveRelationsService
55
def execute(source_project, remove_remaining_elements: true)
66
return unless super
77

8+
# The SHA256 fingerprint should be there, but just in case it isn't
9+
# we want to make sure it's generated. Otherwise we might delete keys.
10+
ensure_sha256_fingerprints
11+
812
Project.transaction do
913
move_deploy_keys_projects
1014
remove_remaining_deploy_keys_projects if remove_remaining_elements
@@ -15,6 +19,11 @@ def execute(source_project, remove_remaining_elements: true)
1519

1620
private
1721

22+
def ensure_sha256_fingerprints
23+
@project.deploy_keys.each(&:ensure_sha256_fingerprint!)
24+
source_project.deploy_keys.each(&:ensure_sha256_fingerprint!)
25+
end
26+
1827
def move_deploy_keys_projects
1928
non_existent_deploy_keys_projects.update_all(project_id: @project.id)
2029
end
@@ -23,7 +32,7 @@ def move_deploy_keys_projects
2332
def non_existent_deploy_keys_projects
2433
source_project.deploy_keys_projects
2534
.joins(:deploy_key)
26-
.where.not(keys: { fingerprint: @project.deploy_keys.select(:fingerprint) })
35+
.where.not(keys: { fingerprint_sha256: @project.deploy_keys.select(:fingerprint_sha256) })
2736
end
2837
# rubocop: enable CodeReuse/ActiveRecord
2938

app/views/users/_profile_basic_info.html.haml

+3
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
= render 'middle_dot_divider' do
33
@#{@user.username}
44
- if can?(current_user, :read_user_profile, @user)
5+
= render 'middle_dot_divider' do
6+
= s_('UserProfile|User ID: %{id}') % { id: @user.id }
7+
= clipboard_button(title: s_('UserProfile|Copy user ID'), text: @user.id)
58
= render 'middle_dot_divider' do
69
= s_('Member since %{date}') % { date: @user.created_at.to_date.to_s(:long) }

doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -927,13 +927,13 @@ conflicting_permanent_redirects.destroy_all
927927

928928
## Merge requests
929929

930-
### Close a merge request properly (if merged but still marked as open)
930+
### Close a merge request
931931

932932
```ruby
933933
u = User.find_by_username('<username>')
934934
p = Project.find_by_full_path('<namespace/project>')
935935
m = p.merge_requests.find_by(iid: <iid>)
936-
MergeRequests::PostMergeService.new(project: p, current_user: u).execute(m)
936+
MergeRequests::CloseService.new(project: p, current_user: u).execute(m)
937937
```
938938

939939
### Delete a merge request
@@ -954,6 +954,21 @@ m = p.merge_requests.find_by(iid: <iid>)
954954
MergeRequests::RebaseService.new(project: m.target_project, current_user: u).execute(m)
955955
```
956956

957+
### Set a merge request as merged
958+
959+
Use when a merge request was accepted and the changes merged into the Git repository,
960+
but the merge request still shows as open.
961+
962+
If the changes are not merged yet, this action causes the merge request to
963+
incorrectly show `merged into <branch-name>`.
964+
965+
```ruby
966+
u = User.find_by_username('<username>')
967+
p = Project.find_by_full_path('<namespace/project>')
968+
m = p.merge_requests.find_by(iid: <iid>)
969+
MergeRequests::PostMergeService.new(project: p, current_user: u).execute(m)
970+
```
971+
957972
## CI
958973

959974
### Cancel stuck pending pipelines

doc/ci/jobs/job_control.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ to add jobs to a pipeline:
304304
```yaml
305305
docker build:
306306
variables:
307-
DOCKERFILES_DIR: 'path/to/files/'
307+
DOCKERFILES_DIR: 'path/to/files'
308308
script: docker build -t my-image:$CI_COMMIT_REF_SLUG .
309309
rules:
310310
- changes:
@@ -1005,6 +1005,26 @@ Additionally, rules with `changes` always evaluate as true in [scheduled pipelin
10051005
All files are considered to have changed when a scheduled pipeline runs, so jobs
10061006
might always be added to scheduled pipelines that use `changes`.
10071007

1008+
### File paths in CI/CD variables
1009+
1010+
Be careful when using file paths in CI/CD variables. A trailing slash can appear correct
1011+
in the variable definition, but can become invalid when expanded in `script:`, `changes:`,
1012+
or other keywords. For example:
1013+
1014+
```yaml
1015+
docker_build:
1016+
variables:
1017+
DOCKERFILES_DIR: 'path/to/files/' # This variable should not have a trailing '/' character
1018+
script: echo "A docker job"
1019+
rules:
1020+
- changes:
1021+
- $DOCKERFILES_DIR/*
1022+
```
1023+
1024+
When the `DOCKERFILES_DIR` variable is expanded in the `changes:` section, the full
1025+
path becomes `path/to/files//*`. The double slashes might cause unexpected behavior
1026+
depending on the keyword used, shell and OS of the runner, and so on.
1027+
10081028
### `You are not allowed to download code from this project.` error message
10091029

10101030
You might see pipelines fail when a GitLab administrator runs a protected manual job

doc/development/i18n/proofreader.md

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ are very appreciative of the work done by translators and proofreaders!
3434
- Weizhe Ding - [GitLab](https://gitlab.com/d.weizhe), [Crowdin](https://crowdin.com/profile/d.weizhe)
3535
- Yi-Jyun Pan - [GitLab](https://gitlab.com/pan93412), [Crowdin](https://crowdin.com/profile/pan93412)
3636
- Victor Wu - [GitLab](https://gitlab.com/_victorwu_), [Crowdin](https://crowdin.com/profile/victorwu)
37+
- Hansel Wang - [GitLab](https://gitlab.com/airness), [Crowdin](https://crowdin.com/profile/airness)
3738
- Chinese Traditional, Hong Kong 繁體中文 (香港)
3839
- Victor Wu - [GitLab](https://gitlab.com/_victorwu_), [Crowdin](https://crowdin.com/profile/victorwu)
3940
- Ivan Ip - [GitLab](https://gitlab.com/lifehome), [Crowdin](https://crowdin.com/profile/lifehome)

doc/user/admin_area/broadcast_messages.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ type: reference, howto
77

88
# Broadcast messages **(FREE SELF)**
99

10-
> Target roles [introduced](https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/461) in GitLab 14.8 [with a flag](../../administration/feature_flags.md) named `role_targeted_broadcast_messages`. Disabled by default.
10+
> - Target roles [introduced](https://gitlab.com/gitlab-org/growth/team-tasks/-/issues/461) in GitLab 14.8 [with a flag](../../administration/feature_flags.md) named `role_targeted_broadcast_messages`. Disabled by default.
11+
> - Theme [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/83251) and background color removed in GitLab 14.10.
1112
1213
GitLab can display broadcast messages to users of a GitLab instance. There are two types of broadcast messages:
1314

doc/user/project/merge_requests/csv_export.md

+12-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@ group: Compliance
44
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
55
---
66

7-
# Export merge requests to CSV **(FREE)**
7+
# Export merge requests to CSV**(FREE)**
88

99
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/3619) in GitLab 13.6.
1010
11-
Exporting merge requests CSV enables you and your team to export all the data collected from merge requests into a comma-separated values (CSV) file, which stores tabular data in plain text.
11+
Export all the data collected from a project's merge requests into a comma-separated values (CSV) file.
1212

13-
To export merge requests to CSV, navigate to your **Merge requests** from the sidebar of a project and select **Export as CSV**.
13+
To export merge requests to a CSV file:
14+
15+
1. On the top bar, select **Menu > Projects** and find your project.
16+
1. On the left sidebar, select **Merge requests** .
17+
1. Add any searches or filters. This can help you keep the size of the CSV file under the 15MB limit. The limit ensures
18+
the file can be emailed to a variety of email providers.
19+
1. Select **Export as CSV** (**{export}**).
20+
1. Confirm the correct number of merge requests are to be exported.
21+
1. Select **Export merge requests**.
1422

1523
## CSV Output
1624

17-
The following table shows what attributes will be present in the CSV.
25+
The following table shows the attributes in the CSV file.
1826

1927
| Column | Description |
2028
|--------------------|--------------------------------------------------------------|
@@ -42,8 +50,3 @@ The following table shows what attributes will be present in the CSV.
4250
In GitLab 14.7 and earlier, the first two columns were `MR ID` and `URL`,
4351
which [caused an issue](https://gitlab.com/gitlab-org/gitlab/-/issues/34769)
4452
when importing back into GitLab.
45-
46-
## Limitations
47-
48-
- Export merge requests to CSV is not available at the Group's merge request list.
49-
- As the merge request CSV file is sent as an email attachment, the size is limited to 15MB to ensure successful delivery across a range of email providers. If you need to minimize the size of the file, you can narrow the search before export. For example, you can set up exports of open and closed merge requests in separate files.

lib/api/maven_packages.rb

+13
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,26 @@ def extract_format(file_name)
4343
end
4444
end
4545

46+
# The sha verification done by the maven api is between:
47+
# - the sha256 set by workhorse helpers
48+
# - the sha256 of the sha1 of the uploaded package file
4649
def verify_package_file(package_file, uploaded_file)
4750
stored_sha256 = Digest::SHA256.hexdigest(package_file.file_sha1)
4851
expected_sha256 = uploaded_file.sha256
4952

5053
if stored_sha256 == expected_sha256
5154
no_content!
5255
else
56+
# Track sha1 conflicts.
57+
# See https://gitlab.com/gitlab-org/gitlab/-/issues/367356
58+
Gitlab::ErrorTracking.log_exception(
59+
ArgumentError.new,
60+
message: 'maven package file sha1 conflict',
61+
stored_sha1: package_file.file_sha1,
62+
received_sha256: uploaded_file.sha256,
63+
sha256_hexdigest_of_stored_sha1: stored_sha256
64+
)
65+
5366
conflict!
5467
end
5568
end

locale/gitlab.pot

+6
Original file line numberDiff line numberDiff line change
@@ -42260,6 +42260,9 @@ msgstr ""
4226042260
msgid "UserProfile|Contributed projects"
4226142261
msgstr ""
4226242262

42263+
msgid "UserProfile|Copy user ID"
42264+
msgstr ""
42265+
4226342266
msgid "UserProfile|Edit profile"
4226442267
msgstr ""
4226542268

@@ -42341,6 +42344,9 @@ msgstr ""
4234142344
msgid "UserProfile|Unconfirmed user"
4234242345
msgstr ""
4234342346

42347+
msgid "UserProfile|User ID: %{id}"
42348+
msgstr ""
42349+
4234442350
msgid "UserProfile|View all"
4234542351
msgstr ""
4234642352

qa/qa/page/group/settings/package_registries.rb

+12-12
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,41 @@ class PackageRegistries < QA::Page::Base
88

99
view 'app/assets/javascripts/packages_and_registries/settings/group/components/packages_settings.vue' do
1010
element :package_registry_settings_content
11-
element :allow_duplicates_toggle
12-
element :allow_duplicates_label
11+
element :reject_duplicates_toggle
12+
element :reject_duplicates_label
1313
end
1414

1515
view 'app/assets/javascripts/packages_and_registries/settings/group/components/dependency_proxy_settings.vue' do
1616
element :dependency_proxy_settings_content
1717
element :dependency_proxy_setting_toggle
1818
end
1919

20-
def set_allow_duplicates_disabled
20+
def set_reject_duplicates_disabled
2121
within_element :package_registry_settings_content do
22-
click_on_allow_duplicates_button if duplicates_enabled?
22+
click_on_reject_duplicates_button if duplicates_disabled?
2323
end
2424
end
2525

26-
def set_allow_duplicates_enabled
26+
def set_reject_duplicates_enabled
2727
within_element :package_registry_settings_content do
28-
click_on_allow_duplicates_button unless duplicates_enabled?
28+
click_on_reject_duplicates_button unless duplicates_disabled?
2929
end
3030
end
3131

32-
def click_on_allow_duplicates_button
33-
with_allow_duplicates_button do |button|
32+
def click_on_reject_duplicates_button
33+
with_reject_duplicates_button do |button|
3434
button.click
3535
end
3636
end
3737

38-
def duplicates_enabled?
39-
with_allow_duplicates_button do |button|
38+
def duplicates_disabled?
39+
with_reject_duplicates_button do |button|
4040
button[:class].include?('is-checked')
4141
end
4242
end
4343

44-
def with_allow_duplicates_button
45-
within_element :allow_duplicates_toggle do
44+
def with_reject_duplicates_button
45+
within_element :reject_duplicates_toggle do
4646
toggle = find('button.gl-toggle:not(.is-disabled)')
4747
yield(toggle)
4848
end

qa/qa/specs/features/browser_ui/5_package/package_registry/maven/maven_group_level_spec.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ module QA
135135
end
136136
end
137137

138-
context 'duplication setting', quarantine: { type: :stale, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/365150' } do
138+
context 'duplication setting' do
139139
before do
140140
package_project.group.visit!
141141

142142
Page::Group::Menu.perform(&:go_to_package_settings)
143143
end
144144

145-
context 'when disabled' do
145+
context 'when enabled' do
146146
where do
147147
{
148148
'using a personal access token' => {
@@ -176,7 +176,7 @@ module QA
176176
end
177177

178178
before do
179-
Page::Group::Settings::PackageRegistries.perform(&:set_allow_duplicates_disabled)
179+
Page::Group::Settings::PackageRegistries.perform(&:set_reject_duplicates_enabled)
180180
end
181181

182182
it 'prevents users from publishing group level Maven packages duplicates', testcase: params[:testcase] do
@@ -195,7 +195,7 @@ module QA
195195
end
196196
end
197197

198-
context 'when enabled' do
198+
context 'when disabled' do
199199
where do
200200
{
201201
'using a personal access token' => {
@@ -229,7 +229,7 @@ module QA
229229
end
230230

231231
before do
232-
Page::Group::Settings::PackageRegistries.perform(&:set_allow_duplicates_enabled)
232+
Page::Group::Settings::PackageRegistries.perform(&:set_reject_duplicates_disabled)
233233
end
234234

235235
it 'allows users to publish group level Maven packages duplicates', testcase: params[:testcase] do

scripts/process_custom_semgrep_results.sh

-55
This file was deleted.

0 commit comments

Comments
 (0)