diff options
author | samdbeckham <sbeckham@gitlab.com> | 2018-07-25 15:31:48 +0100 |
---|---|---|
committer | samdbeckham <sbeckham@gitlab.com> | 2018-07-25 15:31:48 +0100 |
commit | ef5c9a5853b3cff1f5a952e5a87593c187834019 (patch) | |
tree | b94d4a7ce89fc8a0083149a437466144b47f0d3a | |
parent | 181f98f695eac05ffc6b5d57d665f4bd52d43f21 (diff) | |
parent | 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd (diff) | |
download | gitlab-ce-ef5c9a5853b3cff1f5a952e5a87593c187834019.tar.gz |
Merge branch 'artifact-format-v2-with-parser' of gitlab.com:gitlab-org/gitlab-ce into artifact-format-v2-with-parser
-rw-r--r-- | app/assets/javascripts/reports/components/grouped_test_reports_app.vue | 4 | ||||
-rw-r--r-- | app/assets/javascripts/reports/components/modal.vue | 26 | ||||
-rw-r--r-- | app/assets/javascripts/reports/store/actions.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/reports/store/mutations.js | 29 | ||||
-rw-r--r-- | app/assets/javascripts/reports/store/state.js | 3 | ||||
-rw-r--r-- | app/models/ci/job_artifact.rb | 28 | ||||
-rw-r--r-- | spec/javascripts/reports/store/actions_spec.js | 7 |
7 files changed, 101 insertions, 0 deletions
diff --git a/app/assets/javascripts/reports/components/grouped_test_reports_app.vue b/app/assets/javascripts/reports/components/grouped_test_reports_app.vue index 89ee7126cb8..d222f6bc930 100644 --- a/app/assets/javascripts/reports/components/grouped_test_reports_app.vue +++ b/app/assets/javascripts/reports/components/grouped_test_reports_app.vue @@ -40,7 +40,11 @@ return s__('Reports|Test summary results are being parsed'); } +<<<<<<< HEAD if (this.hasError || !this.summaryCounts) { +======= + if (this) { +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd return s__('Reports|Test summary failed loading results'); } diff --git a/app/assets/javascripts/reports/components/modal.vue b/app/assets/javascripts/reports/components/modal.vue index 6b49d0b832e..d51d31f042e 100644 --- a/app/assets/javascripts/reports/components/modal.vue +++ b/app/assets/javascripts/reports/components/modal.vue @@ -31,6 +31,7 @@ this.$emit('createIssue'); }, }, +<<<<<<< HEAD computed: { shouldRenderFooterSection() { return this.canCreateIssuePermission; @@ -40,13 +41,19 @@ return false; }, } +======= +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd }; </script> <template> <modal id="modal-mrwidget-reports" :header-title-text="title" +<<<<<<< HEAD :class="{ 'modal-hide-footer': !shouldRenderFooterSection }" +======= + :class="{ 'modal-hide-footer': false }" +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd class="modal-security-report-dast" > <slot> @@ -86,6 +93,7 @@ </div> </slot> <div slot="footer"> +<<<<<<< HEAD <template v-if="shouldRenderFooterSection"> <button type="button" @@ -104,6 +112,24 @@ @click="handleCreateIssueClick" /> </template> +======= + <button + type="button" + class="btn btn-default" + data-dismiss="modal" + > + {{ __('Cancel' ) }} + </button> + + <loading-button + v-if="canCreateIssuePermission" + :loading="isCreatingNewIssue" + :disabled="isCreatingNewIssue" + :label="__('Create issue')" + container-class="js-create-issue-btn btn btn-success btn-inverted" + @click="handleCreateIssueClick" + /> +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd </div> </modal> </template> diff --git a/app/assets/javascripts/reports/store/actions.js b/app/assets/javascripts/reports/store/actions.js index 1b6a3b7cbb8..b0880254f31 100644 --- a/app/assets/javascripts/reports/store/actions.js +++ b/app/assets/javascripts/reports/store/actions.js @@ -31,7 +31,11 @@ export const restartPolling = () => { * Poll.js will handle etag response. * While http status code is 204, it means it's parsing, and we'll keep polling * When http status code is 200, it means parsing is done, we can show the results & stop polling +<<<<<<< HEAD * When http status code is 500, it means parsing went wrong and we stop polling +======= + * When http status code is 500, it means parsins went wrong and we stop polling +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd */ export const fetchReports = ({ state, dispatch }) => { dispatch('requestReports'); diff --git a/app/assets/javascripts/reports/store/mutations.js b/app/assets/javascripts/reports/store/mutations.js index 6068ef49975..055b01562c3 100644 --- a/app/assets/javascripts/reports/store/mutations.js +++ b/app/assets/javascripts/reports/store/mutations.js @@ -1,4 +1,8 @@ /* eslint-disable no-param-reassign */ +<<<<<<< HEAD +======= +import Vue from 'vue'; +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd import * as types from './mutation_types'; export default { @@ -12,9 +16,15 @@ export default { state.isLoading = false; +<<<<<<< HEAD state.summary.total = response.summary.total; state.summary.resolved = response.summary.resolved; state.summary.failed = response.summary.failed; +======= + Vue.set(state.summary, 'total', response.summary.total); + Vue.set(state.summary, 'resolved', response.summary.resolved); + Vue.set(state.summary, 'failed', response.summary.failed); +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd state.status = response.status; state.reports = response.suites; @@ -25,6 +35,7 @@ export default { state.hasError = true; }, [types.SET_ISSUE_MODAL_DATA](state, payload) { +<<<<<<< HEAD state.modal.title = payload.issue.name; state.modal.status = payload.status; @@ -34,10 +45,19 @@ export default { ...state.modal.data[key], value: payload.issue[key] } +======= + Vue.set(state.modal, 'title', payload.issue.name); + Vue.set(state.modal, 'status', payload.status); + + Object.keys(payload.issue).forEach((key) => { + if (Object.prototype.hasOwnProperty.call(state.modal.data, key)) { + Vue.set(state.modal.data[key], 'value', payload.issue[key]); +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd } }); }, [types.REQUEST_CREATE_ISSUE](state) { +<<<<<<< HEAD state.modal.isLoading = true; }, [types.RECEIVE_CREATE_ISSUE_SUCCESS](state) { @@ -45,5 +65,14 @@ export default { }, [types.RECEIVE_CREATE_ISSUE_ERROR](state) { state.modal.isLoading = false; +======= + Vue.set(state.modal, 'isLoading', true); + }, + [types.RECEIVE_CREATE_ISSUE_SUCCESS](state) { + Vue.set(state.modal, 'isLoading', false); + }, + [types.RECEIVE_CREATE_ISSUE_ERROR](state) { + Vue.set(state.modal, 'isLoading', false); +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd }, }; diff --git a/app/assets/javascripts/reports/store/state.js b/app/assets/javascripts/reports/store/state.js index 02197fbb97a..71300137fe7 100644 --- a/app/assets/javascripts/reports/store/state.js +++ b/app/assets/javascripts/reports/store/state.js @@ -37,7 +37,10 @@ export default () => ({ status: null, isCreatingNewIssue: false, +<<<<<<< HEAD isLoading: false, +======= +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd hasError: false, data: { diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index f2b37f4c986..3f520bdfeb7 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -32,6 +32,7 @@ module Ci metadata: 2, trace: 3, junit: 4 +<<<<<<< HEAD } GENERAL_ARCHIVE_FILE_TYPE = 'archive'.freeze @@ -47,6 +48,8 @@ module Ci FILE_FORMAT_ADAPTERS = { gzip: Gitlab::Ci::Build::Artifacts::GzipFileAdapter +======= +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd } def valid_file_format? unless TYPE_AND_FORMAT_PAIRS[self.file_type&.to_sym] == self.file_format&.to_sym @@ -58,6 +61,31 @@ module Ci ActiveRecord::Migrator.current_version <= ::Gitlab::Ci::Trace::ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION end + GENERAL_ARCHIVE_FILE_TYPE = 'archive'.freeze + TEST_REPORT_FILE_TYPES = %w[junit].freeze + DEFAULT_FILE_NAMES = { junit: 'junit.xml' }.freeze + TYPE_AND_FORMAT_PAIRS = { archive: :zip, metadata: :gzip, trace: :raw, junit: :gzip }.freeze + + enum file_format: { + raw: 1, + zip: 2, + gzip: 3 + } + + FILE_FORMAT_ADAPTERS = { + gzip: Gitlab::Ci::Build::Artifacts::GzipFileAdapter + } + + def valid_file_format? + unless TYPE_AND_FORMAT_PAIRS[self.file_type&.to_sym] == self.file_format&.to_sym + errors.add(:file_format, 'Invalid file format with specified file type') + end + end + + def ignore_schema + ActiveRecord::Migrator.current_version <= ::Gitlab::Ci::Trace::ARCHIVE_LEGACY_TRACES_MIGRATION_VERSION + end + def update_file_store # The file.object_store is set during `uploader.store!` # which happens after object is inserted/updated diff --git a/spec/javascripts/reports/store/actions_spec.js b/spec/javascripts/reports/store/actions_spec.js index 63c69db7739..eff191d15ef 100644 --- a/spec/javascripts/reports/store/actions_spec.js +++ b/spec/javascripts/reports/store/actions_spec.js @@ -56,7 +56,11 @@ describe('Reports Store Actions', () => { describe('success', () => { it('dispatches requestReports and receiveReportsSuccess ', done => { +<<<<<<< HEAD mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, { summary: {}, suites: [{ name: 'rspec' }] }); +======= + mock.onGet(`${TEST_HOST}/endpoint.json`).reply(200, { summary: {}, suites: [{ name: 'rspec' }] }); +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd testAction( fetchReports, @@ -100,6 +104,7 @@ describe('Reports Store Actions', () => { ); }); }); +<<<<<<< HEAD describe('no content', () => { beforeEach(() => { @@ -122,6 +127,8 @@ describe('Reports Store Actions', () => { ); }); }); +======= +>>>>>>> 8f3b9c0d313f9eeef1b6e6b5eccf622156e960bd }); describe('receiveReportsSuccess', () => { |