Skip to content

Commit

Permalink
fix: don't display duplicate runs. #19
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 13, 2024
1 parent 55f2afc commit 40af699
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ Unreleased

- Fix: don't fail if a .netrc file can't be found. Fixes `issue 18`_.

- Fix: in the odd case of duplicate remotes, don't list workflow runs twice.
Fixes `issue 19`_.

.. _issue 18: https://github.com/nedbat/watchgha/issues/18
.. _issue 19: https://github.com/nedbat/watchgha/issues/19


2.2.0 — 2024-01-11
Expand Down
5 changes: 5 additions & 0 deletions src/watchgha/data_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ async def runs_from_url(url):
for url in urls:
nursery.start_soon(runs_from_url, url)

# In odd situations (duplicate remotes) we can get the same run more than
# once. De-duplicate them.
runs_by_id = {r["id"]: r for r in runs}
runs = list(runs_by_id.values())

async with trio.open_nursery() as nursery:
for run in runs:
run["started_dt"] = to_datetime(run["run_started_at"])
Expand Down

0 comments on commit 40af699

Please sign in to comment.