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

6091 Коммитов

Автор SHA1 Сообщение Дата
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
Ben Dean-Kawamura 71578bea70 Persist relevancy data 2024-06-05 14:48:30 +00:00
Ben Dean-Kawamura 7f96b23650 Bug 1898509 - more details for SQL errors
The goal here is to track down some foreign key failures that we're
seeing, but don't have any context on where they're happening.

- Record a breadcrumb when we start to ingest different suggestion types.
- Record what we were doing when we saw an SQL error.  This should
  change the message from `FOREIGN KEY constraint failed` to something
  like `FOREIGN KEY constraint failed (context: mdn insert)`, which I
  think will help greatly.

I wanted to also record which field the foreign key error was happening
on, but AFAICT this is not possible with SQLite.

I added the `extend` crate to help with some of this code.  It's not
really needed, but I think it's worth the dependency. We've been using
it for `uniffi-bindgen-gecko-js` so it's already vetted.
2024-06-03 21:35:59 +00:00
Mark Hammond c148e6060b Update local publish for Fenix instructions 2024-06-03 18:30:53 +00:00
Ryan VanderMeulen 4acb681357 Update Gradle to version 8.8 2024-06-03 16:48:57 +00:00
Ryan VanderMeulen 6ed852ec17 Sync Gradle dependencies with the versions used in AC 2024-06-03 15:35:30 +00:00
dependabot[bot] 91960ea6e2 build(deps): bump typing-extensions from 4.11.0 to 4.12.1 in /tools
Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.11.0 to 4.12.1.
- [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.11.0...4.12.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 14:05:34 +00:00
dependabot[bot] ffaa66e79a build(deps): bump requests from 2.31.0 to 2.32.3 in /tools
Bumps [requests](https://github.com/psf/requests) from 2.31.0 to 2.32.3.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.31.0...v2.32.3)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 13:58:47 +00:00
Alexander Cyon 4bfb0c40c1 chore: Revert two typo fixes in DEPENDENCIES.md since it is auto-generated (fixes introduced in #6251). 2024-05-31 13:05:12 +00:00
Tarik Eshaq 2b3635e05a Uses serde_jsons preserve order for tests that depend on map order 2024-05-30 20:08:51 +00:00
Erich Gubler 3ca067683c build: upgrade `rusqlite` 0.30.0 → 0.31.0 2024-05-29 15:05:57 +00:00
Mark Hammond b09581e8e9 [Tabs] Update the pending close schema so it's also a queue of things to send.
* Abstracts the API towards being more general-purpose "tab command" rather than
  being purely about closing individual tabs, with the intention that it's
  easier to add, say, "close all inactive" (because with 100% certainty I
  know this will be a very early request)

* Updates the schema creation code to be less foot-gun-y.

* Renaming a few things so that we consistently use `device_id` for the fxa id
  and `client_id` for the Sync client ID.

* Fixes the case when syncing when the device ID != fxa id.
2024-05-28 19:13:32 +00:00
Ben Dean-Kawamura be2d22fedc Updating more suggest store tests 2024-05-28 14:57:05 +00:00
Alexander Cyon d73a4c7a45 Typos 2024-05-24 20:17:12 +00:00
Ben Dean-Kawamura 33ea53616a Couple of fixes for the uplift docs 2024-05-22 14:30:59 +00:00
Ben Dean-Kawamura 8bd7ba4ea4 Bug 1897264 - interruption support for ingestion
Added an `interrupt_everything` method that interrupts both the read and
write connection.  This is intended for iOS to use to interrupt the
suggest component during shutdown.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=1897299 for a discussion on
next steps here.

Created a new `WriteScope` type that stores an interrupt scope that can
be used for multiple `write` calls.  This allows the ingestion code to
catch all interruptions that happened after the ingestion started. With
the old system, if `interrupt_everything` was called in-between
ingestion two types then we might miss it.
2024-05-20 17:03:04 +00:00
Ben Dean-Kawamura 1ebbd1a0b4 Suggest: shorten the type names from the `rs` module.
Nan suggested this in the review of #6236 and I think it's a great idea.
2024-05-17 19:31:33 +00:00
Ben Dean-Kawamura 87ddcfcc7c Reworking the suggest tests
- Added some extra utility functions/types for testing.
- Added a module with test data like "Los Pollos Hermanos" that we can
  repeatedly use in the tests.

The end result is that the tests are much more compact, which makes them
easier to understand and maintain.

Also added a new mock RS client for the tests.  It works better with the
new system and also fixes a weird aspect of the old mock client.  The
old client would always return all records for each request, even though
the store now requests one provider type at a time.  When the test store
requested the weather records, it would get all the mock Amp data. The
tests still passed, but I found this odd.

I'm stopping now before replacing all the test code to get feedback.  If
others like this approach I can continue replacing the rest of the
tests.
2024-05-16 19:27:26 +00:00
Ben Dean-Kawamura 1df5028dea Updated SuggestRemoteSettingsClient API
Made the API more high-level and not just a copy of the remote settings
client API.  It now inputs a `SuggestRemoteSettingsRecordRequest` which
is specific to the kinds of requests we make.  It outputs a list of
records linked to the attachment data.  This way:

  - It's simpler to mock up in the tests since the mocks can match the
    actual requests more directly.  I'm hoping to use this to simplify
    the store tests which have gotten really out of hand.
  - We abstract away some of the remote settings client details, which
    makes it easer to switch how we make requests in the future.
2024-05-16 17:16:18 +00:00
Lina Butler 15e90ad278 nimbus-gradle-plugin: Use `getArchOs()` as the path prefix when unzipping `nimbus-fml`.
This fixes a regression from 9197c0bdce.
`NimbusAssembleToolsTask` wouldn't find `nimbus-fml` when run on an
on an x86-64 Linux host, because `getArchOs()` returns
`x86_64-unknown-linux` on that platform, while the directory in the
archive is named `x86_64-unknown-linux-musl`. Using `getArchOs()` as
the prefix fixes this for both x86-64 and ARM64 Linux hosts.

`NimbusAssembleToolsTask` now throws if no files match the unzip spec,
to catch issues like this in the future.
2024-05-16 16:35:44 +00:00
Lina Butler 9197c0bdce nimbus-gradle-plugin: Overhaul the plugin to support lazy configuration.
This is a substantial refactor of the plugin that should fix issues
like bug 1854254 and bug 1856461, and speed up FML generation. These
bugs had the same underlying cause: the plugin was trying to configure
its tasks without observing the Gradle build lifecycle, leading to
inconsistencies and accidental interdependencies.

Further, because the old tasks didn't declare their inputs or outputs,
Gradle couldn't "see" the full task graph, causing too much or too
little to be rebuilt. The easiest way to force Gradle to pick up the
changes used to be a full clobber.

This commit resolves all those issues by:

* Adopting Gradle's lazy configuration API [1], which lets
  Gradle track inputs and outputs, and avoids ordering issues
  caused by realizing the task graph at the wrong time [2].
  As a bonus, we should be able to work much better with
  `afterEvaluate` [3] in m-c's Gradle scripts.
* Adopting the new Android Gradle Plugin `SourceDirectories`
  API that supports lazy configuration [4], which
  replaces the deprecated `registerJavaGeneratingTask` API.
* Adding task classes and custom types to help with naming
  and configuring inputs and outputs.

[1]: https://docs.gradle.org/current/userguide/lazy_configuration.html
[2]: https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
[3]: https://mbonnin.hashnode.dev/my-life-after-afterevaluate
[4]: https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/SourceDirectories
2024-05-16 04:22:42 +00:00
Mark Banner 574be82135 chore: Update vendoring should error if a subprocess has an issue. 2024-05-15 14:09:55 +00:00
Mark Banner 50cad1defa Add missing license to support/types crate. 2024-05-15 14:09:47 +00:00
Ryan VanderMeulen 75d76ea5e4 Update to Glean v60.1.0 2024-05-14 21:06:25 +00:00
Charlie b56ecd38f1 update Nimbus SDK to add and use RecordedContext 2024-05-14 19:36:38 +00:00
dependabot[bot] e7277a3b6c build(deps): bump mozilla-taskgraph from 1.5.0 to 2.0.2 in /taskcluster
Bumps [mozilla-taskgraph](https://github.com/mozilla-releng/mozilla-taskgraph) from 1.5.0 to 2.0.2.
- [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/1.5.0...2.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 13:45:32 +00:00
Pascal Chevrel e0ab1b3a24 Start release v128.0 2024-05-13 13:43:04 +00:00
Ben Dean-Kawamura 74b4b850d9 Starting a CLI for relevancy.
This can be run with `cargo relevancy`.

It currently supports classifying your history and printing the results.
The main way we get history is from sync.  You can also point it to a
places DB, but this must be from a mobile FF, we can't read from
desktop.
2024-05-10 20:17:59 +00:00
Ben Dean-Kawamura b4ff3b1b90 Bug 1894002 - use serde_path_to_error in relevancy
This gives us nicer errors since where the error happened in the JSON
 data.  "Unexpected null value" is not very useful, but if that's paired
 with `record_custom_details.category_to_domains.version` then you have
 a chance of figuring out the bug.

 Gave the error a more specific name and updated the error handling to
 report the error to sentry if we see it.  I don't think this affects
 desktop at all, but once we have this on mobile I think we'll want to
 surface these errors.
2024-05-10 13:59:36 +00:00
Sammy Khamis a976fa30d8 Update Tabs engine to support remote tab management 2024-05-09 19:54:36 +00:00
Ben Dean-Kawamura bd38469c6f Bug 1895553 - Remove unparsable record code
This wasn't really pulling it's weight.  The goal was to handle records
with newer schema versions than the client's schema.  However, whenever
we update the schema we also reset the database tables and re-ingest
everything. There was some dicsussion on avoiding the DB reset, but no
plans to actually do it, so let's just remove the code.
2024-05-09 18:21:08 +00:00
Ben Dean-Kawamura e0563d725f Relevancy: only use 2 parts to computer the URL hash 2024-05-09 16:14:33 +00:00
Nan Jiang f5638a81fd Relevancy: drop viaduct-reqwest 2024-05-09 14:18:27 +00:00
Tif Tran 2e945f39a4 Relevancy: implement ingestion 2024-05-09 03:02:24 +00:00
Tif Tran 9fea1aea9c Relevancy: add fetch url interest data from RS 2024-05-08 23:54:02 +00:00
Lina Butler 55f904c2d2 fxa-client: Omit `ttl` fields from device commands if not set.
c6fdae855c caused Send Tab commands to
be sent with `"ttl": "null"` to the FxA server, since Send Tab
doesn't specify an explicit TTL.

This fixes bug 1895711.
2024-05-08 16:32:56 +00:00
Ryan VanderMeulen 019c87d532 Update NSS to version 3.100 2024-05-08 14:37:24 +00:00
Ryan VanderMeulen 4975a606bd Use dependabot to manage Taskcluster python deps 2024-05-08 13:38:33 +00:00
Ryan VanderMeulen be782cbba4 Update dependency check workflow 2024-05-08 13:38:33 +00:00
Ryan VanderMeulen 34623982ce Update Mac TC worker python paths 2024-05-08 13:38:33 +00:00
Ryan VanderMeulen 8b1c66d006 Use requirements.in for /tools and regenerate requirements.txt with Python 3.8 2024-05-08 13:38:33 +00:00
Ryan VanderMeulen b70dbf12f6 Update taskgraph to 8.0.1 and regenerate taskcluster/requirements.txt with Python 3.8 2024-05-08 13:38:33 +00:00
Ryan VanderMeulen a55750c381 Update changelog 2024-05-08 13:38:33 +00:00
Ryan VanderMeulen 75fa71e416 Update license for rust-base16 crate 2024-05-08 13:08:45 +00:00