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
5 changes: 4 additions & 1 deletion autohands/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,10 @@ def _render_html(snapshot: dict) -> str:
if gh_owner and gh_repo else [])
panel = t_.orchestration_panel(
"hands", "", "", CHECKIN_PROMPT.format(owner=gh_owner or "the organism’s"),
work_links=work_links, organ="hands")
work_links=work_links, organ="hands",
refreshed_at=snapshot.get("generated") if not snapshot.get("errors") else None,
refresh_url=(f"https://github.com/{gh_owner}/{gh_repo}/actions/workflows/release_board.yml"
if gh_owner and gh_repo else None))
github_link = (f' · <a href="https://github.com/{gh_owner}/{gh_repo}'
'/blob/main/README.md">GitHub Page</a>'
if gh_owner and gh_repo else "")
Expand Down
12 changes: 12 additions & 0 deletions tests/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,15 @@ def test_orchestration_without_remote_reports_unknown_destination():
assert "https://github.com/None/None" not in page
assert 'data-orchestration-copy' in page
assert 'manage the organism’s release work' in page


def test_panel_refresh_uses_capture_not_release_time(monkeypatch):
theme = board.theme()
calls = []
monkeypatch.setattr(theme, "orchestration_panel", lambda *a, **kw: calls.append(kw) or "")
board.render(SNAP, "html")
assert calls[0]["refreshed_at"] == SNAP["generated"]
assert calls[0]["refresh_url"] == "https://github.com/SomeOrg/SomeHands/actions/workflows/release_board.yml"

board.render({**SNAP, "errors": ["release collection unavailable"]}, "html")
assert calls[-1]["refreshed_at"] is None
Loading