mirror of
https://github.com/lukaszraczylo/ghtracker.git
synced 2026-10-12 00:45:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bca4c38f0 | ||
|
|
eff9559aee | ||
|
|
5c5416f6f0 | ||
|
|
a0fd6d6856 | ||
|
|
ac5eb2f16a | ||
|
|
66ed84bdbf |
@@ -17,11 +17,11 @@ Release archives and the image checksums are signed with cosign.
|
||||
The dashboard lists only what needs attention, grouped by project. The project with the newest problem comes first:
|
||||
|
||||
- Failing workflows, including scheduled and other background ones, with a link to the run.
|
||||
- Pull requests that wait too long or fail their checks, with links and age.
|
||||
- Stale issues, as one line per project.
|
||||
- Pull requests, one line each: new ones (`pr_fresh`), ones that wait too long (`pr_waiting`) and ones that fail their checks.
|
||||
- Open issues, one line each: new ones (`issue_fresh`) and ones without recent activity (`issue_stale`).
|
||||
- Projects that failed to refresh, or loaded only in part.
|
||||
|
||||
A side panel lists every project with its latest release (or newest tag), a link to the release, and counts of workflows, open pull requests and issues. Healthy items do not appear anywhere else.
|
||||
A side panel lists every project with its latest release (or newest tag), a link to the release, and counts of workflows, open pull requests and issues. Every open non-draft pull request and every open issue raises a warning, so a project with open work is never green.
|
||||
|
||||
### Search and filters
|
||||
|
||||
@@ -48,7 +48,9 @@ A side panel lists every project with its latest release (or newest tag), a link
|
||||
| Non-draft PR open longer than `pr_warn_after` | warn |
|
||||
| PR checks failing | warn |
|
||||
| Workflow queued or running longer than `workflow_stuck_after` | warn |
|
||||
| Open issues without activity for `issue_stale_after` (one alert per repo) | warn |
|
||||
| Non-draft PR open less than `pr_warn_after` (`pr_fresh`) | warn |
|
||||
| Open issue without activity for `issue_stale_after` (`issue_stale`, one alert per issue) | warn |
|
||||
| Open issue with recent activity (`issue_fresh`, one alert per issue) | warn |
|
||||
| A section failed to load, for example a missing App permission | warn |
|
||||
| Data older than `data_stale_after` | warn |
|
||||
|
||||
@@ -122,7 +124,7 @@ actions:
|
||||
All metrics use the `ghtracker_` prefix. Gauges are computed at scrape time.
|
||||
|
||||
| Metric | Labels |
|
||||
| -------------------------------------------------------------------------------------------------------------- | -------------------------- |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
|
||||
| `repo_up`, `repo_health` (0 ok, 1 warn, 2 crit) | repo |
|
||||
| `repo_open_issues`, `repo_open_prs`, `repo_open_prs_failing_checks`, `repo_stale_issues` | repo |
|
||||
| `repo_oldest_pr_age_seconds`, `repo_last_refresh_timestamp_seconds` | repo |
|
||||
|
||||
@@ -155,25 +155,25 @@ func (c *Collector) Refresh(ctx context.Context) {
|
||||
c.limited.Store(false)
|
||||
c.scanDone.Store(0)
|
||||
c.scanTotal.Store(int64(len(c.names)))
|
||||
results := make([]model.Repo, len(c.names))
|
||||
sem := make(chan struct{}, c.concurrency)
|
||||
var wg sync.WaitGroup
|
||||
for i, name := range c.names {
|
||||
for _, name := range c.names {
|
||||
wg.Add(1)
|
||||
sem <- struct{}{}
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
defer func() { <-sem }()
|
||||
results[i] = c.refreshOne(ctx, name, start, true)
|
||||
r := c.refreshOne(ctx, name, start, true)
|
||||
// Publish per repo so a running scan shows new and resolved alerts as they land.
|
||||
c.mu.Lock()
|
||||
c.repos[r.FullName] = r
|
||||
c.mu.Unlock()
|
||||
c.scanDone.Add(1)
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
|
||||
c.mu.Lock()
|
||||
for _, r := range results {
|
||||
c.repos[r.FullName] = r
|
||||
}
|
||||
c.lastRefresh = start
|
||||
c.lastDur = c.now().Sub(start)
|
||||
c.loaded = true
|
||||
|
||||
@@ -67,7 +67,7 @@ func TestEvaluate(t *testing.T) {
|
||||
}, map[string]model.Severity{KindWorkflowStuck: model.Warn}, model.Warn},
|
||||
"pr fresh": {func(r *model.Repo) {
|
||||
r.PRs = []model.PullRequest{{Number: 1, Fork: true, CreatedAt: t0.Add(-47 * time.Hour)}}
|
||||
}, map[string]model.Severity{}, model.OK},
|
||||
}, map[string]model.Severity{KindPRFresh: model.Warn}, model.Warn},
|
||||
"pr waiting warn": {func(r *model.Repo) {
|
||||
r.PRs = []model.PullRequest{{Number: 1, Fork: true, CreatedAt: t0.Add(-49 * time.Hour)}}
|
||||
}, map[string]model.Severity{KindPRWaiting: model.Warn}, model.Warn},
|
||||
@@ -79,11 +79,13 @@ func TestEvaluate(t *testing.T) {
|
||||
}, map[string]model.Severity{}, model.OK},
|
||||
"pr checks failing": {func(r *model.Repo) {
|
||||
r.PRs = []model.PullRequest{{Number: 1, Fork: true, CreatedAt: t0, Checks: model.CheckSummary{State: model.ChecksFail, Failing: []string{"build"}}}}
|
||||
}, map[string]model.Severity{KindPRChecks: model.Warn}, model.Warn},
|
||||
"issues stale aggregated": {func(r *model.Repo) {
|
||||
old := t0.Add(-40 * 24 * time.Hour)
|
||||
r.Issues = []model.Issue{{Number: 1, UpdatedAt: old}, {Number: 2, UpdatedAt: old}, {Number: 3, UpdatedAt: t0}}
|
||||
}, map[string]model.Severity{KindIssuesStale: model.Warn}, model.Warn},
|
||||
}, map[string]model.Severity{KindPRFresh: model.Warn, KindPRChecks: model.Warn}, model.Warn},
|
||||
"issue stale": {func(r *model.Repo) {
|
||||
r.Issues = []model.Issue{{Number: 1, CreatedAt: t0.Add(-60 * 24 * time.Hour), UpdatedAt: t0.Add(-40 * 24 * time.Hour)}}
|
||||
}, map[string]model.Severity{KindIssueStale: model.Warn}, model.Warn},
|
||||
"issue fresh": {func(r *model.Repo) {
|
||||
r.Issues = []model.Issue{{Number: 1, CreatedAt: t0.Add(-time.Hour), UpdatedAt: t0}}
|
||||
}, map[string]model.Severity{KindIssueFresh: model.Warn}, model.Warn},
|
||||
"archived repo skips work alerts": {func(r *model.Repo) {
|
||||
r.Archived = true
|
||||
r.PRs = []model.PullRequest{{Number: 1, Fork: true, CreatedAt: t0.Add(-30 * 24 * time.Hour)}}
|
||||
@@ -125,20 +127,22 @@ func TestEvaluateDisabledThresholds(t *testing.T) {
|
||||
r := model.Repo{FullName: "o/r", RefreshedAt: t0, PRs: []model.PullRequest{{Number: 1, Fork: true, CreatedAt: t0.Add(-100 * 24 * time.Hour)}},
|
||||
Issues: []model.Issue{{UpdatedAt: t0.Add(-100 * 24 * time.Hour)}}}
|
||||
off := config.Thresholds{PRWarnAfter: -1, PRCritAfter: -1, IssueStaleAfter: -1, WorkflowStuck: -1, DataStaleAfter: -1}
|
||||
if a := withoutPROpen(Evaluate(&r, t0, off)); len(a) != 0 {
|
||||
for _, a := range withoutPROpen(Evaluate(&r, t0, off)) {
|
||||
if a.Kind != KindPRFresh && a.Kind != KindIssueFresh {
|
||||
t.Fatalf("disabled checks produced %+v", a)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAgeAdvancesWithoutRefresh(t *testing.T) {
|
||||
r := model.Repo{FullName: "o/r", RefreshedAt: t0, PRs: []model.PullRequest{{Number: 1, Fork: true, CreatedAt: t0.Add(-40 * time.Hour)}}}
|
||||
cfg := th()
|
||||
cfg.DataStaleAfter = -1
|
||||
if a := withoutPROpen(Evaluate(&r, t0, cfg)); len(a) != 0 {
|
||||
t.Fatalf("unexpected %+v", a)
|
||||
if a := withoutPROpen(Evaluate(&r, t0, cfg)); len(a) != 1 || a[0].Kind != KindPRFresh {
|
||||
t.Fatalf("a PR below the warn threshold must be fresh: %+v", a)
|
||||
}
|
||||
if a := withoutPROpen(Evaluate(&r, t0.Add(10*time.Hour), cfg)); len(a) != 1 || a[0].Severity != model.Warn {
|
||||
t.Fatalf("PR must cross the warn threshold as time passes: %+v", a)
|
||||
if a := withoutPROpen(Evaluate(&r, t0.Add(10*time.Hour), cfg)); len(a) != 1 || a[0].Kind != KindPRWaiting {
|
||||
t.Fatalf("PR must turn from fresh to waiting as time passes: %+v", a)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -490,9 +494,6 @@ func TestEvaluatePROpen(t *testing.T) {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
r := model.Repo{FullName: "o/r", Up: true, RefreshedAt: t0, Archived: tc.archived, PRs: []model.PullRequest{tc.pr}}
|
||||
alerts := Evaluate(&r, t0, th())
|
||||
if r.Health != model.OK {
|
||||
t.Fatalf("health = %v, want ok", r.Health)
|
||||
}
|
||||
if !tc.want {
|
||||
if len(alerts) != 0 {
|
||||
t.Fatalf("alerts = %+v, want none", alerts)
|
||||
@@ -501,21 +502,31 @@ func TestEvaluatePROpen(t *testing.T) {
|
||||
}
|
||||
want := model.Alert{Severity: model.OK, Repo: "o/r", Kind: KindPROpen, Subject: "#7 fix", Detail: "open for 5h",
|
||||
URL: tc.pr.URL, Ref: "abc123", Author: "alice", Since: tc.pr.CreatedAt}
|
||||
if len(alerts) != 1 || alerts[0] != want {
|
||||
if alerts = onlyPROpen(alerts); len(alerts) != 1 || alerts[0] != want {
|
||||
t.Fatalf("alerts = %+v, want [%+v]", alerts, want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestPROpenDoesNotChangeCounts(t *testing.T) {
|
||||
func onlyPROpen(in []model.Alert) []model.Alert {
|
||||
var out []model.Alert
|
||||
for _, a := range in {
|
||||
if a.Kind == KindPROpen {
|
||||
out = append(out, a)
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func TestPROpenHasNoSeverityOfItsOwn(t *testing.T) {
|
||||
f := &fakeFetcher{fn: func(name string) (model.Repo, error) {
|
||||
return model.Repo{FullName: name, PRs: []model.PullRequest{{Number: 1, HeadSHA: "s", CreatedAt: t0}}}, nil
|
||||
}}
|
||||
c := newCollector(f, "o/a")
|
||||
c.Refresh(context.Background())
|
||||
v := c.View()
|
||||
if len(v.Alerts) != 1 || v.Alerts[0].Kind != KindPROpen || v.Crit != 0 || v.Warn != 0 || v.Repos[0].Health != model.OK {
|
||||
if len(onlyPROpen(v.Alerts)) != 1 || v.Alerts[0].Severity != model.Warn || v.Crit != 0 || v.Warn != 1 {
|
||||
t.Fatalf("view = %+v", v)
|
||||
}
|
||||
}
|
||||
@@ -553,3 +564,34 @@ func TestRefreshRepoFailureSkipsRefreshHooks(t *testing.T) {
|
||||
case <-time.After(200 * time.Millisecond):
|
||||
}
|
||||
}
|
||||
|
||||
func TestRefreshPublishesEachRepoBeforeTheScanEnds(t *testing.T) {
|
||||
release := make(chan struct{})
|
||||
f := &fakeFetcher{fn: func(name string) (model.Repo, error) {
|
||||
if name == "o/slow" {
|
||||
<-release
|
||||
}
|
||||
return model.Repo{FullName: name, Err: ""}, nil
|
||||
}}
|
||||
cfg := &config.Config{Repos: []string{"o/fast", "o/slow"}, RefreshInterval: time.Hour, Concurrency: 2, Thresholds: th()}
|
||||
c := New(f, cfg, slog.New(slog.NewTextHandler(io.Discard, nil)))
|
||||
c.now = func() time.Time { return t0 }
|
||||
done := make(chan struct{})
|
||||
go func() { c.Refresh(context.Background()); close(done) }()
|
||||
deadline := time.Now().Add(2 * time.Second)
|
||||
for time.Now().Before(deadline) {
|
||||
if v := c.View(); len(v.Repos) == 1 && v.Repos[0].FullName == "o/fast" {
|
||||
break
|
||||
}
|
||||
time.Sleep(5 * time.Millisecond)
|
||||
}
|
||||
v := c.View()
|
||||
if len(v.Repos) != 1 || v.Repos[0].FullName != "o/fast" || !v.Refreshing || v.Loaded {
|
||||
t.Fatalf("mid-scan view: repos=%d refreshing=%v loaded=%v", len(v.Repos), v.Refreshing, v.Loaded)
|
||||
}
|
||||
close(release)
|
||||
<-done
|
||||
if v := c.View(); len(v.Repos) != 2 || !v.Loaded {
|
||||
t.Fatalf("after scan: repos=%d loaded=%v", len(v.Repos), v.Loaded)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,9 @@ const (
|
||||
KindWorkflowStuck = "workflow_stuck"
|
||||
KindPRWaiting = "pr_waiting"
|
||||
KindPRChecks = "pr_checks_failing"
|
||||
KindIssuesStale = "issues_stale"
|
||||
KindPRFresh = "pr_fresh"
|
||||
KindIssueStale = "issue_stale"
|
||||
KindIssueFresh = "issue_fresh"
|
||||
// KindPROpen is informational plumbing for automatic actions; it has OK severity so it never moves health or counts.
|
||||
KindPROpen = "pr_open"
|
||||
)
|
||||
@@ -71,27 +73,20 @@ func Evaluate(r *model.Repo, now time.Time, th config.Thresholds) []model.Alert
|
||||
add(model.Crit, KindPRWaiting, subject, "open "+Age(age), pr.URL, pr.CreatedAt)
|
||||
case th.PRWarnAfter > 0 && age >= th.PRWarnAfter:
|
||||
add(model.Warn, KindPRWaiting, subject, "open "+Age(age), pr.URL, pr.CreatedAt)
|
||||
default:
|
||||
add(model.Warn, KindPRFresh, subject, "new, open "+Age(age), pr.URL, pr.CreatedAt)
|
||||
}
|
||||
if pr.Checks.State == model.ChecksFail {
|
||||
add(model.Warn, KindPRChecks, subject, summarizeChecks(pr.Checks), pr.URL, pr.UpdatedAt)
|
||||
}
|
||||
}
|
||||
|
||||
if th.IssueStaleAfter > 0 {
|
||||
var stale int
|
||||
var oldest time.Time
|
||||
for _, is := range r.Issues {
|
||||
if now.Sub(is.UpdatedAt) >= th.IssueStaleAfter {
|
||||
stale++
|
||||
if oldest.IsZero() || is.UpdatedAt.Before(oldest) {
|
||||
oldest = is.UpdatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
if stale > 0 {
|
||||
add(model.Warn, KindIssuesStale, fmt.Sprintf("%d stale issues", stale),
|
||||
"no activity for "+Age(th.IssueStaleAfter)+" or more",
|
||||
r.URL+"/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-asc", oldest)
|
||||
subject := fmt.Sprintf("#%d %s", is.Number, is.Title)
|
||||
if idle := now.Sub(is.UpdatedAt); th.IssueStaleAfter > 0 && idle >= th.IssueStaleAfter {
|
||||
add(model.Warn, KindIssueStale, subject, "no activity for "+Age(idle), is.URL, is.UpdatedAt)
|
||||
} else {
|
||||
add(model.Warn, KindIssueFresh, subject, "new, open "+Age(now.Sub(is.CreatedAt)), is.URL, is.CreatedAt)
|
||||
}
|
||||
}
|
||||
return alerts
|
||||
|
||||
@@ -158,7 +158,8 @@ func (a *Actions) statusRows(ctx context.Context, rt *actionRuntime) (map[alertR
|
||||
if !rt.fetched.IsZero() && a.now().Sub(rt.fetched) < statusCacheTTL {
|
||||
return rt.rows, rt.err
|
||||
}
|
||||
rows, err := a.fetchStatus(ctx, rt.cfg)
|
||||
// A client that disconnects mid-request must not fail the fetch that every later request reuses.
|
||||
rows, err := a.fetchStatus(context.WithoutCancel(ctx), rt.cfg)
|
||||
if err != nil {
|
||||
a.log.Warn("action status unavailable", "action", rt.cfg.ID, "err", err)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package web
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"log/slog"
|
||||
@@ -407,3 +408,15 @@ func TestRedirectDoesNotForwardToken(t *testing.T) {
|
||||
t.Fatal("bearer token forwarded across a redirect")
|
||||
}
|
||||
}
|
||||
|
||||
func TestStatusFetchSurvivesCancelledRequest(t *testing.T) {
|
||||
fh := newFakeHook(t)
|
||||
fh.statBody = `[{"repo":"o/r","url":"` + alertURL + `","state":"running"}]`
|
||||
h := newActionServer(t, nil, fh.srv.URL)
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
rows, err := h.actions.statusRows(ctx, h.actions.list[0])
|
||||
if err != nil || len(rows) != 1 {
|
||||
t.Fatalf("rows=%d err=%v, want the fetch to complete despite the cancelled request", len(rows), err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,10 +138,10 @@ func TestNewAutoRunnerNilWithoutAutoActions(t *testing.T) {
|
||||
|
||||
func TestStateCarriesPROpenRef(t *testing.T) {
|
||||
st := buildState(autoView(autoPR(1, "abc", "x", nil)), true)
|
||||
if len(st.Alerts) != 1 || st.Alerts[0].Kind != collector.KindPROpen || st.Alerts[0].Ref != "abc" || st.Alerts[0].Severity != "ok" {
|
||||
if len(st.Alerts) != 2 || st.Alerts[0].Kind != collector.KindPROpen || st.Alerts[0].Ref != "abc" || st.Alerts[0].Severity != "ok" || st.Alerts[1].Kind != collector.KindPRFresh {
|
||||
t.Fatalf("alerts = %+v", st.Alerts)
|
||||
}
|
||||
if st.Counts.Crit != 0 || st.Counts.Warn != 0 || st.Repos[0].Health != "ok" {
|
||||
t.Fatalf("counts/health changed: %+v %s", st.Counts, st.Repos[0].Health)
|
||||
if st.Repos[0].Health != "warn" {
|
||||
t.Fatalf("health = %s, want warn", st.Repos[0].Health)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,5 +43,5 @@
|
||||
"vitest": "^5.0.1",
|
||||
"vue-tsc": "^3.3.11"
|
||||
},
|
||||
"packageManager": "[email protected].3"
|
||||
"packageManager": "[email protected].4"
|
||||
}
|
||||
|
||||
+2
-2
@@ -116,7 +116,7 @@ onBeforeUnmount(() => {
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="mt-10 grid grid-cols-[minmax(0,1fr)] gap-x-10 gap-y-10 sm:mt-14 lg:grid-cols-[minmax(0,1fr)_24rem] 2xl:grid-cols-[minmax(0,1fr)_28rem]"
|
||||
class="mt-10 grid grid-cols-[minmax(0,1fr)] gap-x-10 gap-y-10 sm:mt-14 xl:grid-cols-[minmax(0,1fr)_24rem] 2xl:grid-cols-[minmax(0,1fr)_28rem]"
|
||||
>
|
||||
<AttentionList
|
||||
ref="list"
|
||||
@@ -133,7 +133,7 @@ onBeforeUnmount(() => {
|
||||
@clear="store.clearFilters()"
|
||||
@refresh="store.refreshRepo"
|
||||
/>
|
||||
<aside class="lg:sticky lg:top-6 lg:self-start">
|
||||
<aside class="xl:sticky xl:top-6 xl:self-start">
|
||||
<ProjectList
|
||||
:repos="visibleRepos"
|
||||
:total="state.repos.length"
|
||||
|
||||
@@ -89,7 +89,7 @@ const LABEL = { crit: 'Critical', warn: 'Warning', ok: 'Healthy' } as const
|
||||
<ul
|
||||
v-else
|
||||
ref="scroller"
|
||||
class="border-border bg-surface divide-border max-h-[70vh] divide-y overflow-y-auto rounded-lg border [scrollbar-color:var(--border)_transparent] [scrollbar-width:thin] lg:max-h-[calc(100vh-7rem)]"
|
||||
class="border-border bg-surface divide-border max-h-[70vh] divide-y overflow-y-auto rounded-lg border [scrollbar-color:var(--border)_transparent] [scrollbar-width:thin] xl:max-h-[calc(100vh-7rem)]"
|
||||
>
|
||||
<li
|
||||
v-for="repo in visible"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { faSpinner } from '@fortawesome/free-solid-svg-icons'
|
||||
import { faScrewdriverWrench, faSpinner } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
||||
import {
|
||||
AlertDialog,
|
||||
@@ -44,14 +44,18 @@ function press(a: ActionDef): void {
|
||||
<div class="mt-2 flex flex-wrap items-center gap-2" data-test="row-actions">
|
||||
<template v-for="a in row.actions" :key="a.id">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="xs"
|
||||
size="sm"
|
||||
class="font-semibold shadow-sm"
|
||||
:disabled="busy(a)"
|
||||
:aria-busy="busy(a)"
|
||||
:data-test="`action-${a.id}`"
|
||||
@click="press(a)"
|
||||
>
|
||||
<FontAwesomeIcon v-if="busy(a)" :icon="faSpinner" spin aria-hidden="true" />
|
||||
<FontAwesomeIcon
|
||||
:icon="busy(a) ? faSpinner : faScrewdriverWrench"
|
||||
:spin="busy(a)"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{{ a.label }}
|
||||
</Button>
|
||||
<Badge v-if="busy(a)" variant="secondary" data-test="action-status">Sending</Badge>
|
||||
|
||||
@@ -156,7 +156,7 @@ describe('AttentionRow', () => {
|
||||
it('omits the age for an unknown timestamp', () => {
|
||||
const w = mount(AttentionRow, {
|
||||
props: {
|
||||
row: row({ since: '0001-01-01T00:00:00Z', kind: 'issues_stale' }),
|
||||
row: row({ since: '0001-01-01T00:00:00Z', kind: 'issue_stale' }),
|
||||
nowMs,
|
||||
critSeconds: CRIT_SECONDS,
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { onBeforeUnmount, onMounted, ref, type Ref } from 'vue'
|
||||
|
||||
/** 1 column below the breakpoint, 2 at or above it; follows the viewport live. */
|
||||
export function useColumns(minWidth = '(min-width: 96rem)'): Ref<number> {
|
||||
export function useColumns(minWidth = '(min-width: 90rem)'): Ref<number> {
|
||||
const columns = ref(1)
|
||||
let query: MediaQueryList | null = null
|
||||
const update = () => {
|
||||
|
||||
@@ -38,7 +38,7 @@ const fleet = () =>
|
||||
}),
|
||||
alert({
|
||||
repo: 'b/two',
|
||||
kind: 'issues_stale',
|
||||
kind: 'issue_stale',
|
||||
severity: 'warn',
|
||||
subject: '4 stale issues',
|
||||
url: '3',
|
||||
@@ -62,7 +62,7 @@ describe('kindGroup', () => {
|
||||
['workflow_stuck', 'workflow'],
|
||||
['pr_waiting', 'pr'],
|
||||
['pr_checks_failing', 'pr'],
|
||||
['issues_stale', 'issue'],
|
||||
['issue_stale', 'issue'],
|
||||
['refresh_failed', 'data'],
|
||||
['data_stale', 'data'],
|
||||
['partial_data', 'data'],
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ export const emptyFilters = (): Filters => ({
|
||||
export function kindGroup(kind: string): KindGroup {
|
||||
if (kind.startsWith('workflow_')) return 'workflow'
|
||||
if (kind.startsWith('pr_')) return 'pr'
|
||||
if (kind === 'issues_stale') return 'issue'
|
||||
if (kind.startsWith('issue_')) return 'issue'
|
||||
return 'data'
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -14,7 +14,9 @@ export const KIND_ICON: Record<string, IconDefinition> = {
|
||||
workflow_stuck: faGears,
|
||||
pr_waiting: faCodePullRequest,
|
||||
pr_checks_failing: faCodePullRequest,
|
||||
issues_stale: faCircleDot,
|
||||
pr_fresh: faCodePullRequest,
|
||||
issue_stale: faCircleDot,
|
||||
issue_fresh: faCircleDot,
|
||||
refresh_failed: faPlugCircleXmark,
|
||||
data_stale: faClockRotateLeft,
|
||||
partial_data: faTriangleExclamation,
|
||||
|
||||
Reference in New Issue
Block a user