[PR #2072] [MERGED] feat(migration/todoist): migrate from Sync API v9 to API v1 #9752

Closed
opened 2026-04-23 09:11:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2072
Author: @kolaente
Created: 1/8/2026
Status: Merged
Merged: 1/9/2026
Merged by: @kolaente

Base: mainHead: feat-todoist-api-v1


📝 Commits (10+)

  • 59424c6 feat(migration): add DoGetWithHeaders helper for Todoist API v1 migration
  • 8a3aa12 feat(migration/todoist): update sync endpoint to API v1
  • 15fde0c feat(migration/todoist): update completed tasks to API v1 with cursor pagination
  • 69773e2 feat(migration/todoist): update archived projects and project data to API v1
  • 968dd95 refactor(migration/todoist): remove unused types after API v1 migration
  • 690c550 fix(migration/todoist): URL-encode cursor tokens in pagination
  • 9b30a8d fix(migration/todoist): close response bodies immediately after decoding
  • 501ed0a refactor(migration): use RetryWithBackoff helper in DoGetWithHeaders
  • 2efa832 feat(migration): improve error handling in DoGetWithHeaders
  • f60175d refactor(migration): use RetryWithBackoff helper in DoPostWithHeaders

📊 Changes

2 files changed (+133 additions, -73 deletions)

View changed files

📝 pkg/modules/migration/helpers.go (+66 -39)
📝 pkg/modules/migration/todoist/todoist.go (+67 -34)

📄 Description

Summary

Migrates the Todoist migration module from the deprecated Sync API v9 to the new unified Todoist API v1.

Changes

  • Add DoGetWithHeaders helper function for HTTP GET requests with custom headers
  • Update main sync endpoint from /sync/v9/sync to /api/v1/sync
  • Update completed tasks endpoint from /sync/v9/completed/get_all to /api/v1/tasks/completed
    • Changed from POST to GET
    • Implemented cursor-based pagination (replacing offset-based)
  • Update individual task fetch from /sync/v9/items/get to /api/v1/tasks/{task_id}
    • Changed from POST to GET
    • V1 API returns task directly instead of wrapped in item object
  • Update archived projects endpoint from /sync/v9/projects/get_archived to /api/v1/projects/archived
    • Changed from POST to GET
    • Implemented cursor-based pagination
  • Update project full data endpoint from /sync/v9/projects/get_data to /api/v1/projects/{project_id}/full
    • Changed from POST to GET
  • Remove unused types (itemWrapper, doneItemSync) after migration

Reference

Test plan

  • Build passes (mage build)
  • Unit tests pass (mage test:filter TestConvertTodoistToVikunja)
  • Lint passes (mage lint)
  • Manual testing with real Todoist account (requires API credentials)

🔄 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/2072 **Author:** [@kolaente](https://github.com/kolaente) **Created:** 1/8/2026 **Status:** ✅ Merged **Merged:** 1/9/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `feat-todoist-api-v1` --- ### 📝 Commits (10+) - [`59424c6`](https://github.com/go-vikunja/vikunja/commit/59424c695d1cece11b7a11f74336d20360985b89) feat(migration): add DoGetWithHeaders helper for Todoist API v1 migration - [`8a3aa12`](https://github.com/go-vikunja/vikunja/commit/8a3aa1264453008d74fb0c7e7fdbd6d892f9c3b7) feat(migration/todoist): update sync endpoint to API v1 - [`15fde0c`](https://github.com/go-vikunja/vikunja/commit/15fde0c1633d9dea9b6ea91e59ec80512e5b7f26) feat(migration/todoist): update completed tasks to API v1 with cursor pagination - [`69773e2`](https://github.com/go-vikunja/vikunja/commit/69773e2beb0d99a4bc0b87f9d1a9bc733c045768) feat(migration/todoist): update archived projects and project data to API v1 - [`968dd95`](https://github.com/go-vikunja/vikunja/commit/968dd95f7e9c706d34782b19e56b120d64d00ca7) refactor(migration/todoist): remove unused types after API v1 migration - [`690c550`](https://github.com/go-vikunja/vikunja/commit/690c5505050b4d3373967e9b2de91efa032aff4f) fix(migration/todoist): URL-encode cursor tokens in pagination - [`9b30a8d`](https://github.com/go-vikunja/vikunja/commit/9b30a8d74b62e7a42c2caa973972d39c2a0fda9b) fix(migration/todoist): close response bodies immediately after decoding - [`501ed0a`](https://github.com/go-vikunja/vikunja/commit/501ed0aa2bcdb9f988b003db58fcb53440b35bdf) refactor(migration): use RetryWithBackoff helper in DoGetWithHeaders - [`2efa832`](https://github.com/go-vikunja/vikunja/commit/2efa83222e4602cfa5746e0209018941421148fb) feat(migration): improve error handling in DoGetWithHeaders - [`f60175d`](https://github.com/go-vikunja/vikunja/commit/f60175d4c4a0fc07638e810942c10f62e9882a9a) refactor(migration): use RetryWithBackoff helper in DoPostWithHeaders ### 📊 Changes **2 files changed** (+133 additions, -73 deletions) <details> <summary>View changed files</summary> 📝 `pkg/modules/migration/helpers.go` (+66 -39) 📝 `pkg/modules/migration/todoist/todoist.go` (+67 -34) </details> ### 📄 Description ## Summary Migrates the Todoist migration module from the deprecated Sync API v9 to the new unified Todoist API v1. ### Changes - Add `DoGetWithHeaders` helper function for HTTP GET requests with custom headers - Update main sync endpoint from `/sync/v9/sync` to `/api/v1/sync` - Update completed tasks endpoint from `/sync/v9/completed/get_all` to `/api/v1/tasks/completed` - Changed from POST to GET - Implemented cursor-based pagination (replacing offset-based) - Update individual task fetch from `/sync/v9/items/get` to `/api/v1/tasks/{task_id}` - Changed from POST to GET - V1 API returns task directly instead of wrapped in `item` object - Update archived projects endpoint from `/sync/v9/projects/get_archived` to `/api/v1/projects/archived` - Changed from POST to GET - Implemented cursor-based pagination - Update project full data endpoint from `/sync/v9/projects/get_data` to `/api/v1/projects/{project_id}/full` - Changed from POST to GET - Remove unused types (`itemWrapper`, `doneItemSync`) after migration ### Reference - [Todoist API v1 Migration Guide](https://developer.todoist.com/api/v1#tag/Migrating-from-v9) ## Test plan - [x] Build passes (`mage build`) - [x] Unit tests pass (`mage test:filter TestConvertTodoistToVikunja`) - [x] Lint passes (`mage lint`) - [ ] Manual testing with real Todoist account (requires API credentials) --- <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-23 09:11:39 -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#9752