-
Notifications
You must be signed in to change notification settings - Fork 11
Generate weekly test summaries #417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate weekly test summaries #417
Conversation
WalkthroughAdds a new Python script that scans git history to collect tested GPU/operator/OpenShift versions and generate a dated Markdown summary, plus a GitHub Actions workflow that runs weekly (and on demand) to run the script and publish dated summaries to the gh-pages branch. Changes
Sequence DiagramsequenceDiagram
participant Scheduler as GitHub Scheduler
participant Actions as GitHub Actions
participant Script as weekly_summary.py
participant Git as Git Repository
participant Pages as gh-pages Workdir / Deploy
Scheduler->>Actions: trigger workflow (cron / manual)
Actions->>Git: checkout repository (full history)
Actions->>Script: run weekly_summary.py (--since/--until)
Script->>Git: git log for `workflows/gpu_operator_versions/versions.json`
Git-->>Script: list of commits
loop for each commit (oldest→newest)
Script->>Git: git show <commit>:workflows/gpu_operator_versions/versions.json
Git-->>Script: file content (JSON) or not found
Script->>Script: extract versions & accumulate per-category sets
end
Script->>Actions: emit weekly-summary.md (and stdout)
Actions->>Git: checkout gh-pages into gh-pages-work
Actions->>Pages: write dated file to gh-pages/weekly-summaries/
Actions->>Pages: deploy via gh-pages action
Pages-->>Actions: deployment result
alt failure
Actions->>Actions: run failure notification step
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/scripts/weekly_summaries/weekly_summary.py:
- Around line 93-113: prev_content can be None when the file didn't exist before
the first commit, causing prev_content.get(key) to raise AttributeError; update
the loop that initializes prev_content (and/or before using prev_content in the
for commit loop) to coerce None to an empty dict (e.g., set prev_content = {} if
get_file_at_commit(...) returns None) so that calls like prev_content.get(key)
and extract_versions_from_dict(old_val or {}, new_val) are safe; refer to
get_file_at_commit, prev_content, tested_versions, and
extract_versions_from_dict to locate where to add this defensive check.
🧹 Nitpick comments (2)
.github/scripts/weekly_summaries/weekly_summary.py (1)
162-175: Consider using UTC for consistent timestamps across CI runs.
datetime.now()uses the local timezone, which may vary depending on the CI runner. For reproducibility, consider usingdatetime.now(timezone.utc)(importingtimezonefromdatetime).Also, the
tested_versionsinitialization is duplicated here and incollect_tested_versions. Consider extracting a helper or callingcollect_tested_versions([])which already returns the empty structure.♻️ Suggested improvement
+from datetime import datetime, timedelta, timezone -from datetime import datetime, timedelta- end_date = datetime.now() + end_date = datetime.now(timezone.utc) start_date = end_date - timedelta(days=days) - tested_versions = { - VERSION_GPU_MAIN_LATEST: set(), - VERSION_GPU_OPERATOR: set(), - VERSION_OCP: set(), - } + tested_versions = collect_tested_versions([], file_path) else: tested_versions = collect_tested_versions(commits, file_path) - end_date = datetime.now() + end_date = datetime.now(timezone.utc) start_date = end_date - timedelta(days=days).github/workflows/weekly-version-summary.yaml (1)
30-35: Thesummaryoutput is captured but never used.The summary is written to
$GITHUB_OUTPUTbut no subsequent step references${{ steps.generate.outputs.summary }}. If this is intended for future use (e.g., notifications), consider adding a comment. Otherwise, these lines can be removed to simplify the workflow.
5dbc4b1 to
1eb0790
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @.github/scripts/weekly_summaries/weekly_summary.py:
- Around line 82-115: The loop in collect_tested_versions processes commits
newest-first, causing prev_content to be a newer snapshot and inverting diffs;
fix by processing oldest-first: reverse the commits sequence (e.g., commits =
list(reversed(commits)) or iterate reversed(commits)) before computing
first_commit and prev_content so get_file_at_commit(f"{first_commit}^",
file_path) and the subsequent loop compare each commit to its true previous
state; keep the rest of the logic (keys loop, extract_versions_from_dict,
updating tested_versions) unchanged.
🧹 Nitpick comments (1)
.github/scripts/weekly_summaries/weekly_summary.py (1)
19-35: Timezone inconsistency between git query and report dates.
datetime.now()on line 21 produces a naive local-time datetime, whilemain()usesdatetime.now(timezone.utc)for the report header. This could cause the queried commits and the displayed date range to differ slightly at day boundaries.♻️ Suggested fix: use UTC consistently
def get_commits_since(days: int, file_path: str) -> list[str]: """Get all commit hashes that modified the file in the last N days.""" - since_date = (datetime.now() - timedelta(days=days)).isoformat() + since_date = (datetime.now(timezone.utc) - timedelta(days=days)).isoformat() result = subprocess.run(
1eb0790 to
194df2e
Compare
194df2e to
8292f15
Compare
8292f15 to
ea7d442
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: empovit, TomerNewman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
2eeda89
into
rh-ecosystem-edge:main
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.