What is the problem to solve?

Providing a topic with maintainers for introduced deprecations.

Who is this for?

Drupal core developers

Result: what will be the outcome?

Catalyst: #3265945: Deprecate plugins using annotations and plugin types not supporting attributes

Drupal has adopted phpstan-drupal and drupal-rector as official tools the community maintains for handling and fixing deprecations. However, often, Drupal core makes changes faster than the tooling can support.

I am proposing a new subsystem topic with its maintainers to help handle this problem and create a gate. This had been discussed before, such as adding checkboxes to CRs requiring issues for phpstan-drupal and drupal-rector.

Regarding a responsibility assignment matrix, the deprecations topic maintainers would be Consulted and Informed. They would provide domain knowledge if PHPStan can detect an implemented deprecation or if phpstan-drupal requires a new Rule or other changes. Then, a proper issue can be opened for the project—the same for the scope of impact on drupal-rector for an issue to handle automated fixes.

I am proposing Björn Brala (bbrala) and myself for this. Currently, we're using this repo to automate the import of change records to track work needed for phpstan-drupal and drupal-rector https://github.com/mglaman/drupal-change-record-triage/issues

This topic would make it an official process and add a sign-off gate for new deprecations. Each Driesnote discusses the ease of upgrading Drupal with automatic fixes. This adds procedures and policies in place to ensure this is true.

One concern is blocking innovation on approval from these topic maintainers, especially if it's only two people to start. This would be streamlined once phpstan-deprecation-rules (#3263109: Use PHPStan for deprecation checking) is officially adopted. It is already available, and errors are added to the baseline (see https://git.drupalcode.org/project/drupal/-/blob/11.x/core/phpstan-basel....) If a deprecation is added and PHPStan doesn't fail, the topic maintainer must be consulted. For Rector, as drupal-rector grows with more configurable rules, it should scale over time. Deprecations and fixes should be less one-off and more about adding a newly configured rule since most deprecation fixes follow similar patterns.

Only complex deprecations, such as deprecating plugin annotations for attributes, will warrant longer blocking conversations. That's okay because I currently feel the pain and urgency once it has been committed and phpstan-drupal users fail to detect the deprecations.

Proposed solution

Add a Developer Tooling topic to core.

Remaining tasks

  1. Define
  2. Review by community
  3. Review by product managment team
  4. Review by core leadership team team
  5. Create followup governance, to add the role, tag, description and such. #3536493: Add a developer tooling topic to Drupal core
  6. Create followup core issue, to add maintainers
  7. Create followup core issue, to define the core gate #3543735: Define core gate for 'developer tooling'

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Issue summary: View changes
gábor hojtsy’s picture

I think this would make total sense. Deprecations are now a super integral part of the core process and upgrades are still a lot of work to support from the tooling side. I don't know if we must have a subsystem to put in a gate, but that would probably be the most sensible approach to it indeed.

catch’s picture

I agree with this except that I don't think deprecations is exactly the right scope. It feels more like developer tooling (which could then also cover gitlab integration which is currently shoved under phpunit and coincidentally bbrala also works on).

mglaman’s picture

Developer tooling was something I also thought of as well. But I was afraid it would be too broad for the initial discussion. So I agree that's better and gives a bigger purpose

xjm’s picture

I think this is more of a topic maintainer role. Like "Core upgrades and automations" or something.

xjm’s picture

Title: Deprecations "subsystem" and maintainers » Deprecations/upgrade tooling topic, core gate, and maintainers
Issue summary: View changes

I should have elaborated in my previous comment -- the topic maintainer roles correspond to the Drupal core gates. (Usability, accessibility, documentation, testing, etc.)

Since we want to add something like an "Upgrade path and automation gate" (better names may exist), it makes sense to create a topic maintainer group for that.

Retitling the issue and updating the IS accordingly.

xjm’s picture

Maybe we could call it simply the "Upgrade topic maintainers" and "Upgrade gate"? The upgrade path itself is a release management focus area, but the improvements to the D9 and D10 upgrade paths would not have been possible without the support of people informally acting as maintainers of these essential tools and processes to date.

@Gábor Hojtsy is another person who does a lot of work related to the major upgrade path; maybe he should also be in this group?

catch’s picture

Upgrade topic maintainers

