[PR #2300] [MERGED] feat(cli): reorganize repair commands under unified 'vikunja repair' parent #8175

Closed
opened 2026-04-20 18:04:22 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2300
Author: @kolaente
Created: 2/25/2026
Status: Merged
Merged: 2/25/2026
Merged by: @kolaente

Base: mainHead: refactor-cli-repair


📝 Commits (2)

  • 21322ed feat(cli): reorganize repair commands under unified 'vikunja repair' parent
  • e8dd75d fix: resolve staticcheck nil pointer dereference warning in helpers_test.go

📊 Changes

8 files changed (+120 additions, -39 deletions)

View changed files

pkg/cmd/repair.go (+40 -0)
📝 pkg/cmd/repair_file_mime_types.go (+19 -8)
📝 pkg/cmd/repair_orphan_positions.go (+29 -10)
📝 pkg/cmd/repair_projects.go (+2 -2)
📝 pkg/cmd/repair_task_positions.go (+2 -2)
📝 pkg/files/repair.go (+11 -8)
📝 pkg/models/task_position.go (+11 -4)
📝 pkg/modules/migration/helpers_test.go (+6 -5)

📄 Description

Summary

Consolidate four scattered repair/maintenance CLI commands into a unified vikunja repair parent command with subcommands.

Changes

Old Command New Command
repair-file-mime-types repair file-mime-types
repair-task-positions repair task-positions
repair-projects repair projects
delete-orphan-task-positions repair orphan-positions

Features

  • All repair commands are now unified under vikunja repair
  • All subcommands support --dry-run to preview changes without making them
  • Standardized command naming and help text

Files Changed

File Action
pkg/cmd/repair.go Created - parent repair command
pkg/cmd/repair_task_positions.go Modified - registered under repairCmd, renamed to task-positions
pkg/cmd/repair_projects.go Modified - registered under repairCmd, renamed to projects
pkg/cmd/repair_file_mime_types.go Modified - registered under repairCmd, renamed to file-mime-types, added --dry-run
pkg/cmd/maintenance.go Renamed to pkg/cmd/repair_orphan_positions.go - registered under repairCmd, renamed to orphan-positions, added --dry-run
pkg/files/repair.go Modified - added dryRun parameter to RepairFileMimeTypes()
pkg/models/task_position.go Modified - added dryRun parameter to DeleteOrphanedTaskPositions()

Usage

# Show all repair subcommands
vikunja repair --help

# Preview what would be fixed
vikunja repair task-positions --dry-run
vikunja repair projects --dry-run
vikunja repair file-mime-types --dry-run
vikunja repair orphan-positions --dry-run

# Actually run the repairs
vikunja repair task-positions
vikunja repair projects
vikunja repair file-mime-types
vikunja repair orphan-positions

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2300 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 2/25/2026 **Status:** ✅ Merged **Merged:** 2/25/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `refactor-cli-repair` --- ### 📝 Commits (2) - [`21322ed`](https://github.com/go-vikunja/vikunja/commit/21322ed4f5a67769d74b84f759496500a19a88d5) feat(cli): reorganize repair commands under unified 'vikunja repair' parent - [`e8dd75d`](https://github.com/go-vikunja/vikunja/commit/e8dd75d700b48b3f8ed9feb7d4985d61d61fd1fa) fix: resolve staticcheck nil pointer dereference warning in helpers_test.go ### 📊 Changes **8 files changed** (+120 additions, -39 deletions) <details> <summary>View changed files</summary> ➕ `pkg/cmd/repair.go` (+40 -0) 📝 `pkg/cmd/repair_file_mime_types.go` (+19 -8) 📝 `pkg/cmd/repair_orphan_positions.go` (+29 -10) 📝 `pkg/cmd/repair_projects.go` (+2 -2) 📝 `pkg/cmd/repair_task_positions.go` (+2 -2) 📝 `pkg/files/repair.go` (+11 -8) 📝 `pkg/models/task_position.go` (+11 -4) 📝 `pkg/modules/migration/helpers_test.go` (+6 -5) </details> ### 📄 Description ## Summary Consolidate four scattered repair/maintenance CLI commands into a unified `vikunja repair` parent command with subcommands. ## Changes | Old Command | New Command | |-------------|-------------| | `repair-file-mime-types` | `repair file-mime-types` | | `repair-task-positions` | `repair task-positions` | | `repair-projects` | `repair projects` | | `delete-orphan-task-positions` | `repair orphan-positions` | ## Features - All repair commands are now unified under `vikunja repair` - All subcommands support `--dry-run` to preview changes without making them - Standardized command naming and help text ## Files Changed | File | Action | |------|--------| | `pkg/cmd/repair.go` | Created - parent `repair` command | | `pkg/cmd/repair_task_positions.go` | Modified - registered under `repairCmd`, renamed to `task-positions` | | `pkg/cmd/repair_projects.go` | Modified - registered under `repairCmd`, renamed to `projects` | | `pkg/cmd/repair_file_mime_types.go` | Modified - registered under `repairCmd`, renamed to `file-mime-types`, added `--dry-run` | | `pkg/cmd/maintenance.go` | Renamed to `pkg/cmd/repair_orphan_positions.go` - registered under `repairCmd`, renamed to `orphan-positions`, added `--dry-run` | | `pkg/files/repair.go` | Modified - added `dryRun` parameter to `RepairFileMimeTypes()` | | `pkg/models/task_position.go` | Modified - added `dryRun` parameter to `DeleteOrphanedTaskPositions()` | ## Usage ```bash # Show all repair subcommands vikunja repair --help # Preview what would be fixed vikunja repair task-positions --dry-run vikunja repair projects --dry-run vikunja repair file-mime-types --dry-run vikunja repair orphan-positions --dry-run # Actually run the repairs vikunja repair task-positions vikunja repair projects vikunja repair file-mime-types vikunja repair orphan-positions ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:04:22 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8175