feat(changelog): add generic changelog source#41918
feat(changelog): add generic changelog source#41918bdovaz wants to merge 1 commit intorenovatebot:mainfrom
Conversation
|
I see that the
The In the Despite all of the above, I've reached the point where the I haven't been able to get it to render inline because the |
| return null; | ||
| } | ||
| const versioningApi = allVersioning.get(versioning); | ||
| if (versioningApi.equals(currentVersion, newVersion)) { | ||
| return null; | ||
| } | ||
|
|
||
| const platformUrl = sourceUrl ?? registryUrl!; |
There was a problem hiding this comment.
As I mentioned in my original post:
The getChangeLogJSON function (in index.ts) works with sourceUrl, but as I mentioned earlier, Unity is not open source and there is no source URL, nor does the API work that way, so it directly returns the Markdown in changelogUrl. Because of this, I had to make slight modifications to that function.
In other words, I try to use sourceUrl as usual, and if that fails, I fall back to registryUrl. Unless you can suggest a better option for me to use later in detectPlatform, this is the only solution I could come up with that I know will always be set.
In the case of Unity, in the link to an API call that I included in the PR description, you can see that the Markdown links have nothing to do with Unity. They’re hosted on Google Cloud.
I can't use changelogUrl because it doesn't refer to anything in Unity, and I can't filter by it.
| @@ -0,0 +1,25 @@ | |||
| import { BranchUpgradeConfig } from '../../../../../types.ts'; | |||
There was a problem hiding this comment.
you probably need to rebase onto main or merge main and fix this
| @@ -212,7 +213,9 @@ async function releaseNotesResult( | |||
| } | |||
| const { baseUrl, repository } = project; | |||
| const releaseNotes: ChangeLogNotes = releaseMatch; | |||
| if (detectPlatform(baseUrl) === 'gitlab') { | |||
| if (detectPlatform(baseUrl) === 'generic') { | |||
There was a problem hiding this comment.
store detectPlatform(baseUrl) call into a variable and reuse (perf)
| @@ -89,6 +89,7 @@ export abstract class ChangeLogSource { | |||
| const versioning = config.versioning!; | |||
| const currentVersion = config.currentVersion!; | |||
| const newVersion = config.newVersion!; | |||
| const changelogUrl = config.changelogUrl!; | |||
There was a problem hiding this comment.
Are you sure changelogUrl is always set here?
There was a problem hiding this comment.
I don't have much experience with the codebase, but at least I know that in the test I ran mentioned in this comment, it goes through this code and ends up generating the link with the text (changelog).
I know that sourceUrl is empty in the case of the unity3d data source, so if changelogUrl were also empty in the subsequent calls to getCacheKey, the code would throw an error—but it doesn't.
Changes
Create a new generic changelog source to handle cases where data sources such as
unity3dreturn markdown directly in thechangelogUrlfield.API example: https://services.api.unity.com/unity/editor/release/v1/releases?stream=LTS
A markdown example: https://storage.googleapis.com/live-platform-resources-prd/templates/assets/6000_3_11f1_500c5f352f/6000_3_11f1_500c5f352f.md
Context
It comes from here and here
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: