Repository: chanzuckerberg/fogg
Pull request #495 (2020-09-11 04:52:24)

[fix] broken terraform.d symlinks
Avoid having broken terraform.d symlinks.

We download custom plugins to the terraform.d directory at the root of the fogg-managed repos and symlink that directory to each working directory. Until recently it was fine if some of these symlinks were broken, but now TFE complains. 

This PR fixes our .gitignore and .terraformignore rules to be sure that there are no broken links.

### Test Plan
* CI
* tested manually via prerelease on 1 repo

### References
*

codecov-commenter: # [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/495?src=pr&el=h1) Report
> Merging [#495](https://codecov.io/gh/chanzuckerberg/fogg/pull/495?src=pr&el=desc) into [master](https://codecov.io/gh/chanzuckerberg/fogg/commit/ae274065c8aac1c999d4cded1cb7a8bede7b4439?el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/chanzuckerberg/fogg/pull/495/graphs/tree.svg?width=650&height=150&src=pr&token=57DhtZ7g2A)](https://codecov.io/gh/chanzuckerberg/fogg/pull/495?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master     #495   +/-   ##
=======================================
  Coverage   59.72%   59.72%           
=======================================
  Files          19       19           
  Lines        2001     2001           
=======================================
  Hits         1195     1195           
  Misses        649      649           
  Partials      157      157           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/495?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/495?src=pr&el=footer). Last update [ae27406...05ac2b0](https://codecov.io/gh/chanzuckerberg/fogg/pull/495?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

ryanking: Going to force-merge this because it is currently breaking many repos.

Patch:
diff --git a/templates/repo/.gitignore b/templates/repo/.gitignore
index 69565ae8..1985b92a 100644
--- a/templates/repo/.gitignore
+++ b/templates/repo/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/templates/repo/.terraformignore.tmpl b/templates/repo/.terraformignore.tmpl
index 7a58732c..188eeab4 100644
--- a/templates/repo/.terraformignore.tmpl
+++ b/templates/repo/.terraformignore.tmpl
@@ -1,7 +1,8 @@
 {{ template "fogg_header" }}
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/templates/repo/terraform.d/.keep.touch b/templates/repo/terraform.d/.keep.touch
new file mode 100644
index 00000000..e69de29b
diff --git a/templates/repo/terraform.d/plugins/linux_amd64/.gitignore b/templates/repo/terraform.d/plugins/linux_amd64/.gitignore
deleted file mode 100644
index b04e8794..00000000
--- a/templates/repo/terraform.d/plugins/linux_amd64/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-# Auto-generated by fogg. Do not edit
-# Make improvements in fogg, so that everyone can benefit.
-
-*
-!.gitignore
-!terraform-provider*


Test patch:
diff --git a/testdata/bless_provider_yaml/.gitignore b/testdata/bless_provider_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/bless_provider_yaml/.gitignore
+++ b/testdata/bless_provider_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/bless_provider_yaml/.terraformignore b/testdata/bless_provider_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/bless_provider_yaml/.terraformignore
+++ b/testdata/bless_provider_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/bless_provider_yaml/terraform.d/.keep b/testdata/bless_provider_yaml/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/circleci/.gitignore b/testdata/circleci/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/circleci/.gitignore
+++ b/testdata/circleci/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/circleci/.terraformignore b/testdata/circleci/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/circleci/.terraformignore
+++ b/testdata/circleci/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/circleci/terraform.d/.keep b/testdata/circleci/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/github_actions/.gitignore b/testdata/github_actions/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/github_actions/.gitignore
+++ b/testdata/github_actions/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/github_actions/.terraformignore b/testdata/github_actions/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/github_actions/.terraformignore
+++ b/testdata/github_actions/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/github_actions/terraform.d/.keep b/testdata/github_actions/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/github_provider_yaml/.gitignore b/testdata/github_provider_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/github_provider_yaml/.gitignore
+++ b/testdata/github_provider_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/github_provider_yaml/.terraformignore b/testdata/github_provider_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/github_provider_yaml/.terraformignore
+++ b/testdata/github_provider_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/github_provider_yaml/terraform.d/.keep b/testdata/github_provider_yaml/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/okta_provider_yaml/.gitignore b/testdata/okta_provider_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/okta_provider_yaml/.gitignore
+++ b/testdata/okta_provider_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/okta_provider_yaml/.terraformignore b/testdata/okta_provider_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/okta_provider_yaml/.terraformignore
+++ b/testdata/okta_provider_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/okta_provider_yaml/terraform.d/.keep b/testdata/okta_provider_yaml/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/snowflake_provider_yaml/.gitignore b/testdata/snowflake_provider_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/snowflake_provider_yaml/.gitignore
+++ b/testdata/snowflake_provider_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/snowflake_provider_yaml/.terraformignore b/testdata/snowflake_provider_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/snowflake_provider_yaml/.terraformignore
+++ b/testdata/snowflake_provider_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/snowflake_provider_yaml/terraform.d/.keep b/testdata/snowflake_provider_yaml/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/tfe_provider_yaml/.gitignore b/testdata/tfe_provider_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/tfe_provider_yaml/.gitignore
+++ b/testdata/tfe_provider_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/tfe_provider_yaml/.terraformignore b/testdata/tfe_provider_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/tfe_provider_yaml/.terraformignore
+++ b/testdata/tfe_provider_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/tfe_provider_yaml/terraform.d/.keep b/testdata/tfe_provider_yaml/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/v2_full_yaml/.gitignore b/testdata/v2_full_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/v2_full_yaml/.gitignore
+++ b/testdata/v2_full_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/v2_full_yaml/.terraformignore b/testdata/v2_full_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/v2_full_yaml/.terraformignore
+++ b/testdata/v2_full_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/v2_full_yaml/terraform.d/.keep b/testdata/v2_full_yaml/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/v2_minimal_valid_yaml/.gitignore b/testdata/v2_minimal_valid_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/v2_minimal_valid_yaml/.gitignore
+++ b/testdata/v2_minimal_valid_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/v2_minimal_valid_yaml/.terraformignore b/testdata/v2_minimal_valid_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/v2_minimal_valid_yaml/.terraformignore
+++ b/testdata/v2_minimal_valid_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**
diff --git a/testdata/v2_minimal_valid_yaml/terraform.d/.keep b/testdata/v2_minimal_valid_yaml/terraform.d/.keep
new file mode 100644
index 00000000..e69de29b
diff --git a/testdata/v2_no_aws_provider_yaml/.gitignore b/testdata/v2_no_aws_provider_yaml/.gitignore
index 69565ae8..1985b92a 100644
--- a/testdata/v2_no_aws_provider_yaml/.gitignore
+++ b/testdata/v2_no_aws_provider_yaml/.gitignore
@@ -22,7 +22,8 @@
 *.swk
 
 .fogg
-/terraform.d
+/terraform.d/plugins
+/terraform.d/modules
 
 .DS_Store
 .vscode
diff --git a/testdata/v2_no_aws_provider_yaml/.terraformignore b/testdata/v2_no_aws_provider_yaml/.terraformignore
index 60a3f017..e472f375 100644
--- a/testdata/v2_no_aws_provider_yaml/.terraformignore
+++ b/testdata/v2_no_aws_provider_yaml/.terraformignore
@@ -3,7 +3,8 @@
 
 
 .fogg/
-**/terraform.d/**
+terraform.d/**
+**/terraform.d
 **/.terraform.d/**
 **/.terraform/**
 **/.git/**