Quoting dww's original thoughts:

d.o is full of links to things like http://drupal.org/cvs?commit=356444 -- all of those links are going to break if we turn off the cvs.module. It'd be nice to have a mapping of CVS commits to Git commits during the migration (might be really hard/impossible to get this right, I'm not sure of our repo migration process itself), and then have a custom menu handler that responds to these requests and sends you off to the equivalent Git commit.

Comments

dww’s picture

Yeah, this is going to be a bit of a mess. It's not a blocker for phase 2, but it'd be nice. Basically, VCAPI is going to have a serial ID for each Git commit. We're going to need something to walk through that table and try to find the corresponding {cvs_messages}.cid based on cvs_user, timestamp, and message. Then, we'd populate a mapping table of vcapi_op_id to cvs_commit_id. Finally, we'd have that custom menu handler that redirects from a given cvs_commit_id to the corresponding VCAPI operation...

sdboyer’s picture

Priority: Normal » Critical

Gotta do this, or bye-bye google ranking. So yeah, phase 2.

sdboyer’s picture

Project: Drupal.org infrastructure » The Great Git Migration
Component: Git » Migration scripts

This'll probably need to be handled with a special one-off module. In any case, it's not infra's problem, so moving it to TGGM.

marvil07’s picture

Just to point that versioncontrol_cvs have a legacy sub-module that do that mapping.

Naturally we should need to start one compatible to our views, but I think is a good start.

eliza411’s picture

Issue tags: +git sprint 9

Tagging for Git Sprint 9

eliza411’s picture

Issue tags: -git sprint 9 +git sprint 10

Not likely to be touched this sprint.

sdboyer’s picture

Linkrot sucks, but it's not a launch blocker. We can always roll this out after launch; if we do, there'll just be a frustrating window where it doesn't work.

If we're going to do it before launch, though, then it really needs to be done soon. Really soon. End of next week soon.

marvil07’s picture

Project: The Great Git Migration » Drupal.org customizations
Version: » 6.x-3.x-dev
Component: Migration scripts » Code

Sounds like the place for this would be customizations, right?

JohnAlbin’s picture

I paste those CVS commit links into issues that I fix, as it makes it easier for people following the issue to see how the project is changing.

I agree this isn't launch critical. But I would hate for all the links to this break -> http://drupal.org/cvs?commit=374186 ;-)

Dave Reid’s picture

Oh man, just realized I used CVS commit links *all* the time in issues.

dww’s picture

We need 3 things, all of which will have to be handled by the same custom menu item at /cvs

A) check for $_GET['commit'] and map to the right Git commit landing page. Not sure if we have this mapping anywhere. We'll probably want need to do some offline-parsing and build a map table and just use that, instead of trying to query the {cvs_*} tables (which are still in the d.o DB, but should be dropped eventually).

B) check for arg(1) and if it's set, redirect to node/N/commits

C) if neither GET nor arg(1) are there, dump a "we moved to Git, hurray!" landing page with links to Stuff(tm).

This probably can't possibly be solved via an input filter (as I overheard talk in IRC about). We need a menu callback, plain and simple.

Still not sure if a patch for drupalorg_versioncontrol makes sense, or if we want to do the versioncontrol_cvs_legacy thing. I'd have to look much more closely at what that's doing before I could make a recommendation. But, I definitely agree we should look there before writing the mapping logic from A.

Dave Reid’s picture

Assigned: Unassigned » Dave Reid
dww’s picture

Progress on this should hopefully be aided by #1076722: Dave Reid wants a working drupal.org development site now being fixed. ;)

andypost’s picture

Dave Reid’s picture

I've got individual commits working. For example, a Token module commit that I've linked to in a issue comment: http://davereid.redesign.devdrupal.org/cvs?commit=505086

Dave Reid’s picture

Was initially very confused since the 'versioncontrol_repository_git_base_url_drupalorg_gitweb_rewrite' variable was not set on the staging site. Did it accidentally not get transferred over when creating a staging site?

Dave Reid’s picture

For the record, this is all the functionality that we *might* have to duplicate.

1419 function cvs_show_messages() {
1420   global $languages;
1421 
1422   $attributes = array();
1423   $files = '';
1424 
1425   // Transform query string into query string. We use $_REQUEST because we
1426   // need to support both GET and POST requests.
1427   if (isset($_REQUEST['commit']) && is_numeric($_REQUEST['commit'])) {
1428     $where[] = "m.cid = ". db_escape_string($_REQUEST['commit']);
1429     $attributes['commit'] = $_REQUEST['commit'];
1430   }
1431   if (isset($_REQUEST['user'])) {
1432     $where[] = "(m.cvs_user = '". db_escape_string($_REQUEST['user']) ."' OR u.name = '". db_escape_string($_REQUEST['user']) ."')";
1433     $attributes['user'] = $_REQUEST['user'];
1434   }
1435   if (isset($_REQUEST['uid']) && is_numeric($_REQUEST['uid'])) {
1436     $where[] = "u.uid = ". db_escape_string($_REQUEST['uid']);
1437     $attributes['uid'] = $_REQUEST['uid'];
1438   }
1439   if (isset($_REQUEST['nid']) && is_numeric($_REQUEST['nid'])) {
1440     $where[] = "f.nid = ". db_escape_string($_REQUEST['nid']);
1441     $attributes['nid'] = $_REQUEST['nid'];
1442     $files = 'INNER JOIN {cvs_files} f ON m.cid = f.cid';
1443   }
1444   if (isset($_REQUEST['branch'])) {
1445     $branch = strtolower($_REQUEST['branch']) == 'head' ? '' : $_REQUEST['branch'];
1446     $where[] = "f.branch = '". db_escape_string($branch) ."'";
1447     $attributes['branch'] = $_REQUEST['branch'];
1448     $files = 'INNER JOIN {cvs_files} f ON m.cid = f.cid';
1449   }
1450   if (isset($_REQUEST['file'])) {
1451     $where[] = "f.file = '". db_escape_string($_REQUEST['file']) ."'";
1452     $attributes['file'] = $_REQUEST['file'];
1453     $files = 'INNER JOIN {cvs_files} f ON m.cid = f.cid';
1454   }
1455   if (isset($_REQUEST['rid']) && is_numeric($_REQUEST['rid'])) {
1456     $where[] = "m.rid = ". db_escape_string($_REQUEST['rid']);
1457     $attributes['rid'] = $_REQUEST['rid'];
1458   }
1459   if (isset($_REQUEST['message'])) {
1460     $where[] = "m.message LIKE '%". db_escape_string($_REQUEST['message']) ."%'";
1461     $attributes['message'] = $_REQUEST['message'];
1462   }
1463 
1464   if ($where) {
1465     $where = 'WHERE '. implode(' AND ', $where);
1466   }
1467 
1468   $language = count($languages) ? reset(array_keys($languages)) : 'en';
1469 
1470   if (isset($_REQUEST['rss']) && $_REQUEST['rss']) {
1471     $limit = variable_get('feed_default_items', 10);
1472   }
1473   else {
1474     $limit = variable_get('cvs_pager', 10);
1475   }
1476 
1477   // If files is set, we perform a very expensive query.  Otherwise, we
1478   // optimize the query.
1479   if (!empty($files)) {
1480     $result = pager_query("SELECT DISTINCT m.*, u.name, u.uid FROM {cvs_messages} m $files INNER JOIN {users} u ON m.uid = u.uid $where ORDER BY m.cid DESC", $limit, 0, "SELECT COUNT(DISTINCT(m.cid)) FROM {cvs_messages} m $files INNER JOIN {users} u ON m.uid = u.uid $where");
1481   }
1482   else {
1483     $result = pager_query("SELECT m.*, u.name, u.uid FROM {cvs_messages} m INNER JOIN {users} u ON m.uid = u.uid $where ORDER BY m.cid DESC", $limit, 0, "SELECT COUNT(m.cid) FROM {cvs_messages} m INNER JOIN {users} u ON m.uid = u.uid $where");
1484   }
1485   $output = cvs_show_messages_format($result, $attributes);
1486   if (isset($_REQUEST['rss']) && $_REQUEST['rss']) {
1487     drupal_set_header('Content-Type: text/xml; charset=utf-8');
1488     print $output;
1489     exit();
1490   }
1491   else {
1492     return $output;
1493   }
1494 }

I hate cvslog.module.

dww’s picture

Re: #15: excellent! Patch please? ;)

Re: #17: Screw that. ;) Let's start with ?commit=n and get that done (along with 11.B and 11.C). That's going to cover at least 90% of all existing cvs.module links, probably more like 99%. I'd be fine letting the rest of those links rot if the basics are working properly.

And yeah, cvs.module is terrible. I'm so very glad it's no longer enabled on d.o. ;)

Thanks for your work on this!

Cheers,
-Derek

Wim Leers’s picture

Subscribing.

dww’s picture

Whenever this is finally closed (either fixed or won't fix) we should re-open #1302028: Drop legacy CVS integration tables from the DB.

I still vote that if we have the common case working, we should go with that. But, I realize there's probably dwindling concern about this linkrot...

marvil07’s picture

A lot of time has passed, and linkrot kind of happened.
Do we still want to add this or just close it?

dww’s picture

Priority: Critical » Major
Status: Active » Closed (won't fix)