Skip to content

fix(apps): make db --environment optional, auto-select branch server-side#1735

Merged
chenxingyang1019 merged 4 commits into
mainfrom
fix/apps-db-env-optional
Jul 8, 2026
Merged

fix(apps): make db --environment optional, auto-select branch server-side#1735
chenxingyang1019 merged 4 commits into
mainfrom
fix/apps-db-env-optional

Conversation

@chenxingyang1019

@chenxingyang1019 chenxingyang1019 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

All db shortcuts defaulted --environment to "dev", which forced single-env apps (whose DB lives on the online branch, with no dev branch) to fail with "Invalid DB Branch: dev" unless the user explicitly passed --environment online.

Change the default to empty: when --environment is omitted the CLI sends no env, letting the server pick the branch by the app's multi-env state (multi-env → dev, single-env → online), matching miaoda-cli's behavior of not carrying dbBranch when unset. Explicit --environment dev|online is unchanged; explicit dev on a single-env app still errors as expected.

Changes

  • 10 db shortcuts: dbEnvFlags default "dev" → "" (+db-execute, +db-table-list, +db-table-get, +db-quota-get, +db-data-export, +db-data-import, +db-changelog-list, +db-audit-list/-set/-status)
  • dry-run e2e assertions updated: default env is now unset, not "dev"
  • skill docs (lark-apps-db, lark-apps-db-execute) describe the auto-select

Test Plan

  • Unit tests pass (go test ./shortcuts/apps/ ./tests/cli_e2e/apps/ all green)
  • Manual local verification confirms the lark-cli apps +db-* flow works as expected
    • BOE cli_e2e.sh: 91 passed, 0 failed (incl. new "no --environment" dry-run + live cases)
    • Single-env app app_179b0qed55k (BOE): no env / onlineok=true; explicit dev500002511 as expected

Related Issues

  • None

Summary by CodeRabbit

  • Bug Fixes
    • Database commands now auto-select the target environment when --env / --environment is left unset, and omit the env parameter entirely when not provided.
    • Fixed PITR recovery diff reporting to avoid double-counting row changes when schema actions are present.
    • Improved environment migration preview so successful applies don’t incorrectly show “0 changes”.
    • Output numeric fields now parse correctly when returned as strings.
  • Documentation
    • Updated command help and reference docs for unset/auto-selection behavior and clarified removal of legacy --env.
  • Tests
    • Updated E2E dry-run assertions to confirm env is omitted when the flag is not provided, and refreshed migration polling mocks for preview+apply calls.

@github-actions github-actions Bot added the size/M Single-domain feat or fix with limited business impact label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

DB shortcut commands now omit empty environment parameters by default, and recovery commands add env-aware preview/apply wiring plus revised diff aggregation.

Changes

DB environment auto-selection

Layer / File(s) Summary
Add env parameter helper
shortcuts/apps/db_common.go
A shared helper conditionally writes the env query parameter based on the resolved DB environment.
Unset env by default
shortcuts/apps/apps_db_audit_list.go, shortcuts/apps/apps_db_audit_set.go, shortcuts/apps/apps_db_audit_status.go, shortcuts/apps/apps_db_changelog_list.go, shortcuts/apps/apps_db_data_export.go, shortcuts/apps/apps_db_data_import.go, shortcuts/apps/apps_db_execute.go, shortcuts/apps/apps_db_quota_get.go, shortcuts/apps/apps_db_table_get.go, shortcuts/apps/apps_db_table_list.go, skills/lark-apps/references/lark-apps-db-execute.md, skills/lark-apps/references/lark-apps-db.md, tests/cli_e2e/apps/apps_db_execute_dryrun_test.go, tests/cli_e2e/apps/apps_db_table_list_dryrun_test.go
DB shortcut flag wiring changes from a hardcoded dev default to an unset default with updated auto-selection help text, with docs and dry-run assertions updated to match.
Build requests without empty env
shortcuts/apps/apps_db_audit_list.go, shortcuts/apps/apps_db_audit_set.go, shortcuts/apps/apps_db_audit_status.go, shortcuts/apps/apps_db_changelog_list.go, shortcuts/apps/apps_db_data_export.go, shortcuts/apps/apps_db_data_import.go, shortcuts/apps/apps_db_execute.go, shortcuts/apps/apps_db_quota_get.go, shortcuts/apps/apps_db_table_get.go, shortcuts/apps/apps_db_table_list.go
Audit, changelog, export, import, execute, quota, and table requests now use the shared helper or conditional logic so env is only included when non-empty.

DB recovery preview and diff output

Layer / File(s) Summary
Wire recovery env flags
shortcuts/apps/apps_db_recovery.go
Recovery diff and apply commands append DB environment flags, reject the legacy env flag, and pass env parameters through dry-run and apply requests.
Preview migration before apply
shortcuts/apps/apps_db_env_migrate.go, shortcuts/apps/apps_db_env_recovery_quota_test.go
The migration command performs a dry-run preview before apply, reuses preview values when apply responses omit them, and falls back to preview counts when applied changes are reported as zero.
Aggregate recovery diff output
shortcuts/apps/apps_db_recovery.go
The recovery diff output now filters redundant row changes, counts affected tables from the filtered set, and keeps the existing estimated-time fallback.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • larksuite/cli#1596 — Touches the shared DB shortcut environment wiring that these changes extend.

Suggested labels: bug, documentation

Suggested reviewers: liangshuo-1

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: making db --environment optional with server-side branch auto-selection.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/apps-db-env-optional

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.

…side

All db shortcuts defaulted --environment to "dev", which forced single-env
apps (whose DB lives on the online branch, with no dev branch) to fail with
"Invalid DB Branch: dev" unless the user explicitly passed --environment
online.

Change the default to empty: when --environment is omitted the CLI sends no
env, letting the server pick the branch by the app's multi-env state
(multi-env → dev, single-env → online), matching miaoda-cli's behavior of
not carrying dbBranch when unset. Explicit --environment dev|online is
unchanged; explicit dev on a single-env app still errors as expected.

- 10 db shortcuts: dbEnvFlags default "dev" → "" (+db-execute, +db-table-list,
  +db-table-get, +db-quota-get, +db-data-export, +db-data-import,
  +db-changelog-list, +db-audit-list/-set/-status)
- dry-run e2e assertions updated: default env is now unset, not "dev"
- skill docs (lark-apps-db, lark-apps-db-execute) describe the auto-select
@chenxingyang1019 chenxingyang1019 force-pushed the fix/apps-db-env-optional branch from 9b1145c to d752ab9 Compare July 3, 2026 07:45
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#fix/apps-db-env-optional -y -g

