Problem/Motivation

#1393226: Encourage use of issue summary template is certainly a win (enjoying it right now!).
However, there's clearly a need for different templates for different projects.
Especially for non-code projects this template isn't right.
Plus, I'd bet 99% of contrib modules don't want the "Release notes" section, etc.

Proposed resolution

  • Add a new field on d.o project nodes called "Custom default issue summary"
  • Add some form alter magic to drupalorg_project to alter the issue node form. If the project's custom default is defined, replace the #default_value from the field config with whatever the project defined.
  • Change the site-wide default to be less core-centric (remove the 'Release note snippet' -- maybe the 'API changes' and 'Data model changes' sections, too?)
  • Re-add those to the core override once this is deployed.

Remaining tasks

  1. Agree on the proposed resolution and how it would work.
  2. Implement.
  3. Test it on a d.o sandbox (e.g. https://project-drupal.dev.devdrupal.org)
  4. Reviews / refinements.
  5. Commit.
  6. Deploy.
  7. Configure the core template to restore the 'Release notes snippet' section.
  8. Notify project owners about it (not sure the best ways to do this).

User interface changes

TBD.

Issue fork drupalorg-3161070

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

    dww created an issue. See original summary.

    jhodgdon’s picture

    This sounds like a good idea to me.

    We have a section in the drupal.org documentation about issue summaries, which already contains a few special-purpose summaries:
    https://www.drupal.org/community/contributor-guide/reference-information...

    So, I would propose that we create a few more in there -- maybe one for Documentation issues would be good? Probably most projects are either primarily documentation or primarily code in what their issues are about -- or we can create another one if we can figure out another type of summary that would be useful.

    Then in the edit-a-project page that lets you put in a default issue summary, we could (in the field description) link to that docs section for people to find examples.

    dww’s picture

    Issue summary: View changes

    Sure, that all seems reasonable.

    To be clear, my proposal is that the per-project thing is specifically an override of the default template from the field config.

    We'd change the default one to be less core-centric (e.g. remove the 'release note snippet' section). Core would re-add that in its own template.

    Given that, I'd expect ~95+% of code projects to be fine with the default. So mostly the override would be for:
    a) Core.
    b) Non-code projects.

    But yeah, it'd be nice to link to the section of proposed templates on the field on the project nodes...

    jhodgdon’s picture

    +1 to all of that. Meanwhile, we can create some more templates, like "Including release notes" and "Documentation", if we have time/energy.

    dww’s picture

    Status: Active » Needs review
    FileSize
    23.21 KB
    112.63 KB

    This is live on https://project-drupal.dev.devdrupal.org/ if anyone wants to try it there.

    Attaching a screenshot of the project edit UI for the new field. This is a little wonky, but it's not the fault of anything here. Probably some weird JS interactions between collapsible fieldsets and field_group or something. /shrug

    Added the new field to all our project node types (core, module, theme, distro, translation).

    Everything is working as expected.

    Thoughts / objections / concerns / improvements?

    Thanks!
    -Derek

    jhodgdon’s picture

    Status: Needs review » Needs work

    This looks pretty good! I went to the dev site and logged in as bacon. I went to node/add, and clicked on Community project. I don't see the new field. It's also missing if you click on Theme engine project.

    For the other types of projects (core, module, theme, distro), it looks good. I don't see translation in node/add, so I didn't test that.

    Setting to Needs Work because I think this needs to be added to theme engine and community projects
    https://project-drupal.dev.devdrupal.org/node/add/project-theme-engine
    https://project-drupal.dev.devdrupal.org/node/add/project-drupalorg

    Note to self: I didn't yet test whether, if I made a project with and without a customization for the template, what issue summary would be used for new issues.

    dww’s picture

    Status: Needs work » Needs review
    FileSize
    30.15 KB
    6.97 KB

    Oh, good catch! I totally missed the community project thing. ;) I think theme engines are dead, but for completeness, doesn't hurt to add the field there, too.

    Thanks,
    -Derek

    jhodgdon’s picture

    Status: Needs review » Needs work

    I tested this again: logged in as user "bacon" on the dev site, and created 5 test projects of the 5 types available to me. All of them had the new issue summary default value override field available, as well as the guidelines override field. So, I did a variety of overrides and no overrides in my 5 bogus sandbox projects. Here's a list of the projects:
    https://project-drupal.dev.devdrupal.org/project/user/717216
    The description fields say whether the field is overridden or not (I also tested overriding or not overriding the issue submission guidelines, just for fun, although that has not changed in this patch.)

    On all the projects, after saving the project node, I got this error message:

        Warning: array_values() expects parameter 1 to be array, boolean given in _field_filter_items() (line 517 of /var/www/dev/project-drupal.dev.devdrupal.org/htdocs/modules/field/field.module).
        Warning: Invalid argument supplied for foreach() in list_field_validate() (line 393 of /var/www/dev/project-drupal.dev.devdrupal.org/htdocs/modules/field/modules/list/list.module).
        Warning: array_values() expects parameter 1 to be array, boolean given in _field_filter_items() (line 517 of /var/www/dev/project-drupal.dev.devdrupal.org/htdocs/modules/field/field.module).
    

    This could be related to the fact that on the dev site anyway, the text formats for the Description, Submission guidelines, and new Custom issue summary template fields are all broken -- they don't offer me any text format choices. This is perhaps due to the default bogus user account "bacon" not having permission for any text formats? I'm not sure... But when I (still logged in as user bacon) created a Book page content item, I still didn't have text format choices for the Body, but it didn't give the same error when I saved the node. And when I created a Contributor Task content item, which has a formatted text field on it that is not the Body field, and a Contributor Skill, which has several, I didn't get an error... So... ??? not sure.

    Anyway, I also tested creating issues, and the ones with overrides got a new issue summary, and the ones without got the default, so it seems to be working.

    I did find another bug: The new issue summary override field is being shown at the bottom of project pages, if it has a value -- that needs to be removed from Manage Display. See
    https://project-drupal.dev.devdrupal.org/sandbox/bacon/3160628
    for an example.

    dww’s picture

    Status: Needs work » Needs review
    FileSize
    72.52 KB
    82.7 KB

    Re: first error -- not seeing that when logged in as a real user. Must be the permission weirdness from the bacon user. I can send you a login link if you want to try as a real user, instead...

    Re: field displaying on project nodes -- great catch!!! Whoops. ;) Totally slipped my mind. Now fixed.

    Features exports suck, especially of field config. :( So much pointless diff. Interdiff is completely confused as a result. Probably irrelevant, but uploading, anyway.

    Maybe this can be manually massaged to end up being less diff. But I'm not going to spend the time on that unless @drumm requests it. ;)

    Thanks again for testing, @jhodgdon!

    Cheers,
    -Derek

    dww’s picture

    jhodgdon’s picture

    Status: Needs review » Reviewed & tested by the community

    Yes, the display looks good now. I had already tested the other functionality.

    (I have a login for the dev server and could have done a drush uli to use a different user, but I didn't.)

    I made an issue about the bacon user not having decent permissions for text formats (it is probably in the wrong project, but oh well). Probably one of the times when the d.o roles/permissions were rejiggered, no one fixed the bacon user to have a role that works.
    #3161155: Warnings generated when creating sandbox projects

    dww’s picture

    Assigned: Unassigned » drumm

    Thanks again for testing, @jhodgdon!

    I'll leave this for Neil to review. I don't want to commit it myself without his +1, too.

    Cheers,
    -Derek

    drumm’s picture

    Assigned: drumm » Unassigned
    Status: Reviewed & tested by the community » Needs work

    The weight changes like

    @@ -6018,7 +6277,7 @@ function drupalorg_projects_field_default_field_instances() {
             'label' => 'above',
             'settings' => array(),
             'type' => 'hidden',
    -        'weight' => 17,
    +        'weight' => 21,
           ),
           'issuemetadata' => array(
             'label' => 'above',

    all cause a field cache clear for each changed field instance, which stack up to minutes of effective downtime for Drupal.org. When rearranging fields, we have to click “show row weights” and do a minimal changes to get the fields in the right order.

    One other nitpick:

    <a href="https://www.drupal.org/node/3156940">

    This leads off of staging/dev and you might not notice that you’re on production. Use site-relative links whenever possible, like <a href="/node/3156940">

    Otherwise, this looks like a good direction to go in. I thought about using a file in the repository, but there isn’t anything close to standardized across services - https://docs.gitlab.com/ee/user/project/description_templates.html#creat... vs. https://docs.github.com/en/github/building-a-strong-community/configurin.... If we go that direction later, we’ll still want the field to avoid making another HTTP request while serving the form.

    dww’s picture

    Issue summary: View changes
    Status: Needs work » Needs review
    FileSize
    29.92 KB
    2.34 KB

    Yeah, that huge diff made me nervous. :(

    I discovered that reverting to patch #7, and then simply doing this to each instance already gives you exactly the right weights:

    @@ -517,9 +517,8 @@
         'display' => array(
           'default' => array(
             'label' => 'above',
    -        'module' => 'text',
             'settings' => array(),
    -        'type' => 'text_default',
    +        'type' => 'hidden',
             'weight' => 13,
           ),
           'issuemetadata' => array(
    

    So instead of tons of clicking around on the sandbox, I just manually fixed the feature. ;) I reimported on the sandbox and it's all just fine.

    Interdiff from #7, since #9 is all kinds of bogus. ;)

    Thanks,
    -Derek

    dww’s picture

    FileSize
    29.57 KB
    8.08 KB

    Whoops, forgot to also fix the site relative links. Here we go.

    jhodgdon’s picture

    Is that patch up on the dev site? If so I can test it later today.

    dww’s picture

    It is now. #14 (named #11, sorry about that) was deployed, but I just put #15 (3161070-12.patch) up and reverted the feature. Also grabbed the latest from #1393226: Encourage use of issue summary template so the help text at the top of the node/add/project-issue/x pages is now accurate.

    Thanks for the offer to re-test!

    Cheers,
    -Derek

    p.s. Screenshots of 3 issue add pages: core (customized), token (customized) and paragraphs (default).

    jhodgdon’s picture

    I tested on the dev server, and it all looks fine:
    - The field appears on the project create form for all types of projects that user Bacon has access to
    - Manage display is good (you don't see the issue summary template override)
    - I tested with one of my existing projects, and if the override is there, the issue gets the overridden template, and if the override is not there, you get the default template.

    This seems like a good idea.

    So, I am +1 on adding this to drupal.org.

    I also took a look at the patch... This bit is concerning:

    +++ b/features/drupalorg_issues/drupalorg_issues.features.field_instance.inc
    @@ -194,33 +194,32 @@ function drupalorg_issues_field_default_field_instances() {
     
       // Exported field_instance: 'node-project_issue-body'.
       $field_instances['node-project_issue-body'] = array(
    +    'bueditor_profile' => -1,
    

    Not sure what it means.

    Also just below that in the same file, it looks like the default issue summary has changed... why?

    Actually, most of the changes in that file seem weird and unrelated to this projects... Maybe revert that file?

    There are also still some concerning weight changes in
    +++ b/features/drupalorg_projects/drupalorg_projects.features.field_instance.inc

    So... not sure about marking this RTBC?

    jhodgdon’s picture

    Also... (maybe a separate issue) -- would it make sense to add a Description on the issue summary field, which would link to both
    https://www.drupal.org/community/contributor-guide/reference-information...
    (Issue summary field page, node/3156939) and
    https://www.drupal.org/community/contributor-guide/reference-information...
    (Special issue summary templates section, node/3156941)?

    Maybe something like:

    A (link)description of the issue summary field(/endlink) and (link)alternative issue summary templates(/link) can be found in the (link)Drupal project issues(/link) documentation.

    (that last link would be the same is in the description that is below the Priority and Status fields)

    dww’s picture

    Thanks for testing and review!

    A) + 'bueditor_profile' => -1,

    Not sure what it means.

    That just means we want the default bueditor profile on that field. The rest of the file is full of those. The only reason it's showing up in this patch is because there are a handful of changes on the site that aren't reflected in the feature export, and rebuilding the feature is including those.

    B)

    Also just below that in the same file, it looks like the default issue summary has changed... why?

    Because I'm removing the 'Release notes snippet' from the global default template. I'm 99.9% sure that's entirely core-specific, so I'm removing it from the default. See bullet 3 in the proposed resolution.

    C)

    There are also still some concerning weight changes in
    +++ b/features/drupalorg_projects/drupalorg_projects.features.field_instance.inc

    Those are only for the widget / form display config, so I don't think they incur the same awful cost of invalidating the field cache for display. They're necessary to get this new field to appear between the Submission guidelines field and the Enable issue tracker and Version options checkboxes at the bottom of the Issues field group.

    D) #19: Yeah, might be useful, but +1 to doing that in a separate issue so we can hash out the details without blocking this. Generally, less UI text is better. We already have the big blue box at the top with "Learn how to report an issue." so maybe we don't need more. Anyway, let's move this to a follow-up.

    Thanks again!
    -Derek

    jhodgdon’s picture

    Regarding (b), the change is showing many lines changed, not just the release notes snippet being removed?

    Regarding (d), the big blue box is only present on new issues. Field descriptions are there also when you are editing issues. But yes, new issue is probably better.

    dww’s picture

    Re: #21.b: I blame weirdness of features field exporting, line endings, etc. /shrug Inclined not to care, but let's see if Neil has any insights / concerns.

    d) Oh yeah, good point on node help text vs. field descriptions. But yeah, let's continue in a new issue. Your proposal would make sense independently of this issue.

    Thanks,
    -Derek

    jhodgdon’s picture

    drumm’s picture

    I saved the field on production for #3161574: Add links to issue summary info/templates under issue summary field, which flushed out some changes like

         'settings' => array(
    -      'display_summary' => FALSE,
    +      'display_summary' => 0,
           'text_processing' => 1,

    Line endings are likely related to #3143101: Fix line endings to make PHPCompatibility happy, I’ve been keeping those as \n-only.

    Those are only for the widget / form display config, so I don't think they incur the same awful cost of invalidating the field cache for display. They're necessary to get this new field to appear between the Submission guidelines field and the Enable issue tracker and Version options checkboxes at the bottom of the Issues field group.

    Both field bases and instances have that cost. However, if we need to change weights to get fields in a logical order, we need to incur that cost. Depending on the situation, I might break something like that up into multiple deployments - re-weight fields to get them out of the way, then deploy the real change.

    dww’s picture

    Assigned: Unassigned » dww
    Status: Needs review » Needs work

    Duly noted on the widget weights. Luckily, it's only impacting 2 other fields. Might be possible to do it without those changes, I'll take a look at manually mucking with it to see if I can minimize or even eliminate any weight changes.

    I'll re-roll this to pick up recent changes.

    Hopefully I'll have a new patch up later today.

    dww’s picture

    FileSize
    28.06 KB
    2.03 KB

    First, straight re-roll to handle recent commits and fix the line endings on the issue summary default_value.
    Interdiff is confused, so here's a raw diff of this vs. patch "12" from comment #15.

    dww’s picture

    Assigned: dww » drumm
    Status: Needs work » Needs review
    FileSize
    26 KB
    2.12 KB
    24.96 KB
    1.39 KB

    And now an attempt to minimize changes to weights for other fields. This was mostly pretty easy, although due to peculiarities in the existing values, the specifics are a bit different from bundle to bundle. There are now only 5 other field instances that are touched. Hope this is a small enough change to be deployable as-is.

    1. project_drupalorg: Move field_project_has_issue_queue down one (weight 2 => 3).
    2. project_module: Move field_project_issue_guidelines up one (weight 2 => 1).
    3. project_theme: Move field_project_issue_guidelines up one (weight 2 => 1).
    4. project_theme_engine: Move field_project_issue_guidelines up one (weight 2 => 1).
    5. project_translation: Move field_project_issue_guidelines up one (weight 2 => 1).

    I don't fully understand how separate deployments helps this, but if so, here's the full patch split into 2 parts:

    • Just the new field and its instances, touching nothing else.
    • The 5 other field instance widget weight changes from above.

    Lemme know if there's anything else we need here.

    Thanks!
    -Derek

    • drumm committed f7f9feb on 7.x-3.x authored by dww
      Issue #3161070 by dww, jhodgdon: Provide mechanism for per-project...
    drumm’s picture

    Status: Needs review » Fixed

    This is now deployed!

    I had to script one additional bit to run via drush php-script:

    foreach (project_project_node_types() as $project_type) {
      $groups = field_group_info_groups('node', $project_type, 'form', TRUE);
      $groups['group_project_issues']->children[] = 'field_issue_summary_template';
      ctools_export_crud_save('field_group', $groups['group_project_issues']);
    }

    Features isn’t able to export the group_project_issues field group, since it is defined by project_issue module. So this placed the new field in each project type’s group.

    andypost’s picture

    Would be great to announce it with change record

    dww’s picture

    Assigned: drumm » Unassigned
    Issue summary: View changes

    Sweet, thanks!

    I just edited the core project to restore the "Release notes" section to core's default template:

    https://www.drupal.org/node/3060/revisions/view/11919914/12010291 (not that that link shows you the diff of the new field). ;)

    I also posted about it in a few Slack channels (#contribute and #documentation). Any suggestions on other ways to address this:

    • Notify project owners about it (not sure the best ways to do this).

    Thanks again,
    -Derek

    drumm’s picture

    This should make the next “What’s new on Drupal.org” at https://www.drupal.org/drupalorg/blog. I went ahead and made a change record: https://www.drupal.org/node/3162437

    Status: Fixed » Closed (fixed)

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