Skip to content
Snippets Groups Projects
Unverified Commit 878a3d0f authored by Nao Hashizume's avatar Nao Hashizume Committed by GitLab
Browse files

Merge branch 'minac_fix_master' into 'master'

parent 092e557b
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -29,33 +29,6 @@ build-qa-image as-if-foss:
- .as-if-foss
- .build-images:rules:build-qa-image-as-if-foss
 
# Prepares an image with GDK configured based on code in master. This saves some time in MRs because some installation
# and complilation will have already been performed.
build-qa-on-gdk-master-image:
extends:
- .base-image-build-buildx
- .build-images:rules:build-qa-on-gdk-master-image
tags:
- e2e
stage: build-images
needs: []
variables:
QA_GDK_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-qa-gdk"
before_script:
- !reference [.use-buildx, before_script]
- sysctl -n -w fs.inotify.max_user_watches=524288
script:
- |
docker buildx build \
--cache-to=type=inline \
--cache-from ${QA_GDK_IMAGE}:master \
--platform=${ARCH:-amd64} \
--add-host gdk.test:127.0.0.1 \
--tag ${QA_GDK_IMAGE}:master \
--file="qa/gdk/Dockerfile" \
--push \
${CI_PROJECT_DIR}
build-assets-image:
extends:
- .base-image-build
Loading
Loading
Loading
Loading
@@ -144,23 +144,3 @@ e2e:package-and-test-nightly:
ALLURE_JOB_NAME: nightly
PIPELINE_NAME: E2E Omnibus GitLab Nightly
DYNAMIC_PIPELINE_YML: package-and-test-nightly-pipeline.yml
e2e:test-on-gdk:
extends:
- .e2e-trigger-base
- .qa:rules:e2e:test-on-gdk
stage: qa
needs:
# In scheduled master pipelines we wait for the image to be built.
# In MRs we assume the last scheduled master pipeline built the image already.
- job: build-qa-on-gdk-master-image
optional: true
- job: e2e-test-pipeline-generate
artifacts: true
variables:
ALLURE_JOB_NAME: e2e-test-on-gdk
QA_RUN_TYPE: e2e-test-on-gdk
PIPELINE_NAME: E2E GDK
DYNAMIC_PIPELINE_YML: test-on-gdk-pipeline.yml
SKIP_MESSAGE: Skipping test-on-gdk due to mr containing only quarantine changes!
allow_failure: true
Loading
Loading
@@ -2261,6 +2261,8 @@
when: never
- <<: *if-merge-request-labels-pipeline-expedite
when: never
- if: '$CI_REVIEW_APPS_ENABLED != "true"'
when: never
- <<: *if-merge-request-labels-run-review-app
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
Loading
Loading
Loading
Loading
@@ -3,9 +3,10 @@
require_relative '../lib/gitlab_settings'
 
file = ENV.fetch('GITLAB_CONFIG') { Rails.root.join('config/gitlab.yml') }
section = ENV.fetch('GITLAB_ENV') { Rails.env }
 
Settings = GitlabSettings.load(file, section) do
GITLAB_INSTANCE_UUID_NOT_SET = 'uuid-not-set'
Settings = GitlabSettings.load(file, Rails.env) do
def gitlab_on_standard_port?
on_standard_port?(gitlab)
end
Loading
Loading
Loading
Loading
@@ -14,11 +14,17 @@
file_registry.create!(file_id: 4, file_type: 'job_artifact', success: false, bytes: 4096, sha256: '2' * 64)
end
 
def migrate_and_reset_registry_columns!
migrate!
[file_registry, job_artifact_registry].each(&:reset_column_information)
end
describe '#up' do
it 'migrates all job artifacts to its own data table' do
expect(file_registry.all.count).to eq(4)
 
migrate!
migrate_and_reset_registry_columns!
 
expect(file_registry.all.count).to eq(4)
expect(job_artifact_registry.all.count).to eq(3)
Loading
Loading
@@ -30,7 +36,7 @@
end
 
it 'creates a new artifact with the trigger' do
migrate!
migrate_and_reset_registry_columns!
 
expect(job_artifact_registry.all.count).to eq(3)
 
Loading
Loading
@@ -41,7 +47,7 @@
end
 
it 'updates a new artifact with the trigger' do
migrate!
migrate_and_reset_registry_columns!
 
expect(job_artifact_registry.all.count).to eq(3)
 
Loading
Loading
@@ -54,7 +60,7 @@
end
 
it 'creates a new artifact using the next ID' do
migrate!
migrate_and_reset_registry_columns!
 
max_id = job_artifact_registry.maximum(:id)
last_id = job_artifact_registry.create!(artifact_id: 5, success: true).id
Loading
Loading
@@ -65,7 +71,7 @@
 
