Skip to content

Improve release announcement formatting and content - #23

Draft
razo7 wants to merge 1 commit into
mainfrom
improve-release-announcements
Draft

Improve release announcement formatting and content#23
razo7 wants to merge 1 commit into
mainfrom
improve-release-announcements

Conversation

@razo7

@razo7 razo7 commented Jul 27, 2026

Copy link
Copy Markdown
Member

Why we need this PR

Follow-up to #17. The generated announcements had several gaps compared to the actual posts used for the RHWA-4.22-0 release cycle:

  • SBR was missing its hyphen ("Storage Based" vs "Storage-Based")
  • Slack output was .txt when the content is already markdown
  • Upstream template spoke in first person ("On behalf of... I am pleased") instead of group voice
  • Community links (Google Group, LinkedIn) were missing from the footer

Changes made

  • Fix SBR name to "Storage-Based Remediation" (hyphenated, matching the operator's actual name)
  • Output Slack/RHWA release notes as release-notes-<ver>.md instead of release-slack.txt
  • Use group voice ("The Medik8s team is pleased to announce") in upstream template
  • Add Google Group and LinkedIn links to upstream footer
  • Update tests, README, Makefile, and .gitignore accordingly

Which issue(s) this PR fixes

Follow-up to #17

Test plan

All 16 existing tests pass with make test.

- Fix SBR name to "Storage-Based Remediation" (hyphenated)
- Output Slack/RHWA release notes as release-notes-<ver>.md instead of
  release-slack.txt for better readability
- Use company voice ("The Medik8s team") instead of personal ("On behalf
  of... I am pleased") in upstream template
- Add Google Group and LinkedIn links to upstream footer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: razo7

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:

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

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Slack announcement output changed from a fixed text file to a versioned Markdown file. Related documentation and cleanup rules were updated, while operator naming and upstream announcement content received corresponding revisions and test updates.

Changes

Release announcement updates

Layer / File(s) Summary
Versioned Slack output contract
ProductReleaseAnnouncement/product_rel_announcement.py, ProductReleaseAnnouncement/README.md, ProductReleaseAnnouncement/.gitignore, ProductReleaseAnnouncement/Makefile
The Slack option and implementation now write release-notes-<ver>.md; documentation, ignore rules, and cleanup behavior were updated accordingly.
Announcement content and expectations
ProductReleaseAnnouncement/product_rel_announcement.py, ProductReleaseAnnouncement/test_product_rel_announcement.py
The SBR operator name and upstream announcement closing links were revised, with matching full-message test expectations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • medik8s/tools#17: Introduced the Slack announcement and template generation that this versioned-output update modifies.

Suggested reviewers: clobrano

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main changes to release announcement formatting and content.
Description check ✅ Passed The description directly matches the changes in output files, template wording, links, and renamed release notes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improve-release-announcements

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ProductReleaseAnnouncement/product_rel_announcement.py`:
- Around line 80-82: Validate arguments['--rhwa-version'] against the expected
version format (for example, digits.digits-digits) before constructing
slack_file in the release announcement flow. Reject invalid values, including
path separators, and only then interpolate the validated version into the
filename used by open.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 694f7cd4-ebf9-48fd-b27b-2522ead54d57

📥 Commits

Reviewing files that changed from the base of the PR and between bbca26d and 3d64b7d.

📒 Files selected for processing (5)
  • ProductReleaseAnnouncement/.gitignore
  • ProductReleaseAnnouncement/Makefile
  • ProductReleaseAnnouncement/README.md
  • ProductReleaseAnnouncement/product_rel_announcement.py
  • ProductReleaseAnnouncement/test_product_rel_announcement.py

Comment on lines +80 to 82
slack_file = f"release-notes-{arguments['--rhwa-version']}.md"
with open(slack_file, 'w', encoding='utf-8') as f:
f.write(slack)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Validate rhwa-version before using it in a filesystem path.

rhwa-version is CLI-controlled and is interpolated directly into the filename. Values containing path separators can create unexpected nested paths, fail with FileNotFoundError, or—when matching directories already exist—escape the working directory and overwrite another writable file. Validate the expected format (for example, ^\d+\.\d+-\d+$) before constructing the path.

Proposed fix
+    version = arguments['--rhwa-version']
+    if not re.fullmatch(r'\d+\.\d+-\d+', version):
+        sys.exit("Error: invalid --rhwa-version")
+
-        slack_file = f"release-notes-{arguments['--rhwa-version']}.md"
+        slack_file = f"release-notes-{version}.md"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
slack_file = f"release-notes-{arguments['--rhwa-version']}.md"
with open(slack_file, 'w', encoding='utf-8') as f:
f.write(slack)
version = arguments['--rhwa-version']
if not re.fullmatch(r'\d+\.\d+-\d+', version):
sys.exit("Error: invalid --rhwa-version")
slack_file = f"release-notes-{version}.md"
with open(slack_file, 'w', encoding='utf-8') as f:
f.write(slack)
🧰 Tools
🪛 ast-grep (0.44.1)

[warning] 80-80: File path is request-/variable-derived; validate and normalize to prevent path traversal.
Context: open(slack_file, 'w', encoding='utf-8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(open-filename-from-request)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ProductReleaseAnnouncement/product_rel_announcement.py` around lines 80 - 82,
Validate arguments['--rhwa-version'] against the expected version format (for
example, digits.digits-digits) before constructing slack_file in the release
announcement flow. Reject invalid values, including path separators, and only
then interpolate the validated version into the filename used by open.

Source: Linters/SAST tools

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.

1 participant