Skip to content

Add support for update-types in allow block#12925

Merged
kbukum1 merged 2 commits intomainfrom
copilot/fix-12668
Mar 31, 2026
Merged

Add support for update-types in allow block#12925
kbukum1 merged 2 commits intomainfrom
copilot/fix-12668

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 22, 2025

What are you trying to accomplish?

Add support for update-types in the allow block of dependabot configuration, enabling users to specify semver-level filtering (major/minor/patch) for allowed updates directly — instead of the counterintuitive workaround of combining allow + ignore.

Fixes #12668.

Related PRs:

Example usage:

version: 2
updates:
  - package-ecosystem: "bundler"
    directory: "/"
    schedule:
      interval: "daily"
    allow:
      - dependency-name: "rails"
        update-types:
          - "version-update:semver-minor"
          - "version-update:semver-patch"

Anything you want to highlight for special attention from reviewers?

  • allowed_update? in Job now checks update-types against the computed semver update type for the dependency
  • Security updates bypass update-types filtering to preserve security-first behavior
  • Dependencies without a previous version (new dependencies) are allowed through regardless of update-types
  • The dependency_update_type helper reuses the same version comparison logic as the pull request labeler

How will you know you have accomplished your goal?

  • All existing tests continue to pass
  • New tests cover: all semver update types, combinations, security update bypass, and dependencies without previous versions

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested my code changes to ensure they work as expected, including adding additional tests for new functionality.
  • I have written clear and descriptive commit messages.
  • I have provided a detailed description of the changes in the pull request, including the problem it addresses, how it fixes the problem, and any relevant details about the implementation.
  • I have ensured that the code is well-documented and easy to understand.

Copilot AI changed the title [WIP] Add support for update-types in allow block Add support for update-types in allow block Aug 22, 2025
Copilot AI requested a review from kbukum1 August 22, 2025 17:16
@yeikel
Copy link
Copy Markdown
Contributor

yeikel commented Feb 18, 2026

@kbukum1 Is there any way I can help to move this forward?

@kbukum1
Copy link
Copy Markdown
Contributor

kbukum1 commented Feb 23, 2026

@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.

@kbukum1 kbukum1 moved this to In Progress in Dependabot Feb 23, 2026
@kbukum1
Copy link
Copy Markdown
Contributor

kbukum1 commented Feb 25, 2026

@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.

@yeikel
Copy link
Copy Markdown
Contributor

yeikel commented Feb 25, 2026

@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

@kbukum1
Copy link
Copy Markdown
Contributor

kbukum1 commented Mar 25, 2026

@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.

@kbukum1 kbukum1 force-pushed the copilot/fix-12668 branch 2 times, most recently from 4e5dbc3 to db6d17e Compare March 25, 2026 22:15
@kbukum1 kbukum1 closed this Mar 25, 2026
@kbukum1 kbukum1 deleted the copilot/fix-12668 branch March 25, 2026 22:31
@github-project-automation github-project-automation bot moved this from In Progress to Done in Dependabot Mar 25, 2026
@kbukum1 kbukum1 restored the copilot/fix-12668 branch March 25, 2026 22:32
@kbukum1 kbukum1 reopened this Mar 25, 2026
@kbukum1 kbukum1 force-pushed the copilot/fix-12668 branch 3 times, most recently from 573a63d to b851c71 Compare March 27, 2026 20:33
@kbukum1 kbukum1 marked this pull request as ready for review March 27, 2026 20:52
@kbukum1 kbukum1 requested a review from a team as a code owner March 27, 2026 20:52
Copilot AI review requested due to automatic review settings March 27, 2026 20:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 apply allow[].update-types filtering based on the dependency’s computed semver update type.
  • Add UpdateTypeHelper#update_type_for_dependency and reuse it from Job (and de-duplicate the prior implementation in GroupDependencySelector).
  • Add specs covering semver type detection and allow behavior (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.

Copy link
Copy Markdown
Contributor

@AbhishekBhaskar AbhishekBhaskar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kbukum1 kbukum1 force-pushed the copilot/fix-12668 branch from 8249a62 to 358907a Compare March 31, 2026 19:18
@kbukum1 kbukum1 merged commit e32ea97 into main Mar 31, 2026
171 checks passed
@kbukum1 kbukum1 deleted the copilot/fix-12668 branch March 31, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add support for update-types in allow block

5 participants