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

Checking if resource server scopes is empty for auth0 tf generate #856

Merged
merged 7 commits into from
Sep 26, 2023

Conversation

willvedd
Copy link
Contributor

@willvedd willvedd commented Sep 25, 2023

🔧 Changes

When exporting resource with the auth0 tf generate command, it is possible to have an auth0 resource server (api) that possess no associated scopes. In this case, the correlating auth0_resource_server_scopes resource will error upon terraform plan because it violates the non-empty scopes validation. To address this, we check if a resource server has at least one scope associate before exporting that import configuration.

🔬 Testing

Added unit test.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@willvedd willvedd requested a review from a team as a code owner September 25, 2023 11:29
@willvedd willvedd enabled auto-merge (squash) September 25, 2023 12:18
@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (c9c09f2) 73.39% compared to head (6abec61) 73.40%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
+ Coverage   73.39%   73.40%   +0.01%     
==========================================
  Files          92       92              
  Lines       11893    11895       +2     
==========================================
+ Hits         8729     8732       +3     
+ Misses       2648     2647       -1     
  Partials      516      516              
Files Coverage Δ
internal/cli/terraform_fetcher.go 98.09% <100.00%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@willvedd willvedd merged commit 2e785d6 into main Sep 26, 2023
6 checks passed
@willvedd willvedd deleted the tf-gen-check-empty-resource-server-scopes branch September 26, 2023 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants