Support source URLs for GitLab-provided terraform modules #25002
colinodell
started this conversation in
Suggest an Idea
Replies: 1 comment 1 reply
-
SGTM |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR: I would like Renovate's
terraform-module
datasource to always capture thesource
URL field if provided by the registry, as some registries (like GitLab's) do expose this non-standard field.Details
The Terraform Module Registry Protocol defines a minimal specification that all implementations must follow. Notably, the "list available versions" endpoint must return responses like this:
However, implementations are allowed to provided a superset of the API:
Both the public Terraform Registry and GitLab's Terraform Registry provide an additional
source
field which may (or may not) contain a valid URL.Currently, Renovate will only check for and use that
source
field if the registry URL containsterraform.io
:renovate/lib/modules/datasource/terraform-module/index.ts
Lines 61 to 73 in 2554a5e
(This next code snippet is only present in the
queryRegistryExtendedApi()
method)renovate/lib/modules/datasource/terraform-module/index.ts
Lines 114 to 116 in 2554a5e
I propose that Renovate should always check for that
source
field (for other registries viaqueryRegistryVersions()
), and use that value as thesourceUrl
if it indeed contains a URL. The proposed implementation would look something like this:(Some other minor tweaks are also needed; this is just the important bit)
Basically, if a
source
key is found and it looks like a URL, let's assume it must be a source URL.I have this working locally (along with an automated test) and would be glad to push up a PR if you're open to this change :)
Beta Was this translation helpful? Give feedback.
All reactions