This repository was archived by the owner on Sep 5, 2025. It is now read-only.
adjust fallback-week calculation to avoid incomplete weeks#350
Draft
adjust fallback-week calculation to avoid incomplete weeks#350
Conversation
There was a problem hiding this comment.
Pull Request Overview
Improves fallback week selection logic to prioritize weeks with service on all days of the week over partial weeks that may have zero service on certain days. This addresses an issue where weeks with incomplete service patterns (e.g., no Monday/Tuesday service) were being selected as fallback weeks.
- Modified fallback week selection to use a two-pass algorithm that first seeks weeks with full service, then falls back to highest total service if none exist
- Added comprehensive test coverage for various edge cases including partial weeks, complete zero-service weeks, and reduced service scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/clock/swcache.go | Implements two-pass fallback week selection algorithm with individual day service checks |
| internal/clock/swcache_test.go | Comprehensive test suite covering edge cases for fallback week selection logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.