if ($release = drupalorg_drush_find_release_node($project_data)) {
      $release_nid = basename($release['release_link']);
      $release_data = array(
        'nid' => $release_nid,
      );

This uses the release link from update status XML, like http://drupal.org/node/1727916. When the release node is aliased, like http://drupal.org/drupal-7.17-release-notes, basename() no longer gets the nid.

Instead, project_package or drupalorg's release packagers should use other data to find the nid in Drupal.org's database. I think the version number string will have to be added to the metadata json.

Comments

dww’s picture

Whacky. While it's good to be defensive in the clients in case of exceptions, I think the real solution here is that the release history XML generation should always print the release link as the unaliased node/N link (which can never change and would always work), not honoring path aliasing.

dww’s picture

p.s. the release history XML does already include the version string (<version>) (and current node title (<name>)):

http://updates.drupal.org/release-history/drupal/7.x

...
<release>
  <name>drupal 7.17</name>
  <version>7.17</version>
  <tag>7.17</tag>
  <version_major>7</version_major>
  <version_patch>17</version_patch>
  <status>published</status>
  <release_link>http://drupal.org/drupal-7.17-release-notes</release_link>
  ...
</release>

But, I still think it's better to always publish <release_link> as node/N and ignore path aliases in here. Not just because of this problem, but because aliases can change and be invalidated, while once you get a nid, it's yours forever. Then we don't have to worry about all the terrible (basically intractable) cache invalidation problems for this data if/when aliases are added/changed.

drumm’s picture

Title: drupalorg_drush_record_project_metadata() does not reliably find nid » Update status XML should publish non-aliased release links
Project: Drupal.org drush » Project
Version: » 7.x-2.x-dev
Component: Code » Releases
jonhattan’s picture

Drush itself is also affected by this. See #1839378: Fatal call to asXML

jonhattan’s picture

drush pm-updatecode --notes breaks because of this.

It would be very convenient to have a fix --revert to node/nid in <release_link>-- before the next drupal 7 release (assuming it will continue to provide an aliased url for the release notes). Otherwise drush should release a new version before the scheduled date (TBD).