Skip to content

fix: return raw base field and view responses#378

Merged
kongenpei merged 1 commit intomainfrom
fix-table-resp
Apr 10, 2026
Merged

fix: return raw base field and view responses#378
kongenpei merged 1 commit intomainfrom
fix-table-resp

Conversation

@kongenpei
Copy link
Copy Markdown
Collaborator

@kongenpei kongenpei commented Apr 10, 2026

Summary

Return raw field and view payloads from Base read shortcuts so list responses match the upstream API shape instead of adding shortcut-specific envelope fields and normalized key names.

Changes

  • Remove simplifyFields and simplifyViews and return raw field/view objects from +field-list, +view-list, and +table-get
  • Update Base list shortcut responses to return fields/views plus total, and drop CLI-added items, offset, limit, and count
  • Update shortcut tests to assert the raw response shape

Test Plan

  • Unit tests pass
  • Manual local verification confirms the lark xxx command works as expected
  • make unit-test
  • go mod tidy (no changes to go.mod or go.sum)
  • GOFLAGS=-buildvcs=false go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main
  • Rebuilt and installed the current worktree binary to ~/.local/bin/lark-cli, then verified base +field-list, base +view-list, and base +table-get against a live Base table

Related Issues

  • None

Summary by CodeRabbit

  • Refactor
    • Updated CLI output format for list and get operations to return raw field and view data structures with modified payload layouts.
    • Removed internal field and view simplification layers from response formatting.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2c2a7296-8436-451a-809f-a95d583bdafb

📥 Commits

Reviewing files that changed from the base of the PR and between c16a021 and 91ce040.

📒 Files selected for processing (6)
  • shortcuts/base/base_execute_test.go
  • shortcuts/base/field_ops.go
  • shortcuts/base/helpers.go
  • shortcuts/base/helpers_test.go
  • shortcuts/base/table_ops.go
  • shortcuts/base/view_ops.go
💤 Files with no reviewable changes (1)
  • shortcuts/base/helpers.go

📝 Walkthrough

Walkthrough

This PR removes data simplification helper functions and updates response payload formats across field, view, and table operations to return raw data structures instead of simplified/transformed versions. Response structures are being standardized with consistent output formatting.

Changes

Cohort / File(s) Summary
Response Payload Restructuring
shortcuts/base/field_ops.go, shortcuts/base/table_ops.go, shortcuts/base/view_ops.go
Modified response formats to return raw data structures directly instead of simplified versions. Field and view lists now omit pagination metadata (offset, limit, count) in favor of simpler structures with total counts.
Helper Function Removal
shortcuts/base/helpers.go
Removed unexported helper functions viewType, simplifyFields, and simplifyViews that previously transformed field and view objects for output formatting.
Test Updates
shortcuts/base/base_execute_test.go, shortcuts/base/helpers_test.go
Updated assertions in three test cases to verify new output shapes. Renamed TestResolveAndSimplifyHelpers to TestResolveHelpers and removed assertions validating simplified data structures.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • zgz2048

Poem

🐰 Hopping through the code with glee,
Simplified helpers? Let them free!
Raw data flows, no frills in sight,
The output shapes shine clean and bright!
Tests updated, responses refined—
A cleaner API we now shall find! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing field/view simplification and returning raw API responses instead.
Description check ✅ Passed The description includes all required sections: Summary (motivation and scope), Changes (specific modifications), Test Plan (verification methods), and Related Issues.

✏️ 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-table-resp

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 Apr 10, 2026
@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 Apr 10, 2026
@kongenpei kongenpei marked this pull request as ready for review April 10, 2026 01:56
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

kongenpei has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@github-actions
Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@91ce0402d2ee87f07fbaa92bd1dd60a4b4e3df4a

🧩 Skill update

npx skills add larksuite/cli#fix-table-resp -y -g

@kongenpei kongenpei requested a review from zgz2048 April 10, 2026 02:42
@kongenpei kongenpei merged commit 5f3915b into main Apr 10, 2026
17 checks passed
@kongenpei kongenpei deleted the fix-table-resp branch April 10, 2026 03:09
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