[RFC] Add priority field and automatic priority assignment

Ali Alnubani alialnu at nvidia.com
Tue Oct 21 07:13:55 AEDT 2025


Hello,

I'm sending this email to propose adding a priority field to patches with support for
automatic priority assignment based on file paths. This would help
maintainers identify and triage patches that affect critical subsystems/components.

Many projects have certain files or subsystems that are more critical than
others, and currently there's no easy way to highlight
patches that modify these critical areas, which makes triage more difficult
for maintainers.

My proposed solution is to add a priority field to the Patch model with four categorical levels:
- Low (0)
- Normal (1) - default
- High (2)
- Critical (3)

The priority can be set manually through the UI/API, or automatically
assigned when patches are parsed based on configurable rules.

As for the implementation,

Will add a priority field to the Patch model with choices. This is stored as an
integer but displayed as text labels in the UI.

Will create a new PriorityRule model that defines path patterns and their
associated priority levels. Similar to the existing DelegationRule model,
it includes:
- project: which project the rule applies to
- path: fnmatch-style pattern
- priority: the priority level to assign (Low/Normal/High/Critical)
- rule_priority: precedence when multiple rules match

When parsing incoming patches, will extract filenames from the diff and match
them against the project's PriorityRule entries. If multiple rules match,
will use the one with the highest rule_priority. When a patch modifies multiple
files that match different priority rules, the parser assigns the highest priority
found. If no rules match, default to Normal.

This is similar to how Patchwork currently handles delegation rules, so the
implementation can follow that pattern.

Patch list view will get a new sortable "Priority" column that displays the
text label (Low/Normal/High/Critical). Will add a filter dropdown to allow
filtering by priority level. Showing the new column can be optional (opt-in)
and enabled in user profile settings. We can also implement it so that it can
be optional per-project.

Admin interface gets an inline editor for PriorityRule on the Project
admin page, plus a standalone admin page for managing rules.

The migration will add the priority column with a default of 1 (Normal), so
existing patches are unaffected. New projects can define priority rules
as needed (optional).

Please let me know what you think,

Thanks,
Ali



More information about the Patchwork mailing list