Skip to content

Commit 1403e9b

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent af3904f commit 1403e9b

File tree

18 files changed

+136
-34
lines changed

18 files changed

+136
-34
lines changed

app/assets/javascripts/sidebar/components/sidebar_editable_item.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default {
125125
<template>
126126
<div>
127127
<div
128-
class="gl-display-flex gl-align-items-center gl-line-height-20 gl-mb-2 gl-text-gray-900 gl-font-weight-bold"
128+
class="gl-display-flex gl-align-items-center gl-line-height-20 gl-text-gray-900 gl-font-weight-bold"
129129
@click.self="collapse"
130130
>
131131
<span class="hide-collapsed" data-testid="title" @click="collapse">

app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default {
6161
</script>
6262

6363
<template>
64-
<div class="block">
64+
<div class="block time-tracking">
6565
<issuable-time-tracker
6666
:full-path="fullPath"
6767
:issuable-id="issuableId"

app/assets/stylesheets/framework/variables.scss

-8
Original file line numberDiff line numberDiff line change
@@ -649,14 +649,6 @@ $calendar-hover-bg: #ecf3fe;
649649
$calendar-border-color: rgba(#000, 0.1);
650650
$calendar-user-contrib-text: #959494;
651651

652-
/*
653-
* Value Stream Analytics
654-
*/
655-
$cycle-analytics-box-padding: 30px;
656-
$cycle-analytics-box-text-color: #8c8c8c;
657-
$cycle-analytics-big-font: 19px;
658-
$cycle-analytics-dismiss-icon-color: #b2b2b2;
659-
660652
/*
661653
* CI
662654
*/

app/assets/stylesheets/page_bundles/milestone.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import 'mixins_and_variables_and_functions';
1+
@import 'page_bundles/mixins_and_variables_and_functions';
22

33
$status-box-line-height: 26px;
44

app/assets/stylesheets/pages/issuable.scss

+14-3
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,15 @@
199199
.sidebar-contained-width,
200200
.issuable-sidebar-header {
201201
width: 100%;
202-
border-bottom: 0;
203202
}
204203

205204
.block {
206205
@include media-breakpoint-up(lg) {
207-
padding: $gl-spacing-scale-5 0;
206+
padding: $gl-spacing-scale-4 0 $gl-spacing-scale-5;
207+
}
208+
209+
&.participants {
210+
border-bottom: 0;
208211
}
209212
}
210213
}
@@ -213,7 +216,8 @@
213216
.sidebar-contained-width,
214217
.issuable-sidebar-header {
215218
@include clearfix;
216-
padding: $gl-padding 0;
219+
padding: $gl-spacing-scale-4 0 $gl-spacing-scale-5;
220+
border-bottom: 1px solid $border-gray-normal;
217221
// This prevents the mess when resizing the sidebar
218222
// of elements repositioning themselves..
219223
width: $gutter-inner-width;
@@ -235,6 +239,13 @@
235239
}
236240
}
237241
}
242+
243+
&.time-tracking,
244+
&.participants,
245+
&.subscriptions,
246+
&.with-sub-blocks {
247+
padding-top: $gl-spacing-scale-5;
248+
}
238249
}
239250

