diff --git a/heart/dashboard.py b/heart/dashboard.py index fbed2d17..320ac525 100644 --- a/heart/dashboard.py +++ b/heart/dashboard.py @@ -2067,6 +2067,10 @@ def _html_reason(item: dict) -> str: # variables, so this board follows the family accent rather than setting a # second palette. _EXTRA_CSS = """ +.test-workspace-detail{margin-inline-start:.75rem;padding-inline-start:.75rem;border-inline-start:2px solid var(--line,#888)} +.test-workspace-detail dl{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:.35rem .8rem} +.test-workspace-detail dd{margin:0;overflow-wrap:anywhere} + /* All check categories share one compact disclosure grid. */ .board{border:1px solid var(--line);border-radius:10px;overflow:hidden} .check-row{position:relative;border-bottom:1px solid var(--line)} diff --git a/heart/resources.py b/heart/resources.py index 69fa65cf..06709014 100644 --- a/heart/resources.py +++ b/heart/resources.py @@ -55,16 +55,24 @@ def render(catalogue, repos, *, now=None): pass projects = ', '.join(p['name'] for p in resource['projects']) sources = ' · '.join(link(l['url'], l['label']) for l in resource['links']) - workflows = [] - for workflow, evidence in (ci.get('workflows') or {}).items(): + workflows = ci.get('workflows') or {} + rows = [] + failures = [] + for workflow, evidence in workflows.items(): status = evidence.get('conclusion') or evidence.get('status') or 'unknown' - workflows.append(f'
  • {link(evidence.get("url", ""), workflow)}: {esc(status)}
  • ') - detail = ('') if workflows else '

    No workflow-level evidence available.

    ' - cards.append(f'''
    {esc(resource['name'])} · {esc(projects)} · CI: {esc(state)} · {esc(freshness)} -

    Regression, smoke and parity checks for {esc(projects)}. Source remains in the test workspace.

    -

    {sources} · {link(ci.get('url', ''), 'Latest recorded CI run')}

    -
    Observed
    {esc(observed)} · {esc(freshness)}
    Source revision
    {esc(ci.get('head_sha') or ci.get('sha') or 'Unknown')}
    -{detail}

    Test-level counts and coverage are not supplied by this CI snapshot. CI is separate from full release validation; these rows do not change readiness.

    -

    Next: use Heart's check-in to inspect this workspace's latest run, missing evidence and failures before scheduling any check.

    ''') - return ('

    Test workspaces

    Project-owned test suites and their recorded CI evidence. Inventory is not a passing result. CI without matching repository run provenance is unavailable. Evidence older than 24 hours is labelled outdated here; release gates retain their own policy.

    ' - + ''.join(cards) + ('' if cards else '

    No public test-workspace resources available.

    ') + '
    ') + rows.append(f'
  • {link(evidence.get("url", ""), workflow)}: {esc(status)}
  • ') + if status in {'failure', 'timed_out', 'cancelled', 'action_required'}: + failures.append(workflow) + workflow_count = str(len(workflows)) if workflows else 'Not reported' + failure_summary = ', '.join(failures) if failures else ('None' if state == 'success' else 'See run' if ci else 'Unknown') + detail = '' if rows else '' + cards.append(f'''
    {esc(resource['name'])} · CI: {esc(state)} · {esc(freshness)} +
    +
    Suite
    {esc(projects)} — regression, smoke and parity
    +
    Tests
    Count not reported
    +
    Workflows
    {workflow_count}
    +
    Failing workflows
    {esc(failure_summary)}
    +
    Updated
    {esc(observed)}
    +
    {detail}

    {sources} · {link(ci.get('url', ''), 'CI run')}

    ''') + return ('

    Test workspaces

    ' + + ''.join(cards) + ('' if cards else '

    No test workspaces configured.

    ') + '
    ') diff --git a/tests/test_resource_dropdowns.py b/tests/test_resource_dropdowns.py index eeb57689..433b056d 100644 --- a/tests/test_resource_dropdowns.py +++ b/tests/test_resource_dropdowns.py @@ -11,7 +11,7 @@ def test_unknown_is_not_pass(): page = render(CATALOGUE, {}) assert 'CI: unavailable' in page and 'Age unknown' in page assert 'resource-example-tests' in page - assert 'Test-level counts' in page + assert 'Count not reported' in page def test_old_failure_stays_failure_and_links_run(): @@ -20,7 +20,7 @@ def test_old_failure_stays_failure_and_links_run(): 'workflows': {'Smoke': {'conclusion': 'failure'}}} page = render(CATALOGUE, {'checks': {'ci_status': ci}}, now=datetime(2026, 1, 1, tzinfo=timezone.utc)) assert 'CI: failure' in page and 'Evidence outdated' in page - assert 'abcdef' in page and '/actions/runs/1' in page + assert '/actions/runs/1' in page and 'Failing workflows' in page assert 'Smoke' in page