Add support for update-types in allow block#12925
Conversation
update-types in allow blockupdate-types in allow block
|
@kbukum1 Is there any way I can help to move this forward? |
I need to check it. I will let you know hopefully by tomorrow. |
This may take sometime since it is not only dependabot-core. But also need to check on dependabot-api to pass parameters. |
Sure, thanks for the update. Just let me know later on if I can support |
@yeikel , I am checking this now. Sorry for the delay. |
4e5dbc3 to
db6d17e
Compare
573a63d to
b851c71
Compare
There was a problem hiding this comment.
Pull request overview
Adds update-types support to the Dependabot config allow block so users can semver-filter allowed updates (major/minor/patch) without relying on an allow + ignore workaround.
Changes:
- Extend
Dependabot::Job#allowed_update?to applyallow[].update-typesfiltering based on the dependency’s computed semver update type. - Add
UpdateTypeHelper#update_type_for_dependencyand reuse it fromJob(and de-duplicate the prior implementation inGroupDependencySelector). - Add specs covering semver type detection and
allowbehavior (including security bypass and “no previous version” cases).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| updater/lib/dependabot/job.rb | Applies allow.update-types filtering during allowed_update? evaluation (with security bypass). |
| updater/lib/dependabot/updater/update_type_helper.rb | Adds update_type_for_dependency helper to compute major/minor/patch from previous vs current versions. |
| updater/lib/dependabot/updater/group_dependency_selector.rb | Removes the duplicated update_type_for_dependency implementation (relies on shared helper). |
| updater/spec/dependabot/job_spec.rb | Adds test coverage for allow.update-types semantics across update types and edge cases. |
| updater/spec/dependabot/updater/update_type_helper_spec.rb | Adds tests for dependency-level update type classification. |
8249a62 to
358907a
Compare
What are you trying to accomplish?
Add support for
update-typesin theallowblock of dependabot configuration, enabling users to specify semver-level filtering (major/minor/patch) for allowed updates directly — instead of the counterintuitive workaround of combiningallow+ignore.Fixes #12668.
Related PRs:
Example usage:
Anything you want to highlight for special attention from reviewers?
allowed_update?inJobnow checksupdate-typesagainst the computed semver update type for the dependencyupdate-typesfiltering to preserve security-first behaviorupdate-typesdependency_update_typehelper reuses the same version comparison logic as the pull request labelerHow will you know you have accomplished your goal?
Checklist