From a86ce37d580e5b028e02fdaa28ef6390e8f1ec73 Mon Sep 17 00:00:00 2001 From: Victor Perevertkin Date: Sat, 20 Jul 2019 21:12:24 +0300 Subject: [PATCH] Fix flatMap and forgotten BuildBot doc links --- client/src/redux/sagas/buildSetSaga.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/redux/sagas/buildSetSaga.js b/client/src/redux/sagas/buildSetSaga.js index f461405..3d70390 100644 --- a/client/src/redux/sagas/buildSetSaga.js +++ b/client/src/redux/sagas/buildSetSaga.js @@ -5,7 +5,7 @@ import { setBuildSetsError, setBuilds } from '../actions'; /* These functions are used to build an HTTP query string for * filtering data on BuildBot side. - * see BuildBot API: + * see BuildBot API: http://docs.buildbot.net/latest/developer/rest.html#filtering */ function getBuildQString(builds) { return builds @@ -15,10 +15,9 @@ function getBuildQString(builds) { function getBuildReqQString(commits, buildData) { return commits - .map(commit => + .flatMap(commit => buildData.filter(bd => bd.sourcestamps[0].revision === commit.sha) ) - .flat() .map(bd => 'buildsetid__contains=' + bd.bsid) .join('&'); } @@ -32,6 +31,7 @@ function getBuildReqQString(commits, buildData) { * 3rd step: using all BuildRequest IDs (buildrequestid field), fetch all Builds * which to our BuildRequests * PROFIT! Now just construct a proper object from all of this data + * See BuildBot API: http://docs.buildbot.net/latest/developer/rest.html#raml-specs */ function* handleBuildsLoad() { try {