Skip to content

Conversation

@hu-qi
Copy link
Collaborator

@hu-qi hu-qi commented Dec 6, 2025

test

Summary by CodeRabbit

  • New Features

    • Enabled removal of code blocks and inline code in notification markdown
  • Improvements

    • Standardized notification links to show raw URLs (removed custom link labels across events)
    • Switched workflows to use a webhook URL from the environment and improved message serialization/quoting for more reliable delivery
  • Chores

    • Updated CI checkout action versions
    • Expanded TypeScript include configuration

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Walkthrough

Strips fenced code blocks and inline code during markdown sanitization; stops deriving/passing commitId for push events; standardizes link creation to URL-only anchors; updates GitHub Actions checkout to v6, adds FEISHU_BOT_WEBHOOK_URL env and heredoc JSON handling; adds tsconfig "include": ["src/**/*"].

Changes

Cohort / File(s) Summary
Workflows
​.github/workflows/Lark-notification.yml, ​.github/workflows/test.yml
Bumps actions/checkout to v6; Lark workflow adds FEISHU_BOT_WEBHOOK_URL env and a presence check, switches message serialization to a heredoc feeding deno, improves quoting/GITHUB_OUTPUT handling, and reads webhook from env; test workflow only updates checkout version.
Message transformation
​.github/scripts/transform-message-for-card.ts
Enables removal of fenced code blocks and inline code in sanitizeMarkdown; removes derived commitId usage for push events; changes many createLink calls to pass only the URL (removing custom anchor text/labels) across commits, issues, PRs, discussions, comments, releases, and review-comment payloads.
TypeScript config
tsconfig.json
Adds top-level include: ["src/**/*"] to define TypeScript compilation scope.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review ​.github/scripts/transform-message-for-card.ts for unintended data loss from sanitization and verify downstream renderers accept URL-only link text.
  • Validate Lark workflow heredoc JSON handling and the secret→env switch for FEISHU_BOT_WEBHOOK_URL.
  • Confirm tsconfig.json include doesn't exclude necessary files.

Possibly related PRs

Poem

🐇 I chewed the backticks, left the links to shine,
No fenced blocks now — just tidy line.
Workflows hopped to v6 with flair,
TypeScript narrowed its little lair.
A happy rabbit twitches its nose — hooray! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing short commit IDs from commit link display, which aligns with the primary modification in transform-message-for-card.ts where commitId usage is removed from createLink calls.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c1aa4a4 and ccd63f1.

📒 Files selected for processing (1)
  • .github/workflows/Lark-notification.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/Lark-notification.yml

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
.github/workflows/Lark-notification.yml (1)

35-48: Event serialization and GITHUB_OUTPUT handling look correct

The heredoc into deno run with toJSON(github) and capturing it into YAML (actually JSON) is well-quoted, and the { echo 'content<<EOF'; echo "$YAML"; echo 'EOF'; } >> "$GITHUB_OUTPUT" pattern correctly emits a multi-line output while protecting $GITHUB_OUTPUT with quotes. This should be safe even for complex payloads.

If you want to be extra defensive, consider using a less common delimiter than EOF to further reduce the chance of collisions with content lines.

.github/scripts/transform-message-for-card.ts (2)

61-83: Markdown sanitization for code blocks/inline code is reasonable

Enabling .replace(/```[\s\S]*?```/g, '[代码块]') and the inline-code unwrapping keeps messages compact while preserving the code indication. The order of replacements is safe, and the transformations remain compatible with the later truncation and other markdown cleanups.

If you start seeing very large payloads dominated by code, you might consider truncating before running the expensive [\s\S]*? regex or replacing code blocks with a shorter marker to reduce processing overhead.


96-229: Link text standardization to URL-only is consistent with the PR goal

For push, issues, PRs, discussions, comments, and releases, the “链接:” fields now use createLink(<url>) so the visible text is the URL itself, which removes short IDs/custom labels as described and keeps behavior consistent across event types. The remaining custom PR: link text (#${pull_request!.number}) is still clear and seems intentional.

If you later want complete uniformity, you could also switch the PR: field to URL-only text (or conversely keep human-friendly labels everywhere and drop only the short commit ID), but that’s stylistic rather than functional.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 39f4810 and c366a6c.

📒 Files selected for processing (4)
  • .github/scripts/transform-message-for-card.ts (9 hunks)
  • .github/workflows/Lark-notification.yml (1 hunks)
  • .github/workflows/test.yml (1 hunks)
  • tsconfig.json (1 hunks)
🔇 Additional comments (3)
tsconfig.json (1)

11-11: Explicit include matches rootDir and is safe

Adding "include": ["src/**/*"] is consistent with rootDir: "./src" and keeps tests excluded via the existing exclude. This should make the compile scope more explicit without side effects, assuming all runtime sources live under src/.

.github/workflows/test.yml (1)

15-15: Checkout upgrade to v6 looks fine; just confirm compatibility

Using actions/checkout@v6 in both build and test jobs is a good modernization step and should behave the same for this basic usage, but please confirm in CI that there are no surprises from the major-version bump (e.g., changes to default options).

Also applies to: 23-23

.github/workflows/Lark-notification.yml (1)

20-33: Checkout bump and Feishu URL guard improve robustness

Upgrading to actions/checkout@v6 and adding an explicit Check for Feishu URL step (failing when the secret is unset/empty) both make this workflow more robust and fail-fast instead of sending malformed requests.

@hu-qi hu-qi merged commit 95e0cb7 into Open-Source-Bazaar:master Dec 6, 2025
3 of 4 checks passed
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