Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

added support for github connection #184

Merged
merged 1 commit into from
Mar 26, 2020

Conversation

smaant
Copy link
Contributor

@smaant smaant commented Mar 24, 2020

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

Changes proposed in this pull request:

  • Extended connection resource in order to support GitHub Connection

Output from acceptance testing:

$ make testacc TESTS=TestAccConnectionGitHub
==> Checking that code complies with gofmt requirements...
?   	github.com/terraform-providers/terraform-provider-auth0	[no test files]
=== RUN   TestAccConnectionGitHub
--- PASS: TestAccConnectionGitHub (5.66s)
PASS
coverage: 10.8% of statements
ok  	github.com/terraform-providers/terraform-provider-auth0/auth0	6.549s	coverage: 10.8% of statements
?   	github.com/terraform-providers/terraform-provider-auth0/auth0/internal/debug	[no test files]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok  	github.com/terraform-providers/terraform-provider-auth0/auth0/internal/random	0.309s	coverage: 0.0% of statements [no tests to run]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok  	github.com/terraform-providers/terraform-provider-auth0/auth0/internal/validation	0.765s	coverage: 0.0% of statements [no tests to run]
...

@smaant
Copy link
Contributor Author

smaant commented Mar 26, 2020

@alexkappa do you think this is something that can be accepted soon?

@alexkappa
Copy link
Owner

Hi Anton, I was in the middle of testing this branch yesterday but other things took away my attention. The changes look good. If tests pass I’ll merge it in

@smaant
Copy link
Contributor Author

smaant commented Mar 26, 2020

Hey Alex, no problem! Thank you! I've run tests locally, all relevant tests passed, there were a few that failed but they're failing for me on the master branch as well. Here's the entire output just in case it will be helpful:

$ AUTH0_DOMAIN=... AUTH0_CLIENT_ID=... AUTH0_CLIENT_SECRET=... make testacc
==> Checking that code complies with gofmt requirements...
?   	github.com/terraform-providers/terraform-provider-auth0	[no test files]
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_debugDefaults
--- PASS: TestProvider_debugDefaults (0.00s)
=== RUN   TestAccClientGrant
--- PASS: TestAccClientGrant (16.39s)
=== RUN   TestAccClient
--- PASS: TestAccClient (1.36s)
=== RUN   TestAccClientZeroValueCheck
--- PASS: TestAccClientZeroValueCheck (9.27s)
=== RUN   TestAccClientRotateSecret
--- PASS: TestAccClientRotateSecret (2.28s)
=== RUN   TestAccClientInitiateLoginUri
--- PASS: TestAccClientInitiateLoginUri (0.02s)
=== RUN   TestAccConnection
--- PASS: TestAccConnection (8.29s)
=== RUN   TestAccConnectionAD
--- PASS: TestAccConnectionAD (1.15s)
=== RUN   TestAccConnectionAzureAD
--- PASS: TestAccConnectionAzureAD (2.09s)
=== RUN   TestAccConnectionWithEnbledClients
--- PASS: TestAccConnectionWithEnbledClients (13.83s)
=== RUN   TestAccConnectionSMS
--- PASS: TestAccConnectionSMS (7.28s)
=== RUN   TestAccConnectionEmail
--- PASS: TestAccConnectionEmail (1.39s)
=== RUN   TestAccConnectionSalesforce
--- PASS: TestAccConnectionSalesforce (1.38s)
=== RUN   TestAccConnectionGoogleOAuth2
--- PASS: TestAccConnectionGoogleOAuth2 (1.17s)
=== RUN   TestAccConnectionGitHub
--- PASS: TestAccConnectionGitHub (7.31s)
=== RUN   TestAccCustomDomain
--- FAIL: TestAccCustomDomain (0.36s)
    testing.go:654: Step 0 error: errors during apply:

        Error: 403 Forbidden: The account is not allowed to perform this operation, please contact our support team

          on /var/folders/hf/tj2w_g1947j8jhk7c9tzygw80000gp/T/tf-test385269721/main.tf line 3:
          (source code not available)


