Problem/Motivation

We need to port project_release to D7. In D6, it provides a custom content type with all sorts of hard-coded fields. In D7, we'd like to just use the core Field API as much as possible to avoid hard-coded stuff.

However, there are some "magical" features of project_release, mostly related to "branches". I.e. figuring out what the available release branches are, what the latest + recommended releases on each branch are, how to display all that for the download table on the project page, etc.

Proposed resolution

- We'll provide a default "project_release" node type on install, with some generic basic core fields (title, version string, entityref pointing to the parent project, multi-valued file field for release tarballs/zips, etc).
- I'm thinking a field_collection attached to project nodes themselves that records info about the available release branches. Similar to what lives in {project_release_supported_versions} now.
- Some magic (TBD) that uses that field collection to store the denormalized info about the latest and recommended release nodes on each release branch.
- Appropriate views integration to make the download table and other stuff possible.
...

Note that a bunch of this code now lives on the '1551384-release-deep-port' feature branch.

Remaining tasks

#1546092: Add a field to control if a given project node has releases
#1606656: Port the 'project_release_download_base' setting to D7 and make it per-node-type
#1609382: Port release files with extra metadata to D7
#1611960: Kill project-release-private-download.php now that D7 allows both public/private downloads
#1612050: Figure out how to represent branches for D7 project_release
#1764260: Update security_update_tid behavior for D7
includes/packager.inc
Sampler metrics
package-release-nodes.php, maybe convert to drush
project-release-create-history.php, maybe convert to drush
project-release-serve-history.php, depends on project usage
Promoting sandbox projects
Download table
Views integration

Original report by dww

At this point, a "deep port" of releases to core fields is low on the priority list. It Would Be Nice(tm) to do this, but it's a lot of work, and the pay-off isn't nearly as high as the deep port of issues and projects themselves. So, it's likely that the 7.x-2.x branch of Project will just have a straight-port of the D6 project_release code, complete with the evil hard-coded node type, non-field fields, etc. :( Not ideal, but pragmatic.

Comments

Senpai’s picture

Reminding myself to circle up with Moshe on this issue in regards to data migration capabilities.

jojonaloha’s picture

StatusFileSize
new196.37 KB

I've attached a patch of the results from a coder_upgrade port of this sub-module. I haven't tested it yet, but started work on this as it is a dependency to #1465786: Port Project Dependency to Drupal 7

jojonaloha’s picture

StatusFileSize
new205.56 KB

Here is an updated patch, which fixes some fatal errors (but definitely not all of them).

In particular I ran into this error: Fatal error: Call to undefined function project_projects_select_options() in /Users/jojonaloha/Sites/drupalorg/drupal/profiles/projectinstall/modules/project/release/includes/release_node_form.inc on line 579

Looks like it was defined in project.module, which appears to be being re-built from the ground up. I'm interested in helping with the port, but I don't want to duplicate any efforts. Any advice on how project.module is/will be handling it would be appreciated.

dww’s picture

Assigned:Unassigned» dww

Thanks for your work on this so far, jojonaloha! I'm sorry I didn't reply here sooner. We had a thorough discussion on Friday about this and are going to try a "deep port" of project_release to the core field API, after all. At least, we'll try it and see if we run into major problems. If it turns into a mess once we really start implementing it, we might come back to the approach of your first few patches here. But, probably we're going to flush most of this code and start over cleanly.

I'll update the issue summary with the new proposed strategy when I have a chance (probably on Monday), but I just wanted to let you know to stop putting effort into this issue for now.

Thanks!
-Derek

dww’s picture

Status:Active» Needs work
StatusFileSize
new99.23 KB

Very preliminary patch, but I wanted to post it here for backup. ;) I started working in a feature branch, but I didn't want to push that just yet, either.

Here's the local commit message I used:

Issue #1551384 by dww: Initial 'port' to D7 using core Field API.

- Removed tons of code for the D6 custom node type and fields.
- Added code to define an initial default node type with D7 fields.
- Started getting node/add/project-release to work.
- Removed the D6 DB updates and added hook_update_last_removed().
- Removed the release settings page since none of them will be needed.
- Removed code related to custom "fields" we injected into project
  nodes in D6.
- Removed code for the weird "API compatibility" taxonomy vocabulary.
- Removed custom token support (since we should get that for free now).

It's not a fair comparison, since we're not even close to feature parity yet, but I love these kinds of diffstats ;)

6 files changed, 320 insertions(+), 2052 deletions(-)
Senpai’s picture

Assigned:dww» Unassigned
Status:Needs work» Active
Issue tags:+sprint 2, +sprint 3

Tagging for sprint 3.

dww’s picture

Assigned:Unassigned» dww
Status:Active» Needs work

Repairing some metadata from the x-post...

dww’s picture

Issue summary:View changes

initial sketch of the plan for a D7 Field API deep port of project_release

dww’s picture

Issue summary:View changes

started fleshing out the subtasks

dww’s picture

Issue summary:View changes

added #1611960

dww’s picture

Note: I just pushed a feature branch with some work on this effort: 1551384-release-deep-port. The release nodes themselves are mostly done. The "Remaining tasks" in the issue summary here are still valid. I was hoping to get this further along before I pushed it, but I need to leave town, and Senpai kept hounding me about this, so I went ahead and pushed. Alas that I can no longer re-write this history, but I'll survive. ;)

dww’s picture

Issue summary:View changes

added #1612050

Senpai’s picture

Issue tags:+sprint 4, +sprint 5, +sprint 6

Tagging for Sprint 6.

Senpai’s picture

Assigned:dww» drumm

Assigning to Drumm at the D7 Upgrade sprint #2.

Senpai’s picture

Issue tags:+sprint 7, +sprint 8

Tagging for Sprint 8.

Senpai’s picture

Issue summary:View changes

added note about the '1551384-release-deep-port' feature branch.

drumm’s picture

I committed a bunch of code getting release node save and the edit releases page working. Sorry for the large commit, they should be smaller in the future.

I noticed #1764260: Update security_update_tid behavior for D7 along the way. Quick notes other things that will need attention:

  • Migration
  • includes/packager.inc after/for #1609382: Port release files with extra metadata to D7
  • Sampler metrics
  • package-release-nodes.php, maybe convert to drush
  • project-release-create-history.php, maybe convert to drush
  • project-release-serve-history.php, depends on project usage
  • Promoting sandbox projects
  • Views integration
bdragon’s picture

Merged current state of the branch to 7.x-2.x.

bdragon’s picture

Issue summary:View changes

Adding #1764260

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

Anonymous’s picture

Issue summary:View changes

updating todo