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

feat(datasource/unity3d): Use Unity Releases API #33240

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bdovaz
Copy link

@bdovaz bdovaz commented Dec 22, 2024

Changes

The API has been changed to use the new Unity Releases API instead of the "old RSS system".

The new API is richer in metadata, allows more granularity by having queries (number of results, stream, os, architecture, version, ...). Example: https://services.api.unity.com/unity/editor/release/v1/releases?stream=LTS&platform=WINDOWS&architecture=X86_64

I have removed many tests that no longer make sense and were there before because of the inconsistencies of the RSS system. This new API has filters and these inconsistencies no longer occur.

I have also aligned the Unity terminology of streams (lts, tech, alpha, beta).

Context

Unity Releases API: https://services.docs.unity.com/release/v1/#tag/Release/operation/getUnityReleases

Example call: https://services.api.unity.com/unity/editor/release/v1/releases?stream=LTS

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@@ -0,0 +1,14 @@
export interface UnityReleasesJSON {
Copy link
Member

Choose a reason for hiding this comment

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

use zod schema

Copy link
Author

Choose a reason for hiding this comment

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

Done!

Unity3dDatasource.streams.stable,
Unity3dDatasource.streams.lts,
];
override readonly defaultRegistryUrls = [Unity3dDatasource.streams.lts];

override readonly defaultVersioning = Unity3dVersioning.id;
Copy link
Member

Choose a reason for hiding this comment

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

release timestamp message below needs an update

Copy link
Author

Choose a reason for hiding this comment

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

Done!

static readonly homepage = 'https://unity.com/';
static readonly streams: Record<string, string> = {
lts: `${Unity3dDatasource.homepage}releases/editor/lts-releases.xml`,
Copy link
Member

Choose a reason for hiding this comment

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

we need a compatibility helper which translates old registry urls to the new API urls. otherwise this is a breaking change.

another option is to check passed registry url and use old RSS API when an old url is passed

Copy link
Author

Choose a reason for hiding this comment

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

Done! I used a "translator"

@viceice viceice added the breaking Breaking change, requires major version bump label Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change, requires major version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants