Skip to content

Conversation

@empovit
Copy link
Member

@empovit empovit commented Jan 18, 2026

Summary by CodeRabbit

  • New Features

    • Adds automated weekly summaries of tested GPU main, GPU operator, and OpenShift versions (Markdown) with per-section counts and lists.
    • CLI supports custom date ranges (defaults to last 7 days) and emits informational logs.
    • Outputs saved as date-stamped archives and published online; workflow runs weekly (Thu 14:00 UTC) and is manually triggerable.
  • Chores

    • Workflow runs on Python 3.13, exposes a version-source environment variable, and includes a failure-notification step.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

Walkthrough

Adds 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

Cohort / File(s) Summary
Weekly Summary Script
.github/scripts/weekly_summaries/weekly_summary.py
New Python module that finds commits touching workflows/gpu_operator_versions/versions.json, reads file contents at historical commits, extracts nested patch-version strings, aggregates per-category versions (gpu-main-latest, gpu-operator, ocp), formats Markdown sections, writes weekly-summary.md, prints to stdout, and exposes a CLI (--since, --until) plus helper functions.
Workflow Automation
.github/workflows/weekly-version-summary.yaml
New GitHub Actions workflow (cron weekly + manual) that checks out full history, sets up Python 3.13, runs the script (env VERSION_FILE_PATH=workflows/gpu_operator_versions/versions.json), checks out gh-pages into a workdir, saves a dated copy under gh-pages/weekly-summaries/ (YYYY-MM-DD-weekly-summary.md), and deploys via a gh-pages deploy action; includes a failure notification step.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

lgtm

Suggested reviewers

  • ggordaniRed
  • TomerNewman
  • wabouhamad

Poem

🐰 I hopped through commits both near and far,
I plucked the versions like berries on a vine,
GPU, operator, OpenShift in line,
Saved with dates for everyone to see—
A weekly summary, fresh as can be.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Generate weekly test summaries' directly reflects the main changes in the changeset, which adds a Python script and GitHub Actions workflow to generate weekly summaries of tested GPU operator versions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 using datetime.now(timezone.utc) (importing timezone from datetime).

Also, the tested_versions initialization is duplicated here and in collect_tested_versions. Consider extracting a helper or calling collect_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: The summary output is captured but never used.

The summary is written to $GITHUB_OUTPUT but 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.

@empovit empovit force-pushed the add-weekly-summary branch from 5dbc4b1 to 1eb0790 Compare January 18, 2026 09:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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, while main() uses datetime.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(

@empovit empovit force-pushed the add-weekly-summary branch from 1eb0790 to 194df2e Compare January 18, 2026 10:13
@empovit empovit force-pushed the add-weekly-summary branch from 194df2e to 8292f15 Compare January 18, 2026 12:41
@empovit empovit force-pushed the add-weekly-summary branch from 8292f15 to ea7d442 Compare January 18, 2026 12:44
@openshift-ci
Copy link

openshift-ci bot commented Jan 18, 2026

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [TomerNewman,empovit]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 2eeda89 into rh-ecosystem-edge:main Jan 18, 2026
3 checks passed
@empovit empovit deleted the add-weekly-summary branch January 18, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants