Add package pattern overrides for cooldown - #9
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds per-package glob-pattern cooldown overrides to cooldown.Config, enabling configuration of cooldown durations for groups of packages (e.g., an npm scope) and updating the cooldown resolution order accordingly.
Changes:
- Introduces
Config.PackagePatterns(glob patterns over versionless PURLs), parsed and used between exact package overrides and ecosystem defaults. - Updates cooldown resolution logic (
Config.For) andEnabled()to account for pattern-based overrides. - Extends documentation and adds tests covering pattern precedence and behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Documents PackagePatterns, precedence, and matching semantics. |
| cooldown.go | Implements pattern parsing, ordering, and matching in cooldown resolution. |
| cooldown_test.go | Adds tests for pattern overrides and updates Enabled() coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
Thanks for this. The use case (zero cooldown for an internal npm scope) is real, but I don't think The two consumers of this library are There's also an encoding mismatch: proxy and pin both pass canonical I see you've already got a |
|
Thanks. I will create PR there. |
This pull request adds support for per-package pattern cooldown overrides in the
cooldownpackage, allowing configuration of cooldown durations using glob patterns that match multiple packages (such as all packages in an npm scope). It updates the resolution order for cooldowns, improves documentation, and adds tests for the new functionality.Pattern-based configuration support
PackagePatternsfield toConfigfor specifying cooldown durations using glob patterns against versionless PURLs. Patterns are parsed, validated, and sorted by specificity, with exact package matches taking precedence over patterns. [1] [2]Config.Forto: exact package override > package pattern override > ecosystem override > global default.%40to@for npm scopes.Documentation updates
README.mdto describe the newPackagePatternsfield, its usage, precedence rules, and pattern matching behavior. [1] [2] [3]Testing
PackagePatternsfield in configuration.