Skip to content

Fix OCP manifest start/end dates to reflect full range across all generators#623

Open
esebesto wants to merge 1 commit intomainfrom
esebesto/fix_ocp_manifest
Open

Fix OCP manifest start/end dates to reflect full range across all generators#623
esebesto wants to merge 1 commit intomainfrom
esebesto/fix_ocp_manifest

Conversation

@esebesto
Copy link
Copy Markdown
Contributor

Co-Authored-By: Claude noreply@anthropic.com

Issue:
The manifest start and end fields were set from gen_start_date/gen_end_date after the generator loop, which meant they always reflected the last generator's date window rather than the actual reporting range. In a static YAML with multiple generators having different start_date/end_date attributes, the manifest would misreport its coverage — potentially excluding earlier generators entirely.

Fix: track manifest_start_date = min(gen_start_date) and manifest_end_date = max(gen_end_date) across all generators in the loop, and use those for the manifest instead.

A new test (test_ocp_create_report_manifest_dates_span_all_generators) covers the scenario: two generators where the second has a narrower window than the first, asserting the manifest covers the full union of both.

@esebesto esebesto changed the title Fix OCP manifest start/end dates to reflect full range across all gen… Fix OCP manifest start/end dates to reflect full range across all generators Apr 21, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the OCP report generation to ensure the manifest start and end dates reflect the full range across all generators instead of just the last one. It includes a version bump to 5.4.2 and a new test case. Feedback was provided regarding the initialization of manifest dates, which could lead to swapped values if no generators are processed, and the need to update other references to gen_start_date for consistency.

Comment thread nise/report.py
Comment on lines +927 to +928
manifest_start_date = month.get("end")
manifest_end_date = month.get("start")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The initialization of manifest_start_date and manifest_end_date to the month's boundaries in reverse order is a functional way to find the min/max within the loop. However, if no generators are processed or if all are skipped (lines 936-939), the manifest will be generated with swapped start and end dates (e.g., start at the end of the month and end at the start).

Additionally, note that gen_start_date is still used outside the generator loop at line 976 (for the filename year) and line 1095 (for the payload key). To fully align with the PR's objective of reflecting the full reporting range and to avoid relying on loop-leaked variables, those instances should also be updated to use manifest_start_date.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.6%. Comparing base (12990a2) to head (0f2241a).

Additional details and impacted files
@@           Coverage Diff           @@
##            main    #623     +/-   ##
=======================================
- Coverage   93.7%   93.6%   -0.1%     
=======================================
  Files         56      56             
  Lines       4800    4806      +6     
  Branches     674     676      +2     
=======================================
+ Hits        4496    4499      +3     
- Misses       164     165      +1     
- Partials     140     142      +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant