-
Notifications
You must be signed in to change notification settings - Fork 56
Fixed UDA & priority orders #366
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
base: 2.x
Are you sure you want to change the base?
Fixed UDA & priority orders #366
Conversation
Thanks for the PR. I will tell you up front that we have to be very careful with the sorting code, in particular because it's a real performance bottleneck for large reports -- some of my feedback will be addressing that.
|
@thehunmonkgroup Thank you for your quick reply. |
I've updated the code based on your suggestions, in commit 95863fa Updated
TestingFor the performance concern, I tested with the following settings:
and used a report like:
With around 250 tasks, I didn't notice significant difference in rendering speed. I'm not entirely sure if I’ve fully understood your suggestions, so please let me know if there are still any issues with my approach. |
I've made a small refinement to the sort logic in 19a59fa |
We're heading in a bit of the wrong direction here. We definitely do not want to keep a hard-coded list of non-UDA values around, that's brittle. In fact, we shouldn't be parsing the UDA config in this code at all, that should be the job of I've added 6625681 to handle parsing UDA values as part of Also in 921f9fd I fixed a bug you would have introduced by stripping trailing commas from string values. Those are valid values, the value being an empty string. So refactor your approach to inspect |
Here's a dummy install script that can be used to test the performance of your change: custom-sort-dummy-install.sh.txt Make that executable and run it, and it will create about 4200 tasks in a temporary install, and give you instructions about how to execute VIT to access it, with this config: data.location=$TASK_DIR
uda.test.values = one,two,three,
uda.test.type = string
# Report sorted by priority ascending
report.priorityasc.description=Tasks sorted by priority (Ascending)
report.priorityasc.columns=id,priority,project,due,description
report.priorityasc.filter=priority.not:
report.priorityasc.sort=priority+,id+
# Report sorted by priority descending
report.prioritydesc.description=Tasks sorted by priority (Descending)
report.prioritydesc.columns=id,priority,project,due,description
report.prioritydesc.filter=priority.not:
report.prioritydesc.sort=priority-,id+
# Report sorted by test ascending
report.testasc.description=Tasks sorted by test (Ascending)
report.testasc.columns=id,test,project,due,description
report.testasc.filter=test.not:
report.testasc.sort=test+,id+
# Report sorted by test descending
report.testdesc.description=Tasks sorted by test (Descending)
report.testdesc.columns=id,test,project,due,description
report.testdesc.filter=test.not:
report.testdesc.sort=test-,id+ Once you get your PR sorted, I'd recommend running each of those reports several times with and without your change to check on the performance hit, and well as standard reports which don't use the custom comparator. That will allow us some confidence that the change will not negatively impact performance. Really, it's most important that it doesn't impact performance when sorting on columns other than UDA string type, as I think it's reasonable to give up a little performance on the string type sorting in exchange for it actually sorting correctly. ;) |
Thank you for the detailed explanation and for even updating the main branch to support my changes — I really appreciate it! |
I noticed that you wrote that shell script ! Thank you so much !
Results:upstream/2.xpriorityasc, prioritydesc, testasc, testdesc: around 2 seconds My forkpriorityasc, prioritydesc, testasc, testdesc: around 2 seconds I measured the time manually using the timer app on my iPhone ^^; Please let me know if there are still any concerns or improvements needed. |
Something about the PR seems off, I'm seeing changes listed in |
I'm sorry for the trouble. I'm still not fully familiar with how GitHub and forks work... I suspect that the issue may have been caused by accidentally running Is the following the correct approach for me to take? git reset --hard HEAD~2
git rebase upstream/2.x
# git add & commit
# Add my fix again
# git add & commit Or, should I make new PR with another branch created with current |
i don't think you need to reset hard. if you have the latest 2.x code locally, a |
after the |
fc10765
to
5e18917
Compare
Thank you. I tried But I'm not sure my procedure is right... |
The code looks the same, see here: Another way to approach this is to do a hard reset to a commit before your work started, then merge 2.x to get to the tip of that branch, then manually apply your changes and commit them, then do a force push with Most importantly, look at the 2.x branch, it already contains the code in |
Consider priority and UDA orders in taskrc, such as
uda.priority.values = H,M,L,
.Note that this only works if the UDA type is set to string.
taskrc:
Before:

H -> L -> M (Wrong... Alphabetically...)
After:

H -> M -> L (Correct !)
This is my first pull request on GitHub.
Please let me know if there are any issues or if I've made any mistakes.