Skip to content
Snippets Groups Projects
Commit 37eff29d authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent 9411a664
No related branches found
No related tags found
No related merge requests found
Showing
with 246 additions and 38 deletions
Loading
Loading
@@ -187,7 +187,7 @@ class Gitlab::Seeder::CycleAnalytics
 
pipeline.builds.each(&:enqueue) # make sure all pipelines in pending state
pipeline.builds.each(&:run!)
pipeline.update_status
pipeline.update_legacy_status
end
end
 
Loading
Loading
@@ -208,7 +208,7 @@ class Gitlab::Seeder::CycleAnalytics
job = merge_request.head_pipeline.builds.where.not(environment: nil).last
 
job.success!
job.pipeline.update_status
job.pipeline.update_legacy_status
end
end
end
Loading
Loading
# frozen_string_literal: true
class AddProcessedToCiBuilds < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :ci_builds, :processed, :boolean
end
end
Loading
Loading
@@ -697,6 +697,7 @@ ActiveRecord::Schema.define(version: 2020_01_14_204949) do
t.integer "upstream_pipeline_id"
t.bigint "resource_group_id"
t.datetime_with_timezone "waiting_for_resource_at"
t.boolean "processed"
t.index ["artifacts_expire_at"], name: "index_ci_builds_on_artifacts_expire_at", where: "(artifacts_file <> ''::text)"
t.index ["auto_canceled_by_id"], name: "index_ci_builds_on_auto_canceled_by_id"
t.index ["commit_id", "artifacts_expire_at", "id"], name: "index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial", where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('sast:container'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))"
Loading
Loading
Loading
Loading
@@ -410,7 +410,7 @@ This method is controlled by the following parameters:
In the example below, we list 50 [projects](projects.md) per page, ordered by `id` ascending.
 
```bash
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects?pagination=keyset&per_page=50&order_by=id&sort=asc"
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects?pagination=keyset&per_page=50&order_by=id&sort=asc"
```
 
The response header includes a link to the next page. For example:
Loading
Loading
Loading
Loading
@@ -211,7 +211,7 @@ create the actual RDS instance.
 
Now, it's time to create the database:
 
1. Select **Instances** from the left menu and click **Create database**.
1. Select **Databases** from the left menu and click **Create database**.
1. Select PostgreSQL and click **Next**.
1. Since this is a production server, let's choose "Production". Click **Next**.
1. Let's see the instance specifications:
Loading
Loading
Loading
Loading
@@ -240,6 +240,7 @@ excluded_attributes:
- :upstream_pipeline_id
- :resource_group_id
- :waiting_for_resource_at
- :processed
sentry_issue:
- :issue_id
push_event_payload:
Loading
Loading
Loading
Loading
@@ -587,7 +587,9 @@ msgstr[0] ""
msgstr[1] ""
 
msgid "1 hour"
msgstr ""
msgid_plural "%d hours"
msgstr[0] ""
msgstr[1] ""
 
msgid "1 merged merge request"
msgid_plural "%{merge_requests} merged merge requests"
Loading
Loading
@@ -684,6 +686,9 @@ msgstr ""
msgid "8 hours"
msgstr ""
 
msgid "< 1 hour"
msgstr ""
msgid "<code>\"johnsmith@example.com\": \"@johnsmith\"</code> will add \"By <a href=\"#\">@johnsmith</a>\" to all issues and comments originally created by johnsmith@example.com, and will set <a href=\"#\">@johnsmith</a> as the assignee on all issues originally assigned to johnsmith@example.com."
msgstr ""
 
Loading
Loading
@@ -1774,6 +1779,9 @@ msgstr ""
msgid "An error occurred while loading issues"
msgstr ""
 
msgid "An error occurred while loading merge requests."
msgstr ""
msgid "An error occurred while loading the data. Please try again."
msgstr ""
 
Loading
Loading
@@ -11058,6 +11066,9 @@ msgid_plural "Limited to showing %d events at most"
msgstr[0] ""
msgstr[1] ""
 
msgid "Line changes"
msgstr ""
msgid "Link copied"
msgstr ""
 
Loading
Loading
@@ -15835,6 +15846,9 @@ msgstr ""
msgid "Review the process for configuring service providers in your identity provider — in this case, GitLab is the \"service provider\" or \"relying party\"."
msgstr ""
 
msgid "Review time"
msgstr ""
msgid "Review time is defined as the time it takes from first comment until merged."
msgstr ""
 
Loading
Loading
@@ -22627,6 +22641,9 @@ msgstr ""
msgid "opened %{timeAgoString} by %{user}"
msgstr ""
 