@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/apps/apps_db_audit_list.go`:
- Line 43: The DB audit/list command setup uses an empty default env via
dbEnvFlags, but the tests do not cover the no-`--environment` path. Update the
relevant tests in apps_db_audit_test and apps_db_changelog_list_test to add a
dry-run assertion for the default empty env case, alongside the existing env=dev
coverage, so the command behavior is verified when env is unset.
🪄 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: a345fb27-f13b-48c8-88da-31173d1768ce

📥 Commits

Reviewing files that changed from the base of the PR and between 73be1d0 and 9b1145c.

📒 Files selected for processing (14)
  • shortcuts/apps/apps_db_audit_list.go
  • shortcuts/apps/apps_db_audit_set.go
  • shortcuts/apps/apps_db_audit_status.go
  • shortcuts/apps/apps_db_changelog_list.go
  • shortcuts/apps/apps_db_data_export.go
  • shortcuts/apps/apps_db_data_import.go
  • shortcuts/apps/apps_db_execute.go
  • shortcuts/apps/apps_db_quota_get.go
  • shortcuts/apps/apps_db_table_get.go
  • shortcuts/apps/apps_db_table_list.go
  • skills/lark-apps/references/lark-apps-db-execute.md
  • skills/lark-apps/references/lark-apps-db.md
  • tests/cli_e2e/apps/apps_db_execute_dryrun_test.go
  • tests/cli_e2e/apps/apps_db_table_list_dryrun_test.go

Comment thread shortcuts/apps/apps_db_audit_list.go
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.39%. Comparing base (73be1d0) to head (ee8d8fd).
⚠️ Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
shortcuts/apps/apps_db_recovery.go 72.00% 4 Missing and 3 partials ⚠️
shortcuts/apps/apps_db_env_migrate.go 45.45% 3 Missing and 3 partials ⚠️
shortcuts/apps/apps_db_audit_list.go 55.55% 2 Missing and 2 partials ⚠️
shortcuts/apps/apps_db_data_export.go 75.00% 2 Missing and 2 partials ⚠️
shortcuts/apps/apps_db_data_import.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1735      +/-   ##
==========================================
- Coverage   74.40%   74.39%   -0.01%     
==========================================
  Files         853      857       +4     
  Lines       88311    89001     +690     
==========================================
+ Hits        65704    66215     +511     
- Misses      17544    17673     +129     
- Partials     5063     5113      +50     

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

…kill doc

Address PR #1735 review:
- omit-empty: when --environment is unset, drop the env query key entirely
  instead of sending env="" — matches the family's omit-empty convention
  (cf. page_token) and miaoda-cli's "no dbBranch when unset". Add dbEnvParams
  helper; apply across all db shortcuts (execute, table-list/-get, quota-get,
  changelog-list, audit-list/-set/-status, data-export/-import) plus the
  export/import query params, queryExportTotal and audit-list table/status probes.
- e2e dry-run assertions pin env is omitted via .Exists() (was Equal "").
- skill doc (lark-apps-db): rewrite the --environment guidance from an agent's
  decision POV — read vs write, single-env writes hit online prod, explicit dev
  on single-env as a probe; drop redundant/changelog phrasing.

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

♻️ Duplicate comments (2)
shortcuts/apps/apps_db_changelog_list.go (1)

79-82: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Confirm dry-run test coverage for the unset-env default.

Prior review noted shortcuts/apps/apps_db_changelog_list_test.go only exercises env=dev, not the no---environment path that this refactor now defaults to.

🤖 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/apps/apps_db_changelog_list.go` around lines 79 - 82, The changelog
parameter builder in buildChangelogParams now defaults unset environment
handling, but the tests only cover the env=dev path. Add or update coverage in
shortcuts/apps/apps_db_changelog_list_test.go for the no--environment case to
verify the dry-run/default behavior matches the new dbEnvParams logic and the
fallback environment is applied correctly.

Source: Coding guidelines

shortcuts/apps/apps_db_audit_list.go (1)

217-231: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Confirm dry-run test coverage for the unset-env default.

A prior review noted shortcuts/apps/apps_db_audit_test.go doesn't assert env at all for the no---environment path, and the same coding guideline ("Every behavior change needs a test alongside the change") applies here since buildAuditListParams/fetchExistingTables/fetchAuditEnabledTables now build params without env by default.