For me this is tricky because it sounds like it should include database update system et al, which I wouldn't wish on any living human being but is also a very different area.

Also phpstan while it's useful for upgrading module is also used for a lot of other things.

gábor hojtsy’s picture

Matt, Björn and myself do a bunch of work in this area, but the technical (API) parts are not my forte, its theirs :) Sounds good IMHO to add as a topic. Hopefully we can find a good name :)

aaronmchale’s picture

Just a thought: Maybe rather than trying to come up with the name first, a very specific list of responsibilities should be decided? Maybe that has already been done, and the issue summary hinted at some of these, but the summary doesn't contain a specific/agreed list. That might make it easier to figure out what the name should be. "Deprecation maintainer" could quite easily be misread as something like "deprecated maintainer", I don't think we want to deprecate maintainers 😀

gábor hojtsy’s picture

Title: Deprecations/upgrade tooling topic, core gate, and maintainers » Tooling for code upgrades topic, core gate, and maintainers

I think the responsibilities all evolve around code upgrade tooling and what core changes need to comform to, to make it feasible to build those tools. So "Tooling for code upgrades topic"? I think the naming could be adjusted later, it would be great to establish this in our governance though to embed those working on the tools in the process.

nicxvan’s picture

Issue tags: +depreca

@Gábor Hojtsy Do you mean an outline like in here?
https://www.drupal.org/about/core/policies/core-change-policies/core-gat...

Can this start with a tag for issues that introduce deprecations and a process to create an issue in Rector or Drupal PHPStan for follow up?

From my understanding after discussing briefly there are a few concerns:
1. Make sure change records have a BC snippet for module maintainers
2. Ensure that deprecations are properly triggered
3. Catch runtime deprecations for further review
4. Ensure that phpstan-drupal and or drupal-rector can fix / catch deprecations

What about while these details are hashed out we start with a non-blocking tag for `Needs Developer Tooling` or something similar.
Then once we start tagging issues we can evaluate scope and see what needs to be documented vs addressed before merging.

I'm not trying to volunteer anyone, I am trying to parse out above, feel free to correct anything I state below.
And to prevent repeating I'll define the Developer Tooling Team (DTT) as the following people for now.
Gábor Hojtsy
mglaman
bbrala

Would a responsibilities list look something like this for a first pass?

TASK: Tagging issues for review by DTT

  • Community
  • Needs Review Issue Queue
  • Committers

TASK: Triaging tagged issues

  • Developer Tooling Team

TASK: Creating followup issues in phpstan-drupal and or drupal-rector

  • Community
  • Developer Tooling Team

Maintaining phpstan-drupal and or drupal-rector

  • Community
  • Developer Tooling Team

I think the idea is that the tag for now would only block closing as long as phpstan-drupal and or drupal-rector follow up issues do not exist, but would not block closing beyond that.
So in the beginning this gate only blocks as much as a change record or less so it is minimally disruptive while gathering info.

nicxvan’s picture

As an example I've tagged #933004: Test that all form elements have a #title for accessibility

That also obviously allows: https://www.drupal.org/project/issues/search?issue_tags=Needs%20Develope...

Then a first step would be to create an issue like this: https://github.com/mglaman/phpstan-drupal/issues/748
Maybe a template can be put in the project for the details that Matt would like to see.

For now I would also say only the members of the DTT should remove the tag until we establish guidelines.

nicxvan’s picture

Issue tags: -depreca
joachim’s picture

We should combine PHPCS with Rector.

For example, when running the Rector rule to convert annotations to attributes, the resulting PHP attribute is all on one line and the classes aren't imported. That's because Rector can't do class imports (it can only modify the node it found AFAIK) -- I don't know whether we could improve its output to do linebreaks.

But the resulting code can be improved by then running it throuh PHPCS & PHPCBF. In the case of converting annotations to attributes, the Drupal.Classes.FullyQualifiedNamespace.UseStatementMissing sniff will fix the classes at least.

So Rector rules should come with a list of the specific PHPCS sniffs that are needed to correctly reformat the fixed code, and our tooling should run Rector AND PHPCBF with those sniffs.

nicxvan’s picture

@joachim, thanks for your insight, I think that would be certainly helpful, and I think bbrala has been experimenting with core rewrites.

