Skip to content

fix: mark base field update high risk#936

Merged
zgz2048 merged 1 commit into
larksuite:mainfrom
zgz2048:codex/base-risk-tags
May 18, 2026
Merged

fix: mark base field update high risk#936
zgz2048 merged 1 commit into
larksuite:mainfrom
zgz2048:codex/base-risk-tags

Conversation

@zgz2048

@zgz2048 zgz2048 commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Mark base +field-update as high-risk-write.
  • Add a metadata test locking the risk level.
  • Update the field update execution test to pass --yes under the high-risk confirmation gate.
  • Update lark-base skill references so agents include --yes for field updates.

Why

field update is implemented with PUT semantics and sends a complete field definition, not a narrow patch. Changing a Base field can change the column type or configuration, which may affect how the entire column of existing data is interpreted, displayed, or remains usable. It should require explicit confirmation like other high-risk Base schema changes.

The skill docs need to match this behavior; otherwise agents may keep generating +field-update commands without --yes and hit the confirmation gate.

Validation

  • go test ./shortcuts/base

Summary by CodeRabbit

  • Bug Fixes

    • Field update operations now report the correct high-risk classification.
  • Documentation

    • Clarified safety guidance: field-update is a high-risk operation and must be confirmed with --yes; examples and guidance updated accordingly.
  • Tests

    • Added and adjusted tests to verify the risk classification and confirmation behavior for field updates.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bd05f524-9657-4dab-a19e-6471769a8266

📥 Commits

Reviewing files that changed from the base of the PR and between 8c648f9 and 3ea89ec.

📒 Files selected for processing (8)
  • shortcuts/base/base_execute_test.go
  • shortcuts/base/base_shortcuts_test.go
  • shortcuts/base/field_update.go
  • skills/lark-base/SKILL.md
  • skills/lark-base/references/formula-field-guide.md
  • skills/lark-base/references/lark-base-field-update.md
  • skills/lark-base/references/lark-base-shortcut-field-properties.md
  • skills/lark-base/references/lookup-field-guide.md
✅ Files skipped from review due to trivial changes (3)
  • skills/lark-base/references/lark-base-shortcut-field-properties.md
  • skills/lark-base/references/lookup-field-guide.md
  • skills/lark-base/references/formula-field-guide.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • shortcuts/base/base_shortcuts_test.go
  • shortcuts/base/base_execute_test.go

📝 Walkthrough

Walkthrough

BaseFieldUpdate shortcut is reclassified as high-risk-write with risk metadata updated, a corresponding unit test added to verify the risk classification, and the execution test modified to pass the --yes confirmation flag.

Changes

BaseFieldUpdate Risk Reclassification

Layer / File(s) Summary
High-Risk metadata and tests
shortcuts/base/field_update.go, shortcuts/base/base_shortcuts_test.go, shortcuts/base/base_execute_test.go
BaseFieldUpdate.Risk changed from "write" to "high-risk-write". Added TestBaseFieldUpdateRisk asserting the new Risk value. Updated TestBaseFieldExecuteUpdate to pass --yes when invoking the shortcut.
Documentation and guidance updates
skills/lark-base/SKILL.md, skills/lark-base/references/formula-field-guide.md, skills/lark-base/references/lark-base-field-update.md, skills/lark-base/references/lark-base-shortcut-field-properties.md, skills/lark-base/references/lookup-field-guide.md
Docs updated to require and demonstrate --yes for +field-update, describe PUT semantics as high-risk, update examples and warning text accordingly.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • larksuite/cli#701: Both PRs adjust tests and behavior around high-risk-write operations and confirmation flags.
  • larksuite/cli#633: Related risk-tier confirmation plumbing (high-risk-write require-confirmation logic).
  • larksuite/cli#748: Related changes touching BaseFieldUpdate help and guidance for full PUT semantics.

Suggested reviewers

  • kongenpei
  • liangshuo-1

Poem

🐰 I hopped through code to mark the field with care,
"High-risk" it warned — please handle with a prayer.
Tests now ask kindly, "Did you mean to say yes?"
Flags in a row, avoiding messy regress.
A cautious rabbit cheers the safer press!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: marking the base field update shortcut as high-risk, which is the primary objective of the PR.
Description check ✅ Passed The PR description includes all required template sections: Summary (objective and scope), Changes (listed as bullet points), Test Plan (validation via go test), and Related Issues (marked as None).
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@github-actions github-actions Bot added domain/base PR touches the base domain size/L Large or sensitive change across domains or core paths labels May 18, 2026
@zgz2048
zgz2048 marked this pull request as ready for review May 18, 2026 03:46
@zgz2048
zgz2048 force-pushed the codex/base-risk-tags branch from 8c72690 to 8c648f9 Compare May 18, 2026 03:47
@github-actions github-actions Bot added size/M Single-domain feat or fix with limited business impact and removed size/L Large or sensitive change across domains or core paths labels May 18, 2026
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@3ea89ec0d541583481378a72cfa86df7f326355b

🧩 Skill update

npx skills add zgz2048/cli#codex/base-risk-tags -y -g

@zgz2048
zgz2048 force-pushed the codex/base-risk-tags branch from 8c648f9 to 3ea89ec Compare May 18, 2026 03:51
@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.92%. Comparing base (898e0ee) to head (3ea89ec).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #936   +/-   ##
=======================================
  Coverage   65.92%   65.92%           
=======================================
  Files         523      523           
  Lines       49692    49694    +2     
=======================================
+ Hits        32758    32760    +2     
  Misses      14134    14134           
  Partials     2800     2800           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kongenpei kongenpei left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Verified locally with:

  • go test ./shortcuts/base
  • go test ./shortcuts/common ./shortcuts/base

Non-blocking: shortcuts/base/field_update.go tips still show +field-update examples without --yes, while the command is now high-risk-write. Consider updating those examples so copied help output succeeds.

@zgz2048
zgz2048 merged commit ca6c6c3 into larksuite:main May 18, 2026
20 checks passed
@liangshuo-1 liangshuo-1 mentioned this pull request May 18, 2026
2 tasks
tuxedomm pushed a commit to zhumiaoxin/cli that referenced this pull request Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants