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

issue#511: Add custom domain data source #526

Merged
merged 2 commits into from
Mar 13, 2023

Conversation

sergiught
Copy link
Contributor

🔧 Changes

This PR adds a new data source to retrieve the custom domain configuration.

📚 References

🔬 Testing

📝 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)

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 91.42% and project coverage change: +0.02 🎉

Comparison is base (76cd907) 85.36% compared to head (85c4966) 85.38%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #526      +/-   ##
==========================================
+ Coverage   85.36%   85.38%   +0.02%     
==========================================
  Files          75       76       +1     
  Lines        9923     9958      +35     
==========================================
+ Hits         8471     8503      +32     
- Misses       1147     1149       +2     
- Partials      305      306       +1     
Impacted Files Coverage Δ
internal/provider/provider.go 59.59% <ø> (ø)
internal/auth0/customdomain/data_source.go 91.42% <91.42%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sergiught sergiught marked this pull request as ready for review March 13, 2023 14:23
@sergiught sergiught requested a review from a team as a code owner March 13, 2023 14:23
@sergiught sergiught force-pushed the issue#511/auth0_custom_domains-data-source branch from 85c4966 to 141129a Compare March 13, 2023 14:59
return internalSchema.TransformResourceToDataSource(NewResource().Schema)
}

func readCustomDomainForDataSource(ctx context.Context, data *schema.ResourceData, meta interface{}) diag.Diagnostics {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just asking, do we use this context anywhere? To configure the API client? or is the instance meta already configured?

Copy link
Contributor Author

@sergiught sergiught Mar 13, 2023

Choose a reason for hiding this comment

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

The meta property has access to the already configured api client, essentially it is the api client at the moment, however in the future we could create a struct that holds both the api client and the key/value mutex used throughout other resources. In this way we wouldn't use the mutex as a global property any more.

The context isn't used anywhere sadly 😢 but needs to be present within the function signature. Hopefully the Go SDK v1 introduces context passing as a first param in function calls.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the context (put not intended). Maybe mark it as unused with _ then?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind, too late 😬, my bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Argh, sorry already merged 😢 I can follow up on this, maybe tweaking our linter to check and fix such occurences.

@sergiught sergiught merged commit 9c40c5b into main Mar 13, 2023
@sergiught sergiught deleted the issue#511/auth0_custom_domains-data-source branch March 13, 2023 16:36
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