Add blocked versions support to dry-run script#14916
Open
Conversation
c4cffaf to
c395939
Compare
Add BLOCKED_VERSIONS environment variable support to bin/dry-run.rb
so developers can simulate blocked dependency versions locally without
needing access to the production API.
Usage:
BLOCKED_VERSIONS='[{"dependency-name":"event-stream","version":"= 3.3.6","reason":"malware"}]' \
bin/dry-run.rb npm some/repo
Changes:
- Parse BLOCKED_VERSIONS env var (JSON array, same format as job attr)
- Merge blocked versions into ignored_versions_for as version
requirement strings (passthrough, supports exact and ranges)
- Log active blocked versions at the start of the update run
- Defensive: skip entries missing dependency-name or version
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c395939 to
1905894
Compare
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.
What
Add
BLOCKED_VERSIONSenvironment variable support tobin/dry-run.rbso developers can simulate blocked dependency versions during local testing.Why
The blocked versions feature prevents Dependabot from suggesting updates to known-malicious dependency versions. To support local development and testing of this feature, the dry-run script needs a way to pass blocked versions without requiring access to the production API.
What's Being Changed
bin/dry-run.rb: AddedBLOCKED_VERSIONSenv var parsing (JSON array format), merged blocked versions into the ignored versions list as version requirement strings, and added startup logging when blocked versions are active.Example Usage
How to Review
dependency-name,version(a requirement string like"= 3.3.6"or"> 2.10"), and optionalreason.dependency-nameorversionare defensively skipped.