Refactor Bug 2003236 refactor NimbusClient params#31678
Refactor Bug 2003236 refactor NimbusClient params#31678tiftran wants to merge 1 commit intomozilla-mobile:mainfrom
Conversation
| return Bundle.main.object(forInfoDictionaryKey: key) as? String | ||
| } | ||
|
|
||
| static func remoteSettingsAppContext() -> RemoteSettingsContext { |
There was a problem hiding this comment.
I mostly copied this over from ios. I'm not sure if this is the best way to go about it
| case .mac: "desktop" | ||
| default: "phone" | ||
| } | ||
| let regionCode = Locale.current.regionCode |
There was a problem hiding this comment.
this was changed though, since Focus doesn't have storage, though im not sure if this is correct
|
Hello IOS friends! I'm not sure what the Focus:reference string linter is referring to... the logs doesn't seem to point to anything to me |
|
Tagging @adudenamedruby. He's the Nimbus Wizard!! 🧙 |
|
@mergify rebase |
✅ Branch has been successfully rebased |
13a19ff to
a6fb034
Compare
|
@tiftran Heya. Seems both focus strings script and bitrise are failing. Oh noes! re: strings: can you make sure your branch is rebased on the latest re: bitrise: is this building successfully locally? Both firefox and focus fail to build with the same error: |
|
Hi @adudenamedruby, makes me think im missing something... as for bitrise, it runs locally for me when I have it set up to use my local app services with the related changes. |
| return RemoteSettingsContext( | ||
| channel: appInfo.buildChannel?.rawValue ?? "release", | ||
| appVersion: AppInfo.appVersion, | ||
| appId: AppInfo.bundleIdentifier, | ||
| /// `Locale.current.identifier` uses an underscore (e.g. “en_US”), which is not supported by RS. | ||
| /// Nimbus’s `getLocaleTag()` returns a Gecko-compatible locale (e.g. “en-US”). | ||
| /// In Gecko, we use BCP47 format, specifically `appLocaleAsBCP47` | ||
| /// See : https://searchfox.org/mozilla-central/rev/240ca3f/toolkit/modules/RustSharedRemoteSettingsService.sys.mjs#46 | ||
| /// Once we drop support for iOS <16 we can support the proper BCP47 by using `Locale.IdentifierType.bcp47` | ||
| /// See: https://developer.apple.com/documentation/foundation/locale/identifiertype/bcp47 | ||
| locale: getLocaleTag(), | ||
| os: "iOS", | ||
| osVersion: UIDeviceDetails.systemVersion, | ||
| formFactor: formFactor, | ||
| country: country) | ||
| } |
There was a problem hiding this comment.
Is this basically bringing Remote Settings over to Focus? 🤔 Focus is in maintenance mode, and it seems like if we want to integrate Remote Settings into it properly that's going to be a whole project unto itself.
For example using Remote Settings in any client (Firefox or Focus) also requires code for syncing the collections etc. (In Firefox currently that happens in RemoteSettingsServiceSyncCoordinator).
My understanding based on past iOS team conversations is that we had not planned to update Focus to use Remote Settings.
There was a problem hiding this comment.
@mattreaganmozilla ooh if Remote Settings Service shouldn't be in focus, then this is definitely not what I actually want to do.
My app services PR tries to change the Nimbus Client params to use NimbusServerSettings instead of passing RemoteSettingsService and CollectionName around everywhere. So I tried to repurpose the existing NimbusServerSettings for that. Maybe not worth it, if this is causing complexity to Focus.
Though, looking at it again (im a total ios dummy, so i probs 100% wrong), Is NimbusServerSettings.createFromInfoDictionary used anywhere? I see NimbusAppSettings.createFromInfoDictionary being used but not the former. I also tried renaming it to see if the build would break too.
There was a problem hiding this comment.
@tiftran I could be misunderstanding, so apologies for any confusion. My concern was that using RemoteSettingsService directly in Focus would add additional complexity beyond just the requirements for this PR, but I don't have full context on this update. Maybe we don't need anything special besides this (no support for calling into service.sync()?)
@issammani is our resident AS+iOS wizard so I'm curious if he has more context or thoughts.
There was a problem hiding this comment.
@mattreaganmozilla I spoke with @freshstrangemusic, and since there will be an eventual removal of Nimbus related code, she advised to pass RemoteSettingsService as nil for now, so therefore all this extra remote settings logic i tried to shove in to make things work, would go away. Would like your perspective before going ahead and doing so.
There was a problem hiding this comment.
so therefore all this extra remote settings logic i tried to shove in to make things work, would go away
Ok gotcha, SGTM. 👍 Thanks @tiftran
There was a problem hiding this comment.
Changes made, I think it looks better? Though, Im still getting the Focus: reference string linter / build (26.0) check failing. Could I get some assistance please @mattreaganmozilla or @adudenamedruby? 🥺
There was a problem hiding this comment.
I'm not sure where github stores the artifacts (that export-strings.log file). Can you check locally what the error is or what's in that log?? Also, make sure you're rebased to the latest main - I made some changes for l10n - and looking at the GH action log, I think you've already ingested them, but just good to double check. If we don't figure it out from the log, set up a quick meeting with me (Tuesday or after, please as I'll be PTO Monday) and we'll try and debug.
Also, what's the merge order for these changes? The AS needs to be merged first, right? Otherwise bitrise won't pass and we can't merge this.
There was a problem hiding this comment.
@tiftran Can you DM me (or @adudenamedruby) in Slack if you end up becoming blocked on this? I didn't want this PR to slip under the radar but I also am not clear on what the remaining issues are (if it's just the linter & strings issues then Roux will know much more than me, but if I can help with anything else LMK). I'm going to hold off on re-reviewing in the meantime.
08253a3 to
c02a267
Compare
c02a267 to
e266f8b
Compare
|
This pull request has conflicts when rebasing. Could you fix it @tiftran? 🙏 |
|
@tiftran I was able to build pointing to your AS branch locally. And with the build being successful the linter passes as well now locally. This branch has conflicts now however so could you update it against main please? After that @mattreaganmozilla and @adudenamedruby could review the PR. |
e266f8b to
2d4d47c
Compare
|
rebase completed |
📜 Tickets
https://bugzilla.mozilla.org/show_bug.cgi?id=2003236
💡 Description
Hello IOS friends!
There was some refactor work in app service PR here
I tried to make the corresponding changes to IOS.
Essentially we're passing along NimbusServerSettings as a param along with contains
RemoteSettingsServiceandcollection_namerather passing the two separately.🎥 Demos
Demo
📝 Checklist