cmd/mbf: package status dashboard

This displays package metadata with optional status from a report.
This commit is contained in:
mae
2026-03-04 22:50:58 -06:00
committed by Ophestra
parent e61628a34e
commit 1d5d063d6a
16 changed files with 1189 additions and 21 deletions

View File

@@ -95,7 +95,7 @@ status : not in report
var (
cm *cache
buf strings.Builder
rp string
r *rosa.Report
)
if tc.status != nil || tc.report != "" {
@@ -108,14 +108,25 @@ status : not in report
}
if tc.report != "" {
rp = filepath.Join(t.TempDir(), "report")
if err := os.WriteFile(
rp,
pathname := filepath.Join(t.TempDir(), "report")
err := os.WriteFile(
pathname,
unsafe.Slice(unsafe.StringData(tc.report), len(tc.report)),
0400,
); err != nil {
)
if err != nil {
t.Fatal(err)
}
r, err = rosa.OpenReport(pathname)
if err != nil {
t.Fatal(err)
}
defer func() {
if err = r.Close(); err != nil {
t.Fatal(err)
}
}()
}
if tc.status != nil {
@@ -157,7 +168,7 @@ status : not in report
tc.args,
&buf,
cm != nil,
rp,
r,
); !reflect.DeepEqual(err, wantErr) {
t.Fatalf("commandInfo: error = %v, want %v", err, wantErr)
}