Cherrypick 35309 changes into 4.77 - #35904
Conversation
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #35309 Related doc update #35736 Adds a PUT endpoint for setting setup experience scripts, as opposed to the current POST implementation(which errors if the script is already set, which is why gitops calls DELETE first every time). If the contents change, the new endpoint has the same effect as DELETE then POST today, however if the contents are unchanged no changes occur, allowing gitops runs to avoid cancelling script executions. Also switched gitops over to the new PUT endpoint and removed the DELETE in the "set" path. # Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes ## Testing - [x] Added/updated automated tests - [x] Where appropriate, [automated tests simulate multiple hosts and test for host isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing) (updates to one hosts's records do not affect another) - [ ] QA'd all new/changed functionality manually
…cripts (#35818) <!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #35309 Followup changes, see https://fleetdm.slack.com/archives/C019WG4GH0A/p1763137466439419 for more context. We decided not to use the initially proposed PUT endpoint at all and update the existing POST endpoint to have the desired behavior # Checklist for submitter If some of the following don't apply, delete the relevant line. - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes ## Testing - [x] Added/updated automated tests - [x] Where appropriate, [automated tests simulate multiple hosts and test for host isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing) (updates to one hosts's records do not affect another) - [x] QA'd all new/changed functionality manually
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## rc-minor-fleet-v4.77.0 #35904 +/- ##
=========================================================
Coverage ? 66.20%
=========================================================
Files ? 2102
Lines ? 178192
Branches ? 7336
=========================================================
Hits ? 117979
Misses ? 49383
Partials ? 10830
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:
|
|
|
||
| // Setup experience script endpoints: | ||
| ue.GET("/api/_version_/fleet/setup_experience/script", getSetupExperienceScriptEndpoint, getSetupExperienceScriptRequest{}) | ||
| ue.POST("/api/_version_/fleet/setup_experience/script", setSetupExperienceScriptEndpoint, setSetupExperienceScriptRequest{}) |
There was a problem hiding this comment.
Are we updating the API documentation to call out the change to PUT semantics for the POST endpoint?
There was a problem hiding this comment.
Yup. latest doc PR here: #35820
TLDR is we originally added a separate PUT version then decided to update semantics of the POST version and doc updates now reflect that
|
Test failures are unrelated(looks like errors hitting ubuntu repo, perhaps cloudflare related). |
65a4e8e
into
rc-minor-fleet-v4.77.0
Related issue: Resolves #35309
cherrypicks #35651 and #35818 into 4.77
Checklist for submitter
If some of the following don't apply, delete the relevant line.
Changes file added for user-visible changes in
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Input data is properly validated,
SELECT *is avoided, SQL injection is prevented (using placeholders for values in statements)If paths of existing endpoints are modified without backwards compatibility, checked the frontend/CLI for any necessary changes
Testing
Added/updated automated tests
Where appropriate, automated tests simulate multiple hosts and test for host isolation (updates to one hosts's records do not affect another)
QA'd all new/changed functionality manually