Skip to content
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

Add placeholder API for swiftly releases #828

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cmcgee1024
Copy link
Member

As pitched in the forum this is a preliminary API providing metadata about the currently available swiftly release. https://forums.swift.org/t/new-swift-org-api-endpoint-for-the-current-swiftly-release/74702

Motivation:

Swiftly itself has a self-update mechanism to help provide an easy path to keep in sync with the capability of the swift.org website, and to roll out new features and bug fixes. Since swift.org is the place where the official swiftly releases will be published then this API is updated whenever there is a new release. Since there has not yet been a swiftly release on swift.org and existing swiftly installations do not yet use this new API mechanism, there are no expected clients of this API yet. This is a preliminary step to prepare for a release of swiftly when that does happen.

Modifications:

Added a new /api/v1/swiftly.json endpoint with metadata about the current swiftly release, for now, until the next swiftly is released.

Result:

As a result, this endpoint will be accessible to swiftly when it is released.

@@ -0,0 +1,15 @@
{
"version": "0.3.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we want to host more versions on here or would this always point to the latest?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my current thinking, this would only ever have a single version of swiftly. I can't think of good reasons why someone should want to cherry-pick a particular version to install.

@0xTim
Copy link
Member

0xTim commented Oct 11, 2024

Have we checked this get copied over automatically or do they need page metadata adding so Jekyll knows what to do with them?

@cmcgee1024
Copy link
Member Author

Have we checked this get copied over automatically or do they need page metadata adding so Jekyll knows what to do with them?

@0xTim the Jekyll mechanism is entirely opaque to me. I'm assuming a plain json without any template information will be taken literally by the template engine, but I'm not sure about that. To use the template engine for swiftly, I'd need to understand where in that data model the swiftly metadata will be kept.

Suggestions are certainly welcome from anyone who understands the system.

@shahmishal
Copy link
Member

We can do the same as swift_releases.yml, so we will need to create a new yaml file (swiftly_releases.yml) under _data/build.
for example: swiftly_releases.yml

- name: "0.3.0"
  tag: 0.3.0
  platforms:
    - name: Linux
      platform: Linux
      x86_64: "https://download.swift.org/swiftly-0.3.0-release/linux/swiftly-0.3.0-RELEASE/swiftly-0.3.0-RELEASE-linux.tar.gz"

After you will want to create a dir api/v1/swiftly and add a file releases.json

---
layout: none
---
{{ site.data.builds.swiftly_releases | jsonify }}

@cmcgee1024
Copy link
Member Author

@0xTim @shahmishal thank you, I've refactored the changes as you've suggested.

Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I'll let @shahmishal take a look as well before merging

@0xTim
Copy link
Member

0xTim commented Oct 21, 2024

@swift-ci test

@0xTim
Copy link
Member

0xTim commented Oct 21, 2024

@swift-ci please test

@shahmishal
Copy link
Member

Moving this to draft until swiftly tar.gz / pkg are available on download.swift.org

@czechboy0
Copy link
Member

Related to #841, depending on which one lands first, we'll want to update the other one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants