UNPKG

morning-builds-core

Version:

Core functionality for Morning Builds

32 lines 1.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var BluebirdPromise = require("bluebird"); var fail_categories_1 = require("../fail-categories"); var Comments = /** @class */ (function () { function Comments(clients) { this.infrastructureErrorComments = { 'Detected hung build state. Attempting to generate stack trace and terminate spawned sub-processes... - HungBuildKiller Plugin': 'Hung Build state' }; this.bambooClient = clients.bamboo; } Comments.prototype.assembleBuildsWithErrorInComments = function (builds) { var _this = this; return BluebirdPromise .map(builds, function (failingBuild) { return (_this.bambooClient .fetchComments({ planKey: failingBuild.planKey, resultNumber: failingBuild.resultNumber, }) .then(function (comments) { return ({ build: failingBuild, failDetails: comments .filter(function (comment) { return Object.keys(_this.infrastructureErrorComments).includes(comment); }) .map(function (comment) { return _this.infrastructureErrorComments[comment]; }), failReason: fail_categories_1.categories.infrastructureError, }); })); }) .filter(function (buildWithFailDetails) { return buildWithFailDetails.failDetails.length > 0; }); }; return Comments; }()); exports.Comments = Comments; //# sourceMappingURL=comments.js.map