240251
.block-first {

app/models/ci/build.rb

+9
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def persisted_environment=(environment)
112112
end
113113

114114
scope :unstarted, -> { where(runner_id: nil) }
115+
115116
scope :with_downloadable_artifacts, -> do
116117
where('EXISTS (?)',
117118
Ci::JobArtifact.select(1)
@@ -120,6 +121,14 @@ def persisted_environment=(environment)
120121
)
121122
end
122123

124+
scope :with_erasable_artifacts, -> do
125+
where('EXISTS (?)',
126+
Ci::JobArtifact.select(1)
127+
.where('ci_builds.id = ci_job_artifacts.job_id')
128+
.where(file_type: Ci::JobArtifact.erasable_file_types)
129+
)
130+
end
131+
123132
scope :in_pipelines, ->(pipelines) do
124133
where(pipeline: pipelines)
125134
end

app/models/ci/pipeline.rb

+4
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,10 @@ def has_exposed_artifacts?
11821182
complete? && builds.latest.with_exposed_artifacts.exists?
11831183
end
11841184

1185+
def has_erasable_artifacts?
1186+
complete? && builds.latest.with_erasable_artifacts.exists?
1187+
end
1188+
11851189
def branch_updated?
11861190
strong_memoize(:branch_updated) do
11871191
push_details.branch_updated?

app/views/projects/pipeline_schedules/index.html.haml

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
%ul.content-list
1717
= render partial: "table"
1818
- else
19-
.card.bg-light.gl-mt-3
20-
.nothing-here-block= _("No schedules")
19+
= render Pajamas::CardComponent.new(card_options: { class: 'bg-light gl-mt-3 gl-text-center' }) do |c|
20+
- c.body do
21+
= _("No schedules")
2122

2223
#pipeline-take-ownership-modal

app/workers/ci/pipeline_success_unlock_artifacts_worker.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ class PipelineSuccessUnlockArtifactsWorker
1313

1414
def perform(pipeline_id)
1515
::Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline|
16-
break unless pipeline.has_archive_artifacts?
16+
# TODO: Move this check inside the Ci::UnlockArtifactsService
17+
# once the feature flags in it have been removed.
18+
break unless pipeline.has_erasable_artifacts?
1719

1820
results = ::Ci::UnlockArtifactsService
1921
.new(pipeline.project, pipeline.user)

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
"devDependencies": {
200200
"@gitlab/eslint-plugin": "17.0.0",
201201
"@gitlab/stylelint-config": "4.1.0",
202-
"@graphql-eslint/eslint-plugin": "3.11.1",
202+
"@graphql-eslint/eslint-plugin": "3.11.2",
203203
"@testing-library/dom": "^7.16.2",
204204
"@types/jest": "^27.5.1",
205205
"@vue/test-utils": "1.3.0",

qa/qa/specs/features/api/1_manage/migration/gitlab_project_migration_common.rb

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# frozen_string_literal: true
22

33
module QA
4-
# Disable on live envs until bulk_import_projects toggle is on by default
5-
# Otherwise tests running in parallel can disable feature in the middle of other test
64
RSpec.shared_context 'with gitlab project migration', requires_admin: 'creates a user via API',
5+
quarantine: {
6+
type: :flaky,
7+
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/364839'
8+
},
79
feature_flag: {
810
name: 'bulk_import_projects',
911
scope: :global

spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ describe('ReadyToMerge', () => {
311311
"the MR hasn't merged yet, and the backend-provided value expects to leave the branch",
312312
"the MR hasn't merged yet, and the backend-provided value is a non-boolean falsey value",
313313
"the MR hasn't merged yet, and the backend-provided value is a non-boolean truthy value",
314-
'the MR has merged, and the backend reports that the branch has been removed',
314+
'the MR has been merged, and the backend reports that the branch has been removed',
315315
'the MR has been merged, and the backend reports that the branch has not been removed',
316316
'the MR has been merged, and the backend reports a non-boolean falsey value',
317317
'the MR has been merged, and the backend reports a non-boolean truthy value',

spec/models/ci/build_spec.rb

+36
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,42 @@
160160
end
161161
end
162162

163+
describe '.with_erasable_artifacts' do
164+
subject { described_class.with_erasable_artifacts }
165+
166+
context 'when job does not have any artifacts' do
167+
let!(:job) { create(:ci_build) }
168+
169+
it 'does not return the job' do
170+
is_expected.not_to include(job)
171+
end
172+
end
173+
174+
::Ci::JobArtifact.erasable_file_types.each do |type|
175+
context "when job has a #{type} artifact" do
176+
it 'returns the job' do
177+
job = create(:ci_build)
178+
create(
179+
:ci_job_artifact,
180+
file_format: ::Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS[type.to_sym],
181+
file_type: type,
182+
job: job
183+
)
184+
185+
is_expected.to include(job)
186+
end
187+
end
188+
end
189+
190+
context 'when job has a non-erasable artifact' do
191+
let!(:job) { create(:ci_build, :trace_artifact) }
192+
193+
it 'does not return the job' do
194+
is_expected.not_to include(job)
195+
end
196+
end
197+
end
198+
163199
describe '.with_live_trace' do
164200
subject { described_class.with_live_trace }
165201

spec/models/ci/pipeline_spec.rb

+39
Original file line numberDiff line numberDiff line change
@@ -5546,4 +5546,43 @@ def create_bridge(upstream, downstream, depend = false)
55465546
end
55475547
end
55485548
end
5549+
5550+
describe '#has_erasable_artifacts?' do
5551+
subject { pipeline.has_erasable_artifacts? }
5552+
5553+
context 'when pipeline is not complete' do
5554+
let(:pipeline) { create(:ci_pipeline, :running, :with_job) }
5555+
5556+
context 'and has erasable artifacts' do
5557+
before do
5558+
create(:ci_job_artifact, :archive, job: pipeline.builds.first)
5559+
end
5560+
5561+
it { is_expected.to be_falsey }
5562+
end
5563+
end
5564+
5565+
context 'when pipeline is complete' do
5566+
let(:pipeline) { create(:ci_pipeline, :success, :with_job) }
5567+
5568+
context 'and has no artifacts' do
5569+
it { is_expected.to be_falsey }
5570+
end
5571+
5572+
Ci::JobArtifact.erasable_file_types.each do |type|
5573+
context "and has an artifact of type #{type}" do
5574+
before do
5575+
create(
5576+
:ci_job_artifact,
5577+
file_format: ::Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS[type.to_sym],
5578+
file_type: type,
5579+
job: pipeline.builds.first
5580+
)
5581+
end
5582+
5583+
it { is_expected.to be_truthy }
5584+
end
5585+
end
5586+
end
5587+
end
55495588
end

spec/support/shared_examples/features/sidebar/sidebar_due_date_shared_examples.rb

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
scroll_to(button)
2121
button.click
2222

23+
execute_script('document.querySelector(".issuable-sidebar")?.scrollBy(0, 50)')
24+
2325
click_button today.to_s
2426

2527
wait_for_requests

spec/workers/ci/pipeline_success_unlock_artifacts_worker_spec.rb

+13-8
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@
2727
end
2828

2929
context 'when pipeline exists' do
30-
let(:pipeline) { create(:ci_pipeline, :success, :with_job) }
30+
let!(:pipeline) { create(:ci_pipeline, :success, :with_job) }
3131
let(:pipeline_id) { pipeline.id }
3232

33-
context 'when pipeline has artifacts' do
34-
before do
35-
create(:ci_job_artifact, job: pipeline.builds.first)
36-
end
33+
before do
34+
allow(Ci::Pipeline).to receive(:find_by_id).with(pipeline.id).and_return(pipeline)
35+
allow(pipeline).to receive(:has_erasable_artifacts?).and_return(has_erasable_artifacts)
36+
end
3737

38-
it 'calls the service' do
38+
context 'when pipeline has erasable artifacts' do
39+
let(:has_erasable_artifacts) { true }
40+
41+
it 'calls the unlock service' do
3942
service = spy(Ci::UnlockArtifactsService)
4043
expect(Ci::UnlockArtifactsService).to receive(:new).and_return(service)
4144

@@ -45,8 +48,10 @@
4548
end
4649
end
4750

48-
context 'when pipeline does not have artifacts' do
49-
it 'does not call service' do
51+
context 'when pipeline has no erasable artifacts' do
52+
let(:has_erasable_artifacts) { false }
53+
54+
it 'does not call the unlock service' do
5055
expect(Ci::UnlockArtifactsService).not_to receive(:new)
5156

5257
perform

tooling/config/CODEOWNERS.yml

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
- '**/merge_requests/**'
7676
- '/config/feature_flags/**/*'
7777
- '/ee/app/services/audit_events/**/*'
78-
- '/ee/config/feature_flags/development/auditor_group_runner_access.yml'
7978
- '/ee/spec/services/audit_events/**/*'
8079
- '/ee/spec/services/ci/*'
8180
- '/ee/spec/services/personal_access_tokens/*'

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1090,10 +1090,10 @@
10901090
dependencies:
10911091
mustache "^4.2.0"
10921092

1093-
"@graphql-eslint/[email protected].1":
1094-
version "3.11.1"
1095-
resolved "https://registry.yarnpkg.com/@graphql-eslint/eslint-plugin/-/eslint-plugin-3.11.1.tgz#3ff3fce52d31d169fdbe33f70cb5234966d2bea1"
1096-
integrity sha512-y72HwLgCBMS5diGhtOM9EnDRY7rcyevbiHeLJPy0gjcVzAhj0xdH7dJV7aNLlVNSSqZ+3M8ZuKfwEX5ByFqx4w==
1093+
"@graphql-eslint/[email protected].2":
1094+
version "3.11.2"
1095+
resolved "https://registry.yarnpkg.com/@graphql-eslint/eslint-plugin/-/eslint-plugin-3.11.2.tgz#d982a45291aadd483c79c2bcb209166115ef6123"
1096+
integrity sha512-gnR6L2S64mesNyF34n/c3qOTIwu6MtapRhPQLHqU1/Qdf/7Ga9KKtFJKKxRrK7YbzlteMYweC05khhZycxDtLw==
10971097
dependencies:
10981098
"@babel/code-frame" "^7.16.7"
10991099
"@graphql-tools/code-file-loader" "^7.2.14"

0 commit comments

Comments
 (0)