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

Support Nested Terraform Code (HCL) #649

Open
osterman opened this issue Aug 24, 2018 · 26 comments
Open

Support Nested Terraform Code (HCL) #649

osterman opened this issue Aug 24, 2018 · 26 comments
Labels
F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. Keep Exempt this from being marked by stalebot L: terraform Terraform packages T: feature-request Requests for new features transitive-dependencies

Comments

@osterman
Copy link

what

  • Dependabot will not look recursively through directories in repo for .tf code
  • Want submodules to get updates

why

  • In terraform, it's valid to nest modules in subfolders

references

@greysteil
Copy link
Contributor

In general, the approach we take with recursive dependency file finding is:

  • If the files are somehow linked (e.g., they reference each other, or have a top level file that lists all of them) then we download them all and update them all at once
  • If the files aren't linked in any way then we don't crawl your repo looking for them - instead you need to add each directory manually in Dependabot (you can add the same "language" multiple times to a project - apologies for the confusing terminology)

What's the setup with Terraform? I'd like to improve the flow for setups that we don't bump all-at-once, but I think it's a UI tweak rather than a core change (i.e., making it easier to select them in the dashboard).

What do you reckon?

@lorengordon
Copy link
Contributor

It's a bit of a bear to manually add every directory with terraform configurations into dependabot. Each directory with .tf files is really its own, independent terraform module.

Plus, the way dependabot is now, restructuring the repo would mean needing to also "fix" the dependabot config.

A better workflow to me would be to scan the repo for directories with .tf files, check each for module sources, and create separate PRs for each.

@greysteil
Copy link
Contributor

That makes sense to me. I think what's needed here is a better frontend for Dependabot for selecting multiple directories to apply it to, and an option to "always apply to all directories" or something like that (maybe with a blacklist).

Sounds like you think the backend implementation (separate PRs for each module) is basically correct, though?

@lorengordon
Copy link
Contributor

Separate PRs for each updated "source" is my preference... That way each dependency update gets tested on it's own. If there are interrelated changes between dependencies needed to pass tests, I'd modify the PR myself.

@greysteil
Copy link
Contributor

Great. We're planning to work on the front-end a bunch over the next couple of months, so I should be able to get this sorted then.

@takotaco
Copy link

takotaco commented May 9, 2019

Any updates on this? This would be a really awesome feature to have!

@greysteil
Copy link
Contributor

We haven't had a chance to work on the improved project-selection interface yet, but I'm still keen to do it. Will have an update in the next few weeks.

@takotaco
Copy link

@greysteil awesome, thanks! I'll keep an eye out for updates.

I just added dependabot to a bunch of repos, several of which have multiple terraform stacks/modules. It would be cool to have the auto detect feature but I was still able to set everything up with the current config format so I'm pretty happy with that for now.

@LaurenceGA
Copy link

Any updates on this? Seems common to have Terraform modules as separate subdirectories and it can be tedious to add each one.

@feelepxyz feelepxyz added the T: feature-request Requests for new features label Oct 23, 2019
@rebelagentm rebelagentm added the L: terraform Terraform packages label Oct 30, 2019
@infin8x infin8x added the F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. label Jul 2, 2020
@carbohydrates
Copy link

Hello, any update on this ?

@pigri
Copy link

pigri commented Mar 14, 2022

Any updates on this?

@balay80
Copy link

balay80 commented Mar 17, 2022

Any update on this ?

@jinzishuai
Copy link

I am having the same problem. How do we address this?

@jmreicha
Copy link

Piling on here, looking for this functionality as well.

@BogdanBozic
Copy link

Hoping to see this as well.

@zlahham
Copy link

zlahham commented Aug 8, 2022

Any updates? :)

@cyberveseli
Copy link

Also looking for this option :)

@bartelemi
Copy link

Looking forward for this feature. I think this would also solve our problem around upgrading modules in terragrunt nested directories.

@jmreicha
Copy link

FWIW I have been able to completely ditch dependabot for this use case by using Renovate and a quick custom CI job.

@dgokcin
Copy link

dgokcin commented Sep 3, 2023

has anyone tried the described options in github blog? looks promising.

@SchulteMarkus
Copy link

has anyone tried the described options in github blog? looks promising.

I don't see where the new Dependabot grouping feature helps with this request. Can you give an example?

@dgokcin
Copy link

dgokcin commented Sep 4, 2023

@SchulteMarkus sure

If you have a terraform modules in a repo like the ss below, you need to specify every directory in the dependabot config. As far as I understand, the blog post introduces a feature that allows you to use terraform modules in dependabot config with a wildcard pattern without specifying each of them seperately.

image

@YElyousfi
Copy link

Is there any plan to support this? It's been years.

Right now if a repo has let's say 100 modules in their own folder, which is convention, then we need 100 TF dependabot configs in the YAML file. It's a lot of maintenance that can quickly fall out of sync minimizing the benefits of Dependabot with Terraform

@jensenbox
Copy link

Just use Snyk - dependabot clearly does not care about Terraform.

@ferdi145
Copy link

ferdi145 commented Oct 5, 2023

@dependabot recreate

@MykolaDzhamQC
Copy link

I've just realised that .tflint.hcl file in the root of the repo caused dependabot to not look at anything else as result ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: language-support Issues specific to a particular language or ecosystem; may be paired with an L: label. Keep Exempt this from being marked by stalebot L: terraform Terraform packages T: feature-request Requests for new features transitive-dependencies
Projects
None yet
Development

No branches or pull requests