Skip to content

Add dependency flags to tq issue update#214

Merged
version-1 merged 1 commit into
mainfrom
agent/issue-45-cli-dependencies
Jun 24, 2026
Merged

Add dependency flags to tq issue update#214
version-1 merged 1 commit into
mainfrom
agent/issue-45-cli-dependencies

Conversation

@version-1

Copy link
Copy Markdown
Owner

Add dependency flags to tq issue update

Summary

This PR adds CLI support for replacing or clearing issue dependencies through tq issue update, matching the existing PATCH /api/v1/issues/{id} dependency_ids contract.

主な変更点:

  • Add --dependency <comma-separated-ids> to fully replace issue dependencies.
  • Add --clear-dependencies to explicitly clear dependencies.
  • Preserve existing specified-field-only update payloads with a typed CLI patch struct.
  • Document the new flags in English and Japanese CLI references.

チケットへのリンク

Issue #45

やったこと

  • tq issue update now rejects simultaneous --dependency and --clear-dependencies.
  • --dependency "", non-integer IDs, zero/negative IDs, and duplicate IDs are usage errors.
  • API validation errors, such as dependency cycles, continue to propagate to CLI stderr.
  • Added CLI tests for replacement, clearing, usage errors, explicit --clear-dependencies=false, and server validation errors.

動作確認

  • go test ./internal/cli/tq
  • go test ./internal/cli/tq ./internal/issue/...
  • go test ./internal/... ./cmd/issue-tracker ./cmd/orchestrator ./cmd/tq ./cmd/tasq-tui ./db/migrations
  • git diff --check
  • PR前レビュー: High 以上の指摘なし

レビュー & 動作確認 チェックリスト

  • Dependency replacement - --dependency 1,2 sends dependency_ids: [1,2] and replaces the full dependency set.
  • Dependency clearing - --clear-dependencies sends dependency_ids: [].
  • Usage errors - conflicting flags and invalid dependency input exit as usage errors.
  • Server validation propagation - server-side dependency validation messages are shown by the CLI.

推奨テスト計画:

  1. Run tq issue update <id> --dependency <dep-id> against local issue-tracker and confirm the issue response contains the dependency.
  2. Run tq issue update <id> --clear-dependencies and confirm dependencies are empty.
  3. Try a cycle-producing dependency update and confirm the CLI prints the server validation error.

その他気になることや相談ごと

go test ./... was also attempted, but cmd/web fails during setup because cmd/web/frontend/dist is not present in this worktree. The non-web Go package set above passed.

Use a typed CLI patch payload so issue updates can send dependency_ids while preserving specified-field-only JSON for existing updates.

Add CLI tests for dependency replacement, clearing, usage errors, and server validation error propagation. Update English and Japanese CLI references.
@version-1 version-1 merged commit fe24de0 into main Jun 24, 2026
5 checks passed
@version-1 version-1 mentioned this pull request Jul 12, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant