[policy, no patch] Add link to change record in code comments

Created on 15 May 2018, over 6 years ago
Updated 6 August 2024, 2 months ago

Problem/Motivation

To improve developer experience, it makes sense to provide code usage examples, especially adjacent or within API docs. In the past, usage examples were often provided by the community in api.drupal.org page comments, but with our new release cycle, a new node is created with each new minor release and comments for api.drupal.org pages are not readily accessible. Also, people using IDEs won't see comments on api.drupal.org.

Currently, change records are often the best place to find usage examples of new features; however, this documentation doesn't always find its way back to community docs or code comments in a timely fashion, if at all, and developers may not think to search for a change record to figure out how to use a class or function.

Proposed resolution

After a change record is published, provide a patch to the related issue that updates or adds a code comment with a link back to the change record. [Note: actually, since in most cases draft change records are required to be in place before the patch is committed, and draft records can be viewed by all site visitors, adding a link to the change record could be part of the initial patch.]

Remaining tasks

- Get community feedback <-- we are here
- Get core committer buy-in and enforce as a policy

User interface changes

Possibly add help text to the change record form with instructions to add a patch to the related issue.

API changes

None, except after this policy, hopefully a link to the change record with a usage example(s) would appear in api.drupal.org for the class or function.

Data model changes

None.

🌱 Plan
Status

Closed: won't fix

Component

Idea

Created by

πŸ‡ΊπŸ‡ΈUnited States Amber Himes Matz Portland, OR USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Reading the issue summary, this belongs in the core queue. It is not about the Drupal project, more internal implementation, and developer experience.

    I don't see how this would work in practice because MRs can have changes across many files. How does one choose where to put a comment with a link to the change record? And if we decided to place the info in the api.php or some high level interface then those files would have an ever growing list of links to change records. Or at least a list that needs to be maintained.

    I think the easiest and best solution to improve documentation is to actually write it, whether that is in the core queue or in the handbook. And I do appreciate the challenges of doing that as I have done it myself, sometimes it was easy and sometimes quite difficult and even frustrating. And also, the handbook is a wiki, anyone can edit it at any time. That can help in some cases.

  • Status changed to Closed: won't fix 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    I came across this again today. Except for my comment there hasn't been any discussion here about this, pro or con. Since there is no interest I am closing this as won't fix.

    If you disagree, by all means, add a comment explaining your view and set the status to active.

Production build 0.71.5 2024