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

Refactor auth0_prompt resource and add additional test case #305

Merged
merged 1 commit into from
Aug 27, 2022

Conversation

sergiught
Copy link
Contributor

@sergiught sergiught commented Aug 26, 2022

🔧 Changes

#264 raises a potential issue with the auth0_prompt resource, however upon trying to reproduce I wasn't able to spot any issues with the bool flags. I ended up slightly refactoring the resource and also adding a test case to ensure the values get pushed and saved correctly.

📚 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

Merging #305 (6b045fc) into main (f7abd37) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #305      +/-   ##
==========================================
+ Coverage   85.23%   85.27%   +0.04%     
==========================================
  Files          39       39              
  Lines        8227     8225       -2     
==========================================
+ Hits         7012     7014       +2     
+ Misses        964      960       -4     
  Partials      251      251              
Impacted Files Coverage Δ
internal/provider/resource_auth0_prompt.go 91.04% <100.00%> (+5.53%) ⬆️

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

@sergiught sergiught marked this pull request as ready for review August 26, 2022 15:33
@sergiught sergiught requested a review from a team as a code owner August 26, 2022 15:33
@sergiught sergiught self-assigned this Aug 26, 2022
prompt, err := api.Prompt.Read()
if err != nil {
if mErr, ok := err.(management.Error); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this not necessary for this operation?

Copy link
Contributor Author

@sergiught sergiught Aug 27, 2022

Choose a reason for hiding this comment

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

This was actually unnecessary because if we are getting a 404 it means the endpoint disappeared. It's not an endpoint of an ID managed resource: https://auth0.com/docs/api/management/v2#!/Prompts/get_prompts and we do want to throw that error if that happens :)

@sergiught sergiught merged commit 2ac91db into main Aug 27, 2022
@sergiught sergiught deleted the patch/issue#264-prompts branch August 27, 2022 11:08
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