Skip to content

fix(base): surface url resolve block list errors - #2130

Open
zhouyue-bytedance wants to merge 2 commits into
mainfrom
fix/base-url-resolve-propagate-block-error
Open

fix(base): surface url resolve block list errors#2130
zhouyue-bytedance wants to merge 2 commits into
mainfrom
fix/base-url-resolve-propagate-block-error

Conversation

@zhouyue-bytedance

@zhouyue-bytedance zhouyue-bytedance commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

base +url-resolve now returns the underlying blocks/list API error when selected Base block enrichment fails, instead of emitting ok=true with only a neutral unknown-block hint. This makes missing base:block:read scope and other block-list failures visible to users and CI.

Changes

  • Propagate resolveSelectedBaseBlock errors through executeBaseURLResolve for Base and Wiki Base URLs.
  • Keep successful-but-nonmatching block-list responses as neutral unknown block output.
  • Add regression coverage for block-list authorization errors and successful nonmatching block-list responses.

Test Plan

  • Unit tests pass: go test ./shortcuts/base
  • Dry-run E2E pass: go test ./tests/cli_e2e/base -run 'TestBaseURLResolveSelectedBlockDryRun|TestBaseURLResolveWikiSelectedBlockDryRun'\n- [x] Manual local verification confirms base +url-resolve --as bot surfaces base:block:read missing scope for a bot without that scope, while --as user still resolves the same table URL successfully.\n\n## Related Issues\n- None

Summary by CodeRabbit

  • Bug Fixes
    • Base and Wiki URL resolution now correctly reports failures when selected-block authorization or resolution fails.
    • Authorization errors include missing-scope details and no longer produce misleading output.
  • Tests
    • Added coverage for block-list authorization failures and neutral block selection scenarios.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1519c7ca-dfce-4e1c-a766-2eab815fbc5e

📥 Commits

Reviewing files that changed from the base of the PR and between 236bf7d and 58d488e.

📒 Files selected for processing (1)
  • shortcuts/base/base_resolve_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • shortcuts/base/base_resolve_test.go

📝 Walkthrough

Walkthrough

Base and Wiki URL resolution now return errors from selected-block hint enrichment. Tests cover block-list authorization failures and unconfirmed block selection.

Changes

Base resolution error handling

Layer / File(s) Summary
Propagate enrichment errors
shortcuts/base/base_resolve.go
enrichBaseResolveHint returns selected-block resolution errors. Base and Wiki URL execution paths return those errors.
Validate authorization failure handling
shortcuts/base/base_resolve_test.go
Tests register block-list responses and verify typed authorization errors, the missing base:block:read scope, and empty stdout for Base and Wiki URLs.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • larksuite/cli#2099: Both changes modify Base and Wiki URL resolution and block-list hint enrichment error handling.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: surfacing block-list errors during Base URL resolution.
Description check ✅ Passed The description covers the summary, changes, test plan, and related issues, with specific regression and verification details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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/base-url-resolve-propagate-block-error

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.

@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 Jul 31, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@shortcuts/base/base_resolve.go`:
- Around line 210-212: Add regression coverage for the Wiki Base table URL path
that triggers a 99991672 base:block:read block-list error. Assert the response
is the typed problem/PermissionError and that stdout remains empty, alongside
the existing Base URL block-list test.
🪄 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 Plus

Run ID: 4d242929-1e7e-44df-b0af-a846064562cd

📥 Commits

Reviewing files that changed from the base of the PR and between 0f35676 and 236bf7d.

📒 Files selected for processing (2)
  • shortcuts/base/base_resolve.go
  • shortcuts/base/base_resolve_test.go

Comment thread shortcuts/base/base_resolve.go
@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

npm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@58d488e379cdfb8449134eb8de4edc06a9d0b2f3

🧩 Skill update

npx skills add larksuite/cli#fix/base-url-resolve-propagate-block-error -y -g

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.45%. Comparing base (cfe76ad) to head (58d488e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2130      +/-   ##
==========================================
+ Coverage   75.39%   75.45%   +0.05%     
==========================================
  Files         924      924              
  Lines       98005    98303     +298     
==========================================
+ Hits        73895    74172     +277     
- Misses      18478    18491      +13     
- Partials     5632     5640       +8     

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant