Currently it attempts to do so via the CVS tag and some regex, but obviously that isn't a 100% since HEAD can mean totally different things for each module.

Comments

boombatower’s picture

After talking with sun, it seems that project_release_supported_versions is the table I need and the major version will contain the related core version...not sure if that is true yet.

dww’s picture

Sounds like you need to either use, or at the very least, look at CVS Deploy.

boombatower’s picture

This is the current code, which is somewhat based of the PIFT 1.x method. It is ugly and flawed, but I wasn't sure what else to do at the time. It works fine for now since we only want to do D7 (HEAD), but this won't work for contrib.

/**
 * Generate a regular expression to match the release tags per specified core
 * versions.
 *
 * @param boolean $mysql_compatible Generate MySQL compatible regular expression.
 * @return string Regular expression.
 */
function pift_test_release_regex($mysql_compatible) {
  $regex = '';
  $branches = variable_get('pift_core', array());
  sort($branches);

  if (end($branches) == 7) {
    $regex .= 'HEAD|';
    array_pop($branches);
  }

  $branches = implode('|', $branches);
  return $mysql_compatible ? "{$regex}DRUPAL-($branches)" : "/{$regex}DRUPAL\-($branches)/";
}

Looking into sun's suggestion and dww's.

boombatower’s picture

Assigned: Unassigned » boombatower
boombatower’s picture

Doesn't look like cvs_deploy is what I'm looking for.

dww’s picture

Status: Active » Postponed (maintainer needs more info)

@boombatower: if you provide no evidence or details with #5, then I can't help you. ;) Why isn't it what you're looking for? What are you looking for, then?

boombatower’s picture

Status: Postponed (maintainer needs more info) » Active

There are two cases that will trigger testing:
1) a commit
2) a patch

Patches are on issues and thus they have a release node associated with them, via the version property of the issue. In the release information is the version string like "7.x-1.x-dev" or w/e. I am now guessing this is really the only way to figure out what version of core they are compatible with. Previously to be consistent with cvs message I tried to to do on CVS tag, but as I said that doesn't work with HEAD. Please let me know if there is a better way.

For commits the information is extremely limited. Currently it uses the cvs_files table and compares against the branch. Blank indicating HEAD, but of course for contrib HEAD may mean a lot of things. What I need is the core version it is compatible with since we want to restrict to 7.x (eventually 8.x) and possibly 6.x.

If there is clear cut way to figure out the major core version that would be great. So 7 for Drupal 7, etc.

Thanks.

dww’s picture

If you have release nodes, there's a taxonomy vocab that tells you this, even if it's a -dev from HEAD. See _project_release_get_api_vid() for example. Of course, you can also just parse the version string -- it's a trivial regexp and the version strings are consistent.

If all you have are CVS commits, and you want to map a CVS branch into a version, see CVS deploy. It does exactly that.

boombatower’s picture

I thought about taxonomy, but that will complicate the query quite a bit. I'll take a look at those two solutions.

As for CVS deploy, ok will also look again.

I appreciate your thoughts.

boombatower’s picture

Status: Active » Fixed

Committed.

Status: Fixed » Closed (fixed)

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