Skip to content

fix: get storage type better with tm-core#1347

Merged
Crunchyman-ralph merged 1 commit into
nextfrom
ralph/fix/improve.commands.get.storageType
Oct 26, 2025
Merged

fix: get storage type better with tm-core#1347
Crunchyman-ralph merged 1 commit into
nextfrom
ralph/fix/improve.commands.get.storageType

Conversation

@Crunchyman-ralph

@Crunchyman-ralph Crunchyman-ralph commented Oct 26, 2025

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 🔌 Integration
  • 📝 Docs
  • 🧹 Refactor
  • Other:

Description

Related Issues

How to Test This

# Example commands or steps

Expected result:

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

Changelog Entry


For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced CLI command stability by improving storage type resolution across task operations, eliminating potential configuration errors.

@changeset-bot

changeset-bot Bot commented Oct 26, 2025

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d00d811

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 26, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Multiple CLI commands are updated to retrieve the storage type from a dedicated tasks.getStorageType() method instead of directly from configuration, ensuring the returned storage type excludes the 'auto' variant across all command handlers.

Changes

Cohort / File(s) Summary
Storage type retrieval refactoring
apps/cli/src/commands/next.command.ts, apps/cli/src/commands/set-status.command.ts, apps/cli/src/commands/show.command.ts, apps/cli/src/commands/start.command.ts
Replaced getStorageConfig().type with tasks.getStorageType() to retrieve resolved storage type instead of config value; NextTaskResult.storageType updated to exclude 'auto' from StorageType union.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Changes follow a homogeneous, repetitive pattern across all four files (method delegation substitution)
  • Logic is straightforward: replacing one retrieval method with another
  • Type narrowing is consistent and well-defined (excluding 'auto')
  • No conditional logic, error handling changes, or control flow modifications

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "fix: get storage type better with tm-core" directly and accurately summarizes the main change across the entire changeset. The primary modification throughout all four modified command files involves replacing storage type retrieval from this.tmCore.config.getStorageConfig().type with this.tmCore.tasks.getStorageType(), which is exactly what the title conveys—using a better (dedicated) method from tm-core to obtain storage type. The title is concise, avoids vague language, and provides sufficient clarity for a teammate reviewing the history to understand the purpose of the change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ralph/fix/improve.commands.get.storageType

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
apps/cli/src/commands/show.command.ts (1)

159-165: Remove unnecessary type cast at line 164 for consistency.

Both getSingleTask() and getMultipleTasks() return results typed as ShowTaskResult and ShowMultipleTasksResult, which require storageType: Exclude<StorageType, 'auto'>. Since getStorageType() already returns 'file' | 'api' (as documented in tm-core), the cast at line 164 is redundant. Line 198 correctly omits it. Remove the cast at line 164 to align both methods:

storageType: storageType  // instead of: storageType as Exclude<StorageType, 'auto'>
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 486ed40 and d00d811.

📒 Files selected for processing (4)
  • apps/cli/src/commands/next.command.ts (1 hunks)
  • apps/cli/src/commands/set-status.command.ts (1 hunks)
  • apps/cli/src/commands/show.command.ts (2 hunks)
  • apps/cli/src/commands/start.command.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-18T17:18:17.759Z
Learnt from: CR
PR: eyaltoledano/claude-task-master#0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-07-18T17:18:17.759Z
Learning: Applies to scripts/modules/utils.js : Use tag resolution functions for all task data access, provide backward compatibility with legacy format, and default to 'master' tag when no tag is specified.

Applied to files:

  • apps/cli/src/commands/next.command.ts
🔇 Additional comments (3)
apps/cli/src/commands/set-status.command.ts (1)

167-167: LGTM: Clean refactoring to centralized storage type retrieval.

The change correctly delegates storage type resolution to the core tasks API, ensuring consistency across commands.

apps/cli/src/commands/show.command.ts (1)

192-199: Approve with consistency note.

The storage type retrieval correctly uses the centralized core method. However, note the inconsistency with line 164 where a type cast was used but is absent here.

apps/cli/src/commands/next.command.ts (1)

130-139: LGTM: Clean implementation of centralized storage type retrieval.

The change correctly retrieves the resolved storage type from the core tasks API and properly types it as Exclude<StorageType, 'auto'> in the interface. No type casting needed, indicating the API contract is well-aligned.

Comment thread apps/cli/src/commands/start.command.ts
@Crunchyman-ralph Crunchyman-ralph merged commit d0342d2 into next Oct 26, 2025
8 checks passed
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