Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Pull Request

Proposed Changes

The action silently fails with an empty report when END_DATE is set before or equal to START_DATE. This adds validation to catch the misconfiguration early with a clear error message.

Implementation

  • Added validate_date_range() in env.py: Validates END_DATE > START_DATE using string comparison (YYYY-MM-DD allows lexicographic ordering). Only runs when both dates are provided.
  • Integrated into get_env_vars(): Called after format validation, before any processing.
  • Added test coverage: Three test cases covering invalid range (raises ValueError), equal dates (raises ValueError), and valid range (allowed).

Error message:

END_DATE ('2024-01-01') must be after START_DATE ('2025-01-01')

The validation ensures users must provide a meaningful date range where END_DATE is at least one day after START_DATE, preventing zero-day ranges and potential edge cases.

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • run make lint and fix any issues that you have introduced
  • run make test and ensure you have test coverage for the lines you are introducing
  • If publishing new data to the public (scorecards, security scan results, code quality results, live dashboards, etc.), please request review from @jeffrey-luszcz

Reviewer

  • Label as either bug, documentation, enhancement, infrastructure, maintenance or breaking
Original prompt

This section details on the original issue you should resolve

<issue_title>No check for end date that points to before start date</issue_title>
<issue_description>### Describe the bug

If you set the end date to a time before the start date the action will report success but have an empty report. (silent failure)

To Reproduce

set end date to 2024-01-01
set start date to 2025-01-01
set other required configs
observe an empty report with no indication of what you did wrong

Expected behavior

the action should run a check that the start date is pointing to a time before the end date.

Screenshots

No response

Additional context

No response</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.

Copilot AI and others added 3 commits December 30, 2025 15:38
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
…st readability

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix silent failure due to end date before start date Dec 30, 2025
Copilot AI requested a review from zkoppert December 30, 2025 15:46
@github-actions github-actions bot added the fix label Dec 31, 2025
@zkoppert
Copy link
Member

@copilot change the code and corresponding tests so that if the end date is before or the same as the start date, then it should return the error. Currently the code demonstrates only end date less than start date. It should be less than or equal to.

Co-authored-by: zkoppert <6935431+zkoppert@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 31, 2025

@copilot change the code and corresponding tests so that if the end date is before or the same as the start date, then it should return the error. Currently the code demonstrates only end date less th...

Changed the validation logic to require END_DATE strictly after START_DATE (using <= comparison). Equal dates now raise an error with the message: "END_DATE ('2024-01-01') must be after START_DATE ('2024-01-01')". Updated corresponding tests. See commit 9d8c0bd.

Copilot AI changed the title fix: validate END_DATE is not before START_DATE Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants