Pawel/new project token#422
Conversation
Pull Request Test Coverage Report for Build 14724865123Details
💛 - Coveralls |
|
Hi Pawel, I'm not an experienced golang developer, neither a terraform one, but looked thru the code and it looks good to me but discussing the changes with my team members one question raised. |
well, it's implemented according to how the api was written, at least when I tested it. I am not changing any POST parameter and assign access_token to public id for UPDATE, READ and DELETE . I can change it to |
| accessToken := d.Get("access_token").(string) | ||
| publicID := d.Get("public_id").(string) | ||
|
|
||
| if publicID != "" { | ||
| accessToken = publicID | ||
| } | ||
| projectID := d.Get("project_id").(int) | ||
| l := log.With(). | ||
| Str("accessToken", accessToken). |
There was a problem hiding this comment.
| accessToken := d.Get("access_token").(string) | |
| publicID := d.Get("public_id").(string) | |
| if publicID != "" { | |
| accessToken = publicID | |
| } | |
| projectID := d.Get("project_id").(int) | |
| l := log.With(). | |
| Str("accessToken", accessToken). | |
| accessToken := d.Get("access_token").(string) | |
| publicID := d.Get("public_id").(string) | |
| tokenIdentifier := publicID | |
| if tokenIdentifier == "" { | |
| tokenIdentifier = accessToken | |
| } | |
| projectID := d.Get("project_id").(int) | |
| l := log.With(). | |
| Str("tokenIdentifier", tokenIdentifier). |
and where it's used at line 206 >
pat, err := c.ReadProjectAccessToken(projectID, tokenIdentifier) // accessToken => tokenIdentifier|
@pawelsz-rb With our existing tokens, this change is forcing us to re-create all our tokens. From the Terraform plan: What is the migration path here if we don't want to replace all our existing tokens? |
|
@awendt , this should not happen when you just upgrade the terraform plugin without changing token info on UI. I have tested multiple scenarios and never ran to this problem. Are you enabled for new token type or you are still using old type? |
|
@pawelsz-rb Sorry for the confusion, this was due to me running |
|
@pawelsz-rb Could you please point to me to documentation on how to safely migrate our account that is currently using the legacy token to using the new project access type tokens? Can we safely ask Rollbar support to enable the new feature without immediately changing existing Terraform ProjectAccessToken resources and then gradually migrate them one by one over time? |
|
@jtsaito , yes that should be the case, you can safely ask the support team to enable new feature, and if you don't touch your existing tokens everything should be transparent to you. Then, old tokens remain legacy tokens and you will be able to create only new tokens. |
Description of the change
Adding support for token version v2 and v3 (public_id)
Users will need to download new terraform plugin only when they are enabled for new token and when they want to create new tokens (because API's behavior has changed for new token CREATE ). If the users don’t want to create new tokens, then UPDATE, READ and DELETE will work with old terraform plugin (even when they are enabled for new tokens).
Note: we need to set the default value of token_type to
legacyin order to be backward compatible. That way our users will need to specify token type while creating a new token, which is different fromlegacyType of change
Checklists
Development
Code review