feat(supply-chain): add support for version ranges to dependency definitions#445
Draft
nhakmiller wants to merge 1 commit intomainfrom
Draft
feat(supply-chain): add support for version ranges to dependency definitions#445nhakmiller wants to merge 1 commit intomainfrom
nhakmiller wants to merge 1 commit intomainfrom
Conversation
bkettle
reviewed
Mar 26, 2026
| (* alt: sca_dependency? *) | ||
| type found_dependency <ocaml attr="deriving ord"> = { | ||
| package: string; | ||
| version: string; |
Contributor
There was a problem hiding this comment.
What do you think should go here when version_specifier is provided? I wonder if version_specifier should just replace version? It couple then be one of Exact string | Constraints version_constraint list or something
bkettle
reviewed
Mar 26, 2026
| When present, indicates the dependency version is a range rather than a | ||
| pinned version, and matching should use range overlap instead of exact | ||
| version comparison."> | ||
| : string option; |
Contributor
There was a problem hiding this comment.
What do you think about parsing this out in to something like
type version_constraint = [
| Gt of string
| Lt of string
| Geq of string
| Leq of string
]
Where the string in each is a version string? I'm thinking this could be better because there are all kinds of funky version specifiers used that can be package manager specific (`>` vs `~` and `^` etc) and it would be nice to have the parsers handle the package-manager-specific stuff.
bkettle
reviewed
Mar 26, 2026
Contributor
bkettle
left a comment
There was a problem hiding this comment.
the other thing we need to think about is how the app will handle this stuff and put it into its database, since the DB currently expects an exact version as well. You probably know the most about what's feasible there from your experience with the version filters
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.
Context
I'm investigating what it could look like to support unpinned versions of dependencies, at least in processing
requirements.txt(a special case of dependency source file which is kind of like a manifest file but also kind of like a lockfile.This change adds a field for us to optionally track a
version_specifieron afound_dependencyin addition to a package name and version. We will consume this on the CLI to track non exact pinned versions.make setup && maketo update the generated code after editing a.atdfileFor example, the Semgrep backend need to still be able to consume data
generated by Semgrep 1.50.0.
See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades
Note that the types related to the semgrep-core JSON output or the
semgrep-core RPC do not need to be backward compatible!
semgrep-proprietaryare approved and ready to merge once this PR is merged