Add an API to infrastructure registry in order to support renovatebot for terraform modules
Proposal
Tested with gitlab 14.4.1 premium
I use Infrastructure Registry to store terraform modules shared across projects.
I also use renovate to ease the maintenance of dependencies such as golnag modules, helm charts, etc... including terraform modules, and to ensure that the projects are up to date.
From what I understand with the renovate logs, it sends a request to a URL such as <base_url>/api/v4/packages/terraform/modules/v1/<group>/<module_name>/<provider>
From the terraform registry doc, this URL allows to fetch the latest version of a module (https://www.terraform.io/docs/registry/api.html#latest-version-for-a-specific-module-provider)
Currently, Infra Registry does not support this API, and returns a {"error":"404 Not Found"}
. It supports though <base_url>/api/v4/packages/terraform/modules/v1/<group>/<module_name>/<provider>/versions
API that lists all the versions of the module.
So the logic is already present in gitlab code, it seems that only this API is missing to enable the dependency management by renovatebot.