Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions os-checks/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ $fetch(docs_json_url).then(val => docs.value = val);

const summaryTable = computed<SummaryTable[]>(() => {
const value = summaries.value.map(val => {
return Object.entries(val.pkgs).map(([name, pkg]) => {
return Object.entries(val.pkgs ?? {}).map(([name, pkg]) => {
let testcases_color = null;
if (pkg.testcases?.pkg_tests_count) {
if (pkg.testcases?.failed === 0) {
Expand Down Expand Up @@ -457,7 +457,7 @@ watch(selectedPkg, val => {

const pkg = summaries.value
.find(summary => summary.user === val.user && summary.repo === val.repo)
?.pkgs[val.pkg];
?.pkgs?.[val.pkg];

if (!pkg) { return; }

Expand Down
15 changes: 12 additions & 3 deletions os-checks/shared/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ import { type Col, Cols } from "./columns-select"
export type PkgInfo = {
user: string,
repo: string,
pkgs: { [key: string]: Pkg }
timestamp: TimeStamp,
// good repo: pkgs and err are exclusive
pkgs?: { [key: string]: Pkg },
// compilation error
err?: string,
}

export type TimeStamp = {
start: number,
end: number,
}

export type Pkg = {
Expand Down Expand Up @@ -58,12 +67,12 @@ export type TestCase = {
}

export function unique_field(summaries: PkgInfo[], cb: (_: Pkg) => string[]): string[] {
const arr = summaries.map(s => Object.values(s.pkgs).map(pkg => cb(pkg).flat()).flat()).flat();
const arr = summaries.map(s => Object.values(s.pkgs ?? {}).map(pkg => cb(pkg).flat()).flat()).flat();
return [...new Set(arr)].sort();
}

export function unique_field_bool(summaries: PkgInfo[], cb: (_: Pkg) => boolean): boolean {
const arr = summaries.filter(s => Object.values(s.pkgs).filter(cb).length > 0)
const arr = summaries.filter(s => Object.values(s.pkgs ?? {}).filter(cb).length > 0)
return arr.length > 0;
}

Expand Down
2 changes: 1 addition & 1 deletion os-checks/shared/testcases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export function summariesToTestResult(pkg_info: PkgInfo[]): TestResult[] {
let idx = 0;

for (const info of pkg_info) {
for (const [pkg, value] of Object.entries(info.pkgs)) {
for (const [pkg, value] of Object.entries(info.pkgs ?? {})) {
for (const test of value.testcases?.tests || []) {
for (const testcase of test.testcases) {
result.push({
Expand Down