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

Bug 1302815 - Switch Firefox iOS to use list.json #3555

Merged
merged 5 commits into from
Jan 6, 2018

Conversation

farhanpatel
Copy link
Contributor

@farhanpatel farhanpatel commented Dec 21, 2017

This PR looks big but its mostly search metadata files being moved.

You can look at DefaultSearchPrefs.swift and SearchEngines.swift for the code changes.

@mozillamobilebot
Copy link

mozillamobilebot commented Dec 21, 2017

SwiftLint found issues

Warnings

File Line Reason
SearchEngines.swift 148 Force tries should be avoided.

Generated by 🚫 Danger

Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

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

Looks good; some comments about testing.

// }
//
// Telemetry.default.add(pingBuilderType: CorePingBuilder.self)
// Telemetry.default.add(pingBuilderType: MobileEventPingBuilder.self)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

woops. My bad. This commit is so annoyingly large that I didnt see this 😢

}
return possibilities
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is cleaner than what went before, to be sure.

// These exceptions can go away when we drop iOS 8 or when we start using a better mechanism for search
// engine selection that is not based on language identifier.

What happens when we drop iOS8? What's in iOS9?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apple changed Locale Identifiers


// might not work to change the default.
// if someone has added/removed an engine new engines or edits to the default engines might never be shown.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we test this?

// setup the list json
let searchPrefs = DefaultSearchPrefs(with: Bundle.main.resourceURL!.appendingPathComponent("SearchPlugins").appendingPathComponent("list.json"))!

// setup the most popular locales
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we know we're not shipping broken XML files to Indonesia or India?

For that matter, how do we know we're not shipping broken list.json? (smoke testing aside)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The good thing about this setup vs the old one is. The XML files are all shared between countries. So if we test the global xml file in a test for en_CA then the XML file should also work in India.

As for List.json, Hopefully we arent merging patches to master without CI 😄

<Param name="tag" value="firefox-fr-21"/>
<Param name="sourceid" value="Mozilla-search"/>
</Url>
<SearchForm>https://www.amazon.fr/</SearchForm>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these files actually changed, or are they simply mved? Did you git mv them?

Copy link
Contributor Author

@farhanpatel farhanpatel Jan 5, 2018

Choose a reason for hiding this comment

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

I picked up this patch from mkaply, according to him. These were just moved

@farhanpatel farhanpatel merged commit 8b7be4a into master Jan 6, 2018
@farhanpatel farhanpatel deleted the 1302815_list_json branch January 6, 2018 00:28
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