Skip to content

feat(base): add workflow enable-all-disabled shortcut#1634

Open
yballul-bytedance wants to merge 1 commit into
mainfrom
auto-research-sync/01KW59XW4VYEGQSJS7A0ZX6X0F/mr-697-b83ed3a5
Open

feat(base): add workflow enable-all-disabled shortcut#1634
yballul-bytedance wants to merge 1 commit into
mainfrom
auto-research-sync/01KW59XW4VYEGQSJS7A0ZX6X0F/mr-697-b83ed3a5

Conversation

@yballul-bytedance

@yballul-bytedance yballul-bytedance commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a Base workflow shortcut that enables every currently disabled workflow and reports per-workflow results.

Changes

  • Register +workflow-enable-all-disabled in the Base shortcut catalog.
  • Implement disabled workflow listing, batch enable attempts, per-item failure collection, and remaining disabled summary output.
  • Add unit and dry-run E2E coverage for the new workflow shortcut.
  • Update the lark-base skill guidance to direct agents to the new batch-enable shortcut.

Test Plan

  • git diff --check

Related Issues

Auto research task: 01KW59XW4VYEGQSJS7A0ZX6X0F

Summary by CodeRabbit

  • New Features

    • Added a new shortcut to enable all currently disabled workflows in one batch.
    • The command now reports counts for succeeded, failed, and remaining disabled workflows, along with per-workflow results.
  • Bug Fixes

    • Batch execution continues even if one workflow fails to enable, so other workflows can still be processed.
  • Documentation

    • Updated workflow guidance to include the new shortcut and how to interpret its output.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


github-pr-syncer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a new base +workflow-enable-all-disabled CLI shortcut that paginates through all disabled workflows, attempts to enable each one individually (continuing on per-item failures), and outputs a summary of succeeded, failed, and remaining_disabled counts. Includes catalog wiring, unit tests, a dry-run e2e test, and updated skill documentation.

Changes

workflow-enable-all-disabled shortcut

Layer / File(s) Summary
Shortcut definition and pagination helper
shortcuts/base/workflow_enable_all_disabled.go
Defines BaseWorkflowEnableAllDisabled with flag validation, DryRun pipeline, and Execute logic that batch-enables disabled workflows and collects per-item failures; adds listWorkflowsByStatus paginator.
Catalog wiring, tests, and docs
shortcuts/base/shortcuts.go, shortcuts/base/base_shortcuts_test.go, shortcuts/base/workflow_execute_test.go, tests/cli_e2e/base/base_workflow_enable_all_disabled_dryrun_test.go, skills/lark-base/SKILL.md
Registers the shortcut in Shortcuts(), updates catalog and help-guide test expectations, adds a unit test for continue-after-failure behavior, adds a dry-run e2e test, and updates SKILL.md with invocation guidance and output interpretation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • larksuite/cli#759: Also adds a new shortcut entry to shortcuts/base/shortcuts.go and updates TestShortcutsCatalog in shortcuts/base/base_shortcuts_test.go with the same catalog-wiring pattern.

Suggested reviewers

  • kongenpei

🐇 A rabbit hops through workflows asleep,
flips each "disabled" from its slumber deep,
counts the won, the lost, what still remain—
one tidy batch command clears the pain.
Hop hop hooray, the catalog grows! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% 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 is concise and accurately names the new Base shortcut added in this PR.
Description check ✅ Passed The description follows the required template and includes summary, changes, test plan, and related issues.
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 auto-research-sync/01KW59XW4VYEGQSJS7A0ZX6X0F/mr-697-b83ed3a5

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 Jun 29, 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: 2

