Improve release announcement formatting and content - #23
Conversation
- 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>
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughThe 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. ChangesRelease announcement updates
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (5)
ProductReleaseAnnouncement/.gitignoreProductReleaseAnnouncement/MakefileProductReleaseAnnouncement/README.mdProductReleaseAnnouncement/product_rel_announcement.pyProductReleaseAnnouncement/test_product_rel_announcement.py
| slack_file = f"release-notes-{arguments['--rhwa-version']}.md" | ||
| with open(slack_file, 'w', encoding='utf-8') as f: | ||
| f.write(slack) |
There was a problem hiding this comment.
🔒 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.
| 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
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:
.txtwhen the content is already markdownChanges made
release-notes-<ver>.mdinstead ofrelease-slack.txtWhich issue(s) this PR fixes
Follow-up to #17
Test plan
All 16 existing tests pass with
make test.