Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix #1307: Upgrade adblock stats library to use adblock-rust. #1308

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

iccub
Copy link
Contributor

@iccub iccub commented Jul 30, 2019

For now there is no automation when it comes to updating this library, it needs to be done manually.

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • My patch or PR title has a standard commit message that looks like Fix #123: This fixes the shattered coffee cup! (or No Bug: <message> if no relevant ticket)
  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()
  • New files have MPL-2.0 license header.

Test Plan:

Browse through popular websites and see if adblock stats are updating and the app is not crashing.
Play few youtube/twitch videos as well

Screenshots:

Reviewer Checklist:

  • PR is linked to an issue via Zenhub.
  • Issues are assigned to at least one epic.
  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • release-notes/(include|exclude)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable)

@iccub iccub added the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Jul 30, 2019
@iccub iccub changed the title Fix #1307: Upgrade adblock stats library to use adblock-rust. [WIP] Fix #1307: Upgrade adblock stats library to use adblock-rust. Jul 30, 2019
@iccub iccub changed the title [WIP] Fix #1307: Upgrade adblock stats library to use adblock-rust. Fix #1307: Upgrade adblock stats library to use adblock-rust. Jul 30, 2019
static let generalAdblockName = "latest"
static func generalAdblockName(for fileType: FileType) -> String? {
switch fileType {
case .dat: return "rs-ABPFilterParserData"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some logic had to be added to handle differences between ios-json and universal-dat files, this includes different endpoints and file names

@@ -0,0 +1,96 @@
#ifndef ADBLOCK_RUST_FFI_H
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@iccub iccub removed the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Jul 31, 2019
@iccub iccub added the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Aug 6, 2019
@iccub iccub force-pushed the feature/adblock-rust-migration branch from eb62981 to 64438df Compare August 7, 2019 14:25
iccub added 2 commits August 7, 2019 17:05
This file will be now always downloaded from the server if not present
on the device.
@iccub iccub force-pushed the feature/adblock-rust-migration branch from 64438df to 3b387a7 Compare August 7, 2019 17:18
@iccub iccub removed the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Aug 7, 2019
@jhreis jhreis added blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue needs security review labels Aug 7, 2019
switch self {
case .dat: return "https://adblock-data.s3.brave.com/4/"
case .json: return "https://adblock-data.s3.brave.com/ios/"
case .tgz: return "" // Httpse resources are not supported yet.
Copy link
Contributor

Choose a reason for hiding this comment

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

Clarified this, but wanted to say that this does not impact HTTPSE stats, as we currently use a different system for this anyway.

case .vi: resourceId = "6A0209AC-9869-4FD6-A9DF-039B4200D52C"
}

switch fileType {
Copy link
Contributor

Choose a reason for hiding this comment

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

Creative solution to get around this 😄

@jumde jumde self-requested a review August 8, 2019 16:50
@jumde
Copy link
Contributor

jumde commented Aug 8, 2019

lgtm

@jhreis jhreis merged commit 46c29df into brave:development Aug 8, 2019
@iccub iccub deleted the feature/adblock-rust-migration branch August 8, 2019 18:01
@jhreis jhreis removed the blocked If a ticket is blocked for some reason, if not using a sub-block label, please provide info in issue label Aug 8, 2019
jhreis added a commit that referenced this pull request Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants