-
Notifications
You must be signed in to change notification settings - Fork 478
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
Strip RSR suffixes prior to handing off OS version from Nudge check to Semver comparison #22830
Conversation
…o Semver comparison Fixes 500s in config endpoint when a machine with an RSR version installed is in a team with enforced macOS updates
@@ -43,7 +45,8 @@ func (os *OperatingSystem) RequiresNudge() (bool, error) { | |||
return false, nil | |||
} | |||
|
|||
version, err := semver.NewVersion(os.Version) | |||
// strip Rapid Security Response suffix (e.g. version 13.3.7 (a)) if any | |||
version, err := semver.NewVersion(macOSRapidSecurityResponseVersionSuffix.ReplaceAllString(os.Version, ``)) | |||
if err != nil { | |||
return false, fmt.Errorf("parsing macos version \"%s\": %w", os.Version, err) |
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.
nit: can we wrap this error in the calling func so we know it's coming from RequiresNudge()
?
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.
Can fast-follow that after this gets merged (to avoid needing to rerun CI on this, given that luckily the error message in L48/51 is unique anyway).
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #22830 +/- ##
=======================================
Coverage 65.29% 65.29%
=======================================
Files 1524 1524
Lines 118742 118755 +13
Branches 3551 3551
=======================================
+ Hits 77533 77546 +13
+ Misses 34019 34013 -6
- Partials 7190 7196 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…o Semver comparison (#22830) #22829 Fixes 500s in config endpoint when a machine with an RSR version installed is in a team with enforced macOS updates # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [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/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] Added/updated tests - [ ] Manual QA for all new/changed functionality
…o Semver comparison (#22830) #22829 Fixes 500s in config endpoint when a machine with an RSR version installed is in a team with enforced macOS updates # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [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/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] Added/updated tests - [ ] Manual QA for all new/changed functionality
…from Nudge check to Semver comparison (#22842) Cherry-pick for patch release of #22830, for #22829 Fixes 500s in config endpoint when a machine with an RSR version installed is in a team with enforced macOS updates --------- Co-authored-by: Tim Lee <[email protected]>
#22829
Fixes 500s in config endpoint when a machine with an RSR version installed is in a team with enforced macOS updates
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.
SELECT *
is avoided, SQL injection is prevented (using placeholders for values in statements)