feat: add mail signature write shortcuts#1304
Conversation
Add create, update, and delete shortcuts for personal mail signatures, including inline image upload and cid rewrite reuse from the template pipeline. sprint: S4
|
Codex seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Worried about impact? Review this PR in Change Stack to explore blast radius before you approve or request changes. 📝 WalkthroughWalkthroughThis PR implements three new mail signature management commands ( ChangesMail Signature CRUD Shortcuts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
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 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)
shortcuts/mail/mail_signature_write_test.go (1)
1-246:⚠️ Potential issue | 🟠 MajorAdd dry-run E2E coverage for mail signature shortcuts
The dry-run E2E suite under
tests/cli_e2e/has no test files (and no dry-run test content) referencingMailSignatureor+signature-create/+signature-update/+signature-delete, so the new shortcuts lack the required--dry-runrequest-structure coverage. Add corresponding dry-run E2E tests undertests/cli_e2e/mail/(ortests/cli_e2e/dryrun/) that validate payloads without real API calls.🤖 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 `@shortcuts/mail/mail_signature_write_test.go` around lines 1 - 246, The PR is missing dry-run E2E coverage for the new mail signature shortcuts; add E2E tests that exercise MailSignatureCreate, MailSignatureUpdate and MailSignatureDelete with --dry-run and assert the generated request payloads instead of performing real API calls. Create test files under tests/cli_e2e/mail/ (or tests/cli_e2e/dryrun/) that invoke the CLI with "+signature-create --dry-run ...", "+signature-update --dry-run ...", and "+signature-delete --dry-run ..." and validate the produced request bodies and flags (name, content/content-file mutex, device, signature-id, mailbox) match the expected structure, and ensure the tests verify no network calls are made (dry-run mode) and that payloads include full-replace behavior for update when content omitted. Reference the shortcut symbols MailSignatureCreate, MailSignatureUpdate, MailSignatureDelete when locating which behaviors/flags to cover.Source: Learnings
🤖 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 `@skills/lark-mail/references/lark-mail-signature-create.md`:
- Line 58: Remove the irrelevant error code entry "找不到签名
ID(`15180302`,通常出现在更新/删除)" from the +signature-create documentation
(lark-mail-signature-create.md): locate the line referencing error code 15180302
and delete it so the create docs no longer list an update/delete-only error, and
ensure 15180302 remains documented only in the signature update/delete docs.
---
Outside diff comments:
In `@shortcuts/mail/mail_signature_write_test.go`:
- Around line 1-246: The PR is missing dry-run E2E coverage for the new mail
signature shortcuts; add E2E tests that exercise MailSignatureCreate,
MailSignatureUpdate and MailSignatureDelete with --dry-run and assert the
generated request payloads instead of performing real API calls. Create test
files under tests/cli_e2e/mail/ (or tests/cli_e2e/dryrun/) that invoke the CLI
with "+signature-create --dry-run ...", "+signature-update --dry-run ...", and
"+signature-delete --dry-run ..." and validate the produced request bodies and
flags (name, content/content-file mutex, device, signature-id, mailbox) match
the expected structure, and ensure the tests verify no network calls are made
(dry-run mode) and that payloads include full-replace behavior for update when
content omitted. Reference the shortcut symbols MailSignatureCreate,
MailSignatureUpdate, MailSignatureDelete when locating which behaviors/flags to
cover.
🪄 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: 66db5b00-a286-4868-a8af-f72db411d482
📒 Files selected for processing (11)
shortcuts/mail/mail_signature_create.goshortcuts/mail/mail_signature_delete.goshortcuts/mail/mail_signature_update.goshortcuts/mail/mail_signature_write.goshortcuts/mail/mail_signature_write_test.goshortcuts/mail/shortcuts.goskill-template/domains/mail.mdskills/lark-mail/SKILL.mdskills/lark-mail/references/lark-mail-signature-create.mdskills/lark-mail/references/lark-mail-signature-delete.mdskills/lark-mail/references/lark-mail-signature-update.md
| ## 错误提示 | ||
|
|
||
| - 重名(`15180303`):换一个 `--name`,或改用 `+signature-update` 更新已有签名。 | ||
| - 找不到签名 ID(`15180302`,通常出现在更新/删除):先运行 `lark-cli mail +signature` 获取真实 ID。 |
There was a problem hiding this comment.
Remove irrelevant error code from create documentation.
Error code 15180302 ("找不到签名 ID") with the note "通常出现在更新/删除" (usually appears in update/delete) is not relevant to the +signature-create command. Create operations POST new signatures and cannot encounter "signature not found" errors. This error code belongs only in the update and delete documentation.
📝 Suggested fix
## 错误提示
- 重名(`15180303`):换一个 `--name`,或改用 `+signature-update` 更新已有签名。
-- 找不到签名 ID(`15180302`,通常出现在更新/删除):先运行 `lark-cli mail +signature` 获取真实 ID。
- 权限不足(`15180305`):检查 `mail:user_mailbox.message:modify` scope、邮箱权限,以及 bot 身份是否传了显式 `--mailbox`。📝 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.
| - 找不到签名 ID(`15180302`,通常出现在更新/删除):先运行 `lark-cli mail +signature` 获取真实 ID。 | |
| ## 错误提示 | |
| - 重名(`15180303`):换一个 `--name`,或改用 `+signature-update` 更新已有签名。 | |
| - 权限不足(`15180305`):检查 `mail:user_mailbox.message:modify` scope、邮箱权限,以及 bot 身份是否传了显式 `--mailbox`。 |
🤖 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 `@skills/lark-mail/references/lark-mail-signature-create.md` at line 58, Remove
the irrelevant error code entry "找不到签名 ID(`15180302`,通常出现在更新/删除)" from the
+signature-create documentation (lark-mail-signature-create.md): locate the line
referencing error code 15180302 and delete it so the create docs no longer list
an update/delete-only error, and ensure 15180302 remains documented only in the
signature update/delete docs.
Generated by the harness-coding skill.
Sprints
Source specs
This MR was created autonomously. Quality gates were enforced by the repo's own pre-commit hooks.
Summary by CodeRabbit
New Features
Documentation