Skip to content

Fix: oldest report rows dropped on every weekly Action run#13

Merged
hechth merged 2 commits into
mainfrom
copilot/fix-github-action-workflow-issue
Mar 4, 2026
Merged

Fix: oldest report rows dropped on every weekly Action run#13
hechth merged 2 commits into
mainfrom
copilot/fix-github-action-workflow-issue

Conversation

Copilot AI commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

The GitHub traffic API returns a rolling 14-day window. Each weekly run regenerated all_periods solely from the fresh API response, so the oldest week — now outside the window — was permanently deleted from the TSV on every run.

Changes

  • src/reports/base.py — union existing_data.keys() into all_periods so recorded periods are never silently dropped when they age out of the API window:
# Before
all_periods = {p for data in entity_data.values() for p in data.keys()}

# After
all_periods = {p for data in entity_data.values() for p in data.keys()} | set(existing_data.keys())
  • tests/test_report.py — two regression tests (TestReportPreservesExistingPeriods) that reproduce the weekly-run scenario: one verifying the aged-out week remains in the report, one verifying its stored value is unchanged.
Original prompt

This section details on the original issue you should resolve

<issue_title>GitHub Action workflows seem to always remove the first line of the report tables</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… them

Co-authored-by: hechth <12066490+hechth@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix GitHub Action workflows removing first line of report tables Fix: oldest report rows dropped on every weekly Action run Mar 4, 2026
@hechth hechth marked this pull request as ready for review March 4, 2026 14:26
@hechth hechth merged commit 2d209f7 into main Mar 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub Action workflows seem to always remove the first line of the report tables

2 participants