-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When querying a build, TRSS will retry 3 times. In the case of an error, the build will move back to the queue if the return code from Jenkins API is not 404. If the return code is 404, x-jenkins header is checked to ensure the error code is from Jenkins (not nginx). In this case, it means the build has an invalid url or is expired. retry function returns 404 and TRSS will stop processing this build. Otherwise, the error will be ignored (network issue) and the build will move back to the queue. return code 404 only if the Jenkins server returns 404 for the build (i.e., invalid url, expired build, etc) - sleep is removed to increase efficiency and reliability. We will check the header in the response to determine the invalid/expired build case. - test API getJenkinsBuildInfo is added - fix log issue related: #852 Signed-off-by: Lan Xia <[email protected]>
- Loading branch information
Showing
4 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
TestResultSummaryService/routes/test/getJenkinsBuildInfo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const JenkinsInfo = require('../../JenkinsInfo'); | ||
|
||
module.exports = async (req, res) => { | ||
const { url, buildName, buildNum } = req.query; | ||
if (req.query.buildNum) | ||
req.query.buildNum = parseInt(req.query.buildNum, 10); | ||
const jenkinsInfo = new JenkinsInfo(); | ||
try { | ||
const output = await jenkinsInfo.getBuildInfo(url, buildName, buildNum); | ||
res.send({ output }); | ||
} catch (e) { | ||
res.send({ result: e.toString() }); | ||
} | ||
}; |