test: stabilize live e2e auth retries#1904
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughLive E2E CI now provisions a shared Feishu tenant access token and exports CLI identity variables. A shared test helper verifies tenant authentication, while tenant-dependent workflows skip when credentials are unavailable. ChangesLive E2E tenant authentication
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant FeishuOAuth
participant LarkCLI
participant LiveE2ETests
GitHubActions->>FeishuOAuth: Request tenant token
FeishuOAuth-->>GitHubActions: Return token
GitHubActions->>LarkCLI: Export token and CLI identity
LiveE2ETests->>LarkCLI: Verify bot authentication
LarkCLI-->>LiveE2ETests: Return verified status
LiveE2ETests->>LiveE2ETests: Run or skip workflow
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
477052f to
a9e21a3
Compare
There was a problem hiding this comment.
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 `@scripts/ci-workflow.test.sh`:
- Around line 312-324: Strengthen the workflow assertions in the test section
around the “Prepare shared live E2E tenant token” step: require the exact
LARKSUITE_CLI_BRAND: feishu environment entry and verify that
LARKSUITE_CLI_TENANT_ACCESS_TOKEN is written to GITHUB_ENV, not merely
referenced. Preserve the existing step-condition and job-scope checks.
🪄 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: bde452c3-4683-4681-a59f-0bed8ea40de3
📒 Files selected for processing (41)
.github/workflows/ci.ymlinternal/client/api_errors.gointernal/client/api_errors_test.goscripts/ci-workflow.test.shtests/cli_e2e/base/base_basic_workflow_test.gotests/cli_e2e/base/base_role_workflow_test.gotests/cli_e2e/calendar/calendar_create_event_test.gotests/cli_e2e/calendar/calendar_manage_calendar_test.gotests/cli_e2e/calendar/calendar_rsvp_workflow_test.gotests/cli_e2e/calendar/calendar_update_event_test.gotests/cli_e2e/contact/contact_lookup_workflow_test.gotests/cli_e2e/core.gotests/cli_e2e/core_test.gotests/cli_e2e/docs/docs_create_fetch_test.gotests/cli_e2e/docs/docs_update_test.gotests/cli_e2e/drive/drive_add_comment_workflow_test.gotests/cli_e2e/drive/drive_duplicate_sync_workflow_test.gotests/cli_e2e/drive/drive_files_workflow_test.gotests/cli_e2e/drive/drive_preview_workflow_test.gotests/cli_e2e/drive/drive_status_workflow_test.gotests/cli_e2e/drive/drive_sync_workflow_test.gotests/cli_e2e/drive/drive_upload_workflow_test.gotests/cli_e2e/drive/drive_version_workflow_test.gotests/cli_e2e/im/chat_workflow_test.gotests/cli_e2e/im/message_forward_workflow_test.gotests/cli_e2e/im/message_reply_workflow_test.gotests/cli_e2e/markdown/markdown_workflow_test.gotests/cli_e2e/sheets/sheets_crud_workflow_test.gotests/cli_e2e/sheets/sheets_filter_workflow_test.gotests/cli_e2e/sheets/sheets_gridline_workflow_test.gotests/cli_e2e/sheets/sheets_sheet_shortcuts_workflow_test.gotests/cli_e2e/sheets/sheets_table_get_workflow_test.gotests/cli_e2e/sheets/sheets_table_put_typed_workflow_test.gotests/cli_e2e/sheets/sheets_workbook_import_workflow_test.gotests/cli_e2e/task/task_comment_workflow_test.gotests/cli_e2e/task/task_reminder_workflow_test.gotests/cli_e2e/task/task_status_workflow_test.gotests/cli_e2e/task/tasklist_add_task_workflow_test.gotests/cli_e2e/task/tasklist_workflow_test.gotests/cli_e2e/wiki/wiki_shortcut_workflow_test.gotests/cli_e2e/wiki/wiki_workflow_test.go
a9e21a3 to
df471b2
Compare
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@b3d24733e9a8982bb983a874d82d6c3681e503db🧩 Skill updatenpx skills add yxzhaao/cli#fix/e2e-invalid-response-retry -y -g |
c18309f to
a120c90
Compare
f9ac60c to
29b16c3
Compare
29b16c3 to
2c829cf
Compare
Summary
Stabilize live CLI E2E execution against transient Lark API failures and OAuth rate limits. The shared harness now retries server-declared retryable errors, handles eventually consistent cleanup, runs only affected E2E domains, and reuses one tenant access token across all CLI subprocesses in a live test job.
Changes
RunCmdautomatically retry error envelopes that declareretryable: true, using bounded exponential backoff.scripts/fetch_e2e_tat.jshelper that retries the OAuth exchange, including aborted and incomplete HTTP responses, masks the resulting token, and writes it to a private temporary file.lark-cli whoami --as botpreflight before the live suite to verify that the shared TAT resolves to a ready bot identity.TEST_USER_ACCESS_TOKENand inject it only into requests withDefaultAs: "user".whoamiprocess at every test entry.Test Plan
make script-test(110 tests)make quality-gatego test ./tests/cli_e2e/... -run '^$' -count=1Related Issues