=== RUN   TestAccEmailTemplate
--- PASS: TestAccEmailTemplate (1.34s)
=== RUN   TestAccEmail
--- PASS: TestAccEmail (8.96s)
=== RUN   TestAccGlobalClient
--- PASS: TestAccGlobalClient (8.07s)
=== RUN   TestAccHook
--- PASS: TestAccHook (7.24s)
=== RUN   TestHookNameRegexp
--- PASS: TestHookNameRegexp (0.00s)
=== RUN   TestAccPrompt
--- PASS: TestAccPrompt (1.78s)
=== RUN   TestAccResourceServer
--- PASS: TestAccResourceServer (7.98s)
=== RUN   TestAccRole
--- PASS: TestAccRole (9.16s)
=== RUN   TestAccRuleConfig
--- PASS: TestAccRuleConfig (7.12s)
=== RUN   TestAccRule
--- PASS: TestAccRule (1.04s)
=== RUN   TestRuleNameRegexp
--- PASS: TestRuleNameRegexp (0.00s)
=== RUN   TestAccTenant
--- FAIL: TestAccTenant (0.51s)
    testing.go:654: Step 0 error: errors during apply:

        Error: 400 Bad Request: Payload validation error: 'Value 720 is greater than maximum 72' on property idle_session_lifetime

          on /var/folders/hf/tj2w_g1947j8jhk7c9tzygw80000gp/T/tf-test028378869/main.tf line 2:
          (source code not available)


=== RUN   TestAccUserMissingRequiredParams
--- PASS: TestAccUserMissingRequiredParams (0.01s)
=== RUN   TestAccUser
--- FAIL: TestAccUser (0.34s)
    testing.go:654: Step 0 error: errors during apply:

        Error: 400 Bad Request: Cannot set username for connection without requires_username

          on /var/folders/hf/tj2w_g1947j8jhk7c9tzygw80000gp/T/tf-test247370626/main.tf line 3:
          (source code not available)


=== RUN   TestMapData
--- PASS: TestMapData (0.00s)
=== RUN   TestJSON
--- PASS: TestJSON (0.00s)
FAIL
coverage: 67.8% of statements
FAIL	github.com/terraform-providers/terraform-provider-auth0/auth0	127.581s
?   	github.com/terraform-providers/terraform-provider-auth0/auth0/internal/debug	[no test files]
=== RUN   TestString
--- PASS: TestString (0.00s)
=== RUN   TestTemplate
--- PASS: TestTemplate (0.00s)
PASS
coverage: 75.0% of statements
ok  	github.com/terraform-providers/terraform-provider-auth0/auth0/internal/random	0.312s	coverage: 75.0% of statements
=== RUN   TestIsURLWithNoFragment
--- PASS: TestIsURLWithNoFragment (0.00s)
PASS
coverage: 52.9% of statements
ok  	github.com/terraform-providers/terraform-provider-auth0/auth0/internal/validation	0.318s	coverage: 52.9% of statements
FAIL
make: *** [testacc] Error 1

Comment on lines +553 to +555
scopes = [ "email", "profile", "read_user", "follow", "public_repo", "repo", "repo_deployment", "repo_status",
"delete_repo", "notifications", "gist", "read_repo_hook", "write_repo_hook", "admin_repo_hook",
"read_org", "admin_org", "read_public_key", "write_public_key", "admin_public_key", "write_org"
Copy link
Owner

Choose a reason for hiding this comment

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

We wouldn't necessarily need to test all scopes each time.

@alexkappa
Copy link
Owner

Tests are good, Anton. Custom domains will fail if your account is on the free tier. The rest are on how the default connection in my tenant is configured.

Thank you very much!

@alexkappa alexkappa merged commit d071125 into alexkappa:master Mar 26, 2020
@smaant smaant deleted the github-connection branch March 26, 2020 15:54
@smaant
Copy link
Contributor Author

smaant commented Mar 26, 2020

@alexkappa awesome, thank you! Will it be possible to cut a new release so we can start using it?

@alexkappa
Copy link
Owner

Of course Anton. I've pinged hashicorp to cut a release. I'll push a tag here as well right away

@alexkappa
Copy link
Owner

https://github.com/alexkappa/terraform-provider-auth0/releases/tag/v0.8.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants