Skip to content

docs(weekly-changelog): anchor window to China time; filter by commit date#1318

Open
ChaoZheng109 wants to merge 2 commits into
hw-native-sys:mainfrom
ChaoZheng109:fix/weekly-changelog-china-tz
Open

docs(weekly-changelog): anchor window to China time; filter by commit date#1318
ChaoZheng109 wants to merge 2 commits into
hw-native-sys:mainfrom
ChaoZheng109:fix/weekly-changelog-china-tz

Conversation

@ChaoZheng109

Copy link
Copy Markdown
Collaborator

What

The weekly-changelog skill computed its Fri→Thu window with plain date -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)

  • §1 — anchor to China time. 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 — reliable commit collection. Filter on China-local commit date (%cd with --date=iso-local), not author date (%ad, which survives rebases and misfiles a PR by a day/week); and replace git 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 --since walk-pruning dropped 4 in-window PRs, and the PDT-vs-CST offset pulled in 3 out-of-window ones. Both are eliminated by anchoring to Asia/Shanghai and range-filtering commit dates.

Test

  • pre-commit hooks pass (check-english-only, markdownlint).
  • Verified the new collection command reproduces the correct 31-PR window for 2026-07-03 ~ 2026-07-09 China time on this box.

… 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.
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bfeb9a77-d559-4822-af78-ce2daade98b5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The 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.

Changes

Weekly changelog date handling

Layer / File(s) Summary
China-time window computation
.claude/skills/weekly-changelog/SKILL.md
The skill exports TZ='Asia/Shanghai', reports the box-versus-China timezone, and clarifies the START/END window behavior.
Commit-local date filtering
.claude/skills/weekly-changelog/SKILL.md
Pass A uses --date=iso-local and an awk range check over %cd, replacing git log --since/--until and author-date filtering.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit hops through dates so bright,
China time keeps bounds in sight.
Commits line up, both near and far,
Local timestamps show where they are.
The changelog blooms just right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: anchoring the weekly-changelog window to China time and filtering by commit date.
Description check ✅ Passed The description is directly related to the changes and accurately explains the timezone and commit-date filtering updates.
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.

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.

@gemini-code-assist gemini-code-assist 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.

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.

Comment on lines +83 to +85
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}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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}'

@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: 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

📥 Commits

Reviewing files that changed from the base of the PR and between f9e7808 and 7baef9b.

📒 Files selected for processing (1)
  • .claude/skills/weekly-changelog/SKILL.md

Comment on lines +83 to +85
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}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 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.

Suggested change
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.

Suggested change
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant