yocto_console_view: Fix various small issues after migration
cover yocto_console_view: Fix various small issues after migration
Now the migration to buildbot 4.2 has been made, several small issues have been found. This series tries to mix most of them.
---
Mathieu Dubois-Briand (3):
yocto_console_view: Group similar builder builds
yocto_console_view: Keep known revision mappings
yocto_console_view: Fix output link on valkyrie
.../src/views/ConsoleView/ConsoleView.scss | 2 +- .../src/views/ConsoleView/ConsoleView.tsx | 37 +++++++--------------- 2 files changed, 12 insertions(+), 27 deletions(-)
---
base-commit: dab2c9bb81540511e3cc9581f53db1c103714913
change-id: 20250211-mathieu-console_view_colspan-a6ad40201c9c
Best regards,
Signature · 1 line
Mathieu Dubois-Briand <[email protected]>
PATCH 1/3 yocto_console_view: Group similar builder builds
Builds from similar builders have to be in the same <td>, compacting a bit the whole view.
--- yocto_console_view/src/views/ConsoleView/ConsoleView.scss | 2 +- yocto_console_view/src/views/ConsoleView/ConsoleView.tsx | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-)
yocto_console_view/src/views/ConsoleView/ConsoleView.scss +1 -1
@@ -17,7 +17,7 @@ tr.bb-console-table-first-row { font-size: 1em; width: 1.5em; text-align: center; - transform: rotate(-45deg) translate(.5em, 1em); + transform: rotate(-45deg) translate(-.2em, .8em); transform-origin: bottom left; text-decoration: none; white-space: nowrap;
yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +7 -4
@@ -412,14 +412,17 @@ export const ConsoleView = observer(() => { const changeRows = changesToShow.map(changeInfo => { const change = changeInfo.change; - const builderColumns = buildersToShow.map(builder => { - const builds = changeInfo.buildsByBuilderId.get(builder.builderid) ?? []; + const builderColumns = builderGroups.map((builderGroup, i) => { + const builds: Build[] = []; + for (const builder of builderGroup.builders) { + const builderBuilds = changeInfo.buildsByBuilderId.get(builder.builderid) ?? [] + builds.push(...builderBuilds); + } const buildLinks = builds.map(build => ( <BuildLinkWithSummaryTooltip key={build.buildid} build={build}/> )); - return ( - <td key={builder.name} title={builder.name} className="column"> + <td key={i} title={builderGroup.name} colSpan={builderGroup.colspan} className="column"> {buildLinks} </td> );
Signature · 1 line
2.39.5
PATCH 2/3 yocto_console_view: Keep known revision mappings
In reply to Mathieu Dubois-BriandThe 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".
--- .../src/views/ConsoleView/ConsoleView.tsx | 25 +++------------------- 1 file changed, 3 insertions(+), 22 deletions(-)
yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +3 -22
@@ -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) {
Signature · 1 line
2.39.5
Re: [yocto-patches] [PATCH yocto-autobuilder2 2/3] yocto_console_view: Keep known revision mappings
Quoted 58 lines · Mathieu Dubois-Briand via lists.yoctoproject.org
The
yp_build_revisionproperty 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 <[email protected]>---
.../src/views/ConsoleView/ConsoleView.tsx | 25 +++-------------------1 file changed, 3 insertions(+), 22 deletions(-)yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-0@@ -208,6 +208,9 @@ function selectChangeForBuild(build: Build, buildset: Buildset,return fakeChange
}yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +3
-0+const revMapping = new Map<int, string>(); +const branchMapping = new Map<int, string>(); +export const ConsoleView = observer(() => {
const accessor =useDataAccessor([]);yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-0@@ -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 {yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-20@@ -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; - } - } - }; - } }
Quoted 2 lines
functiongetBuildProperty(properties, property){
When you start a build, it gets "Unresolved Revision" and I think by removing this code, it remains there even when the revision becomes known. The code would have allowed it to move to the correct line in the display. This therefore may fix one issue at the expense of another...
Cheers,
Richard
Re: [yocto-patches] [PATCH yocto-autobuilder2 2/3] yocto_console_view: Keep known revision mappings
Quoted 59 lines · Richard Purdie
Quoted 58 lines · Mathieu Dubois-Briand via lists.yoctoproject.org
The
yp_build_revisionproperty 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 <[email protected]>---
.../src/views/ConsoleView/ConsoleView.tsx | 25 +++-------------------1 file changed, 3 insertions(+), 22 deletions(-)yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-0@@ -208,6 +208,9 @@ function selectChangeForBuild(build: Build, buildset: Buildset,return fakeChange
}yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +3
-0+const revMapping = new Map<int, string>(); +const branchMapping = new Map<int, string>(); +export const ConsoleView = observer(() => {
const accessor =useDataAccessor([]);yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-0@@ -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 {yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-20@@ -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; - } - } - }; - } }
Quoted 9 lines
Quoted 2 lines
functiongetBuildProperty(properties, property){When you start a build, it gets "Unresolved Revision" and I think by removing this code, it remains there even when the revision becomes known. The code would have allowed it to move to the correct line in the display. This therefore may fix one issue at the expense of another...
The issue is this part of the code actually did nothing. I believe I imported this from the previous version of the plugin but never really tested it.
I've been trying a few variations, yesterday but it looks like we never get the property update.
Signature · 3 lines
Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Re: [yocto-patches] [PATCH yocto-autobuilder2 2/3] yocto_console_view: Keep known revision mappings
Quoted 85 lines · Mathieu Dubois-Briand
Quoted 75 lines · Richard Purdie
Quoted 64 lines · Mathieu Dubois-Briand via lists.yoctoproject.org
The
yp_build_revisionproperty 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 <[email protected]>
---
.../src/views/ConsoleView/ConsoleView.tsx | 25 +++-----
--------------1 file changed, 3 insertions(+), 22 deletions(-)diff --git a/yocto_console_view/src/views/ConsoleView/ConsoleView.tsx b/yocto_console_view/src/views/ConsoleView/ConsoleView.tsx index
973c26424233..93c51b340b17100644yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-0@@ -208,6 +208,9 @@ function selectChangeForBuild(build: Build, buildset: Buildset,return fakeChange
}yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +3
-0+const revMapping = new Map<int, string>(); +const branchMapping = new Map<int, string>(); +export const ConsoleView = observer(() => {
const accessor =useDataAccessor([]);yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-0@@ -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 {yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +0
-0@@ -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;Quoted 8 lines
- change = true;
- }
- }
- };
- }
}
functiongetBuildProperty(properties, property){Quoted 8 lines
When you start a build, it gets "Unresolved Revision" and I think by
removing this code, it remains there even when the revision becomes known. The code would have allowed it to move to the correct line in
the display. This therefore may fix one issue at the expense of another...
Quoted 6 lines
The issue is this part of the code actually did nothing. I believe I imported this from the previous version of the plugin but never really tested it.
I've been trying a few variations, yesterday but it looks like we never get the property update.
I know it was one of the more problematic elements in the code in the past and can result in a lot more queries. The idea was that when the property became available, we'd update the UI. I'd probably have to replicate a test environment to be able to offer much help at this point...
Cheers,
Richard
PATCH 3/3 yocto_console_view: Fix output link on valkyrie
In reply to Mathieu Dubois-Briand--- yocto_console_view/src/views/ConsoleView/ConsoleView.tsx | 1 + 1 file changed, 1 insertion(+)
yocto_console_view/src/views/ConsoleView/ConsoleView.tsx +1 -0
@@ -191,6 +191,7 @@ function selectChangeForBuild(build: Build, buildset: Buildset, if (build.properties !== null && ('publish_destination' in build.properties)) { change.change.publishurl = build.properties['publish_destination'][0].replace("/srv/autobuilder/autobuilder.yoctoproject.org/", "https://autobuilder.yocto.io/"); change.change.publishurl = change.change.publishurl.replace("/srv/autobuilder/autobuilder.yocto.io/", "https://autobuilder.yocto.io/"); + change.change.publishurl = change.change.publishurl.replace("/srv/autobuilder/valkyrie.yocto.io/", "https://valkyrie.yocto.io/"); } }
Signature · 1 line
2.39.5