msgid "opened %{timeAgo}"
msgstr ""
msgid "out of %d total test"
msgid_plural "out of %d total tests"
msgstr[0] ""
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@
"@babel/plugin-syntax-import-meta": "^7.2.0",
"@babel/preset-env": "^7.6.2",
"@gitlab/svgs": "^1.89.0",
"@gitlab/ui": "8.15.0",
"@gitlab/ui": "8.17.0",
"@gitlab/visual-review-tools": "1.5.1",
"@sentry/browser": "^5.10.2",
"@sourcegraph/code-host-integration": "^0.0.18",
Loading
Loading
Loading
Loading
@@ -63,7 +63,7 @@ describe 'test coverage badge' do
 
create(:ci_pipeline, opts).tap do |pipeline|
yield pipeline
pipeline.update_status
pipeline.update_legacy_status
end
end
 
Loading
Loading
Loading
Loading
@@ -102,7 +102,7 @@ describe Gitlab::Badge::Coverage::Report do
 
create(:ci_pipeline, opts).tap do |pipeline|
yield pipeline
pipeline.update_status
pipeline.update_legacy_status
end
end
end
Loading
Loading
@@ -216,6 +216,7 @@ stages:
- project
- pipeline
- statuses
- processables
- builds
- bridges
statuses:
Loading
Loading
Loading
Loading
@@ -333,6 +333,7 @@ CommitStatus:
- scheduled_at
- upstream_pipeline_id
- interruptible
- processed
Ci::Variable:
- id
- project_id
Loading
Loading
Loading
Loading
@@ -3,6 +3,9 @@
require 'spec_helper'
 
describe Board do
let(:project) { create(:project) }
let(:other_project) { create(:project) }
describe 'relationships' do
it { is_expected.to belong_to(:project) }
it { is_expected.to have_many(:lists).order(list_type: :asc, position: :asc).dependent(:delete_all) }
Loading
Loading
@@ -11,4 +14,28 @@ describe Board do
describe 'validations' do
it { is_expected.to validate_presence_of(:project) }
end
describe '#order_by_name_asc' do
let!(:second_board) { create(:board, name: 'Secondary board', project: project) }
let!(:first_board) { create(:board, name: 'First board', project: project) }
it 'returns in alphabetical order' do
expect(project.boards.order_by_name_asc).to eq [first_board, second_board]
end
end
describe '#first_board' do
let!(:other_board) { create(:board, name: 'Other board', project: other_project) }
let!(:second_board) { create(:board, name: 'Secondary board', project: project) }
let!(:first_board) { create(:board, name: 'First board', project: project) }
it 'return the first alphabetical board as a relation' do
expect(project.boards.first_board).to eq [first_board]
end
# BoardsActions#board expects this behavior
it 'raises an error when find is done on a non-existent record' do
expect { project.boards.first_board.find(second_board.id) }.to raise_error(ActiveRecord::RecordNotFound)
end
end
end
Loading
Loading
@@ -604,7 +604,7 @@ describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state do
context 'when traces are archived' do
let(:subject) do
project.builds.each do |build|
build.success!
build.reset.success!
end
end
 
Loading
Loading
Loading
Loading
@@ -1008,22 +1008,22 @@ describe Ci::Pipeline, :mailer do
end
end
 
describe '#duration', :sidekiq_might_not_need_inline do
describe '#duration', :sidekiq_inline do
context 'when multiple builds are finished' do
before do
travel_to(current + 30) do
build.run!
build.success!
build.reload.success!
build_b.run!
build_c.run!
end
 
travel_to(current + 40) do
build_b.drop!
build_b.reload.drop!
end
 
travel_to(current + 70) do
build_c.success!
build_c.reload.success!
end
end
 
Loading
Loading
@@ -1044,7 +1044,7 @@ describe Ci::Pipeline, :mailer do
end
 
travel_to(current + 5.minutes) do
build.success!
build.reload.success!
end
end
 
Loading
Loading
@@ -1585,6 +1585,30 @@ describe Ci::Pipeline, :mailer do
end
end
 
describe '#needs_processing?' do
using RSpec::Parameterized::TableSyntax
subject { pipeline.needs_processing? }
where(:processed, :result) do
nil | true
false | true
true | false
end
with_them do
let(:build) do
create(:ci_build, :success, pipeline: pipeline, name: 'rubocop')
end
before do
build.update_column(:processed, processed)
end
it { is_expected.to eq(result) }
end
end
shared_context 'with some outdated pipelines' do
before do
create_pipeline(:canceled, 'ref', 'A', project)
Loading
Loading
@@ -1785,7 +1809,7 @@ describe Ci::Pipeline, :mailer do
it { is_expected.not_to include('created', 'waiting_for_resource', 'preparing', 'pending') }
end
 
describe '#status', :sidekiq_might_not_need_inline do
describe '#status', :sidekiq_inline do
let(:build) do
create(:ci_build, :created, pipeline: pipeline, name: 'test')
end
Loading
Loading
@@ -1826,7 +1850,7 @@ describe Ci::Pipeline, :mailer do
context 'on run' do
before do
build.enqueue
build.run
build.reload.run
end
 
it { is_expected.to eq('running') }
Loading
Loading
@@ -1885,7 +1909,7 @@ describe Ci::Pipeline, :mailer do
it 'updates does not change pipeline status' do
expect(pipeline.statuses.latest.slow_composite_status).to be_nil
 
expect { pipeline.update_status }
expect { pipeline.update_legacy_status }
.to change { pipeline.reload.status }
.from('created')
.to('skipped')
Loading
Loading
@@ -1898,7 +1922,7 @@ describe Ci::Pipeline, :mailer do
end
 
it 'updates pipeline status to running' do
expect { pipeline.update_status }
expect { pipeline.update_legacy_status }
.to change { pipeline.reload.status }
.from('created')
.to('running')
Loading
Loading
@@ -1911,7 +1935,7 @@ describe Ci::Pipeline, :mailer do
end
 
it 'updates pipeline status to scheduled' do
expect { pipeline.update_status }
expect { pipeline.update_legacy_status }
.to change { pipeline.reload.status }
.from('created')
.to('scheduled')
Loading
Loading
@@ -1926,7 +1950,7 @@ describe Ci::Pipeline, :mailer do
end
 
it 'raises an exception' do
expect { pipeline.update_status }
expect { pipeline.update_legacy_status }
.to raise_error(HasStatus::UnknownStatusError)
end
end
Loading
Loading
@@ -2214,11 +2238,11 @@ describe Ci::Pipeline, :mailer do
stub_full_request(hook.url, method: :post)
end
 
context 'with multiple builds', :sidekiq_might_not_need_inline do
context 'with multiple builds', :sidekiq_inline do
context 'when build is queued' do
before do
build_a.enqueue
build_b.enqueue
build_a.reload.enqueue
build_b.reload.enqueue
end
 
it 'receives a pending event once' do
Loading
Loading
@@ -2228,10 +2252,10 @@ describe Ci::Pipeline, :mailer do
 
context 'when build is run' do
before do
build_a.enqueue
build_a.run
build_b.enqueue
build_b.run
build_a.reload.enqueue
build_a.reload.run!
build_b.reload.enqueue
build_b.reload.run!
end
 
it 'receives a running event once' do
Loading
Loading
@@ -2292,6 +2316,7 @@ describe Ci::Pipeline, :mailer do
:created,
pipeline: pipeline,
name: name,
stage: "stage:#{stage_idx}",
stage_idx: stage_idx)
end
end
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Ci::Processable do
set(:project) { create(:project) }
set(:pipeline) { create(:ci_pipeline, project: project) }
describe '#aggregated_needs_names' do
let(:with_aggregated_needs) { pipeline.processables.select_with_aggregated_needs(project) }
context 'with created status' do
let!(:processable) { create(:ci_build, :created, project: project, pipeline: pipeline) }
context 'with needs' do
before do
create(:ci_build_need, build: processable, name: 'test1')
create(:ci_build_need, build: processable, name: 'test2')
end
it 'returns all processables' do
expect(with_aggregated_needs).to contain_exactly(processable)
end
it 'returns all needs' do
expect(with_aggregated_needs.first.aggregated_needs_names).to contain_exactly('test1', 'test2')
end
context 'with ci_dag_support disabled' do
before do
stub_feature_flags(ci_dag_support: false)
end
it 'returns all processables' do
expect(with_aggregated_needs).to contain_exactly(processable)
end
it 'returns empty needs' do
expect(with_aggregated_needs.first.aggregated_needs_names).to be_nil
end
end
end
context 'without needs' do
it 'returns all processables' do
expect(with_aggregated_needs).to contain_exactly(processable)
end
it 'returns empty needs' do
expect(with_aggregated_needs.first.aggregated_needs_names).to be_nil
end
end
end
end
end
Loading
Loading
@@ -63,7 +63,7 @@ describe Ci::Stage, :models do
end
 
it 'updates stage status correctly' do
expect { stage.update_status }
expect { stage.update_legacy_status }
.to change { stage.reload.status }
.to eq 'running'
end
Loading
Loading
@@ -87,7 +87,7 @@ describe Ci::Stage, :models do
end
 
