Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 18:08:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-20 18:08:20 +0300
commit1d5ae049f089db097048fa896105ad75fe859596 (patch)
tree563e688a9aca27c1dff95f853e7e26ffeb2ddc30
parent374cf04cf2a496344e0e27d8ddf740f7a543f7af (diff)
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--.rubocop.yml1
-rw-r--r--app/assets/javascripts/alert_management/components/alert_management_list.vue10
-rw-r--r--app/models/clusters/applications/runner.rb2
-rw-r--r--changelogs/unreleased/Remove-clickable-styling-from-loading-row.yml5
-rw-r--r--changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-17-0.yml5
-rw-r--r--db/migrate/20200511181027_create_test_reports.rb18
-rw-r--r--db/migrate/20200511191027_add_author_foreign_key_to_test_reports.rb19
-rw-r--r--db/migrate/20200511208012_add_pipeline_foreign_key_to_test_reports.rb19
-rw-r--r--db/structure.sql41
-rw-r--r--lib/gitlab/danger/emoji_checker.rb6
-rw-r--r--lib/gitlab/danger/request_helper.rb2
-rw-r--r--spec/frontend/alert_management/components/alert_management_list_spec.js20
12 files changed, 140 insertions, 8 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 3c5771da32d..bec305da54c 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -225,6 +225,7 @@ Gitlab/Json:
- 'scripts/**/*'
- 'lib/rspec_flaky/**/*'
- 'lib/quality/**/*'
+ - 'lib/gitlab/danger/**/*'
GitlabSecurity/PublicSend:
Enabled: true
diff --git a/app/assets/javascripts/alert_management/components/alert_management_list.vue b/app/assets/javascripts/alert_management/components/alert_management_list.vue
index 1909840ed19..7c0c456daa1 100644
--- a/app/assets/javascripts/alert_management/components/alert_management_list.vue
+++ b/app/assets/javascripts/alert_management/components/alert_management_list.vue
@@ -26,7 +26,6 @@ const bodyTrClass =
'gl-border-1 gl-border-t-solid gl-border-gray-100 hover-bg-blue-50 hover-gl-cursor-pointer hover-gl-border-b-solid hover-gl-border-blue-200';
export default {
- bodyTrClass,
i18n: {
noAlertsMsg: s__(
"AlertManagement|No alerts available to display. If you think you're seeing this message in error, refresh the page.",
@@ -132,7 +131,6 @@ export default {
},
data() {
return {
- alerts: null,
errored: false,
isAlertDismissed: false,
isErrorAlertDismissed: false,
@@ -149,6 +147,12 @@ export default {
loading() {
return this.$apollo.queries.alerts.loading;
},
+ hasAlerts() {
+ return this.alerts?.length;
+ },
+ tbodyTrClass() {
+ return !this.loading && this.hasAlerts ? bodyTrClass : '';
+ },
},
methods: {
filterAlertsByStatus(tabIndex) {
@@ -210,7 +214,7 @@ export default {
:show-empty="true"
:busy="loading"
stacked="md"
- :tbody-tr-class="$options.bodyTrClass"
+ :tbody-tr-class="tbodyTrClass"
@row-clicked="navigateToAlertDetails"
>
<template #cell(severity)="{ item }">
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb
index a861126908f..51ab5f66302 100644
--- a/app/models/clusters/applications/runner.rb
+++ b/app/models/clusters/applications/runner.rb
@@ -3,7 +3,7 @@
module Clusters
module Applications
class Runner < ApplicationRecord
- VERSION = '0.16.1'
+ VERSION = '0.17.0'
self.table_name = 'clusters_applications_runners'
diff --git a/changelogs/unreleased/Remove-clickable-styling-from-loading-row.yml b/changelogs/unreleased/Remove-clickable-styling-from-loading-row.yml
new file mode 100644
index 00000000000..a32c3d5f847
--- /dev/null
+++ b/changelogs/unreleased/Remove-clickable-styling-from-loading-row.yml
@@ -0,0 +1,5 @@
+---
+title: Fix loading and empty state styling for alerts list
+merge_request: 32531
+author:
+type: fixed
diff --git a/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-17-0.yml b/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-17-0.yml
new file mode 100644
index 00000000000..98f8ec0c03b
--- /dev/null
+++ b/changelogs/unreleased/update-gitlab-runner-helm-chart-to-0-17-0.yml
@@ -0,0 +1,5 @@
+---
+title: Update GitLab Runner Helm Chart to 0.17.0
+merge_request: 32634
+author:
+type: other
diff --git a/db/migrate/20200511181027_create_test_reports.rb b/db/migrate/20200511181027_create_test_reports.rb
new file mode 100644
index 00000000000..a08e208441d
--- /dev/null
+++ b/db/migrate/20200511181027_create_test_reports.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CreateTestReports < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ create_table :requirements_management_test_reports do |t|
+ t.datetime_with_timezone :created_at, null: false
+ t.references :requirement, null: false, foreign_key: { on_delete: :cascade }
+ t.bigint :pipeline_id
+ t.bigint :author_id
+ t.integer :state, null: false, limit: 2
+
+ t.index :pipeline_id
+ t.index :author_id
+ end
+ end
+end
diff --git a/db/migrate/20200511191027_add_author_foreign_key_to_test_reports.rb b/db/migrate/20200511191027_add_author_foreign_key_to_test_reports.rb
new file mode 100644
index 00000000000..a9fbee388c5
--- /dev/null
+++ b/db/migrate/20200511191027_add_author_foreign_key_to_test_reports.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddAuthorForeignKeyToTestReports < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ with_lock_retries do
+ add_foreign_key :requirements_management_test_reports, :users, column: :author_id, on_delete: :nullify # rubocop:disable Migration/AddConcurrentForeignKey
+ end
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :requirements_management_test_reports, column: :author_id
+ end
+ end
+end
diff --git a/db/migrate/20200511208012_add_pipeline_foreign_key_to_test_reports.rb b/db/migrate/20200511208012_add_pipeline_foreign_key_to_test_reports.rb
new file mode 100644
index 00000000000..2b9b3464580
--- /dev/null
+++ b/db/migrate/20200511208012_add_pipeline_foreign_key_to_test_reports.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddPipelineForeignKeyToTestReports < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ with_lock_retries do
+ add_foreign_key :requirements_management_test_reports, :ci_pipelines, column: :pipeline_id, on_delete: :nullify # rubocop:disable Migration/AddConcurrentForeignKey
+ end
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key :requirements_management_test_reports, column: :pipeline_id
+ end
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index 98a111df419..0f732c3ef20 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -5773,6 +5773,24 @@ CREATE SEQUENCE public.requirements_id_seq
ALTER SEQUENCE public.requirements_id_seq OWNED BY public.requirements.id;
+CREATE TABLE public.requirements_management_test_reports (
+ id bigint NOT NULL,
+ created_at timestamp with time zone NOT NULL,
+ requirement_id bigint NOT NULL,
+ pipeline_id bigint,
+ author_id bigint,
+ state smallint NOT NULL
+);
+
+CREATE SEQUENCE public.requirements_management_test_reports_id_seq
+ START WITH 1
+ INCREMENT BY 1
+ NO MINVALUE
+ NO MAXVALUE
+ CACHE 1;
+
+ALTER SEQUENCE public.requirements_management_test_reports_id_seq OWNED BY public.requirements_management_test_reports.id;
+
CREATE TABLE public.resource_label_events (
id bigint NOT NULL,
action integer NOT NULL,
@@ -7777,6 +7795,8 @@ ALTER TABLE ONLY public.remote_mirrors ALTER COLUMN id SET DEFAULT nextval('publ
ALTER TABLE ONLY public.requirements ALTER COLUMN id SET DEFAULT nextval('public.requirements_id_seq'::regclass);
+ALTER TABLE ONLY public.requirements_management_test_reports ALTER COLUMN id SET DEFAULT nextval('public.requirements_management_test_reports_id_seq'::regclass);
+
ALTER TABLE ONLY public.resource_label_events ALTER COLUMN id SET DEFAULT nextval('public.resource_label_events_id_seq'::regclass);
ALTER TABLE ONLY public.resource_milestone_events ALTER COLUMN id SET DEFAULT nextval('public.resource_milestone_events_id_seq'::regclass);
@@ -8709,6 +8729,9 @@ ALTER TABLE ONLY public.releases
ALTER TABLE ONLY public.remote_mirrors
ADD CONSTRAINT remote_mirrors_pkey PRIMARY KEY (id);
+ALTER TABLE ONLY public.requirements_management_test_reports
+ ADD CONSTRAINT requirements_management_test_reports_pkey PRIMARY KEY (id);
+
ALTER TABLE ONLY public.requirements
ADD CONSTRAINT requirements_pkey PRIMARY KEY (id);
@@ -10506,6 +10529,12 @@ CREATE INDEX index_remote_mirrors_on_project_id ON public.remote_mirrors USING b
CREATE UNIQUE INDEX index_repository_languages_on_project_and_languages_id ON public.repository_languages USING btree (project_id, programming_language_id);
+CREATE INDEX index_requirements_management_test_reports_on_author_id ON public.requirements_management_test_reports USING btree (author_id);
+
+CREATE INDEX index_requirements_management_test_reports_on_pipeline_id ON public.requirements_management_test_reports USING btree (pipeline_id);
+
+CREATE INDEX index_requirements_management_test_reports_on_requirement_id ON public.requirements_management_test_reports USING btree (requirement_id);
+
CREATE INDEX index_requirements_on_author_id ON public.requirements USING btree (author_id);
CREATE INDEX index_requirements_on_created_at ON public.requirements USING btree (created_at);
@@ -11731,6 +11760,9 @@ ALTER TABLE ONLY public.service_desk_settings
ALTER TABLE ONLY public.group_custom_attributes
ADD CONSTRAINT fk_rails_246e0db83a FOREIGN KEY (group_id) REFERENCES public.namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY public.requirements_management_test_reports
+ ADD CONSTRAINT fk_rails_24cecc1e68 FOREIGN KEY (pipeline_id) REFERENCES public.ci_pipelines(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY public.group_wiki_repositories
ADD CONSTRAINT fk_rails_26f867598c FOREIGN KEY (group_id) REFERENCES public.namespaces(id) ON DELETE CASCADE;
@@ -12472,6 +12504,9 @@ ALTER TABLE ONLY public.subscriptions
ALTER TABLE ONLY public.operations_strategies
ADD CONSTRAINT fk_rails_d183b6e6dd FOREIGN KEY (feature_flag_id) REFERENCES public.operations_feature_flags(id) ON DELETE CASCADE;
+ALTER TABLE ONLY public.requirements_management_test_reports
+ ADD CONSTRAINT fk_rails_d1e8b498bf FOREIGN KEY (author_id) REFERENCES public.users(id) ON DELETE SET NULL;
+
ALTER TABLE ONLY public.pool_repositories
ADD CONSTRAINT fk_rails_d2711daad4 FOREIGN KEY (source_project_id) REFERENCES public.projects(id) ON DELETE SET NULL;
@@ -12616,6 +12651,9 @@ ALTER TABLE ONLY public.merge_trains
ALTER TABLE ONLY public.ci_runner_namespaces
ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES public.namespaces(id) ON DELETE CASCADE;
+ALTER TABLE ONLY public.requirements_management_test_reports
+ ADD CONSTRAINT fk_rails_fb3308ad55 FOREIGN KEY (requirement_id) REFERENCES public.requirements(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY public.board_project_recent_visits
ADD CONSTRAINT fk_rails_fb6fc419cb FOREIGN KEY (user_id) REFERENCES public.users(id) ON DELETE CASCADE;
@@ -13856,6 +13894,9 @@ COPY "schema_migrations" (version) FROM STDIN;
20200511145545
20200511162057
20200511162115
+20200511181027
+20200511191027
+20200511208012
20200511220023
20200512085150
20200512164334
diff --git a/lib/gitlab/danger/emoji_checker.rb b/lib/gitlab/danger/emoji_checker.rb
index a2867087428..e31a6ae5011 100644
--- a/lib/gitlab/danger/emoji_checker.rb
+++ b/lib/gitlab/danger/emoji_checker.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-require_relative '../json'
+require 'json'
module Gitlab
module Danger
@@ -25,8 +25,8 @@ module Gitlab
)}x.freeze
def initialize
- names = Gitlab::Json.parse(File.read(DIGESTS)).keys +
- Gitlab::Json.parse(File.read(ALIASES)).keys
+ names = JSON.parse(File.read(DIGESTS)).keys +
+ JSON.parse(File.read(ALIASES)).keys
@emoji = names.map { |name| ":#{name}:" }
end
diff --git a/lib/gitlab/danger/request_helper.rb b/lib/gitlab/danger/request_helper.rb
index ef51c3f2052..06da4ed9ad3 100644
--- a/lib/gitlab/danger/request_helper.rb
+++ b/lib/gitlab/danger/request_helper.rb
@@ -16,7 +16,7 @@ module Gitlab
raise HTTPError, "Failed to read #{url}: #{rsp.code} #{rsp.message}"
end
- Gitlab::Json.parse(rsp.body)
+ JSON.parse(rsp.body)
end
end
end
diff --git a/spec/frontend/alert_management/components/alert_management_list_spec.js b/spec/frontend/alert_management/components/alert_management_list_spec.js
index c4630ac57fe..78c097d595a 100644
--- a/spec/frontend/alert_management/components/alert_management_list_spec.js
+++ b/spec/frontend/alert_management/components/alert_management_list_spec.js
@@ -142,6 +142,11 @@ describe('AlertManagementList', () => {
});
expect(findAlertsTable().exists()).toBe(true);
expect(findLoader().exists()).toBe(true);
+ expect(
+ findAlerts()
+ .at(0)
+ .classes(),
+ ).not.toContain('hover-bg-blue-50');
});
it('error state', () => {
@@ -154,6 +159,11 @@ describe('AlertManagementList', () => {
expect(findAlertsTable().text()).toContain('No alerts to display');
expect(findLoader().exists()).toBe(false);
expect(findAlert().props().variant).toBe('danger');
+ expect(
+ findAlerts()
+ .at(0)
+ .classes(),
+ ).not.toContain('hover-bg-blue-50');
});
it('empty state', () => {
@@ -166,6 +176,11 @@ describe('AlertManagementList', () => {
expect(findAlertsTable().text()).toContain('No alerts to display');
expect(findLoader().exists()).toBe(false);
expect(findAlert().props().variant).toBe('info');
+ expect(
+ findAlerts()
+ .at(0)
+ .classes(),
+ ).not.toContain('hover-bg-blue-50');
});
it('has data state', () => {
@@ -177,6 +192,11 @@ describe('AlertManagementList', () => {
expect(findLoader().exists()).toBe(false);
expect(findAlertsTable().exists()).toBe(true);
expect(findAlerts()).toHaveLength(mockAlerts.length);
+ expect(
+ findAlerts()
+ .at(0)
+ .classes(),
+ ).toContain('hover-bg-blue-50');
});
it('displays status dropdown', () => {