Sort patches in a series based on patch number. - #5
Conversation
igsilya
left a comment
There was a problem hiding this comment.
The order is not random, it's the order in which the patches are in patchwork database, i.e. ordered by ID. May be good to re-word this in the commit / PR description. But I agree that not having them sorted by a patch number is annoying.
We'll need a small TestSeriesToRow* test for this though. Or at least a modification of the main TestSeriesToRow to minimally check the sorting behavior.
Also, LLMs point out that the comment in TestCompareStartsAtSelectedPatch about the patch order by ID is stale after this change, so will need an adjustment.
You should also use tui: as a subject prefix for the commit.
Thanks!
When pressing space to expand a series, the patches are listed in order based on their patch ID. This does not always align with the ordering of the patches in the series. This can make it difficult to view patches in order or notice on large series that patches are missing (usually due to patchwork errors). This commit sorts the patches based on patch number. This solves the issues stated above. Signed-off-by: Mark Michelson <mmichels@redhat.com>
aaa5d9e to
0e82048
Compare
|
Hi Ilya, I noticed that I did not address the finding about the outdated comment in This should instead say that patches are sorted by patch number. I also noticed this comment: However, I'm not going to update this since this patch does not affect how the patches are stored in the DB. |
Word 'position' is used here instead of the 'patch number', but I suppose it's fine, it means the same thing in this context. Can keep as is.
You're right, this is about order in the database and not in the UI. The LLM hallucinated a lot on this run. Let's keep as is as well. |
igsilya
left a comment
There was a problem hiding this comment.
Thanks for adding the tests. Though you're trying to fix the UI in case the ID order doesn't match the actual patch order, but it seems like none of the tests are actually covering this scenario. Also, it may be better to define an array of test cases and then run them in a loop with a common logic, but diferent data, as we do in other tests. Will probbaly save some LOCs. The specific original order preserved message is probably not necessary, the tests are small enough to understand the intention.
When pressing space to expand a series, the patches are listed in an arbitrary order. This can make it difficult to view patches in order or notices on large series that patches are missing (usually due to patchwork errors).
This commit sorts the patches based on patch number. This solves the issues stated above.