Skip to content

fix: expose completion state in my tasks output#1641

Merged
luoyangxing merged 3 commits into
larksuite:mainfrom
ILUO:codex/task-my-tasks-completed-status
Jul 1, 2026
Merged

fix: expose completion state in my tasks output#1641
luoyangxing merged 3 commits into
larksuite:mainfrom
ILUO:codex/task-my-tasks-completed-status

Conversation

@ILUO

@ILUO ILUO commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

task +get-my-tasks now exposes explicit completion state in task list output so agents can classify full result sets without relying on --complete filtering.

Changes

  • Add a completed boolean to each JSON item, derived from completed_at.
  • Include formatted completed_at for completed tasks and show completion state in pretty output.
  • Add regression unit coverage and dry-run E2E request-shape coverage for task +get-my-tasks.

Test Plan

  • Unit tests pass: make unit-test
  • Manual local verification confirms the lark-cli task +get-my-tasks flow works as expected via make build and go test ./tests/cli_e2e/task -run TestTask_GetMyTasksDryRun -count=1
  • go vet ./...
  • gofmt -l .
  • go mod tidy with no go.mod / go.sum changes
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main

Related Issues

  • None

Summary by CodeRabbit

  • New Features

    • Task lists now include per-task completion status (completed) in JSON output and “Completed” in plain-text output.
    • When present, completed tasks now show a completion timestamp (completed_at / “Completed At”) formatted for readability.
  • Bug Fixes

    • Improved interpretation of missing, empty, or “0” completion timestamps to ensure incomplete tasks display correctly.
  • Tests

    • Added unit coverage for completion status in both JSON and pretty formats.
    • Added an e2e dry-run test validating the expected request parameters.
    • Updated CLI e2e coverage reporting.

@coderabbitai

coderabbitai Bot commented Jun 29, 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

Run ID: f2cdd89f-06da-443f-ae26-15c92fe5dbf1

📥 Commits

Reviewing files that changed from the base of the PR and between e004b06 and e776a3f.

📒 Files selected for processing (1)
  • shortcuts/task/task_get_my_tasks_test.go

📝 Walkthrough

Walkthrough

GetMyTasks now emits task completion status in JSON and list output using a new taskCompletionState helper. Unit tests, a dry-run e2e test, and task coverage reporting were updated.

Changes

Task completion state in GetMyTasks

Layer / File(s) Summary
Completion state parsing and output
shortcuts/task/task_get_my_tasks.go
Adds taskCompletionState to parse completed_at as a Unix-millisecond timestamp. JSON output and list rendering now emit completed and optional completed_at fields.
Completion-state tests and coverage
shortcuts/task/task_get_my_tasks_test.go, tests/cli_e2e/task/task_get_my_tasks_dryrun_test.go, tests/cli_e2e/task/coverage.md
Adds unit tests for JSON and pretty output, an e2e dry-run test for task +get-my-tasks, and updates task coverage metrics and command table entries.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • liangshuo-1
  • tengchengwei

Poem

🐇 I hopped through tasks both done and new,
With completed_at now shining through.
JSON, pretty, dry-run too—
The bunny checks what the tasks will do.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: exposing completion state in my tasks output.
Description check ✅ Passed The description follows the required template and includes summary, changes, test plan, and related issues.
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

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/task PR touches the task 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: 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/task/task_get_my_tasks_test.go`:
- Around line 113-167: Add a regression test for the pretty output path in
GetMyTasks, since the current TestGetMyTasks_IncludesCompletionStateInJSON only
verifies the JSON branch. Extend the task shortcut test coverage to run
GetMyTasks with the default pretty format and assert the new “Completed” and
“Completed At” lines are printed for both an open task and a completed task; use
the existing GetMyTasks shortcut and task task data setup to locate the behavior
change.
🪄 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: 756d84f4-dfa1-44a3-867d-f2ffba8e038d

📥 Commits

Reviewing files that changed from the base of the PR and between 30b28cf and e004b06.

📒 Files selected for processing (4)
  • shortcuts/task/task_get_my_tasks.go
  • shortcuts/task/task_get_my_tasks_test.go
  • tests/cli_e2e/task/coverage.md
  • tests/cli_e2e/task/task_get_my_tasks_dryrun_test.go

Comment thread shortcuts/task/task_get_my_tasks_test.go
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🚀 PR Preview Install Guide

🧰 CLI update

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

🧩 Skill update

npx skills add ILUO/cli#codex/task-my-tasks-completed-status -y -g

@luoyangxing luoyangxing merged commit e753b15 into larksuite:main Jul 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain/task PR touches the task 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.

3 participants