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

Add organization_id field to github_auth_backend (vault-1.10+) #1296

Merged
merged 5 commits into from
Jan 13, 2022

Conversation

benashz
Copy link
Contributor

@benashz benashz commented Jan 11, 2022

Add organization_id field to the github_auth_backend resource

  • Update the github_auth_backend resource to accept the
    organization_id field for Vault 1.10+
  • Add new GitHub API helper to testutil

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Release note for CHANGELOG:


Output from acceptance testing:

make testacc TESTARGS='-v -test.run TestAccGithubAuthBackend'                        
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test -v -v -test.run TestAccGithubAuthBackend -timeout 20m ./...

[...]

=== RUN   TestAccGithubAuthBackend_basic
--- PASS: TestAccGithubAuthBackend_basic (3.93s)
=== RUN   TestAccGithubAuthBackend_tuning
--- PASS: TestAccGithubAuthBackend_tuning (3.07s)
=== RUN   TestAccGithubAuthBackend_description
--- PASS: TestAccGithubAuthBackend_description (3.00s)
=== RUN   TestAccGithubAuthBackend_importTuning
--- PASS: TestAccGithubAuthBackend_importTuning (2.19s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     12.802s


...

@benashz benashz changed the base branch from main to release/vault-next January 11, 2022 19:09
- Update the github_auth_backend resource to accept the
  `organization_id` field for Vault 1.10+
- Add new GitHub API helper to `testutil`
@benashz benashz changed the base branch from release/vault-next to main January 11, 2022 19:11
@benashz benashz changed the base branch from main to release/vault-next January 11, 2022 19:12
@benashz benashz force-pushed the VAULT-4601/github-auth-add-org-id branch from 7cebe1c to b7873d1 Compare January 11, 2022 19:12
@github-actions github-actions bot added size/L and removed size/XL labels Jan 11, 2022
}

// cache GH API responses to avoid triggering the GH request rate limiter
var ghOrgResponseCache = map[string]*GHOrgResponse{}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@benashz benashz added this to the vault-next milestone Jan 11, 2022
@vinay-gopalan
Copy link
Contributor

vinay-gopalan commented Jan 12, 2022

@benashz code looks good! Do I need to set any env vars to run the tests? All my tests are failing wherever orgMeta := testutil.GetGHOrgResponse(t, testGHOrg) is called

=== RUN   TestAccGithubAuthBackend_basic
    resource_github_auth_backend_test.go:27: not found
--- FAIL: TestAccGithubAuthBackend_basic (0.00s)

@benashz
Copy link
Contributor Author

benashz commented Jan 13, 2022

@benashz code looks good! Do I need to set any env vars to run the tests? All my tests are failing wherever orgMeta := testutil.GetGHOrgResponse(t, testGHOrg) is called

=== RUN   TestAccGithubAuthBackend_basic
    resource_github_auth_backend_test.go:27: not found
--- FAIL: TestAccGithubAuthBackend_basic (0.00s)

Odd, the tests are passing for me (see below). Let's sync up today.

ok      github.com/hashicorp/terraform-provider-vault/util      (cached) [no tests to run]
=== RUN   TestAccGithubAuthBackend_basic
--- PASS: TestAccGithubAuthBackend_basic (5.30s)
=== RUN   TestAccGithubAuthBackend_tuning
--- PASS: TestAccGithubAuthBackend_tuning (3.88s)
=== RUN   TestAccGithubAuthBackend_description
--- PASS: TestAccGithubAuthBackend_description (3.38s)
=== RUN   TestAccGithubAuthBackend_importTuning
--- PASS: TestAccGithubAuthBackend_importTuning (2.31s)
PASS
ok      github.com/hashicorp/terraform-provider-vault/vault     24.784s

@benashz benashz force-pushed the VAULT-4601/github-auth-add-org-id branch from 9c0ec64 to ffe96ad Compare January 13, 2022 21:01
Copy link
Contributor

@vinay-gopalan vinay-gopalan left a comment

Choose a reason for hiding this comment

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

Looks good!

@benashz benashz merged commit e38a288 into release/vault-next Jan 13, 2022
@benashz benashz deleted the VAULT-4601/github-auth-add-org-id branch January 13, 2022 21:43
@benashz benashz modified the milestones: vault-1.10, 3.4.0 Mar 15, 2022
marcboudreau pushed a commit to marcboudreau/terraform-provider-vault that referenced this pull request Nov 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants