Граф коммитов

6084 Коммитов

Автор SHA1 Сообщение Дата
Mark Hammond 06d9054cb9 pin cargo-audit to 0.19 and bump a couple of versions to avoid cargo audit failires. 2024-07-26 13:34:59 +00:00
Ben Dean-Kawamura 0892f96362 Fix record types for SuggestionProvider::AmpMobile
SuggestRecordType::AmpWikipedia is for non-mobile amp.
2024-07-26 13:32:39 +00:00
Ben Dean-Kawamura f3bc5e98c0 Suggest: remove Fakespot FTS prefix indexes
See ADR-0008 for the decision.
2024-07-25 21:09:53 +00:00
Sammy Khamis a5ea699909 Removing pending commands for Close Tab should only affect devices that have synced 2024-07-25 19:33:55 +00:00
Ryan VanderMeulen a1f121beba Update Gradle to version 8.9 2024-07-25 15:06:38 +00:00
Ryan VanderMeulen ca6eaef740 Update some minor Gradle dependencies 2024-07-25 15:06:17 +00:00
Ben Dean-Kawamura a8ec39710b FTS prefix configuration ADR 2024-07-25 14:41:31 +00:00
Ben Dean-Kawamura 3cea5dc7fe Suggest benchmark updates
Added fakespot query benchmark.  Generalized some things so that code
can be shared between the ingest and query benchmarks and also so that
it will be easy to add more query bechmarks.

Added Fakespot ingest benchmarks.  Re-organized the list so that the
ingest and ingest-again benchmarks are next to each other.  This makes
it easier to add benchmarks for a new suggestion type.

Added `bench=false` to Cargo.toml.  This avoids CLI errors when
criterion-specific arguments are passed.  For details, see
https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
2024-07-24 20:58:13 +00:00
Ben Dean-Kawamura 4fa8251b3b Tweak Fakespot scores
I just saw Nive weigh in on this and she says Fakespot should be below
Yelp (0.25), but above MDN (0.24)
2024-07-23 18:58:50 +00:00
Ryan VanderMeulen f5bb8e3cb4 Update to Android SDK 35 2024-07-19 20:24:29 +00:00
Ryan VanderMeulen b64bf9d20e Fetch a newer NSS artifact 2024-07-19 02:36:10 +00:00
Ryan VanderMeulen b48424f453 Update NDK to r27 2024-07-19 02:36:10 +00:00
Ben Dean-Kawamura e19351ddf1 DISCO 2905 - Update Fakespot Suggestion scores 2024-07-18 22:06:51 +00:00
Pier Angelo Vendrame d2a2e7645d nimbus-fml: Make the output deterministic.
Changed some HashMaps with BTreeMaps to ensure the order of the output
is deterministic.
2024-07-17 13:57:24 +00:00
Lina Butler 8995a0d108 fxa-client: Replace `DeviceCommandError` with `CloseTabsResult`.
This commit demotes the `TabsNotClosed` error case from a
`DeviceCommandError` variant, to a `CloseTabsResult` variant
specifically for "close tabs".

`FirefoxAccount::close_tabs` only throws `FxaError`s for
account-related errors, as before. Successes and partial successes
are reported via `CloseTabsResult`.
2024-07-16 23:02:00 -07:00
Lina Butler 09a30f37dc fxa-client: Chunk oversized "close tabs" commands.
This commit:

* Introduces a new `DeviceCommandError` type for
  device command-related operations.
* Adds a `DeviceCommandError::TabsNotClosed` error variant, which
  includes the URLs of any tabs that couldn't be sent in a
  "close tabs" command.
* Reworks `FirefoxAccount::close_tabs` to pack URLs that exceed the
  maximum payload size (16 KB by default) into multiple
  device commands.
2024-07-16 23:02:00 -07:00
Sammy Khamis 8fd08c6f2f Remove Tabs.swift as no longer needed 2024-07-12 22:07:59 +00:00
Ben Dean-Kawamura 8ec2fa34e5 Bug 1907577 - Fakespot icon support
Fetch the icons using a separate query than manually joined them with
the suggestion data.  This has the advantage of not needing to update
the schema.

Also updated the suggest CLI a bit so that I could use it to test that
the code was working in practice.
2024-07-12 19:21:05 +00:00
Ben Dean-Kawamura 2383edfdd9 Remove fakespot feature flag
The plan is to use the current code for the experiment, so we don't need
a feature flag anymore.  The main point of the flag was to avoid
creating multiple migrations as the schema changed, but it looks like
the schema will be stable for a while.
2024-07-11 20:20:28 +00:00
Lina Butler 04956ad25b build: Bump our target Rust version to 1.79.0; MSRV to 1.76.0.
This matches the latest versions used in m-c:

* https://bugzilla.mozilla.org/show_bug.cgi?id=1886058 for the
  target version.