🤖 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/apps/apps_db_audit_list.go` around lines 217 - 231, Confirm the
no-`--environment` dry-run path is covered by a test, since
`buildAuditListParams`, `fetchExistingTables`, and `fetchAuditEnabledTables` now
omit `env` by default. Update `shortcuts/apps/apps_db_audit_test.go` to assert
the generated params for the unset-environment case, including that `env` is
absent when the flag is not provided. Keep the test aligned with the existing
dry-run coverage and verify the behavior through the same audit-list parameter
builder flow.

Source: Coding guidelines

🧹 Nitpick comments (1)
shortcuts/apps/db_common.go (1)

37-45: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Comment language inconsistency.

Logic is correct, but the doc comment (lines 37-39) is written in Chinese while the rest of the codebase (e.g., copyright headers, other shortcut files) uses English. Consider translating for consistency and to keep the codebase accessible to all contributors.

✏️ Suggested English comment
-// dbEnvParams 把 env 并入 params:仅当显式指定了环境(非空)才带 env 键;未指定(空)时
-// 省略该键,由服务端按应用多环境状态自动选分支(多环境→dev,单环境→online)。与家族对
-// 空可选参数的 omit-empty 约定一致——不发空串,wire 上真正不带 env。原样返回同一个 map 便于链式。
+// dbEnvParams merges env into params: only sets the "env" key when an
+// environment is explicitly specified (non-empty). When unset, the key is
+// omitted so the server can auto-select the branch based on the app's
+// multi-environment state (multi-env -> dev, single-env -> online). This
+// follows the family's omit-empty convention for optional params—no empty
+// string is sent on the wire. Returns the same map for chaining.
 func dbEnvParams(rctx *common.RuntimeContext, params map[string]interface{}) map[string]interface{} {
🤖 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/apps/db_common.go` around lines 37 - 45, The logic in dbEnvParams
is fine, but its doc comment is written in Chinese while the surrounding
codebase uses English. Translate the comment above dbEnvParams into concise
English, keeping the same meaning about only setting env when dbEnv(rctx) is
non-empty and otherwise omitting it for server-side default selection.
🤖 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/apps/apps_db_data_import.go`:
- Line 79: The dry-run test for the omitted --environment path only verifies the
derived table name and should also assert the default env behavior. Update
TestAppsDBDataImport_TableDefaultsToFileBasename to check the request shape
produced by dbEnvParams and Params, specifically that env is unset/defaulted in
the dry-run case when no environment is provided, so the default handling stays
covered.

In `@shortcuts/apps/apps_db_quota_get.go`:
- Around line 44-51: The +db-quota-get command currently builds its request
without an explicit dry-run assertion for the omitted env case. Update the
quota-get flow in Execute and the related tests so that when --environment is
not provided, dbEnvParams receives an empty map and the API request is verified
to omit env entirely. Add this coverage alongside the existing quota-get tests
in apps_db_env_recovery_quota_test.go, using appDbQuotaPath, dbEnvParams, and
rctx.CallAPITyped as the key symbols to locate the change.

---

Duplicate comments:
In `@shortcuts/apps/apps_db_audit_list.go`:
- Around line 217-231: Confirm the no-`--environment` dry-run path is covered by
a test, since `buildAuditListParams`, `fetchExistingTables`, and
`fetchAuditEnabledTables` now omit `env` by default. Update
`shortcuts/apps/apps_db_audit_test.go` to assert the generated params for the
unset-environment case, including that `env` is absent when the flag is not
provided. Keep the test aligned with the existing dry-run coverage and verify
the behavior through the same audit-list parameter builder flow.

In `@shortcuts/apps/apps_db_changelog_list.go`:
- Around line 79-82: The changelog parameter builder in buildChangelogParams now
defaults unset environment handling, but the tests only cover the env=dev path.
Add or update coverage in shortcuts/apps/apps_db_changelog_list_test.go for the
no--environment case to verify the dry-run/default behavior matches the new
dbEnvParams logic and the fallback environment is applied correctly.

---

Nitpick comments:
In `@shortcuts/apps/db_common.go`:
- Around line 37-45: The logic in dbEnvParams is fine, but its doc comment is
written in Chinese while the surrounding codebase uses English. Translate the
comment above dbEnvParams into concise English, keeping the same meaning about
only setting env when dbEnv(rctx) is non-empty and otherwise omitting it for
server-side default selection.
🪄 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: 6796977b-3223-4f0d-b3ea-2ea893b9245c

📥 Commits

Reviewing files that changed from the base of the PR and between d752ab9 and f984e16.

📒 Files selected for processing (14)
  • shortcuts/apps/apps_db_audit_list.go
  • shortcuts/apps/apps_db_audit_set.go
  • shortcuts/apps/apps_db_audit_status.go
  • shortcuts/apps/apps_db_changelog_list.go
  • shortcuts/apps/apps_db_data_export.go
  • shortcuts/apps/apps_db_data_import.go
  • shortcuts/apps/apps_db_execute.go
  • shortcuts/apps/apps_db_quota_get.go
  • shortcuts/apps/apps_db_table_get.go
  • shortcuts/apps/apps_db_table_list.go
  • shortcuts/apps/db_common.go
  • skills/lark-apps/references/lark-apps-db.md
  • tests/cli_e2e/apps/apps_db_execute_dryrun_test.go
  • tests/cli_e2e/apps/apps_db_table_list_dryrun_test.go
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-apps/references/lark-apps-db.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/cli_e2e/apps/apps_db_table_list_dryrun_test.go
  • shortcuts/apps/apps_db_audit_status.go
  • shortcuts/apps/apps_db_audit_set.go

Comment thread shortcuts/apps/apps_db_data_import.go
Comment thread shortcuts/apps/apps_db_quota_get.go

@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

🧹 Nitpick comments (1)
shortcuts/apps/apps_db_table_list.go (1)

289-299: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Guard against non-finite strings ("NaN"/"Inf") in the new string branch.

strconv.ParseFloat accepts "NaN", "Inf", and "Infinity" (case-insensitive) as valid floats with no error. If the server ever emits such a value for a row count, numericAsFloat returns (NaN/Inf, true), and downstream int64(n) conversions in humanBytes/intString are implementation-defined for values a float64→int64 cast can't represent, so display could show garbage instead of falling back to "—".

🛡️ Proposed guard
 	case string:
 		// 服务端有些数值字段(如 recovery diff 的 inserted/deleted 行数)以字符串下发。
 		s := strings.TrimSpace(v)
 		if s == "" {
 			return 0, false
 		}
 		f, err := strconv.ParseFloat(s, 64)
 		if err != nil {
 			return 0, false
 		}
+		if math.IsNaN(f) || math.IsInf(f, 0) {
+			return 0, false
+		}
 		return f, true
🤖 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/apps/apps_db_table_list.go` around lines 289 - 299, The new
string-handling branch in numericAsFloat should reject non-finite values before
returning success. After trimming the input and before returning from the
strconv.ParseFloat path, add a finiteness check for values like NaN, Inf, and
Infinity so these cases return (0, false) instead of propagating an unusable
float. Keep the fix localized to numericAsFloat and ensure downstream callers
like humanBytes and intString only receive finite numbers.
🤖 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/apps/apps_db_table_list.go`:
- Around line 289-299: Add a test case in apps_db_table_list_test.go to cover
the new string-to-float conversion branch in the value parsing helper used by
apps_db_table_list.go. Extend the existing test around the string handling path
so it includes a numeric string such as "13.5" or " 13.5 " and asserts it is
parsed successfully via strconv.ParseFloat, while keeping the existing
unsupported string case like "x" intact.

---

Nitpick comments:
In `@shortcuts/apps/apps_db_table_list.go`:
- Around line 289-299: The new string-handling branch in numericAsFloat should
reject non-finite values before returning success. After trimming the input and
before returning from the strconv.ParseFloat path, add a finiteness check for
values like NaN, Inf, and Infinity so these cases return (0, false) instead of
propagating an unusable float. Keep the fix localized to numericAsFloat and
ensure downstream callers like humanBytes and intString only receive finite
numbers.
🪄 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: a56cd64a-19ce-4e60-8a52-c81e7fc480a7

📥 Commits

Reviewing files that changed from the base of the PR and between f984e16 and 3d4f7ca.

📒 Files selected for processing (5)
  • shortcuts/apps/apps_db_env_migrate.go
  • shortcuts/apps/apps_db_env_recovery_quota_test.go
  • shortcuts/apps/apps_db_recovery.go
  • shortcuts/apps/apps_db_table_list.go
  • skills/lark-apps/references/lark-apps-db.md
✅ Files skipped from review due to trivial changes (1)
  • skills/lark-apps/references/lark-apps-db.md

Comment thread shortcuts/apps/apps_db_table_list.go
…ixes

- +db-recovery-diff/-apply: add --environment (env → query param on submit
  and both status polls), aligned with the recovery env IDL
- recovery diff: parse string row counts (inserted/deleted arrive as strings)
  so they render as "-N rows" instead of "no changes"; drop the redundant
  per-table data-row line when a schema action (drop/restore/alter) exists for
  the same table; count tables_affected by distinct tables
- +db-env-migrate: run a dry_run preview before apply to backfill the change
  count when the server reports changes_applied=0 on a cold apply (matches
  miaoda-cli's diff-then-apply)
- lark-apps-db.md: drop the redundant recovery clause (recovery follows the
  standard --environment rule)
@chenxingyang1019 chenxingyang1019 force-pushed the fix/apps-db-env-optional branch from 3d4f7ca to 50fb419 Compare July 7, 2026 12:37
Address CodeRabbit review threads on PR #1735:
- numericAsFloat: add numeric-string cases ("13.5", " 13.5 ", int, empty)
- db-data-import: assert dry-run omits env when --environment unset (table
  still defaults to file basename)
- db-quota-get: assert dry-run omits env when --environment unset
@chenxingyang1019 chenxingyang1019 merged commit 1a9f637 into main Jul 8, 2026
27 checks passed
@chenxingyang1019 chenxingyang1019 deleted the fix/apps-db-env-optional branch July 8, 2026 06:06
This was referenced Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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