Order recipes by lowest usage dependency descending

Created on 1 July 2025, 10 days ago

Problem/Motivation

πŸ“Œ [Meta] Plan for recipe Active adds telemetry to core for when recipes are applied, once it lands in core, it will take a few months for stats to build up.

✨ Add a flag and listing page for recipes Active and the equivalent API page currently lists recipes alphabetically since it doesn't have usage data.

I might have a third option, that could either work until πŸ“Œ [Meta] Plan for recipe Active is ready to use, or possibly be combined with it either initially or permanently.

Each recipe ships with a .info.yml file that includes the module dependencies: https://www.drupal.org/project/drupal_cms_content_type_base β†’ includes https://git.drupalcode.org/project/drupal_cms_content_type_base/-/blob/0... and that lists modules in its 'install' section.

Each of those modules will have its own project usage.

e.g. https://www.drupal.org/project/usage/drupal_cms_olivero β†’ (although it's a theme) has 3.6k project usage.

I don't know the d.o database well enough to know how supported this already is or whether it would require additional relationships to be tracked, however something like the following could be done:

ORDER BY MIN(dependency_project_usage) DESC;

This would mean a recipe that depends only on pathauto module would be ordered close to or at the top (because it's least used dependency has 500k installs)

And a recipe depending on a brand new module with only one install would be listed last.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom catch

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

Comments & Activities

  • Issue created by @catch
  • πŸ‡ΊπŸ‡ΈUnited States drumm NY, US

    ✨ Add tracking for when recipes from Drupal.org are applied Active should be doable and provide better data.

    Implementing this workaround would be just as much work as the server-side of the correct tracking, and is not a quick win. This might even take more time, I do not think we have the module dependencies stored in a database table.

  • πŸ‡¬πŸ‡§United Kingdom catch

    I'm not sure this should only be a temporary workaround.

    Recipe applying is a one-off operation, this means the sorting is likely to happen in two ways:

    1. Purely cumulative - won't pick up trends over time and also very vulnerable to gaming and accidental CI pollution.

    2. With some kind of decay (only 12 months of date, or weighting more recent data higher) - potentially not enough data overall to rank usefully.

    But either #1 or #2 could be combined with the module usage approach, which while it won't reflect installs of the recipes, would represent a ceiling of how many sites could ever possibly use the recipe (e.g. if it depends on a module that's only installed on one site, only one live site is actually based on it).

Production build 0.71.5 2024