-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Terraform]: Add resource_storage_transfer_job #1069
[Terraform]: Add resource_storage_transfer_job #1069
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
Do I need to add the resource to |
Yep! I haven't looked over this PR yet but you'll need to do that here as well. |
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Real quick pass of formatting/nitpicks before we get started, I haven't looked at the actual contents in any depth yet.
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/tests/resource_storage_transfer_job_test.go
Outdated
Show resolved
Hide resolved
third_party/terraform/tests/resource_storage_transfer_job_test.go
Outdated
Show resolved
Hide resolved
third_party/terraform/website/docs/r/storage_transfer_job.html.markdown
Outdated
Show resolved
Hide resolved
third_party/terraform/website/docs/r/storage_transfer_job.html.markdown
Outdated
Show resolved
Hide resolved
3683de4
to
0f3eaab
Compare
Have also rebased on master and squashed this PR |
I signed it! |
0b29b89
to
d70b15a
Compare
Hi @rileykarson - I've rebased on master and also updated the authorship on this commit to match that for the signed CLA. Hopefully it should pick it up - it's done under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great! Most if not all of my comments are just consistency/formatting, sorry for the churn. I tried to provide examples in a few places where the change seemed kind of silly.
For expand/flattens, I only commented on TransferSpecs so far but I think the comment applies to a couple of different fields.
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I saw these errors when trying to generate downstreams (we need the build to pass to generate them):
google-beta/resource_storage_transfer_job.go:34:19: undefined: StringLenBetween
google-beta/validation.go:198:16: undefined: time
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
Hi @rileykarson I'll work through these changes as individual commits and then rebase/squash. Can I ask, what command are you using to compile and generate downstreams? |
Feel free to keep separate commits/submit them however makes sense. The
problem before was the merge; our CI merge script rebases and then squashes
so it encountered a conflict before the merge that fixed it. I normally use
`git pull --rebase upstream master` to update old MM PRs (upstream is this
repo for me)
Assuming you have a checked out copy of Terraform in your GOPATH, MM can be
ran locally with:
bundle exec compiler -a -e terraform -o "${GOPATH}/src/
github.com/terraform-providers/terraform-provider-google/" -v "ga"
It will overwrite every file it generates in that directory! So make sure
you're on a clean checkout without uncommitted changes.
Beta can be generated by append -beta to the path & subbing beta for ga.
…On Tue, Dec 18, 2018 at 10:01 AM Akram Hussein ***@***.***> wrote:
Hi @rileykarson <https://github.com/rileykarson> I'll work through these
changes as individual commits and then rebase/squash.
Can I ask, what command are you using to compile?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1069 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB-_CMQL_e2HISPvklKxvKnVgf-g4uVEks5u6S2AgaJpZM4ZWrqe>
.
|
I am a robot that works on MagicModules PRs! I built this PR into one or more PRs on other repositories, and when those are closed, this PR will also be merged and closed. |
4a57c44
to
abc5a66
Compare
Hi @rileykarson I believe I've now addressed all the comments except for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great! Thanks for your patience with leaning Go + working with the weird unwritten style we tend to follow for our resources at the same time 🙂
I've kicked off a Magician run to regenerate the downstreams in the provider repos, I've left a couple small comments in the meantime if you don't mind looking over those while adding an update test.
Quick update from the run: looks like we're getting these errors from the linters (they can be ran locally with make lint
in a provider repo)
==> Checking source code against linters...
google/resource_storage_transfer_job.go:1::warning: file is not gofmted with -s (gofmt)
google/resource_storage_transfer_job.go:595:6:warning: func flattenAwsAccessKeys is unused (U1000) (unused)
make: *** [lint] Error 1
The command "make lint" exited with 2.
I got a quota error running the test, but that's likely just me needing to submit a quota request. I'll debug that tomorrow.
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
$ terraform import google_storage_transfer_job.nightly-backup-transfer-job my-project-1asd32/8422144862922355674 | ||
``` | ||
|
||
Note that when importing a Transfer Job (and only when importing), the Compute API needs to be enabled - you'll see an error with a link to the enablement page if it is not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you end up encountering this again, I would include this; otherwise I'd slightly prefer omitting it until it's repro'ed again. My expectation is that it was a transient error because an error from the Compute API doesn't make much sense here?
I am (still) a robot that works on MagicModules PRs! I just wanted to let you know that your changes (as of commit 9c6b135) have been included in your existing downstream PRs. |
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
Fixed the linting issue. Unfortunately during testing i hit a rate limit: make testacc TEST=./google TESTARGS='-run=TestAccStorageTransferJob_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 TF_SCHEMA_PANIC_ON_ERROR=1 go test ./google -v -run=TestAccStorageTransferJob_basic -timeout 120m -ldflags="-X=github.com/terraform-providers/terraform-provider-google/version.ProviderVersion=acc"
=== RUN TestAccStorageTransferJob_basic
=== PAUSE TestAccStorageTransferJob_basic
=== CONT TestAccStorageTransferJob_basic
--- FAIL: TestAccStorageTransferJob_basic (239.03s)
testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:
* google_storage_transfer_job.transfer_job: 1 error(s) occurred:
* google_storage_transfer_job.transfer_job: Error reading Transfer Job "transferJobs/17748877939099650077": googleapi: Error 429: Quota exceeded for quota group 'ReadOnlyGroup' and limit 'USER-100s' of service 'storagetransfer.googleapis.com' for consumer 'project_number:278407580213'., rateLimitExceeded
FAIL
FAIL github.com/terraform-providers/terraform-provider-google/google 239.079s
make: *** [testacc] Error 1 Update Oh my...when I changed the |
Removed the line about requiring the |
Hi @rileykarson - I’ve added 2 more steps that 1) change data sink name; then 2) change the data source name. I’ve re-used the same template schema - didn’t see benefit of duplicating it. I’ve tested these against our GCP account and all works. Think that's it? |
980f06c
to
31ef38c
Compare
I am (still) a robot that works on MagicModules PRs! I just wanted to let you know that your changes (as of commit 22e2b94) have been included in your existing downstream PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple minor config nits + some comments about id
left I think! Inside the import tests, Terraform effectively performs an import
using the id
; we expect an import shape of my-project-1asd32/8422144862922355674
but Terraform sends the id
of transferJobs/8422144862922355674
. This leads to a test failure when Terraform tries to treat transferJobs
as the project id.
Do you mind changing the id
everywhere to be {{projectId}}/{{name}}
(w/o prefix) so that it's a valid import id?
third_party/terraform/tests/resource_storage_transfer_job_test.go
Outdated
Show resolved
Hide resolved
third_party/terraform/tests/resource_storage_transfer_job_test.go
Outdated
Show resolved
Hide resolved
CLAs look good, thanks! |
6d20acb
to
2c12012
Compare
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
I've addressed all the points - can you just double check the The CLA was also signed and did go green but I think I pushed some intermediate commits before changing authorship and it got confused. |
I am (still) a robot that works on MagicModules PRs! I just wanted to let you know that your changes (as of commit a3097f8) have been included in your existing downstream PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few more id
/test comments, nothing too big!
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
third_party/terraform/resources/resource_storage_transfer_job.go
Outdated
Show resolved
Hide resolved
I am (still) a robot that works on MagicModules PRs! I just wanted to let you know that your changes (as of commit 729eaf7) have been included in your existing downstream PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, looks like I forgot to comment something - sorry for the extra round trip!
third_party/terraform/tests/resource_storage_transfer_job_test.go
Outdated
Show resolved
Hide resolved
Updated the tests and they pass now. |
5775871
to
1b6482e
Compare
CLAs look good, thanks! |
1b6482e
to
8852674
Compare
I am (still) a robot that works on MagicModules PRs! I just wanted to let you know that your changes (as of commit c70dccc) have been included in your existing downstream PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for your contribution, and for your patience going through review on this change. I'll merge the downstreams & then use the Magician to merge upstream here.
Tracked submodules are build/terraform-beta build/terraform build/ansible build/inspec.
🎉 thanks! |
[all]
[terraform]
Add resource_storage_transfer_job
[terraform-beta]
[ansible]
[inspec]