Skip to content

fix(update): skip redundant daily download on weekly day#17

Open
tgies wants to merge 2 commits intomainfrom
fix/skip-redundant-daily
Open

fix(update): skip redundant daily download on weekly day#17
tgies wants to merge 2 commits intomainfrom
fix/skip-redundant-daily

Conversation

@tgies
Copy link
Copy Markdown
Owner

@tgies tgies commented Mar 16, 2026

Summary

  • When applying a fresh weekly snapshot, skip downloading the daily file for the same weekday (typically Sunday)
  • That daily's data is already contained in the weekly, so downloading it was a no-op that wasted time and IO
  • The daily-chain-only path (no new weekly) is unaffected — all 7 dailies are still checked

Fixes #5

Changes

  • Added skip_weekday: Option<Weekday> parameter to build_daily_chain
  • apply_weekly_then_dailies passes the weekly's weekday to skip
  • run_update (daily-only path) passes None to check all dailies
  • Added 6 unit tests covering date parsing and weekday skip logic

Test plan

  • Unit tests for parse_fcc_date (standard, various months, invalid)
  • Unit tests for weekday skip filtering (skip one, skip none)
  • Unit test for Weekday::for_date matching
  • Full test suite passes (372 tests, 0 failures)
  • Clippy clean with -D warnings

When applying a fresh weekly snapshot, the subsequent daily chain
download now skips the daily file for the same weekday as the weekly
(typically Sunday). That daily's data is already included in the
weekly, so downloading it was a no-op that wasted time and IO.

Fixes #5
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 78.78788% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.17%. Comparing base (0897662) to head (30a5507).

Files with missing lines Patch % Lines
crates/uls-cli/src/commands/update.rs 78.78% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   84.95%   85.17%   +0.21%     
==========================================
  Files          57       57              
  Lines        9805     9867      +62     
==========================================
+ Hits         8330     8404      +74     
+ Misses       1475     1463      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Refactor the weekday skip logic into a standalone function so it is
directly exercised by unit tests, improving patch coverage.
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.

Downloading and applying a superfluous daily when applying weekly

1 participant