-
Notifications
You must be signed in to change notification settings - Fork 752
Add auto-update schedule to software activity updates #37715
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
Add auto-update schedule to software activity updates #37715
Conversation
| updatedApp, err := svc.UpdateAppStoreApp(ctx, req.TitleID, req.TeamID, fleet.AppStoreAppUpdatePayload{ | ||
| updatedApp, activity, err := svc.UpdateAppStoreApp(ctx, req.TitleID, req.TeamID, fleet.AppStoreAppUpdatePayload{ |
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.
Because we update the app itself and its auto-update schedule using separate service methods, we can't gather all of the info we need for the activity inside UpdateAppStoreApp() anymore. So I updated to that method to return an activity that we can then send after all of the updates are done.
| // Re-fetch the software title to get the updated auto-update config. | ||
| updatedTitle, err := svc.SoftwareTitleByID(ctx, req.TitleID, req.TeamID) | ||
| if err != nil { | ||
| return updateAppStoreAppResponse{Err: err}, nil | ||
| } |
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.
Re-fetching here allows us to annotate the activity with auto-update schedule data even if it's not sent in the request (because we're just editing the app's display name, for example).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #37715 +/- ##
=======================================
Coverage 65.88% 65.88%
=======================================
Files 2361 2361
Lines 187305 187313 +8
Branches 8011 8011
=======================================
+ Hits 123401 123411 +10
+ Misses 52622 52618 -4
- Partials 11282 11284 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@rachaelshaw this needs a +1 from you, for the auto-updated docs |
Related issue: Resolves #35458
Details
This PR adds new metadata to the
ActivityEditedAppStoreAppactivity relating to the app's auto-update schedule. The data will be included with everyActivityEditedAppStoreAppactivity regardless of whether the values changed. I have an open question about this on the activity docs PR.One functional change to note here is that the act of recording the activity has been moved up a level into the endpoint code, because the activity now contains metadata from two different service methods (one that updates the VPP app, and one that creates the auto-update schedule).
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Testing