Skip to content

fix(base): add default-table follow-up hint to base-create#600

Merged
kongenpei merged 3 commits intomainfrom
fix-empty-base-v2
Apr 22, 2026
Merged

fix(base): add default-table follow-up hint to base-create#600
kongenpei merged 3 commits intomainfrom
fix-empty-base-v2

Conversation

@kongenpei
Copy link
Copy Markdown
Collaborator

@kongenpei kongenpei commented Apr 22, 2026

Summary

Add a follow-up hint to base +base-create success output so agents know a new Base includes a default empty table and should ask whether to remove it after later table/field setup.

Changes

  • Add a fixed data.hint string to base +base-create success output
  • Add unit test assertions for the new success payload field

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark xxx command works as expected

Related Issues

  • None

Summary by CodeRabbit

  • New Features
    • A user-facing hint is now displayed after creating a new base, explaining the default empty table setup and next steps to populate it.
  • Bug Fixes
    • The creation hint is reliably shown even when automatic permission grants are skipped or other post-create conditions apply.

@github-actions github-actions Bot added domain/base PR touches the base domain size/M Single-domain feat or fix with limited business impact labels Apr 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

📝 Walkthrough

Walkthrough

Added a user-facing hint printed to stderr after successful base creation and updated tests to reset and assert stderr contains that hint when running the command.

Changes

Cohort / File(s) Summary
Base Operations
shortcuts/base/base_ops.go
Added baseCreateHint constant and print it to runtime.IO().ErrOut after successful base creation; added fmt import.
Tests / IO reset
shortcuts/base/base_execute_test.go
Reset factory.IOStreams.ErrOut when it's a *bytes.Buffer in runShortcutWithAuthTypes; strengthened two tests to assert baseCreateHint appears in stderr after decoding the output envelope.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • zgz2048

Poem

🐰 I hopped a patch through code so bright,
A timid hint now glows at night.
Stderr hums a friendly song,
Tests nod gently, nothing's wrong.
🥕✨

🚥 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 accurately summarizes the main change: adding a default-table follow-up hint to base-create output.
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.
Description check ✅ Passed The PR description covers all required template sections with appropriate detail: Summary explains the motivation, Changes lists modifications clearly, Test Plan includes verified checkboxes, and Related Issues is addressed.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-empty-base-v2

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.

@kongenpei kongenpei requested a review from zgz2048 April 22, 2026 05:43
Copy link
Copy Markdown

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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@shortcuts/base/base_execute_test.go`:
- Around line 99-101: The test is asserting the follow-up hint from the JSON
envelope (data["hint"]) but the hint should be emitted to stderr; change the
assertion to capture and inspect the stderr buffer returned by
cmdutil.TestFactory(t, config) (or the TestFactory helper used in this test) and
assert that stderr contains baseCreateHint instead of checking data["hint"];
remove or stop setting expectations on data["hint"] and add an assertion that
the stderr buffer contains baseCreateHint (repeating the same change for the
similar assertions around the previous 204-206 block).

In `@shortcuts/base/base_ops.go`:
- Around line 67-69: Remove the "hint" field from the JSON envelope sent with
runtime.Out (the out map created in this block) and instead emit baseCreateHint
via the runtime stderr/diagnostic path; specifically, update the code around the
out map and runtime.Out(out, nil) (and after augmentBasePermissionGrant(...)) to
no longer set "hint": baseCreateHint and add a separate call that writes
baseCreateHint to the runtime's stderr/diagnostic API (e.g., runtime.Err or the
project's diagnostics/logging helper) so program output remains data-only on
stdout while the follow-up hint goes to stderr.
🪄 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: e63a1558-7cbf-4fe3-b689-d34d8f957e14

📥 Commits

Reviewing files that changed from the base of the PR and between 11191df and 0195532.

📒 Files selected for processing (2)
  • shortcuts/base/base_execute_test.go
  • shortcuts/base/base_ops.go

Comment thread shortcuts/base/base_execute_test.go Outdated
Comment thread shortcuts/base/base_ops.go Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.82%. Comparing base (11191df) to head (7b2feff).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   59.81%   59.82%           
=======================================
  Files         404      404           
  Lines       42526    42527    +1     
=======================================
+ Hits        25439    25440    +1     
  Misses      15082    15082           
  Partials     2005     2005           

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 22, 2026

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@7b2fefffbf92fbdbfc2cb714800dc0fe3ae594d8

🧩 Skill update

npx skills add larksuite/cli#fix-empty-base-v2 -y -g

@kongenpei kongenpei merged commit e4d2639 into main Apr 22, 2026
21 checks passed
@kongenpei kongenpei deleted the fix-empty-base-v2 branch April 22, 2026 06:54
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