Comments

rfay’s picture

Well... need the project shortname instead of going scrambling for it.

damien tournoud’s picture

Project: Drupal.org customizations » Project
Version: 6.x-3.x-dev » 6.x-1.x-dev
Component: Code » Releases
Status: Needs review » Needs work

Seems to make more sense to me to add this as a Project release hook in package_releases(). Could you roll a patch for package-release-nodes.php?

damien tournoud’s picture

Title: Invoke hook_drupalorg_project_create_package() when a package is being created » Invoke hook_project_release_create_package() when a package is being created
rfay’s picture

Status: Needs work » Needs review
StatusFileSize
new844 bytes

OK, here is the patch for project. I've tested this with project_dependency module and it seems to work fine.

I'm pretty sure this can do no real harm on its own.

The matching implementation in project_dependency has been committed.

bfroehle’s picture

I hate to slow the momentum here, but shouldn't this new hook be documented in project.api.php?

Here's a start:

/**
 * Respond when a project release node is packaged.
 *
 * @param $shortname
 *   The shortname of the project.
 * @param $release_node
 *   The node object of the project release.
 */
function hook_project_release_create_package($shortname, $release_node) {
  // This is purely a notification hook, implementations will vary from use
  // case to use case.
}
rfay’s picture

Thanks, @bfroehle, here it is with your hook doc.

dww’s picture

Status: Needs review » Needs work

Thanks for the patches here. I'm totally down with invoking a hook at this point.

However, any reason not to just pass in the fully-loaded project node as the first argument? Your use-case might only care about the shortname, but I can certainly imagine needing to at least know the project nid, if not all sorts of other things about the project, if I was watching this hook...

Cheers,
-Derek

rfay’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

#7: I think that makes perfect sense. Here's the reroll.

dww’s picture

Status: Needs review » Fixed

Perfect. I just wanted to ask instead of changing it myself since I know this change will require a change over at project_dependencies.

I fixed the code style on the PHPDoc block, then committed and pushed:

http://drupal.org/commitlog/commit/122/297dd4494600141f272aa01ad2208b51f...

Thanks!
-Derek

rfay’s picture

Thanks so much!

Status: Fixed » Closed (fixed)

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

rfay’s picture

Status: Closed (fixed) » Fixed

Just a question: We think we're getting close to pushing for deployment of project dependency. Are there blockers for Project deployment that will contain this?

Status: Fixed » Closed (fixed)

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

damien tournoud’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new629 bytes

The last patch has a bug: if a project is not explicitly provided on the command line, $project_node is not going to be initialized, as debugged by jthorson (++) in #1241704-25: Deploy Project Dependency, Project and PIFT on d.o.

Patch attached for review.

rfay’s picture

OK, this version seems to work ok in reality.

There was a slight error on the project node load. Also we noted that there were lots of failures loading sandboxes, as they weren't excluded from the query. This patch excludes the sandboxes. If that's not OK, we can rip that part out.

rfay’s picture

StatusFileSize
new758 bytes

No, we decided that wasn't needed; the sandboxes are successfully excluded by the existing query. Not sure what happened to us.

This is the needed improvement to #14.

damien tournoud’s picture

Status: Needs review » Fixed
Issue tags: +needs drupal.org deployment

Committed.

damien tournoud’s picture

Now deployed.

rfay’s picture

Thanks @DamZ!

Status: Fixed » Closed (fixed)

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

dww’s picture

Issue tags: -needs drupal.org deployment

Please remove the "needs drupal.org deployment" tag once things are actually deployed.

Thanks,
-Derek