-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Upgrade DNSimple provider to API v2 #10760
Conversation
Hey @weppos Thanks for this work - this is a great addition to the provider - I would love to talk about this work more (upgrade path etc) - please can you drop me an email? stack72 at hashicorp.com Thanks P. |
@stack72 👍 done, email sent! |
Hi @stack72, do you have any update about this PR and/or the email? |
Sorry to bother again, but I was wondering it there's any way I can help to move forward with the review of this PR. As we have a fixed deadline for API v1 removal, it would be amazing if I can get this completed in advance so that users will be able to take their time to migrate. :) |
❤️ |
Hey @weppos I promise i will get back to you on this tomorrow - are you EU based? If so, could we have a discussion on this? I can se up a quick hangout for tomorrow to discuss Paul |
Yes, I am in GMT+1. I'd be happy to jump in an hangout. Feel free to reply to the email I sent with the details :) |
Perfect! Doing so now :) |
Acceptance tests pass: ``` === RUN TestProvider --- PASS: TestProvider (0.00s) === RUN TestProvider_impl --- PASS: TestProvider_impl (0.00s) === RUN TestAccDNSimpleRecord_Basic --- PASS: TestAccDNSimpleRecord_Basic (2.67s) === RUN TestAccDNSimpleRecord_Updated --- PASS: TestAccDNSimpleRecord_Updated (1.88s) PASS ok github.com/hashicorp/terraform/builtin/providers/dnsimple ``` Note that the code still has to be updated to pass the account ID dynamically in place of "TODO-ACCOUNT".
The config is required as the new API wants to know the identifier of the account you are operating to. The account is not stored in the client (as the client can talk with different accounts), hence I need to pass it as part of the config.
I generally don't rebase against master, but in this case the merge caused 4k files to be changed, and the diff was I decided to rebase instead. |
Provide upgrade instructions and update the docs for API v2.
@stack72 the PR is now ready for review (and merge). I updated the docs and the integration, but I haven't added the schema deprecations. I am still reading other providers to get more details, and determine an action plan. To avoid adding too many changes here, I would probably open a fresh PR with deprecations, if any is required. If any of you is using this provider, I'd love to get feedbacks. I haven't been able to try it directly (except for running the test suites). I'll try to create a Terraform local setup to play with it. |
Hi @weppos Serious love for this :) LGTM and the tests pass!
Merged and will be part of 0.9 - it won't be back ported to 0.8.8 though if that's ok Paul |
Thanks @stack72. Yes, I'm absolutely fine with the changes NOT being back ported to 0.8.8. |
I thought I'd give this great new code a try. Ran into a problem/inconsistency between the behavior you describe and what i'm actually seeing.
I added the token and got rid of the email settings as per the instructions in this PR, but when i run terraform plan i am immediately prompted for the dnsimple email
My workaround is to configure email as empty string as follows
If you actually set an email address then you get the following error
Maybe a problem with this PR. It wasn't immediately obvious to my what is causing it to prompt for the email. Hope this helps somebody. |
I am fixing this right now so that it will be part of the main release :) Thanks for testing this out for us Paul |
Thanks for reporting it @joshuacronemeyer |
* Replace DNSimple API client with the official Go client * Upgrade DNSimple provider to use the new API v2 Acceptance tests pass: ``` === RUN TestProvider --- PASS: TestProvider (0.00s) === RUN TestProvider_impl --- PASS: TestProvider_impl (0.00s) === RUN TestAccDNSimpleRecord_Basic --- PASS: TestAccDNSimpleRecord_Basic (2.67s) === RUN TestAccDNSimpleRecord_Updated --- PASS: TestAccDNSimpleRecord_Updated (1.88s) PASS ok github.com/hashicorp/terraform/builtin/providers/dnsimple ``` Note that the code still has to be updated to pass the account ID dynamically in place of "TODO-ACCOUNT". * Refactor DNSimple provider to expose both client and config The config is required as the new API wants to know the identifier of the account you are operating to. The account is not stored in the client (as the client can talk with different accounts), hence I need to pass it as part of the config. * Identify Terraform requests to DNSimple via UserAgent * Upgrade to the latest dnsimple-go version * Update docs Provide upgrade instructions and update the docs for API v2. * Remove rendundant type declaration
Glad to hear it was useful. Thanks again. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
A couple of days ago DNSimple announced the next major release of the API. Among the various improvements, API v2 supports the following new features:
In the last months, few users contacted us in particular about the second point, as they created a separate account (e.g. for the company) and they wanted to be able to use it via Terraform.
This PR upgrades the current DNSimple provider to API v2, and replaces @pearkes's Go client with the official DNSimple Go client.
I tried to follow the instructions in the CONTRIBUTING.md file, but I'd be happy if someone can review the changes and provide a feedback. Some notes:
Open questions:
The documentation is not updated yet, I'll work on it, including feedback from this PR (if any). I will probably highlight API v2 support. Does it make sense to provide an API v1 to v2 Terraform upgrade section?