-
Notifications
You must be signed in to change notification settings - Fork 12
Add endpoint that returns the latest stable release #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Leonidas-from-XIV
merged 7 commits into
ocaml-dune:main
from
Leonidas-from-XIV:latest-stable
Mar 12, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d5b5038
Add endpoint for getting the latest stable release
Leonidas-from-XIV 9a98306
No more silly-con
Leonidas-from-XIV ec6b518
Add interface file
Leonidas-from-XIV 9dc18ed
Add explicit route
Leonidas-from-XIV e288e47
Deduplicate target check
Leonidas-from-XIV ef05cba
Document the endpoint
Leonidas-from-XIV d0c1dbd
Refactor `newest_tagged`
Leonidas-from-XIV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| module Target : sig | ||
| type t | ||
|
|
||
| val to_human_readable_string : t -> string | ||
| val to_description : t -> string | ||
| val to_triple : t -> string * string * string | ||
| val of_string : string -> t option | ||
| val defaults : t list | ||
| end | ||
|
|
||
| module Bundle : sig | ||
| type t | ||
|
|
||
| val targets : t -> Target.t list | ||
| val commit : t -> string | ||
| val tag : t -> string option | ||
| val to_download_file : Target.t -> string | ||
| val to_download_url : base_url:string -> target:Target.t -> t -> string | ||
| val to_certificate_url : base_url:string -> target:Target.t -> t -> string | ||
| val get_date_string_from : ?prefix:string -> t -> string | ||
|
|
||
| (* creates a bundle with the current date *) | ||
| val create_daily : Target.t list -> commit:string -> tag:string option -> t | ||
|
|
||
| (* returns [true] if the bundle matches the query *) | ||
| val matches_criteria : tag:string option -> target:Target.t -> t -> bool | ||
|
|
||
| (* returns the bundle with the highest version number *) | ||
| val newest_tagged : t list -> t option | ||
| end | ||
|
|
||
| (* [import_from_json filename] reads the file and parses it into a list of [Bundle.t] *) | ||
| val import_from_json : string -> Bundle.t list | ||
|
|
||
| (* [export_to_json filename bundles] takes bundles and writes them to the specified | ||
| file name. *) | ||
| val export_to_json : string -> Bundle.t list -> unit | ||
|
|
||
| (* Inserts a new bundle into the list unless there is already an equivalent one. *) | ||
| val insert_unique : Bundle.t -> Bundle.t list -> Bundle.t list |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the logic here a bit convoluted to follow. It's partially just due to the nesting and branching and piping together, and reverse sorting, but mainly just due to my limited cognitive capacities.
Still, with a just a few more lines of code, and a few auxiliary functions, I think this could be made more readable and more efficient (just requiring a single pass at the list and avoiding the need to allocate new lists or do sorting). E.g., with something like
I'd not recommend this just to optimize in a place where it probably won't matter much, but since I also find something like this easier to reason about, I felt it worth recommending.
Still, this is just a suggestion on my part on not a blocking change request.