Skip to content

feat(changelog): add generic changelog source#41918

Draft
bdovaz wants to merge 1 commit intorenovatebot:mainfrom
bdovaz:generic-changelog-source
Draft

feat(changelog): add generic changelog source#41918
bdovaz wants to merge 1 commit intorenovatebot:mainfrom
bdovaz:generic-changelog-source

Conversation

@bdovaz
Copy link
Contributor

@bdovaz bdovaz commented Mar 13, 2026

Changes

Create a new generic changelog source to handle cases where data sources such as unity3d return markdown directly in the changelogUrl field.

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:

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

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.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

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

The public repository:

@bdovaz
Copy link
Contributor Author

bdovaz commented Mar 13, 2026

I see that the ChangeLogSource class and everything related to it (repositories, tags, etc) are tightly coupled. And the generic approach “doesn't quite fit”:

  1. In the constructor, I pass the data source as null because I’m not going to use it and I can’t (the Unity3D data source doesn’t resolve the repository because Unity is closed-source, so there are no tags or anything similar to resolve).
  2. Because of the previous point, I haven’t been able to implement getCompareURL.
  3. I implement getAPIBaseUrl, but in my case, it’s obviously “not an API base URL.”
  4. I return true in hasValidRepository, but in reality, there isn’t a repository at all.

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 the getChangeLogJSON function (from source.ts), I had to modify how it resolves the cache key due to the reasons mentioned above.

Despite all of the above, I've reached the point where the (changelog) link appears, which leads to the Markdown file: bdovaz/renovate_test#26

I haven't been able to get it to render inline because the sectionize function in release-notes.ts doesn't seem to like Unity's Markdown. I guess because it isn't formatted correctly (it only has sections 3 and 4). But that's another issue for the future that could be addressed in a separate PR.

@secustor secustor self-requested a review March 14, 2026 05:50
return null;
}
const versioningApi = allVersioning.get(versioning);
if (versioningApi.equals(currentVersion, newVersion)) {
return null;
}

const platformUrl = sourceUrl ?? registryUrl!;
Copy link
Member

Choose a reason for hiding this comment

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

why this is neeed 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Image

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';
Copy link
Member

Choose a reason for hiding this comment

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

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') {
Copy link
Member

Choose a reason for hiding this comment

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

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!;
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure changelogUrl is always set here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

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.

2 participants