docs(weekly-changelog): anchor window to China time; filter by commit date#1318
docs(weekly-changelog): anchor window to China time; filter by commit date#1318ChaoZheng109 wants to merge 2 commits into
Conversation
… date The skill computed the Fri→Thu window with plain `date -d`, i.e. in the host box's timezone. When the box runs a non-China timezone (the dev/CI box has run PDT), the window shifts by the offset and misfiles the weekday boundary — dropping or double-counting a day of PRs. - §1: echo the box tz vs China tz to surface the offset, then `export TZ='Asia/Shanghai'` so every later date/git-log timestamp is China-local before START/END are computed. - §2: collect commits by China-local COMMIT date (%cd with --date=iso-local), not author date (%ad) which survives rebases; and drop `git log --since/--until` (it prunes non-linear history at the first out-of-range commit and silently omits in-range PRs) in favor of an awk range filter over the full list.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe weekly changelog skill now computes its reporting window in China time, labels the window explicitly, and filters commits by local commit date within the calculated range. ChangesWeekly changelog date handling
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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.
Code Review
This pull request updates the weekly changelog skill documentation to anchor all date math and git commit timestamps to China time (Asia/Shanghai) to prevent timezone offset issues. It also refactors the git log filtering to use commit dates and an awk range filter instead of --since/--until to avoid dropping commits in non-linear history. The reviewer recommended using a tab character (%x09) instead of a pipe (|) as a delimiter in the git log output to prevent truncation issues when commit messages contain pipe characters.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| git log --date=iso-local --pretty=format:"%h %cd|%s" -n 300 \ | ||
| | awk -F'|' -v s="$START" -v e="$END" \ | ||
| '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}' |
There was a problem hiding this comment.
Using | as a delimiter in the git log format can cause issues if any commit message (%s) contains a pipe character (which is common in markdown documentation or PR titles). This would cause awk to split the commit message across multiple fields, resulting in truncated output since only $2 is printed.
Using a tab character (%x09) as the delimiter is much safer and avoids truncation.
| git log --date=iso-local --pretty=format:"%h %cd|%s" -n 300 \ | |
| | awk -F'|' -v s="$START" -v e="$END" \ | |
| '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}' | |
| git log --date=iso-local --pretty=format:"%h %cd%x09%s" -n 300 \ | |
| | awk -F'\t' -v s="$START" -v e="$END" \ | |
| '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}' |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.claude/skills/weekly-changelog/SKILL.md:
- Around line 83-85: Remove the “-n 300” limit from the git log command in the
weekly changelog instructions so the date filter processes the complete
reachable commit history and includes every commit within the START–END window.
- Around line 83-85: Update the git-log parsing awk command to preserve commit
subjects containing pipe characters: continue splitting the metadata portion at
the first delimiter, but derive the subject by removing only the first
delimiter-prefixed field from the original record rather than printing $2. Apply
this within the awk expression used by the changelog workflow.
🪄 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: 2cf9d2b3-4b7d-44b5-a1f1-b647f3d9b5d3
📒 Files selected for processing (1)
.claude/skills/weekly-changelog/SKILL.md
| git log --date=iso-local --pretty=format:"%h %cd|%s" -n 300 \ | ||
| | awk -F'|' -v s="$START" -v e="$END" \ | ||
| '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}' |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Remove the 300-commit cap.
-n 300 limits the input before the date filter runs, so windows with more than 300 reachable commits can silently omit valid in-range commits despite the documented “full commit list” behavior.
Proposed fix
-git log --date=iso-local --pretty=format:"%h %cd|%s" -n 300 \
+git log --date=iso-local --pretty=format:"%h %cd|%s" \📝 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.
| git log --date=iso-local --pretty=format:"%h %cd|%s" -n 300 \ | |
| | awk -F'|' -v s="$START" -v e="$END" \ | |
| '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}' | |
| git log --date=iso-local --pretty=format:"%h %cd|%s" \ | |
| | awk -F'|' -v s="$START" -v e="$END" \ | |
| '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}' |
🤖 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 @.claude/skills/weekly-changelog/SKILL.md around lines 83 - 85, Remove the
“-n 300” limit from the git log command in the weekly changelog instructions so
the date filter processes the complete reachable commit history and includes
every commit within the START–END window.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Preserve subjects containing |.
Using -F'|' and $2 truncates any commit subject containing a pipe, which can corrupt the changelog’s PR title data. Extract the text after the first delimiter instead of relying on the second awk field.
Proposed fix
- '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}'
+ '{
+ split($1, a, " ")
+ d = a[2]
+ if (d >= s && d <= e) {
+ print a[1], d, substr($0, index($0, "|") + 1)
+ }
+ }'📝 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.
| git log --date=iso-local --pretty=format:"%h %cd|%s" -n 300 \ | |
| | awk -F'|' -v s="$START" -v e="$END" \ | |
| '{split($1,a," "); d=a[2]} d>=s && d<=e {print a[1], d, $2}' | |
| git log --date=iso-local --pretty=format:"%h %cd|%s" -n 300 \ | |
| | awk -F'|' -v s="$START" -v e="$END" \ | |
| '{ | |
| split($1, a, " ") | |
| d = a[2] | |
| if (d >= s && d <= e) { | |
| print a[1], d, substr($0, index($0, "|") + 1) | |
| } | |
| }' |
🤖 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 @.claude/skills/weekly-changelog/SKILL.md around lines 83 - 85, Update the
git-log parsing awk command to preserve commit subjects containing pipe
characters: continue splitting the metadata portion at the first delimiter, but
derive the subject by removing only the first delimiter-prefixed field from the
original record rather than printing $2. Apply this within the awk expression
used by the changelog workflow.
Two more frictions hit this run, sunk into the skill: - Section 2: the gh api graphql / gh pr view calls intermittently fail with a 'Post: EOF' network error. Document the local-git fallback (squash-commit body via 'git show -s --format=%b', size via 'git show --stat') so a flaky network does not block the run. - Section 8 (new): publishing the _zh docs to the hw-native-sys/simpler.wiki repo -- copy under the existing page names, prepend links to the top of each simpler-Wiki.md section, reuse the existing pages' Chinese H1 style, and set a git identity on the fresh wiki clone (commit otherwise fails with an unknown-author error). Gated on an explicit publish request since it is a team-visible push.
What
The
weekly-changelogskill computed its Fri→Thu window with plaindate -d, i.e. in the host box's timezone. The team and every git commit timestamp are China time (UTC+8); when the box runs a different timezone (the dev/CI box has run PDT), the window shifts by the offset and misfiles the weekday boundary — a run this week dropped in-range PRs and pulled in next-day ones.Changes (
.claude/skills/weekly-changelog/SKILL.md)export TZ='Asia/Shanghai'so every laterdate/git logtimestamp is China-local beforeSTART/ENDare computed.%cdwith--date=iso-local), not author date (%ad, which survives rebases and misfiles a PR by a day/week); and replacegit log --since/--until(it prunes non-linear history at the first out-of-range commit and silently omits in-range PRs) with an awk range filter over the full list.Why it matters
Two independent failure modes bit the same run: the
--sincewalk-pruning dropped 4 in-window PRs, and the PDT-vs-CST offset pulled in 3 out-of-window ones. Both are eliminated by anchoring toAsia/Shanghaiand range-filtering commit dates.Test
pre-commithooks pass (check-english-only, markdownlint).