describe '#down' do
it 'rolls back data properly' do
migrate!
migrate_and_reset_registry_columns!
 
expect(file_registry.all.count).to eq(4)
expect(job_artifact_registry.all.count).to eq(3)
Loading
Loading
Loading
Loading
@@ -2,10 +2,11 @@
 
require 'spec_helper'
 
RSpec.describe Groups::ComplianceReportCsvService, feature_category: :compliance_management do
RSpec.describe Groups::ComplianceReportCsvService, :freeze_time, feature_category: :compliance_management do
subject(:service) { described_class.new(user, group, filters) }
 
let(:filters) { { from: 10.years.ago, to: Time.current } }
let(:from) { 10.years.ago }
let(:filters) { { from: from, to: Time.current } }
 
let_it_be(:user) { create(:user, name: 'John Cena') }
 
Loading
Loading
@@ -107,9 +108,9 @@
 
context 'when verifying the csv data' do
let(:all_commits) do
commits = project1.repository.commits(nil, limit: 100).map(&:sha) +
project2.repository.commits(nil, limit: 100).map(&:sha) +
sub_group_project.repository.commits(nil, limit: 100).map(&:sha)
commits = project1.repository.commits(nil, limit: 100, after: from).map(&:sha) +
project2.repository.commits(nil, limit: 100, after: from).map(&:sha) +
sub_group_project.repository.commits(nil, limit: 100, after: from).map(&:sha)
commits.sort.uniq
end
 
Loading
Loading
Loading
Loading
@@ -40,6 +40,7 @@ module SidekiqConfig
 
class << self
include Gitlab::SidekiqConfig::CliMethods
include Gitlab::Utils::StrongMemoize
 
def redis_queues
# Not memoized, because this can change during the life of the application
Loading
Loading
@@ -54,28 +55,27 @@ def config_queues
end
 
def cron_jobs
@cron_jobs ||= begin
Gitlab.config.load_dynamic_cron_schedules!
jobs = Gitlab.config.cron_jobs.to_hash
jobs.delete('poll_interval') # Would be interpreted as a job otherwise
# Settingslogic (former gem used for yaml configuration) didn't allow 'class' key
# Therefore, we configure cron jobs with `job_class` as a workaround.
required_keys = %w[job_class cron]
jobs.each do |k, v|
if jobs[k] && required_keys.all? { |s| jobs[k].key?(s) }
jobs[k]['class'] = jobs[k].delete('job_class')
else
jobs.delete(k)
Gitlab::AppLogger.error("Invalid cron_jobs config key: '#{k}'. Check your gitlab config file.")
end
end
Gitlab.config.load_dynamic_cron_schedules!
jobs = Gitlab.config.cron_jobs.to_hash
jobs.delete('poll_interval') # Would be interpreted as a job otherwise
 
jobs
# Settingslogic (former gem used for yaml configuration) didn't allow 'class' key
# Therefore, we configure cron jobs with `job_class` as a workaround.
required_keys = %w[job_class cron]
jobs.each do |k, v|
if jobs[k] && required_keys.all? { |s| jobs[k].key?(s) }
jobs[k]['class'] = jobs[k].delete('job_class')
else
jobs.delete(k)
Gitlab::AppLogger.error("Invalid cron_jobs config key: '#{k}'. Check your gitlab config file.")
end
end
jobs
end
strong_memoize_attr :cron_jobs
 
def cron_workers
@cron_workers ||= cron_jobs.map { |job_name, options| options['class'].constantize }
Loading
Loading
Loading
Loading
@@ -8,7 +8,6 @@
 
require_relative '../config/bundler_setup'
 
ENV['GITLAB_ENV'] = 'test'
ENV['IN_MEMORY_APPLICATION_SETTINGS'] = 'true'
 
require './spec/deprecation_warnings'
Loading
Loading
Loading
Loading
@@ -78,11 +78,13 @@
end
 
around do |example|
Gitlab::SidekiqConfig.clear_memoization(:cron_jobs)
original_settings = Gitlab.config['cron_jobs']
Gitlab.config['cron_jobs'] = cron_jobs_settings
 
example.run
 
Gitlab::SidekiqConfig.clear_memoization(:cron_jobs)
Gitlab.config['cron_jobs'] = original_settings
end
 
Loading
Loading
Loading
Loading
@@ -18,6 +18,14 @@
end
 
describe '.cron_jobs' do
around do |example|
described_class.clear_memoization(:cron_jobs)
example.run
described_class.clear_memoization(:cron_jobs)
end
it 'renames job_class to class and removes incomplete jobs' do
expect(Gitlab)
.to receive(:config)
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