fix(migration): import TickTick data by column name instead of index #1356
No reviewers
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#1356
Loading…
Reference in New Issue
No description provided.
Delete Branch "kooshi/api:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A new column "Kind" was inserted to index 3 in the csv.
Also, handling of parent tasks was incorrect (parent id and task id were both reading from index 21)
@ -213,2 +212,3 @@
parentID, err := strconv.ParseInt(record[23], 10, 64)
if err != nil {
return err
parentID = 0
Isn't the
parentID
already0
if there's an error?If we're ignoring the error anyway we might as well just remove the if and do something like
parentID, _ := strconv.ParseInt(record[23], 10, 64)
.I think the tests only check if the conversion from TickTick's structure to Vikunja's works, not if the csv is correctly parsed. Do you want to add tests for that?
It's probably a good idea to switch the csv parsing to something like https://github.com/gocarina/gocsv so that we can avoid issues like this where they shuffle columns or add new ones in between in the future. (not in this PR though)
Any update here?
Resolves this issue: https://github.com/go-vikunja/api/issues/61
fix ticktick migration, still need to update test to matchto fix(migration): import TickTick data by column name instead of indexNow updated to pull the data by name from the csv file instead of relying on column indexes.
Thanks for your effort!