🤖 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/workflow_enable_all_disabled.go`:
- Around line 100-132: Add test coverage for the multi-page branch in
listWorkflowsByStatus so the has_more/page_token loop is exercised, not just the
single-page path. Update the relevant tests around workflow_execute_test and the
dry-run CLI e2e flow to mock a first response with has_more true plus a
page_token, then a second response that ends pagination, and assert all returned
items are accumulated from both pages. Reference listWorkflowsByStatus and the
workflow enable-all-disabled path when locating the code.
- Around line 29-35: The new Validate branches in
workflow_enable_all_disabled.go need unit coverage for both blank base-token and
invalid page-size. Add tests around the Validate function to exercise the
baseFlagErrorf path for an empty “base-token” and the
common.ValidatePageSizeTyped path for bad “page-size” values, using the existing
runtime setup helpers. In the assertions, verify typed error metadata with
errs.ProblemOf, including category/subtype/param and cause preservation, rather
than matching only on error text. Keep the tests focused on the Validate
behavior for these specific flags.
🪄 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: 1c8b21a5-a347-4bc9-9752-06f414b49334

📥 Commits

Reviewing files that changed from the base of the PR and between 297776e and d197af9.

📒 Files selected for processing (6)
  • shortcuts/base/base_shortcuts_test.go
  • shortcuts/base/shortcuts.go
  • shortcuts/base/workflow_enable_all_disabled.go
  • shortcuts/base/workflow_execute_test.go
  • skills/lark-base/SKILL.md
  • tests/cli_e2e/base/base_workflow_enable_all_disabled_dryrun_test.go

Comment on lines +29 to +35
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
if strings.TrimSpace(runtime.Str("base-token")) == "" {
return baseFlagErrorf("--base-token must not be blank")
}
_, err := common.ValidatePageSizeTyped(runtime, "page-size", 100, 1, 100)
return err
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add validation-path tests for the new flags.

These new Validate branches are untested. Please add unit coverage for blank --base-token and invalid --page-size, and assert typed error metadata instead of only message text. As per coding guidelines, "Every behavior change needs a test alongside the change" and "**/*_test.go: Error-path tests must assert typed metadata via errs.ProblemOf (category / subtype / param) and cause preservation, not message substrings alone."

🤖 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/base/workflow_enable_all_disabled.go` around lines 29 - 35, The new
Validate branches in workflow_enable_all_disabled.go need unit coverage for both
blank base-token and invalid page-size. Add tests around the Validate function
to exercise the baseFlagErrorf path for an empty “base-token” and the
common.ValidatePageSizeTyped path for bad “page-size” values, using the existing
runtime setup helpers. In the assertions, verify typed error metadata with
errs.ProblemOf, including category/subtype/param and cause preservation, rather
than matching only on error text. Keep the tests focused on the Validate
behavior for these specific flags.

Source: Coding guidelines

Comment on lines +100 to +132
func listWorkflowsByStatus(runtime *common.RuntimeContext, baseToken string, status string, pageSize int) ([]map[string]interface{}, error) {
allItems := []map[string]interface{}{}
pageToken := ""
for {
body := map[string]interface{}{
"page_size": pageSize,
"status": status,
}
if pageToken != "" {
body["page_token"] = pageToken
}
data, err := baseV3Call(runtime, "POST", baseV3Path("bases", baseToken, "workflows", "list"), nil, body)
if err != nil {
return nil, err
}
if items, _ := data["items"].([]interface{}); len(items) > 0 {
for _, item := range items {
if obj, ok := item.(map[string]interface{}); ok {
allItems = append(allItems, obj)
}
}
}
hasMore, _ := data["has_more"].(bool)
if !hasMore {
break
}
nextToken, _ := data["page_token"].(string)
if nextToken == "" {
break
}
pageToken = nextToken
}
return allItems, nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Cover the multi-page paginator branch.

listWorkflowsByStatus is the core new behavior here, but the added coverage in shortcuts/base/workflow_execute_test.go Lines 119-174 and tests/cli_e2e/base/base_workflow_enable_all_disabled_dryrun_test.go Lines 16-41 only exercises a single-page flow. A regression in has_more / page_token handling would ship unnoticed. As per coding guidelines, "Every behavior change needs a test alongside the change."

🤖 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/base/workflow_enable_all_disabled.go` around lines 100 - 132, Add
test coverage for the multi-page branch in listWorkflowsByStatus so the
has_more/page_token loop is exercised, not just the single-page path. Update the
relevant tests around workflow_execute_test and the dry-run CLI e2e flow to mock
a first response with has_more true plus a page_token, then a second response
that ends pagination, and assert all returned items are accumulated from both
pages. Reference listWorkflowsByStatus and the workflow enable-all-disabled path
when locating the code.

Source: Coding guidelines

@github-actions

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add larksuite/cli#auto-research-sync/01KW59XW4VYEGQSJS7A0ZX6X0F/mr-697-b83ed3a5 -y -g

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.65060% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.67%. Comparing base (297776e) to head (d197af9).

Files with missing lines Patch % Lines
shortcuts/base/workflow_enable_all_disabled.go 62.19% 24 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1634      +/-   ##
==========================================
- Coverage   74.68%   74.67%   -0.01%     
==========================================
  Files         808      809       +1     
  Lines       81484    81567      +83     
==========================================
+ Hits        60858    60912      +54     
- Misses      16091    16114      +23     
- Partials     4535     4541       +6     

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

2 participants