diff --git a/backend/go.mod b/backend/go.mod index 26f7b663..605c3745 100644 --- a/backend/go.mod +++ b/backend/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-enry/go-license-detector/v4 v4.3.1 github.com/lib/pq v1.10.9 github.com/mitchellh/go-spdx v0.1.0 - github.com/opentofu/libregistry v0.0.0-20240902143137-5bc965332079 + github.com/opentofu/libregistry v0.0.0-20240905103355-13386c198ea1 github.com/opentofu/tofudl v0.0.0-20240730151408-3bd8529dae09 github.com/opentofu/tofutestutils v0.0.0-20240821111804-5fcfb797e0a7 golang.org/x/sync v0.8.0 diff --git a/backend/go.sum b/backend/go.sum index 1bf4bd78..e5f73ee7 100644 --- a/backend/go.sum +++ b/backend/go.sum @@ -223,6 +223,8 @@ github.com/opentofu/libregistry v0.0.0-20240902140652-883944ac1490 h1:GrgjoNMwx1 github.com/opentofu/libregistry v0.0.0-20240902140652-883944ac1490/go.mod h1:irS/XyfQZdwi3Ggm105FfDyj3d9deFAi5GraORIeMsI= github.com/opentofu/libregistry v0.0.0-20240902143137-5bc965332079 h1:GdkIdGChrfnE4C/HkDsnffddAm3Qd4pms1gO/sf1GJ4= github.com/opentofu/libregistry v0.0.0-20240902143137-5bc965332079/go.mod h1:irS/XyfQZdwi3Ggm105FfDyj3d9deFAi5GraORIeMsI= +github.com/opentofu/libregistry v0.0.0-20240905103355-13386c198ea1 h1:1+kxZxlnYwakDxdHf90YdaLwd9F+MBuY/70lIRmT2pA= +github.com/opentofu/libregistry v0.0.0-20240905103355-13386c198ea1/go.mod h1:irS/XyfQZdwi3Ggm105FfDyj3d9deFAi5GraORIeMsI= github.com/opentofu/registry-address v0.0.0-20230922120653-901b9ae4061a h1:NyM/PPbc+kxxv2d4OKfE32C5fLtVTLceyg4YKKCYO9Y= github.com/opentofu/registry-address v0.0.0-20230922120653-901b9ae4061a/go.mod h1:HzQhpVo/NJnGmN+7FPECCVCA5ijU7AUcvf39enBKYOc= github.com/opentofu/tofudl v0.0.0-20240730151408-3bd8529dae09 h1:bA3Dy3Be9o896wdcQhK0Ky2Eco0ZwCWZgt73dSaYuDI= diff --git a/backend/internal/providerindex/generator.go b/backend/internal/providerindex/generator.go index 37615040..8c29ce20 100644 --- a/backend/internal/providerindex/generator.go +++ b/backend/internal/providerindex/generator.go @@ -321,16 +321,18 @@ func (d *documentationGenerator) scrapeProvider(ctx context.Context, addr provid } func (d *documentationGenerator) scrapeVersion(ctx context.Context, addr providertypes.ProviderAddr, canonicalAddr provider.Addr, version provider.Version, blocked bool, blockedReason string) (providertypes.ProviderVersion, error) { + // We get the VCS version before normalizing as the tag name may be different. + vcsVersion := version.Version.ToVCSVersion() version.Version = version.Version.Normalize() d.log.Info(ctx, "Scraping documentation for %s version %s...", addr, version.Version) // TODO get the release date instead of the tag date - tag, err := d.vcsClient.GetTagVersion(ctx, canonicalAddr.ToRepositoryAddr(), version.Version.ToVCSVersion()) + tag, err := d.vcsClient.GetTagVersion(ctx, canonicalAddr.ToRepositoryAddr(), vcsVersion) if err != nil { return providertypes.ProviderVersion{}, err } - workingCopy, err := d.vcsClient.Checkout(ctx, canonicalAddr.ToRepositoryAddr(), version.Version.ToVCSVersion()) + workingCopy, err := d.vcsClient.Checkout(ctx, canonicalAddr.ToRepositoryAddr(), vcsVersion) if err != nil { return providertypes.ProviderVersion{}, err }