Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfo: successful seeds are displayed for pull request #1945

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions src/devhub/devhub.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ async function mainSeeds() {
const tableDom = document.querySelector("#seeds>tbody");
let commit_previous = undefined;
let commit_count = 0;
const colors = ["#CCC", "#EEE"]
const colors = ["#CCC", "#EEE"];
for (const record of records) {
if (record.ok) continue;
if (record.ok && !pullRequestNumber(record)) continue;

if (fuzzersWithFailures.has(record.branch + record.fuzzer)) continue;
fuzzersWithFailures.add(record.branch + record.fuzzer);
Expand All @@ -85,14 +85,15 @@ async function mainSeeds() {
Date.now() - (record.seed_timestamp_start * 1000),
);
const rowDom = document.createElement("tr");
rowDom.style.setProperty("background", colors[commit_count % colors.length]);

const prPrefix = "https://github.com/tigerbeetle/tigerbeetle/pull/"
let prLink = ""
if (record.branch.startsWith(prPrefix)) {
const pr = record.branch.substring(prPrefix.length, record.branch.length);
prLink = `<a href="${record.branch}">#${pr}</a>`
}
rowDom.style.setProperty(
"background",
record.ok ? "#CF0" : colors[commit_count % colors.length],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

);

const prLink = pullRequestNumber(record)
? `<a href="${record.branch}">#${pullRequestNumber(record)}</a>`
: "";
rowDom.innerHTML = `
<td>
<a href="https://github.com/tigerbeetle/tigerbeetle/commit/${record.commit_sha}">
Expand All @@ -109,6 +110,18 @@ async function mainSeeds() {
}
}

function pullRequestNumber(record) {
const prPrefix = "https://github.com/tigerbeetle/tigerbeetle/pull/";
if (record.branch.startsWith(prPrefix)) {
const prNumber = record.branch.substring(
prPrefix.length,
record.branch.length,
);
return parseInt(prNumber, 10);
}
return undefined;
}

// The input data is array of runs, where a single run contains many measurements (eg, file size,
// build time).
//
Expand Down
Loading