-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: add bulk dependency management #616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
will-bogusz
wants to merge
3
commits into
eyaltoledano:next
Choose a base branch
from
will-bogusz:feature/bulk-dependencies
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,017
−75
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2495,9 +2495,17 @@ ${result.result} | |
| // add-dependency command | ||
| programInstance | ||
| .command('add-dependency') | ||
| .description('Add a dependency to a task') | ||
| .option('-i, --id <id>', 'Task ID to add dependency to') | ||
| .option('-d, --depends-on <id>', 'Task ID that will become a dependency') | ||
| .description( | ||
| 'Add dependencies to task(s). Supports ranges and comma-separated lists.' | ||
| ) | ||
| .option( | ||
| '-i, --id <id>', | ||
| 'Task ID(s) to add dependencies to (e.g., "7", "7-10", "7,8,9")' | ||
| ) | ||
| .option( | ||
| '-d, --depends-on <id>', | ||
| 'Task ID(s) that will become dependencies (e.g., "1", "1-5", "1,3,5")' | ||
| ) | ||
| .option( | ||
| '-f, --file <file>', | ||
| 'Path to the tasks file', | ||
|
|
@@ -2529,32 +2537,27 @@ ${result.result} | |
| process.exit(1); | ||
| } | ||
|
|
||
| // Handle subtask IDs correctly by preserving the string format for IDs containing dots | ||
| // Only use parseInt for simple numeric IDs | ||
| const formattedTaskId = taskId.includes('.') | ||
| ? taskId | ||
| : parseInt(taskId, 10); | ||
| const formattedDependencyId = dependencyId.includes('.') | ||
| ? dependencyId | ||
| : parseInt(dependencyId, 10); | ||
|
|
||
| await addDependency( | ||
| taskMaster.getTasksPath(), | ||
| formattedTaskId, | ||
| formattedDependencyId, | ||
| { | ||
| projectRoot: taskMaster.getProjectRoot(), | ||
| tag | ||
| } | ||
| ); | ||
| // Pass raw IDs (supporting ranges/lists and dot notation) | ||
| await addDependency(taskMaster.getTasksPath(), taskId, dependencyId, { | ||
| projectRoot: taskMaster.getProjectRoot(), | ||
| tag | ||
| }); | ||
| }); | ||
|
|
||
| // remove-dependency command | ||
| programInstance | ||
| .command('remove-dependency') | ||
| .description('Remove a dependency from a task') | ||
| .option('-i, --id <id>', 'Task ID to remove dependency from') | ||
| .option('-d, --depends-on <id>', 'Task ID to remove as a dependency') | ||
| .description( | ||
| 'Remove dependencies from task(s). Supports ranges and comma-separated lists.' | ||
| ) | ||
| .option( | ||
| '-i, --id <id>', | ||
| 'Task ID(s) to remove dependencies from (e.g., "7", "7-10", "7,8,9")' | ||
| ) | ||
| .option( | ||
| '-d, --depends-on <id>', | ||
| 'Task ID(s) to remove as dependencies (e.g., "1", "1-5", "1,3,5")' | ||
| ) | ||
|
Comment on lines
+2551
to
+2560
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major Expose dry-run in remove-dependency and propagate to core Mirror add-dependency for removals. .command('remove-dependency')
.description(
'Remove dependencies from task(s). Supports ranges and comma-separated lists.'
)
.option(
'-i, --id <id>',
'Task ID(s) to remove dependencies from (e.g., "7", "7-10", "7,8,9")'
)
.option(
'-d, --depends-on <id>',
'Task ID(s) to remove as dependencies (e.g., "1", "1-5", "1,3,5")'
)
+.option('--dry-run', 'Validate and show changes without writing', false)
@@
- await removeDependency(taskMaster.getTasksPath(), taskId, dependencyId, {
- projectRoot: taskMaster.getProjectRoot(),
- tag
- });
+ await removeDependency(taskMaster.getTasksPath(), taskId, dependencyId, {
+ projectRoot: taskMaster.getProjectRoot(),
+ tag,
+ dryRun: !!options.dryRun
+ });As per coding guidelines Also applies to: 2592-2596 🤖 Prompt for AI Agents |
||
| .option( | ||
| '-f, --file <file>', | ||
| 'Path to the tasks file', | ||
|
|
@@ -2586,24 +2589,11 @@ ${result.result} | |
| process.exit(1); | ||
| } | ||
|
|
||
| // Handle subtask IDs correctly by preserving the string format for IDs containing dots | ||
| // Only use parseInt for simple numeric IDs | ||
| const formattedTaskId = taskId.includes('.') | ||
| ? taskId | ||
| : parseInt(taskId, 10); | ||
| const formattedDependencyId = dependencyId.includes('.') | ||
| ? dependencyId | ||
| : parseInt(dependencyId, 10); | ||
|
|
||
| await removeDependency( | ||
| taskMaster.getTasksPath(), | ||
| formattedTaskId, | ||
| formattedDependencyId, | ||
| { | ||
| projectRoot: taskMaster.getProjectRoot(), | ||
| tag | ||
| } | ||
| ); | ||
| // Pass raw IDs (supporting ranges/lists and dot notation) | ||
| await removeDependency(taskMaster.getTasksPath(), taskId, dependencyId, { | ||
| projectRoot: taskMaster.getProjectRoot(), | ||
| tag | ||
| }); | ||
| }); | ||
|
|
||
| // validate-dependencies command | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.