it 'updates status to skipped' do
expect { stage.update_status }
expect { stage.update_legacy_status }
.to change { stage.reload.status }
.to eq 'skipped'
end
Loading
Loading
@@ -99,7 +99,7 @@ describe Ci::Stage, :models do
end
 
it 'updates status to scheduled' do
expect { stage.update_status }
expect { stage.update_legacy_status }
.to change { stage.reload.status }
.to 'scheduled'
end
Loading
Loading
@@ -111,7 +111,7 @@ describe Ci::Stage, :models do
end
 
it 'updates status to waiting for resource' do
expect { stage.update_status }
expect { stage.update_legacy_status }
.to change { stage.reload.status }
.to 'waiting_for_resource'
end
Loading
Loading
@@ -119,7 +119,7 @@ describe Ci::Stage, :models do
 
context 'when stage is skipped because is empty' do
it 'updates status to skipped' do
expect { stage.update_status }
expect { stage.update_legacy_status }
.to change { stage.reload.status }
.to eq('skipped')
end
Loading
Loading
@@ -133,7 +133,7 @@ describe Ci::Stage, :models do
it 'retries a lock to update a stage status' do
stage.lock_version = 100
 
stage.update_status
stage.update_legacy_status
 
expect(stage.reload).to be_failed
end
Loading
Loading
@@ -147,7 +147,7 @@ describe Ci::Stage, :models do
end
 
it 'raises an exception' do
expect { stage.update_status }
expect { stage.update_legacy_status }
.to raise_error(HasStatus::UnknownStatusError)
end
end
Loading
Loading
@@ -179,7 +179,7 @@ describe Ci::Stage, :models do
stage_id: stage.id,
status: status)
 
stage.update_status
stage.update_legacy_status
end
end
 
Loading
Loading
@@ -196,7 +196,7 @@ describe Ci::Stage, :models do
status: :failed,
allow_failure: true)
 
stage.update_status
stage.update_legacy_status
end
 
it 'is passed with warnings' do
Loading
Loading
@@ -243,7 +243,7 @@ describe Ci::Stage, :models do
it 'recalculates index before updating status' do
expect(stage.reload.position).to be_nil
 
stage.update_status
stage.update_legacy_status
 
expect(stage.reload.position).to eq 10
end
Loading
Loading
@@ -253,7 +253,7 @@ describe Ci::Stage, :models do
it 'fallbacks to zero' do
expect(stage.reload.position).to be_nil
 
stage.update_status
stage.update_legacy_status
 
expect(stage.reload.position).to eq 0
end
Loading
Loading
Loading
Loading
@@ -63,6 +63,42 @@ describe CommitStatus do
end
end
 
describe '#processed' do
subject { commit_status.processed }
context 'when ci_atomic_processing is disabled' do
before do
stub_feature_flags(ci_atomic_processing: false)
commit_status.save!
end
it { is_expected.to be_nil }
end
context 'when ci_atomic_processing is enabled' do
before do
stub_feature_flags(ci_atomic_processing: true)
end
context 'status is latest' do
before do
commit_status.update!(retried: false, status: :pending)
end
it { is_expected.to be_falsey }
end
context 'status is retried' do
before do
commit_status.update!(retried: true, status: :pending)
end
it { is_expected.to be_truthy }
end
end
end
describe '#started?' do
subject { commit_status.started? }
 
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe ChatMessage::BaseMessage do
let(:base_message) { described_class.new(args) }
let(:args) { { project_url: 'https://gitlab-domain.com' } }
describe '#fallback' do
subject { base_message.fallback }
before do
allow(base_message).to receive(:message).and_return(message)
end
context 'without relative links' do
let(:message) { 'Just another *markdown* message' }
it { is_expected.to eq(message) }
end
context 'with relative links' do
let(:message) { 'Check this out ![Screenshot1](/uploads/Screenshot1.png)' }
it { is_expected.to eq('Check this out https://gitlab-domain.com/uploads/Screenshot1.png') }
end
context 'with multiple relative links' do
let(:message) { 'Check this out ![Screenshot1](/uploads/Screenshot1.png). And this ![Screenshot2](/uploads/Screenshot2.png)' }
it { is_expected.to eq('Check this out https://gitlab-domain.com/uploads/Screenshot1.png. And this https://gitlab-domain.com/uploads/Screenshot2.png') }
end
end
end
Loading
Loading
@@ -10,6 +10,7 @@ describe Boards::ListService do
subject(:service) { described_class.new(parent, double) }
 
it_behaves_like 'boards list service'
it_behaves_like 'multiple boards list service'
end
 
context 'when board parent is a group' do
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