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

Terraform: always clone repository contents #3978

Merged
merged 2 commits into from
Jun 23, 2021

Conversation

feelepxyz
Copy link
Contributor

@feelepxyz feelepxyz commented Jun 23, 2021

Terraform projects can include local path modules that are currently not
fetched in the file fetching step so any lockfile update will fail
because these files are missing.

The easiest fix seemed to be to always start cloning terraform projects
as this is what we want to end up doing for all ecosystems.

The file fetcher will still hit the gh api when getting the repo contents
but this would require changes in common so keen to make that change
separately as it currently works.

Terraform projects can include local path modules that are currently not
fetched in the file fetching step so any lockfile update will fail
because these files are missing.

The easiest fix seemed to be to always start cloning terraform projects
as this is what we want to end up doing for all ecosystems.

The file fetcher will still hit the gh api when getting the reo contents
but this would require changes in common so keen to make that change
separately as it currently works.
@feelepxyz feelepxyz requested a review from a team as a code owner June 23, 2021 15:33
@feelepxyz feelepxyz changed the title Terraform: clone repository contents for update Terraform: always clone repository contents Jun 23, 2021
@@ -17,3 +17,6 @@
require "dependabot/dependency"
Dependabot::Dependency.
register_production_check("terraform", ->(_) { true })

require "dependabot/utils"
Dependabot::Utils.register_always_clone("terraform")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure this is all that needs to be done, in addition to the file updater change to call SharedHelpers.in_a_temporary_repo_directory. Tested with a dry-run and looks like the updater checks this flag to turn on cloning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any reason we shouldn't be doing this?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is it! 👍

@feelepxyz feelepxyz merged commit da10802 into main Jun 23, 2021
@feelepxyz feelepxyz deleted the feelepxuz/always-clone-terraform branch June 23, 2021 16:53
@feelepxyz feelepxyz mentioned this pull request Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants