If we are going to move issues to git.drupalcode.org, then we lose the data to integrate them with the rest of Drupal.org. Change records have an entity reference field to issues, which will have to be replaced somehow.

The referenced issue can indicate that “draft” change records need review. “Review” will either have to be a separate status from draft, or disappear.

Problem Summary

When issues move from Drupal.org to GitLab we'll now longer have access to issue fields and metadata to populate views.

We currently use a view with three displays (Published, Draft, Review) for Change Records: https://www.drupal.org/list-changes/drupal

These views are sorted/filtered by issue metadata fields, and in particular the Review tab(heavily used by Core) shows just the Change Records associated with 'Fixed' or 'Closed-Fixed' issues.

While we can still make views of *link fields* to issues, we won't be able to include fields or meta data for sorting/filtering. Instead, we can use javascript to pull in some data about those issues once we display them.

Proposed Resolution

The change record content type on Drupal.org continues to exist, with all of the same fields except:

  • The issue entity references now become multi-value link fields

The views would change in the following way:

  • Published
    • Works largely the same as today, showing the list of CRs in publication order
    • Loses any filtering derived from issue meta data, but retains all filtering/sorting from CR fields
  • Draft
    • Works largely the same as today, showing the list of CRs in created order
    • Loses any filtering derived from issue metadata, but retains all filtering/sorting from CR fields
    • We can use client-side javascript to pull in the associated GitLab issue statuses, so that hopefully any CR whose issues are all fixed can be seen at a glance (even if we can't filter on that).
  • Review
    • Cannot be kept, because we won't have access to GitLab issue statuses to use as query criteria in the View.
    • Instead, replaced by the changes to the Draft view above

Next steps:

  • Review with core committers
  • Review with other users of change records
  • Implement
  • Deploy

Deployment instructions

  • Merge/deploy the code
  • cc all & check that features appear as "Default". The new link field should appear in the "Change record" content type.
  • If the changes are not reflected, we might need to revert the "drupalorg_change_notice" feature.
  • Run drupalorg_change_notice:issue-links to populate the new link field with the values from the old entity reference field.

Issue fork drupalorg-3265112

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drumm created an issue. See original summary.

fjgarlin’s picture

Affected field is field_issues

Admin path:/admin/structure/types/manage/changenotice/fields

fjgarlin’s picture

Certain views, like https://www.drupal.org/list-changes/drupal/review rely on the metadata of the issues. By making them links, we might not be able to retrieve the status anymore.

To continue working on this might mean losing certain functionality like ^^, but we can always create follow up issues to see what are the options (ie: query gitlab api to get MR or Issue metadata).

Also, if the issue is part of a change record, it'll have an extra block on the side making reference to the change record. ie: https://www.drupal.org/project/drupal/issues/3280399

moshe weitzman’s picture

My first thought is to use Gitlab issues for the change record itself. Any issue with the label 'Change record' would be considered a change record. Gitlab's issues dont yet allow for custom fields so that's why I suggest using a Label.

Gitlab's excellent query UI would help us make lists, even across projects. Further, issues have a rich UI and data for relating to each other and showing a bit of metadata in the link. We are surely going to be using these for Related Issues. Gitlab's Issue API is available for migration, and any future CRUD work related to change records.

This solution isnt perfect but its good enough IMO, and gets rid of one more custom thing on www.drupal.org

fjgarlin’s picture

Thanks for your insights Moshe. Leveraging Gitlab is in fact one of the options being considered (probably the one we like the most long term). The changes in this issue will be about preparing for the issue migration without disrupting (too much) other parts of the site.

I've added a comment to the child issue about using gitlab features for the change records: https://www.drupal.org/project/drupalorg/issues/3293315#comment-14589560

fjgarlin’s picture

BEFORE
select count(*) from field_data_field_issues; | 6310 |
select count(*) from field_data_field_issue_links; | 0 |

$ drush drupalorg_change_notice:issue-links
4397 nodes will be updated.
Starting...
* 198/4397 processed...
* 395/4397 processed...
...
* 4386/4397 processed...
* 4397/4397 processed...

AFTER
select count(*) from field_data_field_issues; | 6310 |
select count(*) from field_data_field_issue_links; | 6290 |

Discrepancy is just due to (probably just my DB):
    SELECT count(entity_id) FROM field_data_field_issues WHERE entity_id NOT IN (SELECT nid FROM node); | 20 |
fjgarlin’s picture

@drumm - this is ready to be reviewed / tested.

URL: https://fjgarlin-drupal.dev.devdrupal.org

MR: https://git.drupalcode.org/project/drupalorg/-/merge_requests/101/diffs
* drupalorg/drupalorg.module changes the link to use the new format.
* features/drupalorg_change_notice/drupalorg_change_notice.drush.inc adds the drush command
* features/drupalorg_change_notice/drupalorg_change_notice.module adds the logic run in the drush command and a form_alter hook to pre-populate the links if these are given in the URL. It also adds some logic to keep backwards compatibility.
* The rest of the changes are features export from adding the new field and hiding the old one.

Deployment steps:
* Deploy the code and make sure that the feature changes were applied. A new field should be created. If it doesn't happen, we might need to "revert" the feature.
* Run the drush command: "drush drupalorg_change_notice:issue-links"

Changes:
* The old "Issues" entity reference field will no longer be available nor visible.
* A new field "Issue links" is available when viewing/editing/adding change records: https://fjgarlin-drupal.dev.devdrupal.org/node/3260624
* The link "add change notice" present in issues will still prepopulate the value of the link: https://fjgarlin-drupal.dev.devdrupal.org/i/3280589 and then click on "add change notice". You'll be taken here: https://fjgarlin-drupal.dev.devdrupal.org/node/add/changenotice?field_pr...

Once this is deployed, we can fully delete the old field and remove the non-used view displays, but that will break backwards compatibility. I captured this in the child issue: https://www.drupal.org/project/drupalorg/issues/3293585

fjgarlin’s picture

Status: Active » Needs review
hestenet’s picture

Issue summary: View changes
hestenet’s picture

Issue summary: View changes
fjgarlin’s picture

The proposed resolution has been implemented and can be tested.

  • Code changes: https://git.drupalcode.org/project/drupalorg/-/merge_requests/101
  • Approach:
    • New link field was created and is multi-value. It requires absolute links.
    • Old entity reference link has been hidden and will no longer be used.
    • When combined with the work done on the gitlab migration issue, the links metadata is brought via JS.
    • When viewing an issue linked to a change record, the change record is still visible as the view has been changed to try to match the any of the values of the new link field to the current issue being viewed.
    • Change records can still be created from within a drupal issue and the issue will be prepopulated in the new format.
    • A drush command was created to populate the new field with the values from the old (hidden) field, for all previous change records.

Test:

  • drumm committed 1ad4fa4 on 7.x-3.x
    Issue #3265112 by fjgarlin, hestenet, drumm: Add note about future...
fjgarlin’s picture

Assigned: Unassigned » fjgarlin
fjgarlin’s picture

Note: the above endpoint has been reset and I'll re-run all the changes early this week, so the test links might not show what you expect if you check between now and then.

Fixed

fjgarlin’s picture

Issue summary: View changes

  • drumm committed 8de7488 on 7.x-3.x
    Issue #3265112 by fjgarlin, drumm: Add field_issue_links
    
drumm’s picture

drumm’s picture

Issue summary: View changes

Noting cc all is needed on deployment to pick up the new Views handlers/etc.

  • drumm committed 667b44d on 7.x-3.x authored by fjgarlin
    Issue #3265112 by fjgarlin, drumm: Decouple change records from www....
drumm’s picture

Status: Needs review » Fixed

This is now deployed!

Status: Fixed » Closed (fixed)

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