I think it's slightly off topic for this thread though as this thread is more about providing support to the team behind rector and phpstan so they can provide insight and be notified of changes that require rector / phpstan updates before they land.

The current process requires a lot of effort on their part to remain informed and they are always chasing. Ideally we can be more proactive to help with such important tools for keeping contrib up to date.

bbrala’s picture

bbrala’s picture

Me, catch, gabor and mglaman just talked about this in Barcelona.

We considered the different possible names eventually basing is on what would our main goals be.

The goal of the topic would evolve around developer tooling with the name Developer Tooling. This will manage phpstan and possibly also rector. And in a followup create a gate on making sure that we (will) handle deprecations and other possible updates on that. This could also compose of some work being done in the gitlab side of things for core which is something I've been involved with anyways.

The consensus we had is that Developement Tooling is the best way to go since that would contain all the right things without suggesting subsystems like database upgrades and such.

I think comment #13 is pretty good summary on what the initial workflow would look like.

Gabor, catch, mglaman and me think this is the right way forward.

gábor hojtsy’s picture

Title: Tooling for code upgrades topic, core gate, and maintainers » Add a developer tooling topic to Drupal core
Status: Active » Needs review

Retitled for that scope then. Should we open an MR in an another issue or conver this to a core issue?

bbrala’s picture

Issue summary: View changes
bbrala’s picture

Issue summary: View changes
catch’s picture

+1 to developer tooling from me.

mglaman’s picture

+1 for developer tooling.

For example, I foresee Drupal core starting to retain specific PHPStan rules rather than adding them all only to phpstan-drupal. Or maybe the Rector rules as well. This group can then help manage these related issues.

bbrala’s picture

Status: Needs review » Reviewed & tested by the community
quietone’s picture

Project: Drupal core ideas » Drupal core
Version: » 11.x-dev
Component: Idea » other

The Ideas project is being deprecated. This issue is moved to the Drupal project.

quietone’s picture

Title: Add a developer tooling topic to Drupal core » Add a "developer tooling" topic to Drupal core
Issue summary: View changes

Since @gábor hojtsy, has been involved in this I am striking out the task for product manager approval,

The next steps are a followup core issue for add people to the role and another one to define the core gate. An issue in the governance queue is needed as well. The other topic maintainers do not have a role description but the work in #13 would be good to add.

xjm’s picture

Issue tags: +Project governance
xjm’s picture

This issue is in sort of an ambiguous state. In between creating all the followup issues @quietone mentions (which wouldn't be an RTBC state) and community consensus, we need as Core Leadership team decision into whether to evolve the governance with this additional topic area. I created a poll in the Core Leads' decisions channel to this end and asked for responses by June 29 (timeboxing to two weeks as per our practice).

xjm’s picture

Title: Add a "developer tooling" topic to Drupal core » Policy proposal: Add a "developer tooling" topic to Drupal core

 

mstrelan’s picture

I've just been made aware of this proposal as it's an area I'm interested in. I think the IS needs an update to reflect #19. I've commented in the past about a lack of component for Drupal issues to do with gitlab configuration, phpstan, phpcs, and other code quality tools so I'm in support of this proposal. Happy to put my hand up to help with this in some capacity.

xjm’s picture

Title: Policy proposal: Add a "developer tooling" topic to Drupal core » [policy, no patch] Add a "developer tooling" topic to Drupal core
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs followup

All the core leadership team members either endorsed this policy proposal or had no opinion on it. So the next step is to create a governance followup issue. (Edit: and the two other followup issues for core, which would be postponed on the governance issue.) NW for that I guess?

xjm’s picture

Issue summary: View changes
gábor hojtsy’s picture

Opened #3536493: Add a developer tooling topic to Drupal core but that is not where the meat of the description would go based on the structure of the governance there, it would go into the gates definitions, which are d.o docs.

quietone’s picture

Issue summary: View changes
quietone’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs followup

There is agreement here on the idea and the followup issues have been made except for the ones to add people to the role. Those can be added later and should not hold up this policy decision.

xjm’s picture

I committed the governance addition.

I think we probably want to add documentation to the core gates (at least a stub section that can be filled in later)?

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

There is no disagreement here, and the child issue exists to add this to the core gates, so closing this as fixed.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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