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

135 Коммитов

Автор SHA1 Сообщение Дата
Bastian Gruber 91c55bf4f3 feat: adding a remote-settings CLI download feature, sync with local data
Adding two commands to the cargo remote-settings CLI, `dump-sync` and `dump-get`. This allows
to download a local dump of a set of collections, and keep it up to date with the remote version.

It's also possible to open a PR right away to update this file in the app-services repo.

`cargo remote-settings dump-sync --create-pr` will create a local branch and push it to the repo.

When trying to `get_records` from the component, it first checks if the database has some,
if not, it checks if the collection exists and takes it from the local file.
2024-11-19 13:41:28 +00:00
Bastian Gruber 215e37e143 feat: add jexl to remote-settings component 2024-11-07 20:15:33 +00:00
Ben Dean-Kawamura 03f1c2c37e Starting new Remote Settings API
Implemented the high-level API and the client functionality. Storage is
a big TODO.

Added a CLI to test it, you can run it using `cargo remote-settings`.
2024-10-24 13:47:32 +00:00
Ben Dean-Kawamura 7e71b6a672 Remove unwanted ingestion measurements
Don't report measurements when we've already ingested all the records.
This just skews the results.
2024-10-24 13:21:23 +00:00
Tarik Eshaq 3ba1c7c2ef Fix up some internal dependences.
Takes the easy bits of #6129
2024-10-10 15:11:11 +00:00
Mark Hammond c3def30308 Back out "Support for a new "close all inactive tabs" command."
This backs out commit 579d17846c.
2024-08-28 20:19:45 +00:00
Mark Hammond 579d17846c Support for a new "close all inactive tabs" command. 2024-08-27 13:52:32 +00:00
Drew Willcoxon 608b930b02 Bug 1893086 - Port the potential impressions framework to the suggest component 2024-08-21 01:31:16 +00:00
Ben Dean-Kawamura bac73bb442 Bug 1908397 - Suggest metrics
Defined metrics for suggest.  I used labeled timing distributions, which
is a relatively new metric that seems great for our needs.  Using these
metrics, we can track a separate timing distribution for each record
type / provider.

Updated `ingest` to return metrics.  Added `query_with_metrics`, which
returns metrics alongside the usual results. Added some classes to
record metrics as the operations execute.

Moved the top-level `fetch_suggestions` from db.rs to store.rs.  It's
now responsible for metrics, so I thought it fit better in store.
2024-08-07 18:22:50 +00:00
Ben Dean-Kawamura caafbbd7f0 Suggest ingestion logging + refactor
This is prep-work for
https://bugzilla.mozilla.org/show_bug.cgi?id=1908802.

Update the Suggest CLI to log ingestion details so that I can test that
the new code works correctly.  Added support for re-ingesting
suggestions and ingesting specific providers.

Map suggestion providers to a single record type, rather than multiple
ones and always ingest icons/global config.  I think this system is
simpler and also having to list icons/global config for each provider
type is a footgun.  For example, we should ingest icons/config for
fakespot, but I forgot to list them.

Removed the `SuggestIngestionConstraints::max_suggestions` field. AFAICT,
it was not being used by any consumers and doesn't seem to be
implemented correctly.  We apply the limit to each record type, but a
single ingestion request will have many record types.  It also doesn't
seem clear to me how this should work, for example should the
config/icons count?  I want to update this code, but I don't want to
worry about this field.

Updated the benchmark code to download all records/attachments directly,
rather than the complex system of running an ingestion to figure out
what to download.  I'm planning on updating the client code and this
will work with the new system better.
2024-08-01 14:44:08 +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
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
Alexander Cyon d73a4c7a45 Typos 2024-05-24 20:17:12 +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
Lina Butler f2b1d5a132 fxa_client: Add support for the "close tabs" command. 2024-05-03 07:03:49 +00:00
Ben Dean-Kawamura 6c6951cdfe Updating the fxa-client example
Added flags to:
  - Request the session scope.
  - Control how log messages get printed to the console.

Updated the code to re-authenticated using the existing data rather than
throwing it away and starting from scratch.

These changes make it possible to repro
https://bugzilla.mozilla.org/show_bug.cgi?id=1887071

- run `cargo run -- --log -d devices` with fresh credentials.
  - Any command should do, but I used `devices`
  - The client should ask you to login and paste your credentials
  - You should see the device list printed out
- In a browser session, change your FxA password
- run `cargo run -- --log -d devices` again
  - The client should tell you there was an auth-problem and ask you to
    reauthenticate.
  - After you paste the reauthentication URL you should see an error
    printed out
2024-04-04 15:32:33 +00:00
Mark Hammond 47ef7c8c98 Update some crates to avoid cargo audit errors
As part of this, update clap for app-services examples.
2024-03-06 16:02:17 +00:00
Dimi 031dfc91da First draft version 2024-02-26 15:14:43 +00:00
Mark Hammond f538529f15 Update a number of crate package versions.
This was largely done manually to try and bring app-services and
mozilla-central closer together. With this patch we can vendor
into mozilla-central, including when most of our mobile crates are
built into libxul in the Android monorepo, oak.

This patch also re-forks find-places-db to avoid using a now orhpaned
crate which no mozilla staff had access to update.
2024-02-06 15:43:45 +00:00
Mark Hammond 4fde1d35c0 Allow `inactive` field in tabs records and payloads.
This adds an `inactive` field to a `RemoteTabRecord` with the default
value being `false`. The intent is for the mobile platforms to start
populating this, then all platforms can choose how to handle such
tabs (eg, they may not show them by default and instead add a button
which shows them).
2024-01-03 21:38:33 +00:00
Mark Hammond 33af2ee7e7 Bug 1866370 (part 2): Fix some confusion with 2-way-merge and tombstones. 2023-12-28 18:46:15 +00:00
Tarik Eshaq 8961cc57fa Removes wipe from logins engine implementation 2023-12-20 19:39:06 +00:00
Mark Hammond 0c2109c89d Move rusqlite/libslite3-sys to workspace dependencies 2023-12-13 15:53:26 +00:00
Ben Dean-Kawamura afa6e730c7 Removed FxA MetricsParams
This allowed consumers to add extra query parameters to oauth flow URLs.
However, it wasn't being used so let's kill it.
2023-11-28 22:22:22 +00:00
Ben Dean-Kawamura 9cfbb20c3f Added prune_limit pramater to the places maintenance
This allows us to adjust the numbers until we reach a point where we are
effectively limiting the DB size

https://bugzilla.mozilla.org/show_bug.cgi?id=1854383
2023-11-14 15:27:48 +00:00
Sammy Khamis 8a23472daa Refactor VisitTransition to be VisitType 2023-10-16 21:13:39 +00:00
Sammy Khamis 4bc525e8ee Remove SQLCipher 2023-09-15 21:25:34 +00:00
Mike Hommey 8c0c0a60c5 Upgrade base64 to 0.21 2023-09-07 23:47:23 +00:00
lougeniac64 cc29c6925f Removed obsolete iOS sync logic 2023-07-17 22:39:21 +00:00
Mark Hammond 9b9345bac0 Add some more commands to places-utils
* create-fake-visits will create a (possibly large) number of visits.
* delete-history will remove all history
* show-stats will show some stats for the places DB.
2023-06-27 15:14:06 +00:00
Ben Dean-Kawamura 6f74754b7a Refactored fxa-client
This was part of my work for the auth PR, but I think it's useful
separatedly.

- Updated `fxa-client` to be a single binary.
- Added a cargo alias so it can be run with `cargo fxa [args]`.

I think this makes it easier to use and also will make it easier to
expand the functionality.  It's easier to add another clap subcommand
than to add a new binary.
2023-06-27 13:17:30 +00:00
Ben Dean-Kawamura 383333b93f Reworked FirefoxAccount construction
Made `FirefoxAccount` input a single `FxaConfig` instance for all of
it's configuration.  I want to add more constructor arguments but don't
want to end up with a huge argument count.

