summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jobs
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2019-05-06 10:08:42 +0200
committerFilipa Lacerda <filipa@gitlab.com>2019-05-24 10:04:04 +0100
commitb9c19f6b0f5c85956bf85935452c34fc6a21bcb0 (patch)
treea847bd3653357f6ebe5aa80ed416c1f0e7fe3e37 /app/assets/javascripts/jobs
parent819746dc6544820f41d66b87c2c68efc9b17e0f4 (diff)
downloadgitlab-ce-b9c19f6b0f5c85956bf85935452c34fc6a21bcb0.tar.gz
Do not serialize a pipeline again when showing a build
This change makes it possible to avoid additional serialization of entire pipeline when rendering a build details page. Instead we expose more information from the build entity itself what is much cheaper than serializing entire pipeline. Additionally we do not need to serialize `latest?` flag, which involves multiple Gitaly calls.
Diffstat (limited to 'app/assets/javascripts/jobs')
-rw-r--r--app/assets/javascripts/jobs/store/actions.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/app/assets/javascripts/jobs/store/actions.js b/app/assets/javascripts/jobs/store/actions.js
index abbdd7910de..ac16e3b5244 100644
--- a/app/assets/javascripts/jobs/store/actions.js
+++ b/app/assets/javascripts/jobs/store/actions.js
@@ -184,16 +184,9 @@ export const receiveTraceError = ({ commit }) => {
export const requestStages = ({ commit }) => commit(types.REQUEST_STAGES);
export const fetchStages = ({ state, dispatch }) => {
dispatch('requestStages');
-
- axios
- .get(`${state.job.pipeline_path}.json`)
- .then(({ data }) => {
- // Set selected stage
- dispatch('receiveStagesSuccess', data.details.stages);
- const selectedStage = data.details.stages.find(stage => stage.name === state.selectedStage);
- dispatch('fetchJobsForStage', selectedStage);
- })
- .catch(() => dispatch('receiveStagesError'));
+ dispatch('receiveStagesSuccess', state.job.pipeline.details.stages);
+ const selectedStage = state.job.pipeline.details.stages.find(stage => stage.name === state.selectedStage);
+ dispatch('fetchJobsForStage', selectedStage);
};
export const receiveStagesSuccess = ({ commit }, data) =>
commit(types.RECEIVE_STAGES_SUCCESS, data);