-
Notifications
You must be signed in to change notification settings - Fork 547
Rename mdm profiles updated_at
to uploaded_at
and remove automatic setting
#16425
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
Conversation
server/fleet/apple_mdm.go
Outdated
UpdatedAt time.Time `db:"updated_at" json:"updated_at"` | ||
Labels []ConfigurationProfileLabel `db:"labels" json:"labels,omitempty"` | ||
CreatedAt time.Time `db:"created_at" json:"created_at"` | ||
UploadedAt time.Time `db:"uploaded_at" json:"updated_at"` // TODO: should we update the JSON rendering? |
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 don't think we should, that would be an API breaking change (documented e.g. here: https://fleetdm.com/docs/rest-api/rest-api#default-response61)
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.
100% agree with this, I would just leave a comment so a good intended soul doesn't change it later 😅
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.
👍 sounds good, I'll remove the TODO and add that note.
server/fleet/mdm.go
Outdated
@@ -364,7 +364,7 @@ type MDMConfigProfilePayload struct { | |||
Identifier string `json:"identifier,omitempty" db:"identifier"` // only set for macOS | |||
Checksum []byte `json:"checksum,omitempty" db:"checksum"` // only set for macOS | |||
CreatedAt time.Time `json:"created_at" db:"created_at"` | |||
UpdatedAt time.Time `json:"updated_at" db:"updated_at"` | |||
UploadedAt time.Time `json:"updated_at" db:"uploaded_at"` // TODO: should we change the JSON rendering? |
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.
Same here, would be a breaking change.
server/fleet/windows_mdm.go
Outdated
@@ -37,7 +37,7 @@ type MDMWindowsConfigProfile struct { | |||
SyncML []byte `db:"syncml" json:"-"` | |||
Labels []ConfigurationProfileLabel `db:"labels" json:"labels,omitempty"` | |||
CreatedAt time.Time `db:"created_at" json:"created_at"` | |||
UpdatedAt time.Time `db:"updated_at" json:"updated_at"` | |||
UploadedAt time.Time `db:"uploaded_at" json:"updated_at"` // TODO: should we update the JSON rendering? |
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.
Same here, would be a breaking change.
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, I think the only thing to change would be the addition of the w
prefix since that's being worked on separately, but maybe you're chatting with Jahziel about this.
server/datastore/mysql/migrations/tables/20240129095928_AddMdmProfilesUploadedAt.go
Outdated
Show resolved
Hide resolved
server/fleet/apple_mdm.go
Outdated
UpdatedAt time.Time `db:"updated_at" json:"updated_at"` | ||
Labels []ConfigurationProfileLabel `db:"labels" json:"labels,omitempty"` | ||
CreatedAt time.Time `db:"created_at" json:"created_at"` | ||
UploadedAt time.Time `db:"uploaded_at" json:"updated_at"` // TODO: should we update the JSON rendering? |
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.
100% agree with this, I would just leave a comment so a good intended soul doesn't change it later 😅
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #16425 +/- ##
==========================================
- Coverage 65.61% 65.46% -0.15%
==========================================
Files 1133 1135 +2
Lines 99105 99325 +220
Branches 2448 2448
==========================================
- Hits 65030 65026 -4
- Misses 29196 29402 +206
- Partials 4879 4897 +18
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 Go test failure is network-related, unrelated to the changes. It could take a while to resolve given we ping an external server, I'll retry once and merge anyway if that's the only failure:
|
#16051
Checklist for submitter
changes/
ororbit/changes/
.See Changes files for more information.
SELECT *
is avoided, SQL injection is prevented (using placeholders for values in statements)