Skip to content

Improve parts features registration #1187

Open

Description

@bepri

What needs to get done

The parts feature registration method needs to be more opinionated on how features are registered. A proposed solution would be the following:

  • Create an enum, like PartsFeature
  • Populate it with the possible parts features, like PartsFeature.PARTITIONS, PartsFeature.OVERLAY, etc.
  • Keep two set[PartsFeature] attached to the application: _default_parts_feats and _requested_parts_feats
  • Add two public final methods:
    • enable_parts_feature(feature: PartsFeature) -> None will add feature into the set of requested features
    • disable_parts_feature(feature: PartsFeature) -> None will remove feature from both the default features and the requested features sets
  • Make _enable_craft_parts_features() final and have it enable the set of _default_parts_feats & _requested_parts_feats

Why it needs to get done

Currently, it is done in a hook where the implementers of the hook can decide the order features are enabled. We didn't design the API to be tight or opinionated enough, and now any changes may end up being overridden by a downstream consumer that didn't call super().

Activity

  1. syncronize-issues-to-jira commented on Sep 21, 2026

    @syncronize-issues-to-jira

    Thank you for reporting your feedback to us!

    The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-5321.

    This message was autogenerated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions