Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Agree on the proposed resolution and how it would work.Implement.Test it on a d.o sandbox (e.g. https://project-drupal.dev.devdrupal.org)Reviews / refinements.Commit.Deploy.Configure the core template to restore the 'Release notes snippet' section.- Notify project owners about it (not sure the best ways to do this).
User interface changes
TBD.
Comment | File | Size | Author |
---|---|---|---|
#27 | 3161070-27.patch | 26 KB | dww |
#5 | 3161070-4.project-edit-ui.png | 112.63 KB | dww |
Issue fork drupalorg-3161070
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:
Comments
Comment #2
jhodgdonThis 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.
Comment #3
dwwSure, 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...
Comment #4
jhodgdon+1 to all of that. Meanwhile, we can create some more templates, like "Including release notes" and "Documentation", if we have time/energy.
Comment #5
dwwThis 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
Comment #6
jhodgdonThis 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.
Comment #7
dwwOh, 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
Comment #8
jhodgdonI 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:
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.
Comment #9
dwwRe: 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
Comment #10
dwwhttps://project-drupal.dev.devdrupal.org/project/drupal
https://project-drupal.dev.devdrupal.org/project/token
...
looking a lot more normal now. ;)
Comment #11
jhodgdonYes, 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
Comment #12
dwwThanks 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
Comment #13
drummThe
weight
changes likeall 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.
Comment #14
dwwYeah, 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:
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
Comment #15
dwwWhoops, forgot to also fix the site relative links. Here we go.
Comment #16
jhodgdonIs that patch up on the dev site? If so I can test it later today.
Comment #17
dwwIt 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).
Comment #18
jhodgdonI 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:
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?
Comment #19
jhodgdonAlso... (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)
Comment #20
dwwThanks for testing and review!
A)
+ 'bueditor_profile' => -1,
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)
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)
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
Comment #21
jhodgdonRegarding (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.
Comment #22
dwwRe: #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
Comment #23
jhodgdonAdded child issue for (d) #3161574: Add links to issue summary info/templates under issue summary field
Comment #24
drummI saved the field on production for #3161574: Add links to issue summary info/templates under issue summary field, which flushed out some changes like
Line endings are likely related to #3143101: Fix line endings to make PHPCompatibility happy, I’ve been keeping those as
\n
-only.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.
Comment #25
dwwDuly 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.
Comment #26
dwwFirst, 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.
Comment #27
dwwAnd 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.
field_project_has_issue_queue
down one (weight 2 => 3).field_project_issue_guidelines
up one (weight 2 => 1).field_project_issue_guidelines
up one (weight 2 => 1).field_project_issue_guidelines
up one (weight 2 => 1).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:
Lemme know if there's anything else we need here.
Thanks!
-Derek
Comment #29
drummThis is now deployed!
I had to script one additional bit to run via drush php-script:
Features isn’t able to export the
group_project_issues
field group, since it is defined byproject_issue
module. So this placed the new field in each project type’s group.Comment #30
andypostWould be great to announce it with change record
Comment #31
dwwSweet, 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:
Thanks again,
-Derek
Comment #32
drummThis 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