-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
base: main
Are you sure you want to change the base?
Conversation
@viceice apparently there is nothing pending, can you merge now? Thanks! |
Head branch was pushed to by a user without write access
Also, you can remove the |
httpMock.scope(uri.origin).get(uri.pathname).reply(200, content); | ||
httpMock | ||
.scope(uri.origin) | ||
.get(uri.pathname + uri.search) |
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.
use string template instead of +
concat
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.
Done!
].map((fixture) => [fixture, Fixtures.get(fixture + '.xml')]), | ||
[...Object.keys(Unity3dDatasource.streams)].map((fixture) => [ | ||
fixture, | ||
Fixtures.get(fixture + '.json'), |
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.
see comment below
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.
Read below comment
); | ||
|
||
if (legacyKey) { | ||
if (legacyKey === 'stable') { |
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.
so stable and lts are effective the same stream?
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.
If you notice, the “stable” url of the old API points to: https://unity.com/releases/editor/releases.xml
And it redirects to the “lts” url of the old API.
}; | ||
|
||
response.body.results.forEach((release) => { |
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.
use for-of loop instead
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.
Done!
const UnityRelease = z.object({ | ||
version: z.string(), | ||
releaseDate: z.string(), | ||
releaseNotes: UnityReleaseNote, |
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.
are you sure this object always exists for all packages / streams?
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 followed the instructions in the official API documentation: https://services.docs.unity.com/release/v1/#tag/Release/operation/getUnityReleases
@@ -6,7 +6,7 @@ import type { VersioningApi } from '../types'; | |||
export const id = 'unity3d'; | |||
export const displayName = 'Unity3D'; | |||
export const urls = [ | |||
'https://docs.unity3d.com/Manual/ScriptCompilationAssemblyDefinitionFiles.html#version-define-expressions', | |||
'https://docs.unity3d.com/Manual/assembly-definition-includes.html', |
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.
if you move it to a separate docs PR then it'll merged faster
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.
Done! #33927
Co-authored-by: Michael Kriese <[email protected]>
All comments answered and all the changes you requested are done @viceice |
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])
How I've tested my work (please select one)
I have verified these changes via: