-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Snapshots: Do not return internal database ids #77672
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.
LGTM
@@ -29,11 +29,11 @@ type DashboardSnapshot struct { | |||
|
|||
// DashboardSnapshotDTO without dashboard map | |||
type DashboardSnapshotDTO struct { | |||
ID int64 `json:"id" xorm:"id"` | |||
ID int64 `json:"-" xorm:"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.
The entire purpose of this DashboardSnapshotDTO
seems to be returning the search response, we could remove those fields instead of changing the JSON name field
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.
Yes -- but i am reluctant to make too big of change without a concrete destination :). With this minimal change, we keep all internal logic the same but do not leak the the database ids over the public api
The snapshots API currently returns three internal database ids that are not needed or used by clients:
Limiting usage of internal database ids greatly simplifies any multi-tenant migration efforts. Since they are not required here, lets just remove them. See #77667