mirror of
git://git.yoctoproject.org/yocto-autobuilder2.git
synced 2025-07-19 20:59:02 +02:00
yocto_console_view: Keep known revision mappings
The yp_build_revision property disappears from the build instance once the build is done. There is no reason for its value to change, so keep the last seen value in revision mapping. This will prevent finished builds to jump back to "Unresolved Revision". Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
d9bcc41cf7
commit
2ab0fa45dd
|
@ -208,6 +208,9 @@ function selectChangeForBuild(build: Build, buildset: Buildset,
|
|||
return fakeChange
|
||||
}
|
||||
|
||||
const revMapping = new Map<int, string>();
|
||||
const branchMapping = new Map<int, string>();
|
||||
|
||||
export const ConsoleView = observer(() => {
|
||||
const accessor = useDataAccessor([]);
|
||||
|
||||
|
@ -263,8 +266,6 @@ export const ConsoleView = observer(() => {
|
|||
builderIdsWithBuilds.add(build.builderid);
|
||||
}
|
||||
|
||||
const revMapping = new Map<int, string>();
|
||||
const branchMapping = new Map<int, string>();
|
||||
for (const build of buildsQuery.array) {
|
||||
let change = false;
|
||||
let {
|
||||
|
@ -278,26 +279,6 @@ export const ConsoleView = observer(() => {
|
|||
branchMapping[build.buildid] = build.properties.yp_build_branch[0];
|
||||
change = true;
|
||||
}
|
||||
if ((!revMapping[buildid] || !branchMapping[buildid]) && !build.complete_at) {
|
||||
build.getProperties().onChange = properties => {
|
||||
change = false;
|
||||
buildid = properties.endpoint.split('/')[1];
|
||||
if (!revMapping[buildid]) {
|
||||
const rev = getBuildProperty(properties[0], 'yp_build_revision');
|
||||
if (rev != null) {
|
||||
revMapping[buildid] = rev;
|
||||
change = true;
|
||||
}
|
||||
}
|
||||
if (!branchMapping[buildid]) {
|
||||
const branch = getBuildProperty(properties[0], 'yp_build_branch');
|
||||
if (branch != null) {
|
||||
branchMapping[buildid] = branch;
|
||||
change = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function getBuildProperty(properties, property) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user