screwdriver-api 5.0.8 → 5.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "5.0.8",
3
+ "version": "5.0.9",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -40,7 +40,6 @@ module.exports = config => ({
40
40
  const latestEvents = await eventFactory.list({
41
41
  params: {
42
42
  pipelineId,
43
- parentEventId: null,
44
43
  type: 'pipeline'
45
44
  },
46
45
  // Make sure build exists for event, meta will be {} for skipped builds
@@ -53,7 +52,8 @@ module.exports = config => ({
53
52
  paginate: {
54
53
  count: 1
55
54
  },
56
- sort: 'descending'
55
+ sort: 'descending',
56
+ sortBy: 'createTime'
57
57
  });
58
58
 
59
59
  if (!latestEvents || Object.keys(latestEvents).length === 0) {
@@ -62,14 +62,14 @@ module.exports = config => ({
62
62
 
63
63
  // Only care about latest
64
64
  const lastEvent = latestEvents[0];
65
- const builds = await lastEvent.getBuilds({ readOnly: true });
65
+ const builds = await lastEvent.getBuilds({ readOnly: true, sortBy: 'id', sort: 'descending' });
66
66
 
67
67
  if (!builds || builds.length < 1) {
68
68
  return h.response(getPipelineBadge(badgeConfig)).header('Content-Type', contentType);
69
69
  }
70
70
 
71
71
  // Convert build statuses
72
- const buildsStatus = builds.reverse().map(build => build.status.toLowerCase());
72
+ const buildsStatus = builds.map(build => build.status.toLowerCase());
73
73
 
74
74
  return h
75
75
  .response(