• 
      

    Add support for always-enabled extensions.

    Review Request #15106 — Created June 7, 2026 and updated — Latest diff uploaded

    Information

    Djblets
    release-6.x

    Reviewers

    The extension manager can now be given a list of extensions that must
    always be enabled. These act like enabled-by-default extensions, except
    that they cannot be disabled through disable_extension() or the UI,
    and will be considered enabled every time the extension manager loads.

    This and the enabled-by-default extensions can both be set in
    settings, or can now be set as attributes on the extension manager,
    giving implementations a central, non-settings-based place to customize
    this.

    Any always-enabled extension will still show up in the extension
    manager, but it won't have a button for disabling the extension.
    Similarly, the API will return an error when attempting to disable it,
    if invoked through other means.

    get_can_disable_extension(), and therefore disable_extension(), is
    mindful of extensions that are depended on by another. If any dependent
    extension is always-enabled, none of its dependencies anywhere in the
    dependency chain can be disabled.

    There are a few improvements to related functions to make all this work.
    get_can_disable_extension() can now take an extension instance or ID
    string along with the RegisteredExtension.
    get_dependent_extensions() can now return only enabled extensions.

    Unit tests passed.

    Marked some extensions as always-enabled. Verified that they were
    enabled on load/refresh, even when I forced a disable through other
    means.

    Verified that they could not be disabled via the UI. No button
    appeared and API requests attempting to disable were met with an
    error response.


    Commits

    Files