Use Bazel-registry metadata.json repository field for sourceUrl (not just homepage)
#44623
AlexanderLanin
started this conversation in
Suggest an Idea
Replies: 1 comment
|
PR welcome |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
The
bazeldatasource should use the Bazel-registrymetadata.jsonrepositoryfield to determine a module'ssourceUrl, instead of relying solely onhomepage.Current behavior
For a
bazel_dep(Bazel Central Registry or a compatible custom registry), the datasource parses onlyhomepage,versionsandyanked_versionsfrommetadata.json:lib/modules/datasource/bazel/index.tsthen sets onlyresult.homepage. Because nosourceUrlis provided,addMetaData()derivessourceUrlfromhomepage(lib/modules/datasource/metadata.ts).The BCR
metadata.jsonschema also defines arepositoryfield (an array such as["github:owner/repo"]) that is the canonical, machine-readable source location. Renovate ignores it today.Why this is a problem
homepageis a human landing page and is frequently a docs site rather than the source repo. When it points at GitHub Pages (https://owner.github.io/project), the derivedsourceUrlhas a non-github.comhost, and the GitHub changelog source rejects it:Result: no release notes/changelogs are rendered, even though the module's
metadata.jsonrepositoryfield correctly identifies the GitHub repo and that repo publishes GitHub Releases.Concrete example
In the Eclipse SCORE Bazel registry,
score_processandscore_platformset:homepage:https://eclipse-score.github.io/process_description(GitHub Pages)repository:["github:eclipse-score/process_description"]Every update PR for these two modules is created with an empty release-notes section, while sibling modules whose
homepageis agithub.comURL (e.g.score_docs_as_code) render changelogs correctly. Therepositoryfield points at the right repo, but Renovate never reads it.Current workaround (and why it's not enough)
The only workaround today is to change the registry data so
homepageis the GitHub repo URL, e.g. this registry PR:eclipse-score/bazel_registry#462 (sets
homepagetohttps://github.com/eclipse-score/<repo>).That works, but it forces registry maintainers to duplicate the
repositoryvalue intohomepage(and to sacrifice a legitimate docs-site homepage) purely to satisfy Renovate. Honoringrepositorywould remove the need for this workaround entirely.Proposed enhancement
In the
bazeldatasource:repositoryto the parsed schema (array of"<host>:owner/repo"strings, per BCR).github:owner/repoentry intohttps://github.com/owner/repoand set it assourceUrlon theReleaseResult(also supportgitlab:etc. where feasible).homepageas a fallback whenrepositoryis absent, preserving current behavior.This makes changelog retrieval work for any BCR-style module whose
homepageis a docs/Pages site, using the standards-defined field for exactly this purpose. It is backwards compatible (fallback tohomepageis unchanged).References
metadata.jsonrepositoryfield.releaseTimestamp).All reactions