nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: chanzuckerberg/fogg
Pull request #476 (2020-05-21 21:55:00)

[fix] use role arn with additional regions

### Test Plan
* CI

### References
*  #468

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

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

```diff
@@           Coverage Diff           @@
##           master     #476   +/-   ##
=======================================
  Coverage   59.36%   59.36%           
=======================================
  Files          19       19           
  Lines        1996     1996           
=======================================
  Hits         1185     1185           
  Misses        653      653           
  Partials      158      158           
```


| [Impacted Files](https://codecov.io/gh/chanzuckerberg/fogg/pull/476?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [plan/plan.go](https://codecov.io/gh/chanzuckerberg/fogg/pull/476/diff?src=pr&el=tree#diff-cGxhbi9wbGFuLmdv) | `84.87% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/chanzuckerberg/fogg/pull/476?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/476?src=pr&el=footer). Last update [6786f28...b27299e](https://codecov.io/gh/chanzuckerberg/fogg/pull/476?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/plan/plan.go b/plan/plan.go
index c86d8a95..801b34c3 100644
--- a/plan/plan.go
+++ b/plan/plan.go
@@ -468,7 +468,7 @@ func resolveComponentCommon(commons ...v2.Common) ComponentCommon {
 					Alias:     &region,
 					Profile:   awsConfig.Profile,
 					Region:    region,
-					RoleArn:   awsConfig.Role,
+					RoleArn:   roleArn,
 					Version:   *awsConfig.Version,
 				})
 		}


Test patch:
diff --git a/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf b/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
index 337eb881..1e05ec84 100644
--- a/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/accounts/bar/fogg.tf
@@ -22,7 +22,7 @@ provider aws {
 
 
   assume_role {
-    role_arn = "foo"
+    role_arn = "arn:aws:iam::456:role/foo"
   }
 
   allowed_account_ids = [456]
@@ -36,7 +36,7 @@ provider aws {
 
 
   assume_role {
-    role_arn = "foo"
+    role_arn = "arn:aws:iam::456:role/foo"
   }
 
   allowed_account_ids = [456]
Repository: chanzuckerberg/fogg
Pull request #526 (2021-02-11 22:27:38)

[fix] sentry provider required_version


Patch:
diff --git a/plan/plan.go b/plan/plan.go
index d2c80d04..2efa3c08 100644
--- a/plan/plan.go
+++ b/plan/plan.go
@@ -644,6 +644,11 @@ func resolveComponentCommon(commons ...v2.Common) ComponentCommon {
 		sentryPlan = &SentryProvider{
 			Enabled: true,
 		}
+
+		providerVersions["sentry"] = ProviderVersion{
+			Source:  "jianyuan/tfe",
+			Version: sentryConfig.Version,
+		}
 	}
 
 	var tfePlan *TfeProvider


Test patch:
diff --git a/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf b/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf
index e57b3700..6971fa46 100644
--- a/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/prod/sentry/fogg.tf
@@ -63,6 +63,13 @@ terraform {
 
     }
 
+    sentry = {
+      source = "jianyuan/tfe"
+
+      version = "1.2.3"
+
+    }
+
     template = {
       source = "hashicorp/template"
Repository: chanzuckerberg/fogg
Pull request #591 (2022-01-13 14:53:27)

fix: Backend Workspaces is a block, not argument
### Summary
Backend workspaces should be a block not an argument. https://www.terraform.io/language/settings/backends/configuration

### Test Plan
golden files updated

### References
https://www.terraform.io/language/settings/backends/configuration



Patch:
diff --git a/templates/templates/common/backends.tmpl b/templates/templates/common/backends.tmpl
index 305cfc10..ad3f0e95 100644
--- a/templates/templates/common/backends.tmpl
+++ b/templates/templates/common/backends.tmpl
@@ -11,7 +11,7 @@
   {{ else if eq .Kind "remote" }}
     hostname = "{{ .Remote.HostName }}"
     organization = "{{ .Remote.Organization }}"
-    workspaces = {
+    workspaces {
       name = "{{ .Remote.Workspace }}"
     }
   {{ end }}


Test patch:
diff --git a/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf b/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf
index e4df3892..afcf2698 100644
--- a/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf
+++ b/testdata/remote_backend_yaml/terraform/accounts/acct1/fogg.tf
@@ -7,7 +7,7 @@ terraform {
 
     hostname     = "tfe.example.com"
     organization = "test-org"
-    workspaces = {
+    workspaces {
       name = "accounts-acct1"
     }
 
diff --git a/testdata/remote_backend_yaml/terraform/global/fogg.tf b/testdata/remote_backend_yaml/terraform/global/fogg.tf
index da35b8e7..0cc3b2b3 100644
--- a/testdata/remote_backend_yaml/terraform/global/fogg.tf
+++ b/testdata/remote_backend_yaml/terraform/global/fogg.tf
@@ -7,7 +7,7 @@ terraform {
 
     hostname     = "tfe.example.com"
     organization = "test-org"
-    workspaces = {
+    workspaces {
       name = "global"
     }
 
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
index 3329d767..d7d1db2a 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/comp1/fogg.tf
@@ -16,7 +16,7 @@ terraform {
 
     hostname     = "example.com"
     organization = "foo"
-    workspaces = {
+    workspaces {
       name = "staging-comp1"
     }
 
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
index a23286b1..d9e6abdb 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/comp2/fogg.tf
@@ -16,7 +16,7 @@ terraform {
 
     hostname     = "example.com"
     organization = "foo"
-    workspaces = {
+    workspaces {
       name = "staging-comp2"
     }
 
diff --git a/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf b/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
index 4b083e26..b07a49f2 100644
--- a/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
+++ b/testdata/v2_full_yaml/terraform/envs/staging/vpc/fogg.tf
@@ -16,7 +16,7 @@ terraform {
 
     hostname     = "example.com"
     organization = "foo"
-    workspaces = {
+    workspaces {
       name = "staging-vpc"
     }
Repository: chanzuckerberg/fogg
Pull request #646 (2022-05-05 21:53:46)

fix: version contraint in assert provider
### Summary
This PR fixes a bug in the assert template where the version was provided in the old way of doing Terraform version contraints. This PR removes this version constraint.

### Test Plan
Say unittests, or list out steps to verify changes.

### References
(Optional) Additional links to provide more context.



Patch:
diff --git a/templates/templates/common/assert_provider.tmpl b/templates/templates/common/assert_provider.tmpl
index eae7e301..727f728b 100644
--- a/templates/templates/common/assert_provider.tmpl
+++ b/templates/templates/common/assert_provider.tmpl
@@ -1,5 +1,2 @@
 {{ define "assert" }}
-provider "assert" {
-  version = "{{ .Version }}"
-}
-{{ end }}
+provider "assert" {}{{ end }}


Test patch:
diff --git a/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
index 10731ae5..17acf26a 100644
--- a/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -1,9 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-provider "assert" {
-  version = "0.0.1"
-}
+provider "assert" {}
 
 provider "bless" {
   region  = "bar"
diff --git a/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 510cd5b8..046541e8 100644
--- a/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -1,9 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-provider "assert" {
-  version = "0.0.1"
-}
+provider "assert" {}
 
 provider "bless" {
   region  = "bar"
diff --git a/testdata/bless_provider_yaml/terraform/global/fogg.tf b/testdata/bless_provider_yaml/terraform/global/fogg.tf
index cac70d73..1b9f4e7d 100644
--- a/testdata/bless_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/bless_provider_yaml/terraform/global/fogg.tf
@@ -1,9 +1,7 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
 
-provider "assert" {
-  version = "0.0.1"
-}
+provider "assert" {}
 
 provider "bless" {
   region  = "bar"
Repository: chanzuckerberg/fogg
Pull request #655 (2022-06-02 18:48:23)

feat!: Use Snowflake-Lab version of Terraform Snowflake provider
### Summary
In transitioning support of the Snowflake Terraform provider to Snowflake, the hardcoded organization needed to be replaced.

### Test Plan
```
make update-golden-files
go get -u ./...
make test
go run main.go
go mod tidy
```
### References
[ONCALL-56]


[ONCALL-56]: https://czi-eng.atlassian.net/browse/ONCALL-56?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


Patch:
diff --git a/plan/plan.go b/plan/plan.go
index 87d65d24..cf1b8611 100644
--- a/plan/plan.go
+++ b/plan/plan.go
@@ -674,7 +674,7 @@ func resolveComponentCommon(commons ...v2.Common) ComponentCommon {
 		}
 
 		providerVersions["snowflake"] = ProviderVersion{
-			Source:  "chanzuckerberg/snowflake",
+			Source:  "Snowflake-Labs/snowflake",
 			Version: snowflakeConfig.Version,
 		}
 	}


Test patch:
diff --git a/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
index d9b3d927..4819f8b4 100644
--- a/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -58,7 +58,7 @@ terraform {
     }
 
     snowflake = {
-      source = "chanzuckerberg/snowflake"
+      source = "Snowflake-Labs/snowflake"
 
     }
 
diff --git a/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 8f48217f..35b2f43a 100644
--- a/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -58,7 +58,7 @@ terraform {
     }
 
     snowflake = {
-      source = "chanzuckerberg/snowflake"
+      source = "Snowflake-Labs/snowflake"
 
     }
 
diff --git a/testdata/snowflake_provider_yaml/terraform/global/fogg.tf b/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
index 42b3b09d..bc016a12 100644
--- a/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/snowflake_provider_yaml/terraform/global/fogg.tf
@@ -58,7 +58,7 @@ terraform {
     }
 
     snowflake = {
-      source = "chanzuckerberg/snowflake"
+      source = "Snowflake-Labs/snowflake"
 
     }
Repository: chanzuckerberg/fogg
Pull request #716 (2022-08-29 18:16:55)

fix: issue where the default version is not used
### Summary
This PR uses the default version from the fogg.yml file when selecting the version to use in the TFE workspace. 

### Test Plan
Say unittests, or list out steps to verify changes.

### References
(Optional) Additional links to provide more context.



Patch:
diff --git a/apply/apply.go b/apply/apply.go
index a764f8f2..ea528ead 100644
--- a/apply/apply.go
+++ b/apply/apply.go
@@ -119,9 +119,12 @@ type TFEWorkspace struct {
 	RemoteApply          *bool                 `json:"remote_apply,omitempty"`
 }
 
-func MakeTFEWorkspace() *TFEWorkspace {
+func MakeTFEWorkspace(tfVersion string) *TFEWorkspace {
 	defaultTriggerPrefixes := make([]string, 0)
-	defaultTerraformVersion := "1.2.6"
+	defaultTerraformVersion := tfVersion
+	if defaultTerraformVersion == "" {
+		defaultTerraformVersion = "1.2.6"
+	}
 	defaultGithubBranch := "main"
 	defaultAutoApply := true
 	defaultRemoteApply := false
@@ -138,7 +141,7 @@ func updateLocalsFromPlan(locals *LocalsTFE, plan *plan.Plan) {
 	// if there is a planned env or account that isn't in the locals, add it
 	for accountName := range plan.Accounts {
 		if _, ok := locals.Locals.Accounts[accountName]; !ok {
-			locals.Locals.Accounts[accountName] = MakeTFEWorkspace()
+			locals.Locals.Accounts[accountName] = MakeTFEWorkspace(plan.Global.Common.TerraformVersion)
 		}
 	}
 	for envName := range plan.Envs {
@@ -147,7 +150,7 @@ func updateLocalsFromPlan(locals *LocalsTFE, plan *plan.Plan) {
 		}
 		for componentName := range plan.Envs[envName].Components {
 			if _, ok := locals.Locals.Envs[envName][componentName]; !ok {
-				locals.Locals.Envs[envName][componentName] = MakeTFEWorkspace()
+				locals.Locals.Envs[envName][componentName] = MakeTFEWorkspace(plan.Global.Common.TerraformVersion)
 			}
 		}
 	}


Test patch:
diff --git a/apply/apply_test.go b/apply/apply_test.go
index c6c8290d..d6425c17 100644
--- a/apply/apply_test.go
+++ b/apply/apply_test.go
@@ -68,7 +68,7 @@ func makeTestCases(tests []UploadLocalsTestCaseSimple) ([]UploadLocalsTestCase,
 
 		localAccounts := make(map[string]*TFEWorkspace, 0)
 		for _, local := range test.localsAccounts {
-			localAccounts[local] = MakeTFEWorkspace()
+			localAccounts[local] = MakeTFEWorkspace("1.2.6")
 		}
 		localEnvs := make(map[string]map[string]*TFEWorkspace, 0)
 		for _, local := range test.localEnvs {
@@ -77,7 +77,7 @@ func makeTestCases(tests []UploadLocalsTestCaseSimple) ([]UploadLocalsTestCase,
 				return nil, errors.New("env needs to be of the form env/component")
 			}
 			component := map[string]*TFEWorkspace{}
-			component[splits[1]] = MakeTFEWorkspace()
+			component[splits[1]] = MakeTFEWorkspace("1.2.6")
 			localEnvs[splits[0]] = component
 		}
 		locals := LocalsTFE{
Repository: chanzuckerberg/fogg
Pull request #726 (2022-09-14 23:26:02)

feat: allow optional SSH keys in CI
### Summary
This PR allows for fogg users to specify optional SSH keys to be installed from Github secrets like before. This helps for organizations that needs to clone private repos across organizations and SSH keys are the means by which they do that. By default, the Github App credentials are used to clone repos.



Patch:
diff --git a/templates/templates/.github/workflows/fogg_ci.yml.tmpl b/templates/templates/.github/workflows/fogg_ci.yml.tmpl
index f6c2a911..6f1ef334 100644
--- a/templates/templates/.github/workflows/fogg_ci.yml.tmpl
+++ b/templates/templates/.github/workflows/fogg_ci.yml.tmpl
@@ -1,5 +1,6 @@
 # Auto-generated by fogg. Do not edit
 # Make improvements in fogg, so that everyone can benefit.
+{{- $githubActionsCI := . }}
 
 on: push
 
@@ -26,9 +27,17 @@ jobs:
           path: ~/.fogg/cache
           key: fogg-cache-{{`${{ hashFiles('**/.fogg-version') }}`}}
       - run: make setup
+      {{- if not (eq (len $githubActionsCI.SSHKeySecrets) 0) }}
+      - name: Install SSH key
+        uses: webfactory/ssh-agent@v0.4.1
+        with:
+          ssh-private-key: |
+            {{ range $idx, $secret := $githubActionsCI.SSHKeySecrets }}{{`${{`}} secrets.{{ $secret }} {{`}}`}}
+            {{ end }}
+      - run: .fogg/bin/fogg apply{{ else }}
       - run: .fogg/bin/fogg apply
         env:
-          FOGG_GITHUBAPPTOKEN: {{`${{ steps.generate_token.outputs.token }}`}}
+          FOGG_GITHUBAPPTOKEN: {{`${{ steps.generate_token.outputs.token }}`}}{{ end }}
       - uses: EndBug/add-and-commit@v9
         with:
           add: -A


Test patch:
diff --git a/testdata/v2_full_yaml/.github/workflows/fogg_ci.yml b/testdata/v2_full_yaml/.github/workflows/fogg_ci.yml
index 4438e755..90d6b5c0 100644
--- a/testdata/v2_full_yaml/.github/workflows/fogg_ci.yml
+++ b/testdata/v2_full_yaml/.github/workflows/fogg_ci.yml
@@ -26,9 +26,14 @@ jobs:
           path: ~/.fogg/cache
           key: fogg-cache-${{ hashFiles('**/.fogg-version') }}
       - run: make setup
+      - name: Install SSH key
+        uses: webfactory/ssh-agent@v0.4.1
+        with:
+          ssh-private-key: |
+            ${{ secrets.SHARED_INFRA_DEPLOY_KEY }}
+            ${{ secrets.SHARED_INFRA_DEPLOY_KEY2 }}
+            
       - run: .fogg/bin/fogg apply
-        env:
-          FOGG_GITHUBAPPTOKEN: ${{ steps.generate_token.outputs.token }}
       - uses: EndBug/add-and-commit@v9
         with:
           add: -A
diff --git a/testdata/v2_full_yaml/fogg.yml b/testdata/v2_full_yaml/fogg.yml
index 4bbcc3f9..a507617f 100644
--- a/testdata/v2_full_yaml/fogg.yml
+++ b/testdata/v2_full_yaml/fogg.yml
@@ -54,6 +54,9 @@ defaults:
       enabled: true
       command: lint
       aws_iam_role_name: foo
+      ssh_key_secrets:
+        - SHARED_INFRA_DEPLOY_KEY
+        - SHARED_INFRA_DEPLOY_KEY2
       env:
         FOO: bar
 envs:
Repository: chanzuckerberg/fogg
Pull request #737 (2022-09-23 19:07:23)

fix: update the auth0 provider name
### Summary
This PR updates the auth0 provider name since it has changed recently.

### Test Plan
Say unittests, or list out steps to verify changes.

### References
(Optional) Additional links to provide more context.



Patch:
diff --git a/plan/plan.go b/plan/plan.go
index 946e73f2..a0450aa2 100644
--- a/plan/plan.go
+++ b/plan/plan.go
@@ -732,7 +732,7 @@ func resolveComponentCommon(commons ...v2.Common) ComponentCommon {
 		}
 
 		providerVersions["auth0"] = ProviderVersion{
-			Source:  "alexkappa/auth0",
+			Source:  "auth0/auth0",
 			Version: auth0Config.Version,
 		}
 	}


Test patch:
diff --git a/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf b/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf
index fa33b5e1..0bd68ea0 100644
--- a/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf
+++ b/testdata/auth0_provider_yaml/terraform/accounts/foo/fogg.tf
@@ -35,7 +35,7 @@ terraform {
     }
 
     auth0 = {
-      source = "alexkappa/auth0"
+      source = "auth0/auth0"
 
       version = "aversion"
 
diff --git a/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf b/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf
index 8ec3c72c..dcef29ff 100644
--- a/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf
+++ b/testdata/auth0_provider_yaml/terraform/envs/bar/bam/fogg.tf
@@ -35,7 +35,7 @@ terraform {
     }
 
     auth0 = {
-      source = "alexkappa/auth0"
+      source = "auth0/auth0"
 
       version = "aversion"
 
diff --git a/testdata/auth0_provider_yaml/terraform/global/fogg.tf b/testdata/auth0_provider_yaml/terraform/global/fogg.tf
index 898ce594..53c2e09e 100644
--- a/testdata/auth0_provider_yaml/terraform/global/fogg.tf
+++ b/testdata/auth0_provider_yaml/terraform/global/fogg.tf
@@ -35,7 +35,7 @@ terraform {
     }
 
     auth0 = {
-      source = "alexkappa/auth0"
+      source = "auth0/auth0"
 
       version = "aversion"