Implemented view changes.
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-api/pipeline/head This commit looks good
This commit is contained in:
parent
c507f708eb
commit
a25deb0de2
@ -25,7 +25,7 @@ const buildApiUrl = (baseUrl, query = '') => {
|
||||
};
|
||||
|
||||
const getBranchBuildApiUrl = (branchUrl, buildType = 'lastSuccessfulBuild') =>
|
||||
`${normalizeProjectUrl(branchUrl)}/${buildType}/api/json?tree=number,url,result,displayName,timestamp,artifacts[fileName,relativePath]`;
|
||||
`${normalizeProjectUrl(branchUrl)}/${buildType}/api/json?tree=number,url,result,displayName,timestamp,artifacts[fileName,relativePath],changeSets[items[author[fullName],timestamp,msg]]`;
|
||||
|
||||
const mapArtifacts = (build, requestedBranch) => {
|
||||
const buildUrl = normalizeProjectUrl(build?.url);
|
||||
@ -132,6 +132,17 @@ export const appUpdateCurrentRouteHandler = async (req, res) => {
|
||||
logger.error('Failed to parse version from build display name:', error);
|
||||
}
|
||||
|
||||
var changes = [];
|
||||
for (const changeSet of build.changeSets) {
|
||||
for (const item of changeSet.items) {
|
||||
changes.push({
|
||||
author: item.author?.fullName,
|
||||
date: new Date(item.timestamp).toISOString(),
|
||||
message: item.msg,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const payload = {
|
||||
branch: requestedBranch,
|
||||
buildNumber: build.number,
|
||||
@ -142,6 +153,7 @@ export const appUpdateCurrentRouteHandler = async (req, res) => {
|
||||
builtAt: new Date(build.timestamp).toISOString(),
|
||||
buildSource: source,
|
||||
artifacts: mapArtifacts(build, requestedBranch),
|
||||
changes: changes,
|
||||
};
|
||||
|
||||
await redisServer.setKey(currentCacheKey, payload, APP_UPDATE_TTL_SECONDS);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user