Made the example code use the public API, not the internal module.
`FxaConfig` helps ease this transition.  The motivation for this is that
I want to move FxaClent and some other fields to the public
`FirefoxAccount` instance, which means the example code needs to start
using it.  This also results in some nice code cleanups.

Deleted the `fxa-client/migration` example, we're not really
using the migration code anymore.

Now that we're not exposing the `internal` module as pub, Rust is
noticing a lot of dead code.  For the serde JSON structs, I kept the
dead fields and added an annotation.  For the unused functions, I just
deleted them.

Created an `FxaServer` enum.  This matches how the android wrapper
handles it and I don't think we need to input arbitrary URLs here.
2023-06-20 18:46:28 +00:00
Mark Hammond 6c4c65e8ce Move sync-test to the fxa cli helper. 2023-06-14 20:27:20 +00:00
Tarik Eshaq ffb06acd44 Updates rusqlite to 0.29.0 and libsqlite to 0.26.0 2023-06-13 01:11:26 +00:00
Mark Hammond b8d3b225ee Add a debug-tools feature to sql-support.
It steals a cute function from webext-storage which can dump any
arbitrary query.

It also allows for the use of a `dbg()` sql function which can be
helpful trying to debug SQL as it is executing. The function is also
available as a no-op when the feature is not available to prevent us
accidently using it in released code.

Sadly this required updating the use of prettytable-rs as the old
version crashed on Apple silicon, which had a bit of a blow-on effect
on other dependencies.
2023-06-09 15:48:44 +00:00
Tarik Eshaq b9755e3766 Adds back boolean for unsubscribe 2023-05-31 15:39:52 +00:00
Tarik Eshaq d72a995d05 Cleans up errors 2023-05-31 15:39:52 +00:00
Tarik Eshaq a34eafae65 Introduces breaking changes 2023-05-31 15:39:52 +00:00
Tarik Eshaq ae2cee7bd3 Address code review comments 2023-05-31 15:39:52 +00:00
Ben Dean-Kawamura fe156a74fd Clippy fixes
Also made the `clip-support` example work again
2023-05-26 14:34:03 +00:00
Ben Dean-Kawamura 6c7d5f9b0f Use the new `EncryptorDecryptor` with autofill as well
We might as well get the extra reporting benefits.
2023-04-25 15:32:16 -04:00
Mark Hammond 6272142b2b
Remove dependency on the clipboard crate for the tabs example (#5443) 2023-03-29 11:46:40 +11:00
Mark Hammond 70bebedbec
Minor cleanups of sync engine code: (#5365)
* Consolidate the various types used for a "collection name" - now we
  use `Cow` rather than the various `&'static str`, `&str` and `String`
  used previously.
* This made it easier to clean up the `LocalCollState` state machine
  to have the `Ready` state directly provide the `CollState` due to
  a mismatch between `'static str` and `String` reprs of collections.
* No longer store the outgoing timestamp in an OutgoingChangeset - it was
  never actually used and just creates unnecessary complexity.
* OutgoingChangsets now always supply the BSOs as they are created,
  meaning less `mut` objects.
* Bonus fix to unbreak the `places-utils` example.
2023-02-08 13:50:38 +11:00
Ben Dean-Kawamura b3a573164e Clippy and check-dependency fixes 2023-01-27 15:32:17 -05:00
Tarik Eshaq b8ba517115
remove iOS bookmarks migration code (#5276)
* Removes old iOS bookmarks migration code

* Adds changelog

* Fixes cargo clippy
2023-01-04 17:53:31 -05:00
lougeniaC64 05793e9376
Exposed credit card API for iOS (#5293) 2023-01-03 15:09:55 -05:00
Mark Hammond 24098bcafd
Update rust version to 1.65.0, MSR to 1.61 (#5299) 2022-12-16 14:02:22 +11:00
Mark Hammond ba67a665dd
Update rusqlite to 0.28.0 (#5282) 2022-12-08 15:01:25 +11:00
Mark Hammond 4d858e4266
Add support for lastModified in ClientRemoteTabs (#5230) (#5273) 2022-12-04 19:08:06 +11:00