This issue is to start providing test results for branches on project pages. The results are provided on a separate tab, by default available only to project owners.
In addition to current testing status, retests of any branch can be requested.
OP by catch: Opening this as a follow-up to #694876: Current status page and Drupal.org block.
It would be really nifty to have a test summary (passes/fails/exceptions) on Drupal.org project pages. This data is per-branch, but to me it feels like overloading the download block would get really cluttered, so was thinking maybe a block, or in a similar location to the project usage stats.
Not sure how this works but I imagine something like this:
1. qa.drupal.org provides a service to get branch status (per branch or per project).
2. Add a block (drupalorg? somewhere else?) that pulls this into the project page.
Comment | File | Size | Author |
---|---|---|---|
#50 | pift.add_testing_tab-1228462-50.patch | 23.41 KB | jthorson |
#49 | pift.add_testing_tab-1228462-49.patch | 23.41 KB | jthorson |
#39 | pift.add_testing_tab-1228462-39.patch | 22.98 KB | jthorson |
#38 | pift.add_testing_tab-1228462-38.patch | 22.95 KB | jthorson |
#37 | pift.add_testing_tab-1228462-37.patch | 22.95 KB | jthorson |
Comments
Comment #1
jthorson CreditAttribution: jthorson commentedI've created a new module, project_testing_status, which provides an 'Automated Testing' tab on the Project page. The contents of the tab consist of a drop-down box with the available releases for a project, as well as the testing results for the currently selected release.
This tab will appear for logged in users, if the project has any official releases.
The code is currently available in a sandbox at http://drupal.org/sandbox/jthorson/1238958. Once it's been reviewed, and assuming there is some buy-in for moving this to d.o, I'll promote the project and create an official release so that we can open an infrastructure ticket to request d.o deployment.
Pictures attached.
Comment #2
catchScreenshots looks great to me. I was thinking a block but multiple branches makes that very tricky.
Comment #3
rfayI've enabled the module on http://drupal.drupalorg.dev2.c--g.net; you can log in there with your regular d.o password (or contact me and I'll get you in). Note that clean urls are not enabled, so that can be confusing if you're a direct URL typer.
It seems to work wonderfully. I noted some discrepancies in #1277258: Terminology discrepancies and confusion.
+1
Comment #4
rfayI took a tour through the code and found nothing objectionable.
Comment #5
dwwSlick! In general, this would be a great feature. We'd love to make testing and test results more visible on d.o as a module health metric. As soon as this lands, we'll want a spin-off issue about stuffing some kind of summary of this data into the solr document for each project so that we can do ranking and filtering of contrib based on the presence of tests, if they're passing, etc.
In terms of the screenshots in #1, any reason not to just have a table with 1 row of status results for each supported branch? Not sure why we need a form on this page at all. Is the worry that the table will be info overload? Seems like there aren't going to be *that* many branches at any given time, and it'd be easier to just display the data instead of asking users to navigate form elements. Plus, might be nice to compare test results across branches, which the current UI makes very difficult since you can't see the results next to each other.
I'm also slightly concerned about "tab-bloat" on project pages. The bluecheese theme doesn't make those local tabs particularly visible in the first place (so folks might not even see this up there). And then there's the problem of how many tabs we've already got. I have nothing constructive to propose as an alternative, but I'm just sharing my concern in case anyone has a bright idea of a better way/place to display this data on project pages. ;)
In terms of the code: it's not obvious why this is a whole separate project/module. But, I'm far removed from the PIFR development universe, so my opinion doesn't really count for much. ;) Therefore, I'll just shut up about that and let y'all decide the best place for this code to live. I haven't looked at the code itself, so I can't enumerate any objections there.
Thanks,
-Derek
Comment #6
jthorson CreditAttribution: jthorson commentedI went with the select box for a few reasons:
As for the 'seperate module' approach, I was simply trying to avoid colliding with the current project_dependency efforts going on with PIFT, and thought doing this as a standalone might be less confusing than trying to add yet another moving piece to the puzzle. In addition to not muddying the waters for the rest of the PIFT work, this avoids creating an artificial dependency between this and the project_dependency work ... so that an issue or concern with one doesn't cause delays for the other. That said, folding this into the PIFT module directly does make a lot of sense.
Comment #7
dwwRe: select box:
- git instructions has a select box since the entire contents of that page changes depending on what branch you said you want to work on (since all of the examples are updated to reflect the currently active branch). That makes sense for that page. In this case, it makes less sense. ;) It's just a table with some rows where each row has the same columns but potentially different values. Tables are good for that sort of info...
- Nothing says you have to display results for all branches and tags. The table would only have rows for branches that *have* tests.
- Nothing says you must restrict to release branches in the table. Granted, a project that goes nuts with tons of feature branches and other stuff, each of which has testing enabled, could get messy. To mitigate that mess, you could certainly order the table so all the mainline release branches are at the top. Point is, I'd rather not make the experience more clumsy for the vast majority of projects just in case some day there are projects with lots of branches with test results.
Stepping back: I'd love to see some thought go into if/how this integrates/interacts with the "Releases" subtab when editing a project, e.g.:
http://drupal.org/node/313122/edit/releases
and also the "Testing" fieldset on the "Issues" subtab (which is itself a bit of a confusing place for that to live, especially now that testing it's just tied to patches in the issue queue). It'd sure be nice to think about this stuff a bit more holistically, come up with a good plan for all these various testing-related UI elements and how they all fit together into a sane and grokable whole, and then have patches or modules that implement various aspects of the plan. There's an equivalent problem with managing releases themselves -- it'd be great if we didn't replicate that mistake with all the testing-related UI on project nodes.
Comment #8
rfay@dww #1277756: Just show all branches on page (no select process)
Comment #9
dww@rfay: Cool, thanks. I replied there.
Cheers,
-Derek
Comment #10
jthorson CreditAttribution: jthorson commentedI'm not sure it makes sense to tie this in with the 'releases' tab ... I've been working hard to remove the test/release dependency in the rest of the testing infrastructure so that it can be leveraged for sandboxes, core initiatives, forked repositories, etc ... all things which probably do not have associated releases.
That said, it may make sense to move the current 'Enable Testing' checkbox on the 'Issues' subtab over to a per-release 'enable testing' checkbox in the Releases subtab/table ... though changing the logic from 'per project' to 'per release' might also require some associated refactoring inside of PIFT.
Comment #11
dwwSorry I wasn't clear. I'm not talking necessarily about tying this directly to the releases table. However, from the perspective of a project maintainer, it'd be nice if there was a single "dashboard" where you manage your branches and releases and stuff. It's already a bit confusing that there's the page I linked and screenshot'ed above, but there's nothing there to add new releases, etc. From a code perspective, what's happening with this project is probably fine. But from a drupal.org UI/UX perspective, it's just making a bad situation (which is mostly my fault) worse (which is your "fault"). ;) Which is why I'm raising it here. That doesn't mean I want to torpedo this effort (far from it). But, I'm asking if we can at least think about things from the "I just maintain projects on d.o" perspective and consider what would be best for them, instead of only thinking of things from the "I maintain the Project* codebase" or "I maintain the PIFR codebase" perspective and consider what's best for us. Make sense?
Thanks,
-Derek
Comment #12
dwwp.s. Another example of a setting related to Branches and Stuff(tm) that needs a good home is here: #1074960: Let maintainers set a default branch on git repositories. If we're not careful, that's going to live on Yet Another Tab or something. That's the situation I'm trying to resolve, ideally before we just deploy everything separately and then try to unify things at some later (perhaps never to arrive) date when everyone will be confused since things moved around again. If it was easy to Do It Right(tm) in the first place and make the UI not crazy, that'd be better, so that we don't roll out new features and then re-shuffle everything a few weeks/months down the line. See what I mean? That said, these are all not exactly related features, and they're all coming from separate modules (for good reason) so it's harder to get all the moving pieces to play nicely together.
I'm not demanding that everything be unified before we deploy anything.
I'm just requesting that we think about the d.o contributor's experience before we plow ahead with the Easiest To Implement(tm) solution and say "we'll worry about usability and user experience later".
Thanks,
-Derek
Comment #13
jthorson CreditAttribution: jthorson commentedGotchya ... thanks for the clarification.
Sounds like we need to ask someone on the Prairie Initiative to show us the end-game vision, so that we can make sure we're aligning to it in the long run. *wink*
Comment #14
webchickSubscribing!!
Comment #15
jthorson CreditAttribution: jthorson commentedRefactored code now available in sandbox repo, and demo available at http://rfay.redesign.devdrupal.org/node/3060/testing-status
Comment #16
rfayI like it.
Went to a project that has testing for both 6 and 7 (role_change_notify) and note that it doesn't show or offer to test 7.x-1.x (because this is a sanitized, limited site?). Also, it only offers tags for testing, not branches. Should it offer those tags? Will people want to test tags?
Comment #17
jthorson CreditAttribution: jthorson commentedCurrently, it restricts the list to releases only ... there's code in the project to list all branch/tags instead of just releases, but until PIFT can officially support tags, I call the 'get releases' function instead of the 'get versions' function.
Hmmm ... that doesn't explain why 6.x-2.x didn't show up ... I'll have to dig into that again!
Comment #18
jthorson CreditAttribution: jthorson commentedUm ... brainfart. It's already showing a test result for 6.x-2.x.
7.x-1.x-dev doesn't show up in the versioncontrol_labels table for that project, so it didn't get included it in the list. I'm assuming that all releases (-dev included) should be in this table (edit: And this case was simply due to having a truncated database); if this is incorrect, then please enlighten me. :)
Comment #19
jthorson CreditAttribution: jthorson commentedK ... setting back to 'needs review'.
I think I'm leaning towards leaving this as a seperate project, rather than folding it into PIFT ... the main reason behind this is that I had to hardcode a drupal.org specific taxonomy id check into the code, in order to distinguish between module nodes and project nodes; and I'd prefer not to pollute PIFT with d.o specific code.
Comment #20
rfayIf I'm not mistaken we should move this over to infra queue; When it's RTBC it should be tagged "needs drupal.org deployment"
Comment #21
jthorson CreditAttribution: jthorson commentedCode has been refactored to remove the drupal.org specific code ... now adds a 'select project types for which to display test results' option on the PIFT admin settings page.
Comment #22
jthorson CreditAttribution: jthorson commentedSeeing that this is really just exposing the existing PIFT data on a site running PIFT, I think it makes more sense as a feature addition to PIFT (or pift sub-module) as opposed to a seperate project on it's own.
I've refactored the module into the following patch against PIFT. I know that we just recently packaged a new PIFT release, but it would be really nice to include this in the next iteration deployed on d.o.
Comment #23
jthorson CreditAttribution: jthorson commentedNote: After applying the patch, you'll need to go to /admin/project/pift and select the project types for which the testing tab should appear (under the 'Results Display' fieldset).
Comment #24
dwwYay, I think that's a wise move. Thanks, jthorson!
Once this is committed and the feature request is marked "closed (fixed)", you can then add the "needs drupal.org deployment" tag to indicate that a fixed change that's already "upstream" in the Git repo is ready to actually deploy. If there's a new point release at that time, great, indicate what tag it's included in in the comment that adds the tag. If not, we can always deploy from the end of a branch.
Cheers,
-Derek
Comment #25
jthorson CreditAttribution: jthorson commentedSlight tweak ... lack of results was throwing a PHP watchdog warning.
Comment #26
webchickTagging.
Comment #27
jthorson CreditAttribution: jthorson commentedPatch still applies against 6.x-1.x-alpha6.
Comment #28
jthorson CreditAttribution: jthorson commentedThis version should also address the 'retest' link leading to /node, and empty $title variables in the drupal_set_message notification.
Comment #29
jthorson CreditAttribution: jthorson commentedRe-roll ... missing a file.
Comment #30
jthorson CreditAttribution: jthorson commentedAnd ... still missing in #29.
Comment #31
jthorson CreditAttribution: jthorson commentedRedirect still broken.
Comment #32
jthorson CreditAttribution: jthorson commentedYet another attempt.
Comment #33
jthorson CreditAttribution: jthorson commentedSooo ... incredibly ... close ...
Finally, this one works.
Comment #34
jthorson CreditAttribution: jthorson commentedMay be resulting in duplicate entries in pift_test ... need to sleep on this one.
Comment #35
jthorson CreditAttribution: jthorson commentedDuplicate entries were due to PIFT and PIFR auto-increment counters getting out of sync. Back to 'needs review'.
Also deployed on rfay.redesign in conjunction with scratchtestbot, ready for testing.
Comment #36
jthorson CreditAttribution: jthorson commentedOccasionally, a branch tests seems to get stuck in a 'sent' state ... on other words, PIFR completes the testing, but PIFT does not update the status of the test. Because the 're-test' link was only enabled for tests with pass/fail status, there was nothing that a normal user could do to un-stuck this scenario.
This patch enables the 're-test' link for tests in the 'sent' status as well.
Comment #37
jthorson CreditAttribution: jthorson commentedNo good ... re-test routine explicitly fails if the test is in the 'sent' status.
New approach is to add a 'delete' link when in the 'sent' state, which is where the tests appear to get stuck.
Comment #38
jthorson CreditAttribution: jthorson commented... except that it keyed off the wrong status. *grrrrr*
Comment #39
jthorson CreditAttribution: jthorson commented... and the 'delete' button was marked 're-test'. *rolls eyes*
Comment #40
Lars Toomre CreditAttribution: Lars Toomre commentedSiily question ... For performance reasons, I had been instructed it was better to use
I am not sure how PHP does caching and which is more performant in the above example. Thoughts?
Comment #41
rfay@Lars Toomre I would be very surprised if there is a relevant performance difference in those.
In so much of Drupal PHP code performance issues become irrelevant because of how much database work goes on. It's quite unusual that a difference like this (if it matters at all) is relevant to overall performance.
Code structure, algorithm choice, and limiting database accesses matter a lot. PHP oddities, not so much.
Comment #42
Lars Toomre CreditAttribution: Lars Toomre commentedAs I said it was a silly question... However, isn't the first alternative in #40 generally better?
Comment #43
rfayJust took this for a test ride on rfay.redesign.devdrupal.org (test rides can be arranged for anybody, or do a drush upwd over there to set your password).
I was delighted by everything I saw. It all worked perfectly. Made me want to do all kinds of feature requests. I haven't studied the code yet, but fully support this. Looks great to me.
Comment #44
rfayA long-needed related feature request that we may want to graft onto this UI later (so we should maybe think where it goes): #791818: Contrib modules need to be tested regularly against core (and notify maintainer).
Comment #45
skottler CreditAttribution: skottler commentedsub
Comment #46
rfayComment #47
rfayThese are all nits, and IMO this is pretty well ready to go. I also think it's low-risk for d.o. But perhaps you'll be willing to discuss some of these.
How about "Request retest of a file or branch" ?
Request deletion of a test ?
IMO we should have a permission associated with this as well. We may want to open this up to everybody, or not...
Hate to do this. Let's make it more resilient somehow. It will be a short time before this is a bug.
I haven't really checked, but is $test['test_id'] user-entered code? Do we need to check_plain it?
Same question (needs check_plain()?)
Do we usually do this? I'm not in the habit... But I don't know.
Doc params and actual params don't match. ($version)
Oh... and how does this work with $form not being the first param? Is this not called by drupal_get_form()?
It seems that Drupal practice is to capitalize SQL reserved words.
And in all of these.
Just want to make sure here that $label_ids is not user-entered code or gameable, or this would be a security issue.
A silly nit, but we're building the row, not formatting it right (as theme() is doing that for us)? So maybe pift_results_build_testresult_row()?
I really hate our use of numeric literals in PIFT and PIFR. Can we use a define here (and everywhere else). I would rather these were strings in the database even, but we're not going to do that now.
Comment #48
dwwAs the form builder function, it's the responsibility of
pift_results_test_branch_form()
to return the $form. $form_state is an argument to form builders, but not the $form itself.---
Using db_placeholders() like that is exactly how to prevent SQL injection in case $label_ids are user-generated. Not using db_placeholders() and directly including $label_ids in the query string would be the security hole.
---
Otherwise, I agree with all of rfay's review points here.
Re: @author: Yeah, some people feel strongly that including @author is a bad thing since it encourages people to think someone else "owns" that code and that they shouldn't contribute to it. It's also weird once people start patching the file, how much ownership rfay should have after a thorough review like this, etc. See http://groups.drupal.org/node/81679 for more.
Cheers,
-Derek
Comment #49
jthorson CreditAttribution: jthorson commentedHow about "Request retest of a file or branch" ?
- Changed
Request deletion of a test ?
- Changed
IMO we should have a permission associated with this as well. We may want to open this up to everybody, or not...
- Added
Let's make it more resilient somehow. It will be a short time before this is a bug.
- Added pift_valid_prefix_list, which loads from the terms as selected in the pift_core variable. Still need to add new versions to the setting form each major release, but at least you won't need a change here.
I haven't really checked, but is $test['test_id'] user-entered code? Do we need to check_plain it?
- $test_id is user submitted ... which is why I added the check_plain. Of course, $test_id != $test['test_id'] ... so it's been removed.
Do we usually do this? I'm not in the habit... But I don't know.
- Seemed to be the standard for the other PIFT files ... I don't normally do it either. In this case, it was a cut-and-paste file doc block.
Doc params and actual params don't match. ($version)
- Fixed
It seems that Drupal practice is to capitalize SQL reserved words.
- Fixed
A silly nit, but we're building the row, not formatting it right (as theme() is doing that for us)? So maybe pift_results_build_testresult_row()?
- Changed
I really hate our use of numeric literals in PIFT and PIFR. Can we use a define here (and everywhere else). I would rather these were strings in the database even, but we're not going to do that now.
- Changed to use PIFT_STATUS_SENT
Uploading patch ... still need to validate it on qa.scratch.
Comment #50
jthorson CreditAttribution: jthorson commentedRe-roll ... previous patch had two minor issues - with major consequences.
Comment #51
jthorson CreditAttribution: jthorson commentedCommitted to 6.x-2.x (0f1228a)
Comment #52
rfayJust a ping on #791818: Contrib modules need to be tested regularly against core (and notify maintainer), which is so closely related. We can just add a checkbox, right "I want to be notified by email"
Comment #53.0
(not verified) CreditAttribution: commentedAdded a new issue summary.