Fix changelog dialog crash#7117
Conversation
📝 WalkthroughWalkthroughThe changelog overview script now formats the Lua ChangesChangelog Version Formatting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/scripts/python/changelog_overview.py (1)
46-46:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winCritical: Version string still unquoted in the normal code path.
The normal case (4-part filename) assigns
version = file_name_parts[3]without quotes. When this version contains non-numeric characters (e.g., "v3747", "patch-1.2.3"), line 67 outputsVersion = v3747,in Lua, which Lua interprets as a variable reference, causing the same crash this PR aims to fix.This is the original bug location that was not addressed by the change on line 56.
Recommended comprehensive fix
The correct approach is to keep
versionwithout embedded quotes and add quotes in the f-string template on line 67. Apply these changes:Line 46: Keep version unquoted
version = file_name_parts[3]Line 56: Remove embedded quotes (fix separately below)
- version = f'"{markdown_file.stem}"' + version = markdown_file.stemLine 67: Add quotes in the template
- Version = {version}, + Version = "{version}",This ensures:
- Lua always receives a quoted string for the Version field
- The URL on line 70 remains valid (no embedded quotes breaking string syntax)
- Both normal and error code paths are handled consistently
🤖 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 @.github/workflows/scripts/python/changelog_overview.py at line 46, The code assigns version = file_name_parts[3] without quotes but later emits it into the Lua output unquoted; fix by keeping version as-is (no embedded quotes in the value) and instead wrap the {version} placeholder in quotes inside the Lua output f-string/template (the string that writes the "Version = ..." line), and also remove any embedded quotes previously added elsewhere (the other change that modified version assignment) so both normal and error paths consistently emit Version as a quoted Lua string.
🤖 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 @.github/workflows/scripts/python/changelog_overview.py:
- Line 56: The version string currently includes embedded quotes (version =
f'"{markdown_file.stem}"'), which breaks the generated Lua URL; change the
assignment to store the raw stem (version = markdown_file.stem) and then when
emitting the Lua output wrap the Version value in quotes (e.g., use
f'"{version}"' only in the Lua template/format for the Version field) while
using the raw version variable when constructing the URL so the URL remains
valid.
---
Outside diff comments:
In @.github/workflows/scripts/python/changelog_overview.py:
- Line 46: The code assigns version = file_name_parts[3] without quotes but
later emits it into the Lua output unquoted; fix by keeping version as-is (no
embedded quotes in the value) and instead wrap the {version} placeholder in
quotes inside the Lua output f-string/template (the string that writes the
"Version = ..." line), and also remove any embedded quotes previously added
elsewhere (the other change that modified version assignment) so both normal and
error paths consistently emit Version as a quoted Lua string.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: a9e776d7-c9ae-4810-8729-6cea52549c3c
📒 Files selected for processing (1)
.github/workflows/scripts/python/changelog_overview.py
5a5e4cc to
0b4bb3c
Compare
Previously the filename in the version field would be interpreted as a global variable and crash the changelog dialog in the lobby.
Summary by CodeRabbit