Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datasource:terraform): use official api for custom registries #15175

Merged
merged 19 commits into from May 16, 2022

Conversation

mcfedr
Copy link
Contributor

@mcfedr mcfedr commented Apr 19, 2022

Changes

changes the terraform module and provider loading to try to use use the versions endpoint as per the spec, if the extended api isn't available.

The current code uses extensions to the spec, that are supported by registry.terraform.io, but not all third parties, e.g. GitLab. This will allow loading version info for modules hosted on GitLab and other registries that support the basic spec.

Also new endpoint doesn't have release date information, so thats now omitted when using these endpoints.

Context

Fixes #14602

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 tick 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

@viceice viceice self-requested a review April 19, 2022 13:19
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

please trim sample JSON fixture to have less versions.

@mcfedr
Copy link
Contributor Author

mcfedr commented Apr 19, 2022

@viceice I've reduced the size of the samples - just so you know, still changes the snapshots as the versions are in a random order in that response, so i've just left the first couple of 100 lines.

@viceice
Copy link
Member

viceice commented Apr 19, 2022

@viceice I've reduced the size of the samples - just so you know, still changes the snapshots as the versions are in a random order in that response, so i've just left the first couple of 100 lines.

that's fine

lib/modules/datasource/terraform-module/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-module/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-module/types.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/types.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/index.ts Outdated Show resolved Hide resolved
@mcfedr mcfedr force-pushed the terraform-third-party-modules branch from 8967ee1 to 178abd8 Compare April 21, 2022 08:35
@rarkins rarkins requested a review from viceice April 21, 2022 08:55
@mcfedr
Copy link
Contributor Author

mcfedr commented Apr 21, 2022

@viceice so I've made a new commit - new try - this probably makes sense - tries the current endpoint first and if it doesnt work tries the documented api.

changes the terraform module and provider to try loading from basic spec registry
@mcfedr mcfedr force-pushed the terraform-third-party-modules branch from 80ac660 to 9866cea Compare April 21, 2022 12:07
@viceice
Copy link
Member

viceice commented Apr 22, 2022

Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

lib/modules/datasource/terraform-module/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-module/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/index.ts Outdated Show resolved Hide resolved
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

see comments

@mcfedr mcfedr requested a review from viceice April 22, 2022 11:47
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

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

see comment

@mcfedr mcfedr requested a review from viceice April 23, 2022 08:40
@mcfedr
Copy link
Contributor Author

mcfedr commented Apr 28, 2022

Any update on this? I think all the comments have been addressed @viceice

lib/modules/datasource/terraform-module/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-module/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-module/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-module/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-module/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/index.spec.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/index.ts Outdated Show resolved Hide resolved
lib/modules/datasource/terraform-provider/index.ts Outdated Show resolved Hide resolved
@mcfedr mcfedr requested a review from viceice May 9, 2022 13:28
@mcfedr mcfedr requested a review from viceice May 11, 2022 10:18
@mcfedr mcfedr requested a review from viceice May 16, 2022 10:39
This reverts commit 2729fdc.
@mcfedr mcfedr requested a review from viceice May 16, 2022 11:01
viceice
viceice previously approved these changes May 16, 2022
@viceice viceice changed the title fix: loading terraform modules feat(datasource:terraform): use documented api for custom registries May 16, 2022
@viceice viceice changed the title feat(datasource:terraform): use documented api for custom registries feat(datasource:terraform): use official api for custom registries May 16, 2022
@viceice viceice enabled auto-merge (squash) May 16, 2022 11:05
auto-merge was automatically disabled May 16, 2022 11:27

Head branch was pushed to by a user without write access

@mcfedr mcfedr requested a review from viceice May 16, 2022 11:28
@viceice viceice enabled auto-merge (squash) May 16, 2022 11:49
@mcfedr
Copy link
Contributor Author

mcfedr commented May 16, 2022

@viceice i guess something is wrong that it doesnt auto merge

@viceice
Copy link
Member

viceice commented May 16, 2022

nope, needs update from main. 😉

@viceice viceice merged commit bd35df6 into renovatebot:main May 16, 2022
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 32.57.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform modules discovery not working on gitlab.com terraform registry
4 participants