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

Update RMF version matching to ignore build number #1118

Merged

Conversation

samsymons
Copy link
Contributor

@samsymons samsymons commented Dec 6, 2024

Please review the release process for BrowserServicesKit here.

Required:

Task/Issue URL: https://app.asana.com/0/1207619243206445/1208908529122506/f
iOS PR: duckduckgo/iOS#3686
macOS PR: duckduckgo/macos-browser#3635
What kind of version bump will this require?: Patch

Description:

This PR updates the RMF version matching logic to ignore build number. Previously, when you tried to match a version like 1.110.0, it would fail because you needed to know the build number.

To fix this, this PR makes the following changes:

  1. Update the version number fetching logic to use versionNumber, not versionAndBuildNumber
  2. To avoid breaking messages that are using build number, the attributes that match version number ranges have been updated to trim the build number at init time (let's discuss that one in the comments though)

Steps to test this PR:

  1. Check that the test suite is green and correctly covers this new case
  2. Launch one of the clients and verify that existing messages are parsed correctly - many of the existing production messages contain version checks so these can be used for testing as-is, but please ping me if you'd prefer a custom message written to facilitate easier testing

OS Testing:

  • iOS 14
  • iOS 15
  • iOS 16
  • macOS 10.15
  • macOS 11
  • macOS 12

Internal references:

Software Engineering Expectations
Technical Design Template

@samsymons samsymons requested a review from ayoy December 6, 2024 03:45
Comment on lines 46 to 48
min: min.trimmingBuildNumber,
max: max.trimmingBuildNumber,
value: value.trimmingBuildNumber,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines exist to avoid breaking existing messages that already define a build number.

This approach means that build number trimming will happen for all StringRangeMatching attributes, which is currently AppVersionMatchingAttribute and OSMatchingAttribute. But, if you would prefer to keep this change limited to the app version attribute, I can override its initializer and push that logic down there instead.

Alternatively, it could be moved into RangeStringNumericMatchingAttribute instead. We have a few options, let me know what you prefer. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic we're applying here is specific to the app version attribute, right? I'd rather see it in the AppVersionMatchingAttribute to limit its reach. Unless you foresee this adjustment to be useful for other strings?

Copy link
Contributor

@ayoy ayoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for this @samsymons!

@samsymons samsymons merged commit ad28b07 into main Dec 6, 2024
7 checks passed
@samsymons samsymons deleted the sam/update-rmf-version-matching-to-ignore-build-number branch December 6, 2024 20:52
samsymons added a commit that referenced this pull request Dec 6, 2024
…etworks

* main:
  Update RMF version matching to ignore build number (#1118)
  Fix threading issue between using a Semaphore and async/await (#1115)
  add experiment test fake feature (#1119)
  Bump Tests/BrowserServicesKitTests/Resources/privacy-reference-tests from `a603ff9` to `6133e7d` (#1109)
samsymons added a commit to duckduckgo/iOS that referenced this pull request Dec 6, 2024
Task/Issue URL: https://app.asana.com/0/1207619243206445/1208908529122506/f
Tech Design URL:
CC:

Description:

This PR updates the iOS app to pull in the BSK app version matching changes added in duckduckgo/BrowserServicesKit#1118.
samsymons added a commit to duckduckgo/macos-browser that referenced this pull request Dec 6, 2024
Task/Issue URL: https://app.asana.com/0/1207619243206445/1208908529122506/f
Tech Design URL:
CC:

Description:

This PR updates the macOS app to pull in the BSK app version matching changes added in duckduckgo/BrowserServicesKit#1118.
samsymons added a commit that referenced this pull request Dec 19, 2024
* main: (24 commits)
  change api (#1133)
  Ensure authToken is present before calling refreshAuthTokenIfNeeded
  Add 'locale' to report broken site params
  Add 'locale' to report broken site params
  Ensure authToken is present before calling refreshAuthTokenIfNeeded
  Privacy Pro Free Trials - Models and API (#1120)
  remove MaliciousSiteProtectionSubfeature (#1131)
  Malware protection 6: Malware integration (#1099)
  Add underlying error to PrivacyStatsError (#1130)
  Initial changes for compilation time tracking. (#1111)
  iOS System level credential provider (#1127)
  Increase ratio of complete form saves (#1124)
  Add PrivacyStatsError.failedToClearPrivacyStats (#1128)
  Update autofill to 16.0.0 (#1122)
  Update local network routing (#1117)
  Update RMF version matching to ignore build number (#1118)
  Fix threading issue between using a Semaphore and async/await (#1115)
  add experiment test fake feature (#1119)
  Bump Tests/BrowserServicesKitTests/Resources/privacy-reference-tests from `a603ff9` to `6133e7d` (#1109)
  experiment default metrics pixels (#1107)
  ...
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.

2 participants