-
Notifications
You must be signed in to change notification settings - Fork 234
Swift.org install api to support installer tools (Swiftly) #720
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
Swift.org install api to support installer tools (Swiftly) #720
Conversation
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.
It would be amazing if we could use e.g. https://github.com/avillafiorita/jekyll-datapage_gen (do we even need a plugin? I'm no Jekyll expert) to dynamically generate these endpoints based on a single source of truth data file—I guess _data/builds/swift_releases.yml
would be enough?
This data file could then also be used to generate the pages for /install, instead of manually creating them as well as their content for each new supported platform/version, since this can easily lead to inconsistencies.
In this pull request, the data are generated from the yml file during the build phase so it would signal source of truth. for example, its reading the value from the _data and converting it to json.
|
I mean to generate the "template" endpoint files for each version as well, so we don't have to create a new I guess now we would also have to duplicate the platform/version JSON files for each new Swift version as well. If they were generated, adding support for a future Swift version would be as simple as only updating the source of truth data file. |
I will look into https://github.com/avillafiorita/jekyll-datapage_gen plugin, I noticed the repo has not been updated for 2 years (it might be fine). |
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.
This works well enough for the time being, even though I agree with @alexandersandberg that we can benefit from generating the JSON files dynamically.
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.
Looks like a great step in the right direction! Do appear to be missing the newer platforms though
The new platforms are available part of the releases.json only because nightly toolchains currently have an issue with new platforms on main and release/6.0 branches. |
@swift-ci test |
When do you plan to add dev/6.1 to swift.org install API? |
Swift.org install api to support installer tools (Swiftly)
To support Swiftly, I propose static JSON API endpoints from YAML files that will be created during the Jekyll build phase. These endpoints will allow users to access a list of releases at
swift.org/api/v1/install/releases.json
, containing information about tags, platforms, architectures, and docker tags. The dev endpoint,swift.org/api/v1/install/dev/<branch>/<platform>.json
, will provide a list of development toolchain information. In the future, we should provide REST APIs which can be dynamic and supports query parameters.