Commit 85a4a1f1 authored by Jose Vargas's avatar Jose Vargas

Add sentry triggers to the errorCaptured hook

This adds sentry triggers to the errorCaptured
lifecycle hook for the new graph app
parent 3948f4d2
...@@ -4,6 +4,7 @@ import axios from '~/lib/utils/axios_utils'; ...@@ -4,6 +4,7 @@ import axios from '~/lib/utils/axios_utils';
import { dasherize } from '~/lib/utils/text_utility'; import { dasherize } from '~/lib/utils/text_utility';
import { __ } from '~/locale'; import { __ } from '~/locale';
import { deprecatedCreateFlash as createFlash } from '~/flash'; import { deprecatedCreateFlash as createFlash } from '~/flash';
import { reportToSentry } from './utils';
/** /**
* Renders either a cancel, retry or play icon button and handles the post request * Renders either a cancel, retry or play icon button and handles the post request
...@@ -50,6 +51,9 @@ export default { ...@@ -50,6 +51,9 @@ export default {
return `${actionIconDash} js-icon-${actionIconDash}`; return `${actionIconDash} js-icon-${actionIconDash}`;
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry('action_component', `error: ${err}, info: ${info}`);
},
methods: { methods: {
/** /**
* The request should not be handled here. * The request should not be handled here.
......
...@@ -3,6 +3,7 @@ import LinkedGraphWrapper from '../graph_shared/linked_graph_wrapper.vue'; ...@@ -3,6 +3,7 @@ import LinkedGraphWrapper from '../graph_shared/linked_graph_wrapper.vue';
import LinkedPipelinesColumn from './linked_pipelines_column.vue'; import LinkedPipelinesColumn from './linked_pipelines_column.vue';
import StageColumnComponent from './stage_column_component.vue'; import StageColumnComponent from './stage_column_component.vue';
import { DOWNSTREAM, MAIN, UPSTREAM } from './constants'; import { DOWNSTREAM, MAIN, UPSTREAM } from './constants';
import { reportToSentry } from './utils';
export default { export default {
name: 'PipelineGraph', name: 'PipelineGraph',
...@@ -68,6 +69,9 @@ export default { ...@@ -68,6 +69,9 @@ export default {
return this.hasUpstreamPipelines ? this.pipeline.upstream : []; return this.hasUpstreamPipelines ? this.pipeline.upstream : [];
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry(this.$options.name, `error: ${err}, info: ${info}`);
},
methods: { methods: {
setJob(jobName) { setJob(jobName) {
this.hoveredJobName = jobName; this.hoveredJobName = jobName;
......
...@@ -5,6 +5,7 @@ import StageColumnComponentLegacy from './stage_column_component_legacy.vue'; ...@@ -5,6 +5,7 @@ import StageColumnComponentLegacy from './stage_column_component_legacy.vue';
import LinkedPipelinesColumnLegacy from './linked_pipelines_column_legacy.vue'; import LinkedPipelinesColumnLegacy from './linked_pipelines_column_legacy.vue';
import GraphBundleMixin from '../../mixins/graph_pipeline_bundle_mixin'; import GraphBundleMixin from '../../mixins/graph_pipeline_bundle_mixin';
import { UPSTREAM, DOWNSTREAM, MAIN } from './constants'; import { UPSTREAM, DOWNSTREAM, MAIN } from './constants';
import { reportToSentry } from './utils';
export default { export default {
name: 'PipelineGraphLegacy', name: 'PipelineGraphLegacy',
...@@ -94,6 +95,9 @@ export default { ...@@ -94,6 +95,9 @@ export default {
return this.pipeline.project.id; return this.pipeline.project.id;
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry(this.$options.name, `error: ${err}, info: ${info}`);
},
methods: { methods: {
capitalizeStageName(name) { capitalizeStageName(name) {
const escapedName = escape(name); const escapedName = escape(name);
......
...@@ -76,6 +76,9 @@ export default { ...@@ -76,6 +76,9 @@ export default {
mounted() { mounted() {
toggleQueryPollingByVisibility(this.$apollo.queries.pipeline); toggleQueryPollingByVisibility(this.$apollo.queries.pipeline);
}, },
errorCaptured(err, _vm, info) {
reportToSentry(this.$options.name, `error: ${err}, info: ${info}`);
},
methods: { methods: {
hideAlert() { hideAlert() {
this.showAlert = false; this.showAlert = false;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
import { GlTooltipDirective } from '@gitlab/ui'; import { GlTooltipDirective } from '@gitlab/ui';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import JobItem from './job_item.vue'; import JobItem from './job_item.vue';
import { reportToSentry } from './utils';
/** /**
* Renders the dropdown for the pipeline graph. * Renders the dropdown for the pipeline graph.
...@@ -29,6 +30,9 @@ export default { ...@@ -29,6 +30,9 @@ export default {
return `${name} - ${status.label}`; return `${name} - ${status.label}`;
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry('job_group_dropdown', `error: ${err}, info: ${info}`);
},
methods: { methods: {
pipelineActionRequestComplete() { pipelineActionRequestComplete() {
this.$emit('pipelineActionRequestComplete'); this.$emit('pipelineActionRequestComplete');
......
...@@ -6,6 +6,7 @@ import { sprintf } from '~/locale'; ...@@ -6,6 +6,7 @@ import { sprintf } from '~/locale';
import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin'; import delayedJobMixin from '~/jobs/mixins/delayed_job_mixin';
import { accessValue } from './accessors'; import { accessValue } from './accessors';
import { REST } from './constants'; import { REST } from './constants';
import { reportToSentry } from './utils';
/** /**
* Renders the badge for the pipeline graph and the job's dropdown. * Renders the badge for the pipeline graph and the job's dropdown.
...@@ -130,6 +131,9 @@ export default { ...@@ -130,6 +131,9 @@ export default {
: this.cssClassJobName; : this.cssClassJobName;
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry('job_item', `error: ${err}, info: ${info}`);
},
methods: { methods: {
hideTooltips() { hideTooltips() {
this.$root.$emit('bv::hide::tooltip'); this.$root.$emit('bv::hide::tooltip');
......
...@@ -4,6 +4,7 @@ import CiStatus from '~/vue_shared/components/ci_icon.vue'; ...@@ -4,6 +4,7 @@ import CiStatus from '~/vue_shared/components/ci_icon.vue';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import { accessValue } from './accessors'; import { accessValue } from './accessors';
import { DOWNSTREAM, REST, UPSTREAM } from './constants'; import { DOWNSTREAM, REST, UPSTREAM } from './constants';
import { reportToSentry } from './utils';
export default { export default {
directives: { directives: {
...@@ -114,6 +115,9 @@ export default { ...@@ -114,6 +115,9 @@ export default {
return this.isUpstream ? 'gl-left-0 gl-border-r-1!' : 'gl-right-0 gl-border-l-1!'; return this.isUpstream ? 'gl-left-0 gl-border-r-1!' : 'gl-right-0 gl-border-l-1!';
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry('linked_pipeline', `error: ${err}, info: ${info}`);
},
methods: { methods: {
onClickLinkedPipeline() { onClickLinkedPipeline() {
this.hideTooltips(); this.hideTooltips();
......
<script> <script>
import LinkedPipeline from './linked_pipeline.vue'; import LinkedPipeline from './linked_pipeline.vue';
import { UPSTREAM } from './constants'; import { UPSTREAM } from './constants';
import { reportToSentry } from './utils';
export default { export default {
components: { components: {
...@@ -42,6 +43,9 @@ export default { ...@@ -42,6 +43,9 @@ export default {
return this.type === UPSTREAM; return this.type === UPSTREAM;
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry('linked_pipelines_column_legacy', `error: ${err}, info: ${info}`);
},
methods: { methods: {
onPipelineClick(downstreamNode, pipeline, index) { onPipelineClick(downstreamNode, pipeline, index) {
this.$emit('linkedPipelineClick', pipeline, index, downstreamNode); this.$emit('linkedPipelineClick', pipeline, index, downstreamNode);
......
...@@ -6,6 +6,7 @@ import JobGroupDropdown from './job_group_dropdown.vue'; ...@@ -6,6 +6,7 @@ import JobGroupDropdown from './job_group_dropdown.vue';
import ActionComponent from './action_component.vue'; import ActionComponent from './action_component.vue';
import { GRAPHQL } from './constants'; import { GRAPHQL } from './constants';
import { accessValue } from './accessors'; import { accessValue } from './accessors';
import { reportToSentry } from './utils';
export default { export default {
components: { components: {
...@@ -54,6 +55,9 @@ export default { ...@@ -54,6 +55,9 @@ export default {
return !isEmpty(this.action); return !isEmpty(this.action);
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry('stage_column_component', `error: ${err}, info: ${info}`);
},
methods: { methods: {
getGroupId(group) { getGroupId(group) {
return accessValue(GRAPHQL, 'groupId', group); return accessValue(GRAPHQL, 'groupId', group);
......
...@@ -4,6 +4,7 @@ import stageColumnMixin from '../../mixins/stage_column_mixin'; ...@@ -4,6 +4,7 @@ import stageColumnMixin from '../../mixins/stage_column_mixin';
import JobItem from './job_item.vue'; import JobItem from './job_item.vue';
import JobGroupDropdown from './job_group_dropdown.vue'; import JobGroupDropdown from './job_group_dropdown.vue';
import ActionComponent from './action_component.vue'; import ActionComponent from './action_component.vue';
import { reportToSentry } from './utils';
export default { export default {
components: { components: {
...@@ -52,6 +53,9 @@ export default { ...@@ -52,6 +53,9 @@ export default {
return !isEmpty(this.action); return !isEmpty(this.action);
}, },
}, },
errorCaptured(err, _vm, info) {
reportToSentry('stage_column_component_legacy', `error: ${err}, info: ${info}`);
},
methods: { methods: {
groupId(group) { groupId(group) {
return `ci-badge-${escape(group.name)}`; return `ci-badge-${escape(group.name)}`;
......
...@@ -10,6 +10,7 @@ import legacyPipelineHeader from './components/legacy_header_component.vue'; ...@@ -10,6 +10,7 @@ import legacyPipelineHeader from './components/legacy_header_component.vue';
import eventHub from './event_hub'; import eventHub from './event_hub';
import TestReports from './components/test_reports/test_reports.vue'; import TestReports from './components/test_reports/test_reports.vue';
import createTestReportsStore from './stores/test_reports'; import createTestReportsStore from './stores/test_reports';
import { reportToSentry } from './components/graph/utils';
Vue.use(Translate); Vue.use(Translate);
...@@ -36,6 +37,9 @@ const createLegacyPipelinesDetailApp = (mediator) => { ...@@ -36,6 +37,9 @@ const createLegacyPipelinesDetailApp = (mediator) => {
mediator, mediator,
}; };
}, },
errorCaptured(err, _vm, info) {
reportToSentry('pipeline_details_bundle_legacy_details', `error: ${err}, info: ${info}`);
},
render(createElement) { render(createElement) {
return createElement('pipeline-graph-legacy', { return createElement('pipeline-graph-legacy', {
props: { props: {
...@@ -78,6 +82,9 @@ const createLegacyPipelineHeaderApp = (mediator) => { ...@@ -78,6 +82,9 @@ const createLegacyPipelineHeaderApp = (mediator) => {
eventHub.$off('headerPostAction', this.postAction); eventHub.$off('headerPostAction', this.postAction);
eventHub.$off('headerDeleteAction', this.deleteAction); eventHub.$off('headerDeleteAction', this.deleteAction);
}, },
errorCaptured(err, _vm, info) {
reportToSentry('pipeline_details_bundle_legacy', `error: ${err}, info: ${info}`);
},
methods: { methods: {
postAction(path) { postAction(path) {
this.mediator.service this.mediator.service
......
...@@ -3,6 +3,7 @@ import VueApollo from 'vue-apollo'; ...@@ -3,6 +3,7 @@ import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql'; import createDefaultClient from '~/lib/graphql';
import PipelineGraphWrapper from './components/graph/graph_component_wrapper.vue'; import PipelineGraphWrapper from './components/graph/graph_component_wrapper.vue';
import { GRAPHQL } from './components/graph/constants'; import { GRAPHQL } from './components/graph/constants';
import { reportToSentry } from './components/graph/utils';
Vue.use(VueApollo); Vue.use(VueApollo);
...@@ -28,6 +29,9 @@ const createPipelinesDetailApp = (selector, pipelineProjectPath, pipelineIid) => ...@@ -28,6 +29,9 @@ const createPipelinesDetailApp = (selector, pipelineProjectPath, pipelineIid) =>
pipelineIid, pipelineIid,
dataMethod: GRAPHQL, dataMethod: GRAPHQL,
}, },
errorCaptured(err, _vm, info) {
reportToSentry('pipeline_details_graph', `error: ${err}, info: ${info}`);
},
render(createElement) { render(createElement) {
return createElement(PipelineGraphWrapper); return createElement(PipelineGraphWrapper);
}, },
......
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