Remove the `allowed_projects` configuration option

Created on 3 August 2025, 10 days ago

Problem/Motivation

Project Browser supports an undocumented allowed_projects configuration option, which is supposed to be a configurable filter of which projects a particular source can show. We should outright remove it before stable.

Why?

  • It was added to support Drupal CMS at an earlier stage of development and was not well thought-out. At the time, individual sources were not configurable.
  • The intended behavior was only ever implemented by the recipes source. The config object theoretically will filter for any source, but in practice this does not happen and is not supported. So it's inconsistent.
  • This can be replaced by per-source configuration options if desired.

Proposed resolution

Completely remove this configuration structure, with an update path to delete it.

πŸ› Bug report
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

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

Merge Requests

Comments & Activities

  • Issue created by @phenaproxima
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Yeah, this is gonna need a backport.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    10 days ago
    Total: 979s
    #563552
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • Pipeline finished with Success
    9 days ago
    Total: 491s
    #563558
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Assigning to @tim.plunkett for review, commit, and backport. I think this change will make a lot of sense to him and he'll have a clear sense about whether the update path is sound.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    Decided to postpone this on https://www.drupal.org/project/project_browser/issues/3305614 ✨ Allow a module to be blocked from display on Project Browser Active , which I think would be a good place to add more generalized support for allow/deny lists in sources.

  • Pipeline finished with Running
    8 days ago
    #564326
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    After thinking about how this would relate to ✨ Allow a module to be blocked from display on Project Browser Active , I decided to change direction here.

    Since it makes no logical sense to have both an allow list and a deny list operating on the same set of projects, I think what makes sense here is:

    • Remove the allowed_projects configuration entirely, with no direct replacement apart from the recommended source, which is functionally an allow-list unto itself.
    • Add generic deny-list support to the recipes source (and others) in ✨ Allow a module to be blocked from display on Project Browser Active .
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I can, however, see the use case for being able to filter another source through an allow-list. What I think might make sense here -- and would probably need to be a blocker for this issue -- is a whole new source, called allow_list or similar, which decorates another source and filters its results through a configured allow-list. This wouldn't be too hard to do, and it would allow great flexibility for people who want to show "just some of the results from the recipes source", without needing to fully duplicate the information by using recommended.

  • Pipeline finished with Success
    8 days ago
    #564327
  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    I've been thinking about this and here's what I propose.

    There are two things we'd like to allow people to do:

    1. Configure a source to hide a certain subset of its projects.
    2. Find a way to wrap around a source and only show a subset of its projects.

    As these are logically two different things, I think we should implement them as separate features.

    The first thing is a reject list. We should implement a hide_list configuration option in ProjectBrowserSourceBase and respect it by default in createResultsPage(). This allows site admins to specifically hide certain things from users all the time (a perfect use case for this would be hiding CTools, a module which should almost never be visible to Project Browser's target audience).

    The second thing is an allow list. This should probably be a totally new source, maybe called subset, which could be a decorator that takes three configuration options: decorated_id (the plugin ID to decorate), decorated_options (configuration options to pass to the decorated plugin), and query (the query array to pass to the decorated plugin, so as to guarantee that it only shows the stuff you want).

  • πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

    I've tested !849 manually and can verify it doesn't interfere with any base functionality of PB. Will leave Tim to provide code review, if this is the path forward - seems clear it is from the IS but not from a re-read through the comments.

Production build 0.71.5 2024