Comments

jthorson’s picture

StatusFileSize
new20.92 KB

Updated.

jthorson’s picture

New issue: Re-queuing multiple branches on the same project node at the same time results in each node overwriting the previous in the 'queued' table.

jthorson’s picture

StatusFileSize
new23.68 KB

Update.

jthorson’s picture

StatusFileSize
new23.88 KB

This time, I'll save the files before generating the patch. *facepalm*

jthorson’s picture

Status: Active » Fixed
StatusFileSize
new23.83 KB

Final version commited to 7.x-2.x.

jthorson’s picture

Issue tags: +testing, +drupal.org D7

Tagging for historic purposes.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dww’s picture

Status: Closed (fixed) » Needs review

A) Are you sure this is wise?

-    if ($node->field_project_has_releases[LANGUAGE_NONE][0]['value']) {
+    if (!empty($node->field_project_has_releases[$node->language][0]['value'])) {

I still don't grok the D7 field language stuff, but it strikes me as odd that a boolean like this could be translated. No objection to !empty() but I'm not sure $node->language is a good idea here.

B) Surely the semantic markup people will hate this:

+  $content['banner_spacer'] = array(
+    '#markup' => '<br /><br />',
+  );

;)

C) Is this too permissive?

+function pift_pages_project_testing_settings_access($node) {
+  return (user_access('access pift settings for all projects') ||
+    (user_access('access pift settings for own projects')
+     && array_key_exists($user->uid, $node->project['maintainers']))
+   );
+}

My concern is that $node->project['maintainers'] contains all maintainers, regardless of their perms. E.g. people that just have 'Maintain issues', etc. Shouldn't we really be testing for maintainers that have the 'Write to VCS' project perm?

D) Pedantic nit, but this makes it impossible to actually translate to an RTL language:

+  $description = t('Marking a branch for testing will add it to the list of branch/patch requests sent to the automated testing infrastructure. ');
+  $description .= t('Once the tests complete, the results will be passed back to drupal.org and reflected on this page. ');
+  $description .= '<br /><br />';

E) Is this divitis? Without a class or id, it's not obvious why we need the #prefix + #suffix here:

+  $form['additional'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Test Additional Branches'),
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+    '#prefix' => '<div>',
+    '#suffix' => '</div>',
+    '#description' => $description,
+  );

F) Seems like $project_node isn't actually used here at all:

+function pift_pages_project_testing_form_submit($form, &$form_state) {
+  $project_node = $form_state['values']['project_node'];

In fact, doesn't appear to be used anywhere. There's a comment about it when the form is built, but it's never actually touched. Is the idea just to make it easier for folks altering this form or something? At the very least, doesn't seem necessary to initialize this local variable in the submit handler if we're not going to use it. Perhaps the whole thing should go.

G) Same concern about $node->language vs. LANGUAGE_NONE here:

 function pift_test_get_pid($test) {
   $node = node_load($test['nid']);
-  $language = (isset($issue->language)) ? $issue->language : LANGUAGE_NONE;
-  return $issue->field_project[$language][0]['target_id'];
+  $language = (isset($node->language)) ? $node->language : LANGUAGE_NONE;
+  return $node->field_release_project[$language][0]['target_id'];
 }

Not sure "needs work" is appropriate here, but I figured at least "needs review". ;)

Thanks!
-Derek

jthorson’s picture

StatusFileSize
new4.08 KB

a) Corrected in dc91cb7.

b) Agreed ... stuck in a <p> instead.

c) The only setting which is exposed is the ability to turn on/off testing for the project, which doesn't need to be overly restrictive. That said, I also have no problem restricting it to project committers, so it's been converted to check the 'write to vcs' permission.

d) Adjusted.

e) Divitis. Bad habit from my D6 days, where text liked appearing outside of it's parent fieldset.

f) Development leftover ... Removed.

g) Fixed.

jthorson’s picture

Status: Needs review » Fixed

Automatically closed -- issue fixed for 2 weeks with no activity.