Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-09-27 15:13:43 +00:00
parent af3904f9d0
commit 1403e9bc45
18 changed files with 136 additions and 34 deletions

View File

@ -125,7 +125,7 @@ export default {
<template>
<div>
<div
class="gl-display-flex gl-align-items-center gl-line-height-20 gl-mb-2 gl-text-gray-900 gl-font-weight-bold"
class="gl-display-flex gl-align-items-center gl-line-height-20 gl-text-gray-900 gl-font-weight-bold"
@click.self="collapse"
>
<span class="hide-collapsed" data-testid="title" @click="collapse">

View File

@ -61,7 +61,7 @@ export default {
</script>
<template>
<div class="block">
<div class="block time-tracking">
<issuable-time-tracker
:full-path="fullPath"
:issuable-id="issuableId"

View File

@ -649,14 +649,6 @@ $calendar-hover-bg: #ecf3fe;
$calendar-border-color: rgba(#000, 0.1);
$calendar-user-contrib-text: #959494;
/*
* Value Stream Analytics
*/
$cycle-analytics-box-padding: 30px;
$cycle-analytics-box-text-color: #8c8c8c;
$cycle-analytics-big-font: 19px;
$cycle-analytics-dismiss-icon-color: #b2b2b2;
/*
* CI
*/

View File

@ -1,4 +1,4 @@
@import 'mixins_and_variables_and_functions';
@import 'page_bundles/mixins_and_variables_and_functions';
$status-box-line-height: 26px;

View File

@ -199,12 +199,15 @@
.sidebar-contained-width,
.issuable-sidebar-header {
width: 100%;
border-bottom: 0;
}
.block {
@include media-breakpoint-up(lg) {
padding: $gl-spacing-scale-5 0;
padding: $gl-spacing-scale-4 0 $gl-spacing-scale-5;
}
&.participants {
border-bottom: 0;
}
}
}
@ -213,7 +216,8 @@
.sidebar-contained-width,
.issuable-sidebar-header {
@include clearfix;
padding: $gl-padding 0;
padding: $gl-spacing-scale-4 0 $gl-spacing-scale-5;
border-bottom: 1px solid $border-gray-normal;
// This prevents the mess when resizing the sidebar
// of elements repositioning themselves..
width: $gutter-inner-width;
@ -235,6 +239,13 @@
}
}
}
&.time-tracking,
&.participants,
&.subscriptions,
&.with-sub-blocks {
padding-top: $gl-spacing-scale-5;
}
}
.block-first {

View File

@ -112,6 +112,7 @@ module Ci
end
scope :unstarted, -> { where(runner_id: nil) }
scope :with_downloadable_artifacts, -> do
where('EXISTS (?)',
Ci::JobArtifact.select(1)
@ -120,6 +121,14 @@ module Ci
)
end
scope :with_erasable_artifacts, -> do
where('EXISTS (?)',
Ci::JobArtifact.select(1)
.where('ci_builds.id = ci_job_artifacts.job_id')
.where(file_type: Ci::JobArtifact.erasable_file_types)
)
end
scope :in_pipelines, ->(pipelines) do
where(pipeline: pipelines)
end

View File

@ -1182,6 +1182,10 @@ module Ci
complete? && builds.latest.with_exposed_artifacts.exists?
end
def has_erasable_artifacts?
complete? && builds.latest.with_erasable_artifacts.exists?
end
def branch_updated?
strong_memoize(:branch_updated) do
push_details.branch_updated?

View File

@ -16,7 +16,8 @@
%ul.content-list
= render partial: "table"
- else
.card.bg-light.gl-mt-3
.nothing-here-block= _("No schedules")
= render Pajamas::CardComponent.new(card_options: { class: 'bg-light gl-mt-3 gl-text-center' }) do |c|
- c.body do
= _("No schedules")
#pipeline-take-ownership-modal

View File

@ -13,7 +13,9 @@ module Ci
def perform(pipeline_id)
::Ci::Pipeline.find_by_id(pipeline_id).try do |pipeline|
break unless pipeline.has_archive_artifacts?
# TODO: Move this check inside the Ci::UnlockArtifactsService
# once the feature flags in it have been removed.
break unless pipeline.has_erasable_artifacts?
results = ::Ci::UnlockArtifactsService
.new(pipeline.project, pipeline.user)

View File

@ -199,7 +199,7 @@
"devDependencies": {
"@gitlab/eslint-plugin": "17.0.0",
"@gitlab/stylelint-config": "4.1.0",
"@graphql-eslint/eslint-plugin": "3.11.1",
"@graphql-eslint/eslint-plugin": "3.11.2",
"@testing-library/dom": "^7.16.2",
"@types/jest": "^27.5.1",
"@vue/test-utils": "1.3.0",

View File

@ -1,9 +1,11 @@
# frozen_string_literal: true
module QA
# Disable on live envs until bulk_import_projects toggle is on by default
# Otherwise tests running in parallel can disable feature in the middle of other test
RSpec.shared_context 'with gitlab project migration', requires_admin: 'creates a user via API',
quarantine: {
type: :flaky,
issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/364839'
},
feature_flag: {
name: 'bulk_import_projects',
scope: :global

View File

@ -311,7 +311,7 @@ describe('ReadyToMerge', () => {
"the MR hasn't merged yet, and the backend-provided value expects to leave the branch",
"the MR hasn't merged yet, and the backend-provided value is a non-boolean falsey value",
"the MR hasn't merged yet, and the backend-provided value is a non-boolean truthy value",
'the MR has merged, and the backend reports that the branch has been removed',
'the MR has been merged, and the backend reports that the branch has been removed',
'the MR has been merged, and the backend reports that the branch has not been removed',
'the MR has been merged, and the backend reports a non-boolean falsey value',
'the MR has been merged, and the backend reports a non-boolean truthy value',

View File

@ -160,6 +160,42 @@ RSpec.describe Ci::Build do
end
end
describe '.with_erasable_artifacts' do
subject { described_class.with_erasable_artifacts }
context 'when job does not have any artifacts' do
let!(:job) { create(:ci_build) }
it 'does not return the job' do
is_expected.not_to include(job)
end
end
::Ci::JobArtifact.erasable_file_types.each do |type|
context "when job has a #{type} artifact" do
it 'returns the job' do
job = create(:ci_build)
create(
:ci_job_artifact,
file_format: ::Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS[type.to_sym],
file_type: type,
job: job
)
is_expected.to include(job)
end
end
end
context 'when job has a non-erasable artifact' do
let!(:job) { create(:ci_build, :trace_artifact) }
it 'does not return the job' do
is_expected.not_to include(job)
end
end
end
describe '.with_live_trace' do
subject { described_class.with_live_trace }

View File

@ -5546,4 +5546,43 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
end
end
end
describe '#has_erasable_artifacts?' do
subject { pipeline.has_erasable_artifacts? }
context 'when pipeline is not complete' do
let(:pipeline) { create(:ci_pipeline, :running, :with_job) }
context 'and has erasable artifacts' do
before do
create(:ci_job_artifact, :archive, job: pipeline.builds.first)
end
it { is_expected.to be_falsey }
end
end
context 'when pipeline is complete' do
let(:pipeline) { create(:ci_pipeline, :success, :with_job) }
context 'and has no artifacts' do
it { is_expected.to be_falsey }
end
Ci::JobArtifact.erasable_file_types.each do |type|
context "and has an artifact of type #{type}" do
before do
create(
:ci_job_artifact,
file_format: ::Ci::JobArtifact::TYPE_AND_FORMAT_PAIRS[type.to_sym],
file_type: type,
job: pipeline.builds.first
)
end
it { is_expected.to be_truthy }
end
end
end
end
end

View File

@ -20,6 +20,8 @@ RSpec.shared_examples 'date sidebar widget' do
scroll_to(button)
button.click
execute_script('document.querySelector(".issuable-sidebar")?.scrollBy(0, 50)')
click_button today.to_s
wait_for_requests

View File

@ -27,15 +27,18 @@ RSpec.describe Ci::PipelineSuccessUnlockArtifactsWorker do
end
context 'when pipeline exists' do
let(:pipeline) { create(:ci_pipeline, :success, :with_job) }
let!(:pipeline) { create(:ci_pipeline, :success, :with_job) }
let(:pipeline_id) { pipeline.id }
context 'when pipeline has artifacts' do
before do
create(:ci_job_artifact, job: pipeline.builds.first)
end
before do
allow(Ci::Pipeline).to receive(:find_by_id).with(pipeline.id).and_return(pipeline)
allow(pipeline).to receive(:has_erasable_artifacts?).and_return(has_erasable_artifacts)
end
it 'calls the service' do
context 'when pipeline has erasable artifacts' do
let(:has_erasable_artifacts) { true }
it 'calls the unlock service' do
service = spy(Ci::UnlockArtifactsService)
expect(Ci::UnlockArtifactsService).to receive(:new).and_return(service)
@ -45,8 +48,10 @@ RSpec.describe Ci::PipelineSuccessUnlockArtifactsWorker do
end
end
context 'when pipeline does not have artifacts' do
it 'does not call service' do
context 'when pipeline has no erasable artifacts' do
let(:has_erasable_artifacts) { false }
it 'does not call the unlock service' do
expect(Ci::UnlockArtifactsService).not_to receive(:new)
perform

View File

@ -75,7 +75,6 @@
- '**/merge_requests/**'
- '/config/feature_flags/**/*'
- '/ee/app/services/audit_events/**/*'
- '/ee/config/feature_flags/development/auditor_group_runner_access.yml'
- '/ee/spec/services/audit_events/**/*'
- '/ee/spec/services/ci/*'
- '/ee/spec/services/personal_access_tokens/*'

View File

@ -1090,10 +1090,10 @@
dependencies:
mustache "^4.2.0"
"@graphql-eslint/eslint-plugin@3.11.1":
version "3.11.1"
resolved "https://registry.yarnpkg.com/@graphql-eslint/eslint-plugin/-/eslint-plugin-3.11.1.tgz#3ff3fce52d31d169fdbe33f70cb5234966d2bea1"
integrity sha512-y72HwLgCBMS5diGhtOM9EnDRY7rcyevbiHeLJPy0gjcVzAhj0xdH7dJV7aNLlVNSSqZ+3M8ZuKfwEX5ByFqx4w==
"@graphql-eslint/eslint-plugin@3.11.2":
version "3.11.2"
resolved "https://registry.yarnpkg.com/@graphql-eslint/eslint-plugin/-/eslint-plugin-3.11.2.tgz#d982a45291aadd483c79c2bcb209166115ef6123"
integrity sha512-gnR6L2S64mesNyF34n/c3qOTIwu6MtapRhPQLHqU1/Qdf/7Ga9KKtFJKKxRrK7YbzlteMYweC05khhZycxDtLw==
dependencies:
"@babel/code-frame" "^7.16.7"
"@graphql-tools/code-file-loader" "^7.2.14"