* https://bugzilla.mozilla.org/show_bug.cgi?id=1890935 for the MSRV.
2024-07-11 00:03:23 +00:00
Lina Butler 516f0dd45b build: Bump `ctest2` and its dependencies.
The latest version fixes a build-time panic when
building the NSS `systest` crate with Rust 1.79.0.
2024-07-11 00:03:23 +00:00
Lina Butler d4272d9230 all: Fix remaining lint suggestions from Clippy 0.1.79. 2024-07-11 00:03:23 +00:00
Lina Butler a4c2b67deb sync15: Fix range check in `ServerTimestamp::from_float_seconds`.
`f64::{min, max}_value()` is deprecated in newer versions of Rust,
and the previous range check allowed millisecond values that can't be
represented in an `f64` without loss of precision.
2024-07-11 00:03:23 +00:00
Lina Butler 5d0ad19431 all: Add `#[allow(dead_code)]` exemptions to prepare for Rust 1.79.0. 2024-07-11 00:03:23 +00:00
Ben Dean-Kawamura 16fdc3b6fe Bug 1905748 - Fakespot ingestion and matching
Create a FTS table for fakespot and populate it during ingestion.
Updated the `SuggestQuery` code to generate a string to use with the FTS
MATCH operator. I couldn't get DELETE triggers working for this, so I
made it so we delete the FTS data in `drop_suggestions`.

Also:
- Make the `clear_database` function delete the FTS data
- Added some more tests for the fakespot data
- Updated the `assert_schema_matches_new_database()` function to also
  check the triggers.  Followed the rule of 3 and refactored things now
  we're checking tables, indexes, and triggers.
2024-07-10 15:44:11 +00:00
Lina Butler 4419c4e2df support: Extract `payload_support::try_fit_items`.
The tabs and clients engines use the same logic to truncate a list of
items to fit within a size limit when serialized to JSON, though
they handle failures differently: the tabs engine sends the complete
list of tabs; the clients engine clears the list of commands.

We'll reuse the same core logic to pack URLs for closed synced tabs
into multiple commands, so let's factor it out into a shared
support crate.
2024-07-09 20:03:09 +00:00
Beth Rennie 685d659428 Add .mailmap 2024-07-09 19:21:41 +00:00
Ryan VanderMeulen 9b83867cbe Update AndroidX Test to the latest releases 2024-07-08 18:39:57 +00:00
DonalMe ea483d494f Start release v130.0 2024-07-08 13:34:41 +00:00
Ryan VanderMeulen 01b4c20324 Update NSS to version 3.102 2024-07-03 23:57:01 +00:00
dependabot[bot] c7072a0a9e build(deps): bump mozilla-taskgraph from 2.0.2 to 2.0.3 in /taskcluster
Bumps [mozilla-taskgraph](https://github.com/mozilla-releng/mozilla-taskgraph) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/mozilla-releng/mozilla-taskgraph/releases)
- [Changelog](https://github.com/mozilla-releng/mozilla-taskgraph/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mozilla-releng/mozilla-taskgraph/compare/2.0.2...2.0.3)

---
updated-dependencies:
- dependency-name: mozilla-taskgraph
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-03 23:20:59 +00:00
Ben Dean-Kawamura 71226c87a9 Bug 1905769 - Suggest API for loading sqlite3 extensions
Added a method on `SuggestStoreBuilder` to load an SQLite3 extension.
This will be needed to enable FTS5 on Desktop.  It shouldn't be needed
on Android/iOS, since FTS5 is normally loaded by default.

I tested this with a simple .so file that I downloaded myself.  However,
I couldn't figure out a good way to check in this code.
2024-07-02 17:35:00 +00:00
Mark Hammond 7fae3fe145 tabs: filter_pending_remote_tabs only looks at the first tab from a device 2024-06-28 13:43:37 +00:00
Ben Dean-Kawamura 7e50de72c5 Suggest ingestion refactor
Move some common functionality to `ingest_records_by_type()`:
  - Updating the last stored modified time
  - Dropping the old suggestion data for a record

This simplifies the code since we perform these tasks all in one place.
It also means we can remove the `ingest_record()` function and one level
of nested callbacks.

I think this way is more reliable, since it's always unconditionally
happening in the top-level function.   For example, if a record gets
replaced with a new schema that we can't parse, we now delete the old
suggestions rather than keeping them in the DB like before.
2024-06-27 15:51:41 +00:00
Ben Dean-Kawamura 2f4ca52a0a Suggest drop records interruption check
We've seen shutdown hangs in the `drop_suggestions` function because
it's running slowly
(https://bugzilla.mozilla.org/show_bug.cgi?id=1895110).  That function
has been speed up significantly, but it still would be good to check for
interruption to avoid the possibilities.
2024-06-27 15:50:37 +00:00
Ryan VanderMeulen f380463930 Fix swiftlift error 2024-06-27 12:21:43 +00:00
Ryan VanderMeulen 1a91d13488 Update to Glean v60.3.0 2024-06-27 12:21:43 +00:00
Ben Dean-Kawamura ee75ab4855 Bug 1904132 - Suggest CLI
Added the `suggest-cli` crate that implements a simple clap CLI to
ingest and query suggestions.  This can be run using `cargo suggest`.

My plan is to use this to test fakespot blocklist support.
2024-06-25 21:34:36 +00:00
Mark Hammond 3ab90b51f7 Refactor fxa command encryption to avoid duplicated code 2024-06-24 15:07:55 +00:00
Ben Dean-Kawamura a8c15ba63d Bug 1901805 - Starting Fakespot ingestion code
Defined the `fakespot` feature and put most of the changes behind that
feature flag.

Updated ingest code to use 2 remote settings clients, one for fakespot
and one for everything else.  I think I like this setup going forward,
since it makes it easy for new suggestions to have their own colleciton
if we decide it makes sense.

Implemented some very simple matching logic, the next step is for the
SNG team to update this with the real matching logic.  I tried to leave
`FAKESPOT-TODO` comment breadcrumbs where they need to update the code.
2024-06-18 17:29:23 +00:00
Mark Hammond b6094821ad FxaError::Other error should show a description of the other error 2024-06-17 15:41:44 +00:00
Ben Dean-Kawamura 46acbeb2ce Adding SuggestBuilder.remote_settings_bucket_name
I just realized that the JS consumer wants to set the bucket name.  They
currently use the `remote_settings_config` method to do this, but it's
deprecated so we need to give them an alternative.
2024-06-13 16:08:43 +00:00
Charlie 5982870e95 update nimbus metrics.yaml to change notified user and renew an expired metric 2024-06-11 17:47:43 +00:00
Tarik Eshaq dca4196dcc Uses m1 runners for circle ci because x86 is deprecated 2024-06-11 12:51:51 +00:00
Ben Dean-Kawamura 0fff1e63a0 Bug 1900837 - Speed up `drop_suggestions` by dropping the FKs
The main issue was that we had foreign keys without indexes for the
child key columns like SQLite suggests in
https://www.sqlite.org/foreignkeys.html.

My first try was to add the indexes and ran the benchmarks on my
machine:
  - `ingest-again-amp-wikipedia` now completed successfully and returned
    a time of ~1000ms.
  - `ingest-amp-wikipedia` (the test for ingesting the first time) increased
   from about ~450ms to ~575ms.  It seems that adding these keys is
   non-trivial, but there's no other way to make reingestion work at a
   reasonable speed without a major rework of the system.

The second try was to remove the foreign keys altogether, which lead to
an even bigger speedup:
  - `ingest-again-amp-wikipedia` was now ~600ms
  - `ingest-amp-wikipedia` was now ~400ms, even faster than the
    baseline.
  - Database size staid the same as in `main`, whereas the previous
    change increased it from 19m to 26m.

We discussed the pros-and-cons of this in the
https://github.com/mozilla/application-services/pull/6273 and decided to
go with dropping the foreign keys. This represents some loss of safety,
but it's not much because:

  - Ingestion is deterministic, if we set up the relationships correctly
    for one user then we set them up correctly for all users.
  - We regularly throw away all data in the tables and re-create them.

AMP/Wikipedia dominates the total ingestion time, which is why I
focused on this benchmark.  The second slowest benchmark is amp-mobile
which is doing very similar work, but with half the data and finishing
in about half the time. After that, all other benchmarks were < 15ms.

Updated the `assert_schema_matches_new_database` method to also check
that the indexes match.
2024-06-10 16:12:03 +00:00
Ben Dean-Kawamura 43d6ea5132 Bug 1900837 - Adding benchmarks for reingestion
Added new `ingest-again-*` benchmarks that test re-ingesting all
suggestions with a full database.  In particular, this tests the
`drop_suggestions` method that's causing us issues.

Right now the `ingest-again-amp-wikipedia` is extremely slow.  I've
always had to interrupt it before it finishes.

Also, updated `cargo suggest-debug-ingestion-sizes` to print out the
total database size.  I want to use this to check how new indexes affect
it.
2024-06-10 16:12:03 +00:00
dependabot[bot] b440a1f8d5 build(deps): bump typing-extensions from 4.12.1 to 4.12.2 in /tools
Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.12.1 to 4.12.2.
- [Release notes](https://github.com/python/typing_extensions/releases)
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/python/typing_extensions/compare/4.12.1...4.12.2)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-10 10:51:59 +00:00
Ryan VanderMeulen 7d5765f11b Start release v129.0 2024-06-10 08:22:20 +00:00
Sammy Khamis 9884a6dfc1 Disable bad lint rule 2024-06-07 23:37:19 +00:00
Ryan VanderMeulen 245535e727 Update NSS to version 3.101 2024-06-07 20:46:16 +00:00