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

Store dashboard widget IDs #815

Merged
merged 2 commits into from
Jan 11, 2021
Merged

Store dashboard widget IDs #815

merged 2 commits into from
Jan 11, 2021

Conversation

therve
Copy link
Contributor

@therve therve commented Jan 6, 2021

This adds a new attribute to dashboard widgets to store their IDs for
future references.

Closes #301

This adds a new attribute to dashboard widgets to store their IDs for
future references.

Closes #301
@therve therve requested review from a team as code owners January 6, 2021 13:09
Copy link
Contributor

@matt-miller-ddog matt-miller-ddog left a comment

Choose a reason for hiding this comment

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

Approved, with a comment about Int64.

@@ -540,6 +540,11 @@ func getNonGroupWidgetSchema() map[string]*schema.Schema {
Schema: getWidgetLayoutSchema(),
},
},
"id": {
Type: schema.TypeInt,
Computed: true,
Copy link
Contributor

@matt-miller-ddog matt-miller-ddog Jan 6, 2021

Choose a reason for hiding this comment

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

👍 for computed: true

@@ -540,6 +540,11 @@ func getNonGroupWidgetSchema() map[string]*schema.Schema {
Schema: getWidgetLayoutSchema(),
},
},
"id": {
Type: schema.TypeInt,
Copy link
Contributor

Choose a reason for hiding this comment

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

We've had some trouble in the past with widget IDs big enough to require Int64 when represented in Go. I think schema.TypeInt will work (they don't seem to provide an explicitly Int64 version) but I'm not familiar enough to gauge this properly.

Just wanted to put this on your radar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment: terraform does indeed the right thing, and TypeInt is int64 capable.

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.

Store Widget ID In State
3 participants