Skip to content

Add API integration to fetch blocked versions at job updates#15123

Merged
kbukum1 merged 5 commits into
mainfrom
revert-15120-revert-14917-kbukum1/add-blocked-versions-api-integration
May 22, 2026
Merged

Add API integration to fetch blocked versions at job updates#15123
kbukum1 merged 5 commits into
mainfrom
revert-15120-revert-14917-kbukum1/add-blocked-versions-api-integration

Conversation

@kbukum1
Copy link
Copy Markdown
Contributor

@kbukum1 kbukum1 commented May 22, 2026

Note: This PR was previously merged as #14917 and reverted due to an incident. This re-introduces the change with fixes applied from review feedback.

What are you trying to accomplish?

Add the API client integration that fetches blocked versions from the API and injects them into the job definition at construction time. Blocked versions are globally managed (not per-job configuration), so they need to be fetched fresh at execution time. This ensures the updater always uses the latest blocked versions list.

This PR also renames the blocked versions payload field from version to version-requirement to align with ignore_conditions conventions and the API contract.

Stacks on #14915 which adds the blocked_versions attribute to the Job class.

Anything you want to highlight for special attention from reviewers?

  • The fetch is gated behind the blocked_versions experiment flag — no behavior change without it.
  • Graceful degradation on any API or parsing failure — the updater continues without blocked 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.

@kbukum1 kbukum1 requested a review from a team as a code owner May 22, 2026 19:52
Copilot AI review requested due to automatic review settings May 22, 2026 19: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

This PR re-introduces the updater-side integration for fetching globally managed “blocked versions” from the Dependabot API at execution time (gated behind the blocked_versions experiment) and injecting them into the job definition before Dependabot::Job construction. It also updates the blocked versions payload field name from version to version-requirement to align with existing ignore condition conventions and the API contract.

Changes:

  • Add ApiClient#fetch_blocked_versions with defensive parsing/error handling and corresponding specs.
  • Inject fetched blocked versions into the job definition during UpdateFilesCommand#job construction (experiment-gated) with specs.
  • Rename blocked versions entries to use version-requirement across job behavior/tests and dry-run helper output.
Show a summary per file
File Description
updater/lib/dependabot/update_files_command.rb Deep-copies job definition and injects API-fetched blocked versions when experiment is enabled.
updater/lib/dependabot/api_client.rb Adds API client method to fetch blocked versions (instrumented, defensive).
updater/lib/dependabot/service.rb Delegates fetch_blocked_versions through the service adapter.
updater/lib/dependabot/job.rb Updates blocked versions handling/logging to use version-requirement.
updater/spec/dependabot/api_client_spec.rb Adds test coverage for blocked versions API fetch success/failure/format cases.
updater/spec/dependabot/update_files_command_spec.rb Adds test coverage for experiment-gated fetch + injection behavior.
updater/spec/dependabot/job_spec.rb Updates blocked versions fixtures/expectations to version-requirement.
bin/dry-run.rb Updates blocked versions example/output keys to version-requirement.

Copilot's findings

  • Files reviewed: 7/8 changed files
  • Comments generated: 1

Comment thread updater/lib/dependabot/api_client.rb
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.

Copilot's findings

  • Files reviewed: 7/8 changed files
  • Comments generated: 1

Comment thread updater/lib/dependabot/update_files_command.rb Outdated
@kbukum1 kbukum1 changed the title Revert "Revert "Add API integration to fetch blocked versions at job … Add API integration to fetch blocked versions at job updates May 22, 2026
@kbukum1 kbukum1 requested a review from Copilot May 22, 2026 20:38
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.

Copilot's findings

  • Files reviewed: 7/8 changed files
  • Comments generated: 1

Comment thread updater/lib/dependabot/api_client.rb Outdated
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.

Copilot's findings

  • Files reviewed: 7/8 changed files
  • Comments generated: 1

Comment thread updater/lib/dependabot/api_client.rb Outdated
@kbukum1 kbukum1 force-pushed the revert-15120-revert-14917-kbukum1/add-blocked-versions-api-integration branch from 9141639 to acf1505 Compare May 22, 2026 21:00
@kbukum1 kbukum1 requested a review from Copilot May 22, 2026 21:01
@kbukum1 kbukum1 requested review from Copilot and removed request for Copilot May 22, 2026 21:03
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.

Copilot's findings

  • Files reviewed: 7/8 changed files
  • Comments generated: 0 new

@kbukum1 kbukum1 force-pushed the revert-15120-revert-14917-kbukum1/add-blocked-versions-api-integration branch from 70fe6b1 to 4d44fa5 Compare May 22, 2026 21:48
@kbukum1 kbukum1 force-pushed the revert-15120-revert-14917-kbukum1/add-blocked-versions-api-integration branch from 4d44fa5 to 631c808 Compare May 22, 2026 22:15
@kbukum1 kbukum1 force-pushed the revert-15120-revert-14917-kbukum1/add-blocked-versions-api-integration branch from 631c808 to d0439ea Compare May 22, 2026 22:26
@kbukum1 kbukum1 merged commit 04ab85a into main May 22, 2026
282 of 312 checks passed
@kbukum1 kbukum1 deleted the revert-15120-revert-14917-kbukum1/add-blocked-versions-api-integration branch May 22, 2026 23:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants