feat: per-repo label multipliers with fnmatch wildcard support (closes #1016) - #1021
Closed
wdeveloper16 wants to merge 5 commits into
Closed
feat: per-repo label multipliers with fnmatch wildcard support (closes #1016)#1021wdeveloper16 wants to merge 5 commits into
wdeveloper16 wants to merge 5 commits into
Conversation
wdeveloper16
force-pushed
the
fix/per-repo-label-multipliers
branch
2 times, most recently
from
May 5, 2026 23:17
b970c26 to
18e5ce7
Compare
Contributor
Author
|
Hi, @anderdc |
wdeveloper16
force-pushed
the
fix/per-repo-label-multipliers
branch
from
May 6, 2026 01:55
18e5ce7 to
e081ad1
Compare
Contributor
Author
|
Ready to review. |
Collaborator
|
Duplicate of #1027 which is better scoped/implemented. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1016.
Moves label-multiplier scoring from a single global table to per-repository configuration in
RepositoryConfig. Each repo can now define its own label patterns (with fnmatch wildcard support) and a default multiplier, allowing custom label taxonomies likekind/feature,type:bug-fix, or release-prefixed labels such as3.0/feature.Changes
Core
LABEL_MULTIPLIERSfromconstants.pylabel_multipliers: Optional[Dict[str, float]]anddefault_label_multiplier: float = 1.0toRepositoryConfigresolve_label_multiplier(label, repo_config)helper usingfnmatchfor wildcard pattern matching[0.0, 20.0]and enforces a max of 10 entries per repo, logging warnings and skipping invalid entriesLegacy scoring path
PullRequestnow storescurrent_labels: frozenset(all currently-applied labels, set at construction)_resolve_label()inscoring.py: tries the last timeline-applied label first, falls back to the highest-multiplier fnmatch match across all current labels, then defaults todefault_label_multiplierMirror scoring path
_resolve_trusted_scoring_labeland_calculate_pr_multipliersuse per-repo fnmatch instead of the global tableExample config
Tests
resolve_label_multiplier: exact matches, prefix/suffix/middle wildcards (kind/*,type:*,*-dev), case insensitivity, release-prefixed labels_resolve_labelfallback logic: timeline candidate wins if it matches, falls back to highest-multiplier match from current labels, returns default multiplier when nothing matchesload_master_repo_weights: rejects dicts with >10 entries, skips individual entries outside[0.0, 20.0], resets out-of-rangedefault_label_multiplierto1.0, accepts valid configs end-to-endkind/*,type:*,*-dev,3.0/*, multi-pattern with last-applied-wins semantics, no-match fallback to defaultlabel_multiplierson the config fixture instead of the removed global table