Skip to content
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

Merged
merged 3 commits into from
Oct 10, 2024

Conversation

iansltx
Copy link
Member

@iansltx iansltx commented Oct 10, 2024

#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 file added for user-visible changes in changes/, orbit/changes/ or ee/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)
  • Added/updated tests
  • Manual QA for all new/changed functionality

…o Semver comparison

Fixes 500s in config endpoint when a machine with an RSR version installed is in a team with enforced macOS updates
@iansltx iansltx requested a review from a team as a code owner October 10, 2024 16:22
@@ -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)
Copy link
Contributor

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()?

Copy link
Member Author

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).

@iansltx iansltx merged commit b31e842 into main Oct 10, 2024
15 checks passed
@iansltx iansltx deleted the rsr-nudge-quick-fix branch October 10, 2024 17:15
Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.29%. Comparing base (97a2581) to head (eff0958).
Report is 6 commits behind head on main.

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     
Flag Coverage Δ
backend 66.59% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

iansltx added a commit that referenced this pull request Oct 10, 2024
…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
iansltx added a commit that referenced this pull request Oct 10, 2024
…Nudge check to Semver comparison (#22838)

For #22829, merged into `main` via #22830
iansltx added a commit that referenced this pull request Oct 10, 2024
…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
iansltx added a commit that referenced this pull request Oct 10, 2024
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants