-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema/v5.0: introduce computable version ranges
The shorthand version of this schema is: versions: [{ version: $version status: $status // unknown, affected, unaffected; unsupported? range: string (‘semver’, ‘git’, ..., to define meaning of <) repo: string (optional for range ‘git’) limit: $versionLimit (this range stops just before limit; can use * for “infinity” aka "maxuint") changes: [{ at: version where status changes status: ... }] }] An object in the versions list can be either: - a simple {version: V, status: S}, which indicates the status of the single version V. - a range {version: V, range: R, limit: L, status: S, changes: C}, which indicates the status of the half-open interval [V, L) (that is, V is included but L is not). The range starts with V having status S and then changes over time according to the events listed in C. The algorithm for deciding the status of a particular version V is then: for entry in versions { if entry.limit is not present and v == entry.version { return entry.status } if entry.limit is present and v <= entry.version and v < entry.limit { status = entry.status for change in entry.changes { if v >= change.at { status = change.status } } return status } } return "unknown" Fixes #87.
- Loading branch information
Showing
1 changed file
with
64 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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