In (~line 816)

$result = xmlrpc($servers[$s]['xmlrpc_url'], 'pifr.batch.queue', $server_key, $batch);

The files contained in the batch need to have the project_nid that the issue originates in.

This is necessary for #360909: Keep track of project nid so that commit log and cvs can be checked for individual projects.

CommentFileSizeAuthor
#3 pift_query.txt1.08 KBboombatower

Comments

hunmonk’s picture

Status: Active » Fixed

it's already in there, as $file['pid']

boombatower’s picture

Title: Add project_nid to $file in pifr.batch.queue XML-RPC call » Add project_uri and branch to $file in pifr.batch.queue XML-RPC call
Status: Fixed » Active

I think we should either just add the field project_uri (as I need the name for CVS checkout for planned expansion into testing contrib) or modify the batch format a bit.

Probably also need the branch the file applies to.

Something like:

$batch = array(
  'files' => array(/* Current files array with a few tweaks. */),
  'projects' => array(/* Information about the projects referenced by the pids found in the files array. */)
);

The information about a project would look something like this:

$project = array(
  'pid' => 1, // Probably end up being the keys to the projects array instead.
  'project_[uri|name]' => 'name', // The "short name" of the project that can be used to check it out and other operations.
  'cvs_command' => '-d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal' // The part the specifies what repository. I can then add the project name to the command and the branch.
);

This information will be referenced by the files and thus will be updated for the projects that have new files to be tested. In that way all the files are tested on the most up to date project information (aka if name changes or w/e). I would prefer this done of the PIFT side so that if we open this up to Drupal shops or w/e I don't have to write special code for each of them, and at the moment Drupal core is checked out from a different location then the contrib will be.

boombatower’s picture

Title: Update XML-RPC test request » Add project_uri and branch to $file in pifr.batch.queue XML-RPC call
StatusFileSize
new1.08 KB

Since this will require a bit of modification for the XML-RPC data structure I think we should go through and clean-up/standardize everything while we are at it.

File structure
Currently a file consists of (comments explain how I reference, possibly come to a consensus):

$file = array(
  'ftid', // Would it make sense to just use file_id from files table? I use project_file_id when I reference the ID. Rename to file_id.
  'cid',
  'issue_id', // Inconsistent with cid, perhaps change to nid. Or make them issue_id, issue_comment_id.
  'issue_title', // Remove.
  'uid', // Remove.
  'pid', // Possibly change to project_nid.
  'rid', // Release NID. To fully abstract checkout process I need branch name. (ie. DRUPAL-6, HEAD). Rename to branch.
  'patch_url', // Since we refer to them as files in module name PIFT maybe call file_url.
  'project', // Remove: Title of project isn't useful and will be moving all project details to separate location.
  'submitter', // Remove.
);

There seems to be an inconsistency in formal names like issue_id and short names like cid, pid.

What we end up with is: (10 fields to 7!)

$file = array(
  'file_id',
  'project_nid',
  'branch',
  'core', // Compatible core branch. (CVS tag/branch)
  'file_url',
  'issue_nid',
  'issue_cid',
);

I have taken the time to format the, current, query that collects this data and attached it.

Project structure
There are a few project specific pieces of data which will be required. (This will also allow full abstraction of Drupal core procedures! make way for Drupal 8.x)

$project = array(
  'project_nid',
  'name', // Short name/computer name.
  'is_core', // Is Drupal core, otherwise module.
  'repository_type', // Future support cvs, svn? For now leave out.
  'repository_url', // Ie. pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal
);

By sending project data whenever a file is requested to be tested it ensure that it is up-to-date (in-case of rare module rename), and allows the system to auto-collect/sync data without our intervention.

Final batch format

$batch = array(
  'files' => array(/* Files to be request testing of. */),
  'projects' => array(/* Referenced projects. */),
);

While at it I think I will change XML-RPC method name from pifr.batch.queue to pifr.queue.

A 2.x branch of PIFT needs to be started to coincide with PIFR 2.x.

boombatower’s picture

Title: Add project_uri and branch to $file in pifr.batch.queue XML-RPC call » Update XML-RPC test request
boombatower’s picture

Title: Add project_uri and branch to $file in pifr.batch.queue XML-RPC call » Update XML-RPC test request

Updated format.

$batch = array(
  'branches' => array( [referenced branches (may also be tested)] ),
  'files' => array( [files to be tested] ),
  'projects' => array( [referenced projects] ),
);

$branch = array(
  'branch_nid', // Release NID.
  'project_nid', // Project NID.
  'core_branch_nid', // Compatible core branch release NID.
  'identifier', // Repository branch identifier.
  'test', // Request branch to be tested.
);

$file = array(
  'project_file_id', // Unique file ID (from client files table).
  'branch_nid', // Branch release NID.
  'file_url', // Complete URL to file.
  'issue_nid', // Issue NID.
  'issue_cid', // Issue CID.
);

$project = array(
  'project_nid', // Project NID.
  'name', // Short project name.
  'type', // Project type, PIFR_SERVER_PROJECT_TYPE_*.
  'repository_type', // Repository type (currently only CVS).
  'repository_url', // Repository URL, pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal.
);
boombatower’s picture

Version: 5.x-1.x-dev » 6.x-2.x-dev
Assigned: Unassigned » boombatower
Status: Active » Fixed

All required XML-RPC calls have been updated to the PIFR 6.x-2.x standard.

Status: Fixed » Closed (fixed)

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