Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, the 'update status' action in a followup only occurs if the file tests being returned are for the last file in the stack. This means no status update if the test is, for example, followed by an interdiff.
Comment | File | Size | Author |
---|---|---|---|
#14 | 2169435_v3.patch | 1.4 KB | jthorson |
Comments
Comment #1
drummWe could
A) Update the status if the file is displayed. The logic would be the most straightforward of the options.
B) Update the status if the file is attached to the most recent comment with added files. The logic might not be fun; although the node changes API could help. This would most-closely extend the current logic.
I'm not sure what makes sense to more people in the issue queue. I am okay with either.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedI think (a) is enough: mark the whole issue as needs work when one of its displayed patch failed testing.
Comment #3
BerdirHm.
The idea is that you can do this:
File1: test-only.patch
File2: test-and-fix.patch
File3: interdiff.txt
This used to work more or less implicitly on 6.x because it only updated the issue status if no other patches were being processed, so the last one often also came back last and the test-only did not set it to needs work.
I guess this is an attempt to support this explicitly?
What about applying the "should-this-file-be-sent-to-testbot" function/logic on the filenames, and basically check if it's the latest file that is named so that it's tested?
Comment #4
jthorson CreditAttribution: jthorson commentedMy thoughts align with Berdir's suggestion ... changing things to be the 'last testable' file instead of the 'last file' in the stack.
The motivation in changing this behavior for D7 was to clean up a few inconveniences that the old behavior was causing in the issue queues:
- Random (drive-by?) retesting of old patches which no longer apply would cause issues to be bumped to 'needs work', even though the conversation and followup patches have rendered the tested patch as completely irrelevant, and
- Patch 1 gets uploaded and starts testing, problem found, and corrected Patch 2 is uploaded and starts testing ... Patch 2 completes first (and successfully), followed by the Patch 1 failure which causes the status to be incorrectly changed to 'needs work'.
- Inconsistent behavior for issues containing 'test-only' and 'test-plus-patch' patches, depending on the order they were uploaded/tested ... as Berdir points out, this makes the behavior consistent.
Comment #5
jthorson CreditAttribution: jthorson commentedI think this should resolve things ... however, I may not be able to fully test until later this week or weekend.
Comment #6
BerdirLooks correct to me on a visual review. variable names could some improvements.
What you have there aren't really files, they are file field items. So maybe "foreach ($reversed_file_items as $file_item)"
And using $file_items = field_get_items($node, 'field_issue_files') would allow you to clean up that language stuff a bit, you don't have to mess with 'und' then. field_set_items() unfortunately never made it into core, so you still have to use the constant there.
Comment #7
jthorson CreditAttribution: jthorson commentedGreat suggestions ... Thanks!
Comment #8
sunWhile noticing an
array_reverse()
in this patch...Part of the issue might also be this observation:
When attaching multiple files, the UI makes it appear as if you'd add them in the intended order, but:
After submitting (saving), the files that you attached are actually attached in the reversed order.
Once you notice, next time you try, you can actually take the extra experimental course of clicking the "Show row weights" link that happens to be there. And indeed, after disabling the tableDrag JavaScript:
When attaching new files, the weight of a new file has a "negated" weight compared to all other/existing files.
In turn, first == last, and first != first.
Comment #9
jthorson CreditAttribution: jthorson commented#8: That is true, which is why the array_reverse() was required. The 'latest' patch is the last item on the array stack, even though it is displayed as the 'first' item in the UI.
After saving, the files are attached in the 'normal' manner (i.e. how core traditionally handles a multiple-file array) ... but the display is tweaked in order to show the most recent file at the top instead of having to scroll down through what could be a very long list of files. The weight value is tweaked only to ensure the desired display order, but it is negated again during save to ensure consistency in the stored data. Otherwise, the display order would toggle on each save.
Comment #10
sunYeah, I'm just not sure whether the tableDrag JS was also adjusted accordingly — whenever I'm trying to ensure that the .patch appears first (as opposed to the interdiff), I get an unexpected result.
But I merely wanted to note that ordering aspect in case it's relevant. Looks like it's not and the UX issue I'm talking about is a different issue. Thanks! :)
Comment #11
jthorson CreditAttribution: jthorson commentedAh, gotcha ... because the display is flipping everything, any attempt to order the patch/interdiff is going to end up reversed on the stack; resulting in the opposite behavior from what you were probably expecting.
Comment #12
drummSee #2098099: The issue queue *must* make it easier to upload/review patches and #2102365: Improve file list layout on node edit form for background on file reversal.
Comment #13
jthorson CreditAttribution: jthorson commentedCleaned up (and fixed).
Comment #14
jthorson CreditAttribution: jthorson commentedOoops.
Comment #15
jthorson CreditAttribution: jthorson commentedCommitted in http://drupalcode.org/project/project_issue_file_test.git/commit/34f2993...
Merged to bzr, and deploying to prod.