-
Notifications
You must be signed in to change notification settings - Fork 105
Conversation
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'm not a maintainer but as I also submitted my first PR to add a group resource using the 1.0 API a few weeks ago, I was curious to see if we did things differently or not.
Anyway, here is my informal review.
Exists: resourceDeployKeyExists, | ||
|
||
Schema: map[string]*schema.Schema{ | ||
"owner": &schema.Schema{ |
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.
The API documentation refers to this as accountname
which is what I used in my own PR https://github.com/terraform-providers/terraform-provider-bitbucket/pull/6/files#diff-212cd6fa62f60904d8a923069edaa6c9R43
Not sure which is better.
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.
Yeah I used owner
to align with the existing resources in this repo. Atlassian's docs seem to interchangeably use accountname
or username
(maybe a 1.0 vs 2.0 difference), so I guess owner
is as good as anything.
t.Fatal("BITBUCKET_PASSWORD must be set for acceptence tests") | ||
t.Fatal("BITBUCKET_PASSWORD must be set for acceptance tests") | ||
} | ||
if v := os.Getenv("BITBUCKET_TEAM"); v == "" { |
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.
Not that my opinion matters at all, but I like the idea of introducing a BITBUCKET_TEAM
environment variable.
bitbucket/resource_deploy_key.go
Outdated
deployKey_req, _ := client.Get(fmt.Sprintf("1.0/repositories/%s/%s/deploy-keys/%s", | ||
d.Get("owner").(string), | ||
d.Get("repository").(string), | ||
url.PathEscape(d.Id()), |
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.
Why escape as the pk/id is an integer?
bitbucket/resource_deploy_key.go
Outdated
url.PathEscape(d.Id()), | ||
)) | ||
|
||
log.Printf("ID: %s", url.PathEscape(d.Id())) |
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.
Shouldn't that be in debug level?
bitbucket/resource_deploy_key.go
Outdated
_, err = client.Put(fmt.Sprintf("1.0/repositories/%s/%s/deploy-keys/%s", | ||
d.Get("owner").(string), | ||
d.Get("repository").(string), | ||
url.PathEscape(d.Id()), |
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.
Why escape as the pk/id is an integer?
⏳ |
ForceNew: true, | ||
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) { | ||
value := v.(string) | ||
pattern := "ssh-rsa AAAA[0-9A-Za-z+/]+[=]{0,3}( [^@]+@[^@]+)?" |
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.
We support more than just rsa. So this will break if you try to do a ecdsa key.
My only real concern is that the validation string wont really work since we support more than just RSA. |
Sorry to have negative information. But essentially we are gonna be removing all of the 1.0 API's soon(can't give specifics - watch for a blog post). Iv talked to the devs who maintain and work on the apis for us and they havnt come up with any specifics. But it is similar to users/groups. |
Sorry, are you saying that Atlassian is removing support for adding deploy keys via the API? I'm a little confused... |
On the same stance here, confused, as the same arguments were invoked to decline #6. |
Essentially bitbucket will not be implementing either of these apis for the
2.0 version. And I talked to our team who maintains these apis. And they
are going to deprecate these apis. So I don’t want to add these features
then have to remove them later with no real plan to migrate.
…On Thu, Nov 9, 2017 at 10:53 PM Patrick Decat ***@***.***> wrote:
On the same stance here, confused, as the same arguments were invoked to
decline #6
<#6>
.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAO6NcWUJwMQ6z93h1s8IEt5eGgzD7YCks5s0_LMgaJpZM4PtlC8>
.
|
So to confirm, Atlassian will remove the existing feature enabling the
programmatic management of deploy keys?
…On Fri, 10 Nov 2017 at 6:12 pm, Colin Wood ***@***.***> wrote:
Essentially bitbucket will not be implementing either of these apis for the
2.0 version. And I talked to our team who maintains these apis. And they
are going to deprecate these apis. So I don’t want to add these features
then have to remove them later with no real plan to migrate.
On Thu, Nov 9, 2017 at 10:53 PM Patrick Decat ***@***.***>
wrote:
> On the same stance here, confused, as the same arguments were invoked to
> decline #6
> <
#6
>
> .
>
> —
> You are receiving this because you modified the open/close state.
> Reply to this email directly, view it on GitHub
> <
#9 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AAO6NcWUJwMQ6z93h1s8IEt5eGgzD7YCks5s0_LMgaJpZM4PtlC8
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH2eNwUbOIMq09vBMcdwoOhh-6a6aFjqks5s0_dOgaJpZM4PtlC8>
.
|
Yea unfortunately. I am not happy about this either. Your best bet would to make a site/master issue and ask for a 2.0 version of the deployment keys. I asked our API team again and they confirmed it. |
This is correct. We don't yet have a date for when we turn off these APIs, but we will not be creating copies of these in 2.0. I've left a more complete motivation on the site/master ticket. |
Thanks for clarifying Erik
…On Wed, Nov 15, 2017 at 6:07 PM Erik van Zijst ***@***.***> wrote:
So to confirm, Atlassian will remove the existing feature enabling the
programmatic management of deploy keys?
This is correct.
We don't yet have a date for when we turn off these APIs, but we will not
be creating copies of these in 2.0. I've left a more complete motivation on
the site/master ticket
<https://bitbucket.org/site/master/issues/15196/removal-of-10-api#comment-41240017>
.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAO6NWRSDRyYlqRyuhIen6PLiBh0fxx1ks5s25jbgaJpZM4PtlC8>
.
|
My first crack at adding a new resource - please let me know if anything else is needed.