Commit 189b5e69 authored by mfluharty's avatar mfluharty

Remove headPath and basePath

The base pipeline artifact warning was the last thing relying on these
We can render the widget when we have a codequalityReportsPath
and get rid of codeclimate.headPath and codeclimate.basePath altogether
parent 0c9b8090
...@@ -12,19 +12,10 @@ export default { ...@@ -12,19 +12,10 @@ export default {
ReportSection, ReportSection,
}, },
props: { props: {
headPath: {
type: String,
required: true,
},
headBlobPath: { headBlobPath: {
type: String, type: String,
required: true, required: true,
}, },
basePath: {
type: String,
required: false,
default: null,
},
baseBlobPath: { baseBlobPath: {
type: String, type: String,
required: false, required: false,
...@@ -52,8 +43,6 @@ export default { ...@@ -52,8 +43,6 @@ export default {
}, },
created() { created() {
this.setPaths({ this.setPaths({
basePath: this.basePath,
headPath: this.headPath,
baseBlobPath: this.baseBlobPath, baseBlobPath: this.baseBlobPath,
headBlobPath: this.headBlobPath, headBlobPath: this.headBlobPath,
reportsPath: this.codequalityReportsPath, reportsPath: this.codequalityReportsPath,
......
...@@ -2,8 +2,6 @@ import * as types from './mutation_types'; ...@@ -2,8 +2,6 @@ import * as types from './mutation_types';
export default { export default {
[types.SET_PATHS](state, paths) { [types.SET_PATHS](state, paths) {
state.basePath = paths.basePath;
state.headPath = paths.headPath;
state.baseBlobPath = paths.baseBlobPath; state.baseBlobPath = paths.baseBlobPath;
state.headBlobPath = paths.headBlobPath; state.headBlobPath = paths.headBlobPath;
state.reportsPath = paths.reportsPath; state.reportsPath = paths.reportsPath;
......
export default () => ({ export default () => ({
basePath: null,
headPath: null,
reportsPath: null, reportsPath: null,
baseBlobPath: null, baseBlobPath: null,
......
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
); );
}, },
shouldRenderCodeQuality() { shouldRenderCodeQuality() {
return this.mr?.codeclimate?.head_path; return this.mr?.codequalityReportsPath;
}, },
shouldRenderRelatedLinks() { shouldRenderRelatedLinks() {
return Boolean(this.mr.relatedLinks) && !this.mr.isNothingToMergeState; return Boolean(this.mr.relatedLinks) && !this.mr.isNothingToMergeState;
...@@ -496,8 +496,6 @@ export default { ...@@ -496,8 +496,6 @@ export default {
<!-- <extensions-container :mr="mr" /> --> <!-- <extensions-container :mr="mr" /> -->
<grouped-codequality-reports-app <grouped-codequality-reports-app
v-if="shouldRenderCodeQuality" v-if="shouldRenderCodeQuality"
:base-path="mr.codeclimate.base_path"
:head-path="mr.codeclimate.head_path"
:head-blob-path="mr.headBlobPath" :head-blob-path="mr.headBlobPath"
:base-blob-path="mr.baseBlobPath" :base-blob-path="mr.baseBlobPath"
:codequality-reports-path="mr.codequalityReportsPath" :codequality-reports-path="mr.codequalityReportsPath"
......
...@@ -261,7 +261,6 @@ export default class MergeRequestStore { ...@@ -261,7 +261,6 @@ export default class MergeRequestStore {
this.baseBlobPath = blobPath.base_path || ''; this.baseBlobPath = blobPath.base_path || '';
this.codequalityReportsPath = data.codequality_reports_path; this.codequalityReportsPath = data.codequality_reports_path;
this.codequalityHelpPath = data.codequality_help_path; this.codequalityHelpPath = data.codequality_help_path;
this.codeclimate = data.codeclimate;
// Security reports // Security reports
this.sastComparisonPath = data.sast_comparison_path; this.sastComparisonPath = data.sast_comparison_path;
......
...@@ -307,8 +307,6 @@ export default { ...@@ -307,8 +307,6 @@ export default {
<blocking-merge-requests-report :mr="mr" /> <blocking-merge-requests-report :mr="mr" />
<grouped-codequality-reports-app <grouped-codequality-reports-app
v-if="shouldRenderCodeQuality" v-if="shouldRenderCodeQuality"
:base-path="mr.codeclimate.base_path"
:head-path="mr.codeclimate.head_path"
:head-blob-path="mr.headBlobPath" :head-blob-path="mr.headBlobPath"
:base-blob-path="mr.baseBlobPath" :base-blob-path="mr.baseBlobPath"
:codequality-reports-path="mr.codequalityReportsPath" :codequality-reports-path="mr.codequalityReportsPath"
......
...@@ -14,8 +14,6 @@ describe('Grouped code quality reports app', () => { ...@@ -14,8 +14,6 @@ describe('Grouped code quality reports app', () => {
const PATHS = { const PATHS = {
codequalityHelpPath: 'codequality_help.html', codequalityHelpPath: 'codequality_help.html',
basePath: 'base.json',
headPath: 'head.json',
baseBlobPath: 'base/blob/path/', baseBlobPath: 'base/blob/path/',
headBlobPath: 'head/blob/path/', headBlobPath: 'head/blob/path/',
}; };
......
...@@ -24,8 +24,6 @@ describe('Codequality Reports actions', () => { ...@@ -24,8 +24,6 @@ describe('Codequality Reports actions', () => {
describe('setPaths', () => { describe('setPaths', () => {
it('should commit SET_PATHS mutation', (done) => { it('should commit SET_PATHS mutation', (done) => {
const paths = { const paths = {
basePath: 'basePath',
headPath: 'headPath',
baseBlobPath: 'baseBlobPath', baseBlobPath: 'baseBlobPath',
headBlobPath: 'headBlobPath', headBlobPath: 'headBlobPath',
reportsPath: 'reportsPath', reportsPath: 'reportsPath',
...@@ -49,7 +47,6 @@ describe('Codequality Reports actions', () => { ...@@ -49,7 +47,6 @@ describe('Codequality Reports actions', () => {
beforeEach(() => { beforeEach(() => {
localState.reportsPath = endpoint; localState.reportsPath = endpoint;
localState.basePath = '/base/path';
mock = new MockAdapter(axios); mock = new MockAdapter(axios);
}); });
......
...@@ -12,24 +12,18 @@ describe('Codequality Reports mutations', () => { ...@@ -12,24 +12,18 @@ describe('Codequality Reports mutations', () => {
describe('SET_PATHS', () => { describe('SET_PATHS', () => {
it('sets paths to given values', () => { it('sets paths to given values', () => {
const basePath = 'base.json';
const headPath = 'head.json';
const baseBlobPath = 'base/blob/path/'; const baseBlobPath = 'base/blob/path/';
const headBlobPath = 'head/blob/path/'; const headBlobPath = 'head/blob/path/';
const reportsPath = 'reports.json'; const reportsPath = 'reports.json';
const helpPath = 'help.html'; const helpPath = 'help.html';
mutations.SET_PATHS(localState, { mutations.SET_PATHS(localState, {
basePath,
headPath,
baseBlobPath, baseBlobPath,
headBlobPath, headBlobPath,
reportsPath, reportsPath,
helpPath, helpPath,
}); });
expect(localState.basePath).toEqual(basePath);
expect(localState.headPath).toEqual(headPath);
expect(localState.baseBlobPath).toEqual(baseBlobPath); expect(localState.baseBlobPath).toEqual(baseBlobPath);
expect(localState.headBlobPath).toEqual(headBlobPath); expect(localState.headBlobPath).toEqual(headBlobPath);
expect(localState.reportsPath).toEqual(reportsPath); expect(localState.reportsPath).toEqual(reportsPath);
......
...@@ -234,14 +234,11 @@ export default { ...@@ -234,14 +234,11 @@ export default {
can_revert_on_current_merge_request: true, can_revert_on_current_merge_request: true,
can_cherry_pick_on_current_merge_request: true, can_cherry_pick_on_current_merge_request: true,
}, },
codeclimate: {
head_path: 'head.json',
base_path: 'base.json',
},
blob_path: { blob_path: {
base_path: 'blob_path', base_path: 'blob_path',
head_path: 'blob_path', head_path: 'blob_path',
}, },
codequality_reports_path: 'codequality_reports.json',
codequality_help_path: 'code_quality.html', codequality_help_path: 'code_quality.html',
target_branch_path: '/root/acets-app/branches/main', target_branch_path: '/root/acets-app/branches/main',
source_branch_path: '/root/acets-app/branches/daaaa', source_branch_path: '/root/acets-app/branches/daaaa',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment