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

144 Коммитов

Автор SHA1 Сообщение Дата
Bastian Gruber b10c1319e7 fix: add relevancy and suggest to docs (and workspace members) 2024-09-24 16:31:03 +00:00
Ben Dean-Kawamura 9403a4fa6c DISCO-2947 - Bump UniFFI to 0.28.0 2024-09-04 15:23:57 +00:00
Mark Banner eee6c27f05 Bug 1914145 - Create initial search component stub.
This creates a basic search component stub with a simple function that does nothing except raise an error.
Full functionality will come in later commits
2024-09-04 08:58:28 +00:00
Bastian Gruber dbeaef2eb2 feat: be able to generate static website docs from swift components 2024-09-03 14:11:19 +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
Erich Gubler 3ca067683c build: upgrade `rusqlite` 0.30.0 → 0.31.0 2024-05-29 15:05:57 +00:00
Ben Dean-Kawamura e6ccfed09e Bumping UniFFI to 0.27.1 2024-04-04 14:34:31 +00:00
Ben Dean-Kawamura ec40bd649e Initial commit for the relevancy component
Added boilerplate for UniFFI, error handling, databases, etc.  I tried
to follow the best practices from other application-services components.

Created the initial types and methods for the API.  I think all of these
should be considered works-in-progress.  It seems likely that some or
all of them will change as we implement the functionality.

Added some code to read / write URL interest data from a test binary
file currently stored in the repo.  This is also a WIP, at the very
least it needs to change to download the data from remote settings.
2024-03-08 16:18:37 +00:00
Mark Hammond a5e715b286 Remove the rc_log crate. 2024-03-07 16:51:12 +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 c1e935d9d1 Bug 1871499 - Revert "Revert "Bump rusqlite version giving us sqlite 3.44.0""
This reverts commit f11f2df9e8.
2023-12-28 14:33:04 +00:00
Tarik Eshaq f11f2df9e8 Revert "Bump rusqlite version giving us sqlite 3.44.0"
This reverts commit ed59e40df4.
2023-12-21 23:18:13 +00:00
Mark Hammond 79d24ff85a Use uniffi as a workspace dependency 2023-12-15 18:32:25 +00:00
Mark Hammond ed59e40df4 Bump rusqlite version giving us sqlite 3.44.0 2023-12-13 19:20:25 +00:00
Mark Hammond 0c2109c89d Move rusqlite/libslite3-sys to workspace dependencies 2023-12-13 15:53:26 +00:00
Ben Dean-Kawamura b9bf2a36b9 Switch to using the Cargo Resolver v2
The main issue here is that Askama 0.10 isn't compatible with it, so I
needed to update Askama then fix the breakage in nimbus-fml.
2023-09-27 13:45:23 +00:00
James Hugman 5c190edd6a Initial commit of nimbus-experimenter megazord build 2023-09-13 15:07:55 +00:00
Ted Campbell 14def5e1e1 Add Oblivious HTTP (OHTTP) client for iOS
Using the ohttp-rs and bhttp-rs Rust libraries to perform underlying encoding
and encryption. This is exposed to Swift using URLRequest/Response types that
are typical for the platform.

Note that only iOS is targetted since Gecko projects have a builtin OHTTP
solution within Necko.

This use currently using the Rust Crypto libraries for underlying HPKE support,
but this should be changed to NSS or OpenSSL in future.
2023-07-31 18:58:28 +00:00
Lina Butler 15f6adec51 Initial scaffolding for a Suggest component.
This commit adds a new component to fetch search suggestions from
Remote Settings and store them in an SQLite database.
2023-07-20 23:56:12 +00:00
MatthewTighe d054f01641 Add Remote Settings client component 2023-05-16 17:09:43 +00:00
Charlie f746d37f14
Set up Cirrus UDL (#5475)
* add cirrus udl and megazord
* update changelog
2023-05-02 15:28:09 -04:00
jhugman 5f780328a1
Initial commit of nimbus-cli (#5494) r=charlie, tarik
* Add nimbus-cli to workspace

* Initial commit

* Add docs and colors to output

* Add testing

* Add preserve-bucketing

* Update dependency audit to account for h2 vuln

* Address reviewer comments

* Add docs and changelog

* Override isEnrollmentPaused
2023-04-26 18:53:09 +01:00
MatthewTighe ae78506995 Create shared remote settings client and port Nimbus to it. 2023-02-15 14:03:12 -08:00
Ben Dean-Kawamura 8496e93409 Use UniFFI to export our logging API (gh-5308)
Added a new crate called `rust-log-forwarder` that forwards logs to
consumers. This does basically the same thing as `rc-log`, but it uses
UniFFI. Once our consumer apps swich over to `rust-log-forwarder`, we
can remove the `rc-log` component.
2023-02-14 13:53:09 -05:00
Ben Dean-Kawamura 6ecde0b247 Don't use workspace dependencies for UniFFI.
This was really nice, but it breaks when we get vendored in to
moz-central.  So we have to go back to the dark ages.
2023-01-30 12:26:58 -05:00
Ben Dean-Kawamura a79f23574f Updating UniFFI to version 0.23
- Switched to using workspace dependencies, this will make future
  updates much simpler
- Updated code to work with the new UniFFI crate structure
- Updated the error-support integration tests to work with the workspace
  dependencies, following this advice: https://stackoverflow.com/a/71461114.
2023-01-27 12:38:55 -05:00
Tarik Eshaq f24d345731
Make handle_error as a proc macro (#5184)
* [demo] handle_error as a proc macro

* Adds more tests

* Rework handle_error proc macro to take no arguments

* ignore rustdoc since it doesn't have expore to error_support

* Removes function signature validation
2023-01-25 16:00:36 -05:00
Mark Hammond d8503475f4
Merge sync15-traits back into sync15 via features. (#5125) 2022-09-15 11:09:04 +10:00
Mark Hammond e5d8a6d76c
Get sync-test working again. (#5107)
sync-test was removed from the workspace some time ago, which meant it
was never built or checked, so it went quite stale, particularly with
respect to logins changes.

We not keep it in the workspace but as an "excluded" item, which means
you can run it from its directory. To prevent it going stale again, CI
runs clippy on it.

Also needed a few misc tweaks to some other crates.
2022-09-08 20:02:18 +10:00
Tarik Eshaq 53d8020e1f
Ships a seperate megazord for focus-ios (#4953)
* Ship a focus specific megazord

* fix bash lint

* Fix rustfmt

* Fixes broken script

* Fixes script lint

* Adds changelog
2022-05-11 12:26:22 -07:00
Sammy Khamis 3fbe10cfbe
Merge ios and ios-rust directories and clean up Xcode project (#4830)
* remove ios and keep ios-rust directory
2022-03-03 10:03:32 -10:00
Sammy Khamis 73427f79a6
Places uniffication (#4770)
* initial conversion of errors for places uniffication

* Converted history metadata functions for places uniffication

* Converted kotlin history metadata functions

* Converted iOS history metadata functions

* [Places uniffication] Fix places error issues (#4687)

* remove uniffi-specific wrapper and updated error test

* Uniffi VisitObservation and apply_observation (#4689)

* uniffied VisitObservation, HistoryVisitInfo and methods using those structs

* Uniffi top frecent site info (#4711)

* Uniffi top frecent site info

* Uniffis FrecencyThresholdOption

* Uniffi Places Sync (#4714)

* uniffi places sync and sync15 functions

* Uniffi Search result and match url (#4720)

* Uniffi query autocomplete

* uniffi places_accept_result

* uniffi places_match_url

* cargo fmt

* cargo clippy

* remove accept_result from ffi crate

* Adds comment on the uniffi bug with varaint shadowing type

* Uniffi Places Interrupt methods (#4726)

* uniffi places interrupt functions

* Consolidate types (#4736)

* Updates the visit observation to use URL

* Uses VisitTransition for HistoryVisitInfo

* updates uniffi to 0.16

* Uniffied bookmarks

* switch to use uint in the apis for adding bookmarks (#4747)

* Remove the manual places FFI entirely.

* folders and separators now have non-nullable parents

* Always insert via Insertable items, and clarify separation between node types.

* Add json_tree module with all json-based types and implementation.

* Fix swift warnings re non-null parentGuid

* bookmarks: Remove public_node and introduce a fetch module

* Update swift code to make breaking changes fixes cleaner (#4766)

* rebased and added changelog entry

Co-authored-by: lougeniac64 <lougeniaC64@users.noreply.github.com>
Co-authored-by: Tarik Eshaq <teshaq@mozilla.com>
Co-authored-by: Mark Hammond <mhammond@skippinet.com.au>
2022-01-20 15:00:00 -05:00
Ben Dean-Kawamura c63dd82c8a UniFFI SyncManager
- Replaced hand-written FFI code with UniFFI code
- Updated error handling to just use thiserror.  There's no need for
  error-support anymore.
- Added an enum for the SyncParams.engine.  This seems cleaner than
  having None mean sync all engines.
- Replaced `SyncResult.results` with `SyncResult.successful` and
  `SyncSyncResult.failures`.  Before this was handled in the Kotlin
  wrapaper code.
- Made the megazord depend on tabs directly.  Before it pulled in tabs
  because of a transitive dependency from sync_manager_ffi.
2021-11-17 09:28:39 -05:00
Tarik Eshaq d0d45528a1
initial feature-manifest language setup (#4588) 2021-10-19 09:17:27 -07:00
Tarik Eshaq 7a1533b858
Uniffi push component (#4431)
* Adds Push UDL

* [push] Rust code compiles with scaffolding

* [push] removes FFI crate

* [push] removes protocol buffers

* [push] cleans up android api after uniffication

* Removes push from protobuf_files.toml

* Adds changelog
2021-09-13 14:47:30 -07:00
Sammy Khamis e1abe5ad61
Build iOS Rust code as an XCFramework. (#4396)
* Build iOS Rust code as an XCFramework.

Co-authored-by: Ryan Kelly <ryan@rfk.id.au>
2021-08-20 12:44:56 -10:00
Sammy Khamis 6c839a3ade
Update uniffi 0.14.0 (#4389)
* Update UniFFI dependency to v0.14.0

Co-authored-by: Ryan Kelly <ryan@rfk.id.au>
2021-08-19 16:31:02 -10:00
Sammy Khamis d0b7b74cea
Uniffi-ing the Tabs component (#4192)
* uniffi-ed the tabs component

Co-authored-by: Grisha Kruglov <gkruglov@mozilla.com>
2021-07-13 09:40:33 -10:00
Sammy Khamis b43d90441d
Uniffi-ing the Logins component (#4068)
* converting logins to using uniffi

* nits and review changes

* update changelog to put breaking changes on top
2021-06-08 15:29:01 -10:00
Mark Hammond 1248a352cb
Update rust to comply with our new rust version policy (#4165)
* Replace use of the unmaintained ctest package with ctest2.
* Use rust 1.52.1 and CI tweaks
2021-06-04 13:39:14 +10:00
Ryan Kelly 5fc2d7841c
Remove the `ffi-support` crate sources from this repo.
As of https://github.com/mozilla/application-services/issues/3463
the `ffi-support` crate lives in its own repo, and it's confusing
having an old copy of it still hanging around in this one.
2021-06-01 15:56:49 +10:00
Dan Mosedale d11cca9ea4 Disable intermittently failing tests; fixes SDK-233 and #3934 2021-03-25 09:26:57 -07:00
Dan Mosedale 1ed863e2d0 Get the Rust builds working 2021-03-22 14:23:57 -07:00
Ryan Kelly 525ca57543
Add a "crashtest" component for helping test crash-related behaviours. (#3923)
This is a definitely-for-development-purposes-only component that exposes
some functions to let you deliberately crash your application in interesting
Rust-code-related ways.

The idea is that application developers could add some developer-only UI that
deliberately  triggers one of these functions, and then try out the crash or
error-handling behaviour of their app in a live setting. We hope to be able
to use this to debug symbolication issues on Firefox for iOS, ref #3907.

As a side benefit, the very process of adding this component has let me write
a couple of nice tests that our generated bindings are working as intend around
the edges of error and panic handling.
2021-03-12 12:20:46 +11:00
Ryan Kelly d77600e32c
Restructure, UniFFI, and document the fxa-client crate. (#3876)
This is a substantial refactor of the fxa-client crate, intended to bring it
up to speed with our latest best-practices around developing cross-platform
Rust components, in order to ease ongoing maintenance.

THe core change here is that I've deleted the hand-written Kotlin and Swift
bindings, replacing them with autogenerated bindings thanks to UniFFI.

There is still a little bit of hand-written Kotlin, since we have a layer that
automatically manages persistence via a callback. There is still a nontrivial
amount of hand-written Swift, since we have a higher-level state machine built
atop the lower-level fxa-client functionality (such state-machine also exists
for Kotlin, but lives in the android-components repo). If UniFFI works out then
we should look into moving more of that logic into shared Rust code over time.

To support the introduction of UniFFI, I have restructured to Rust crate so
that its public interface deliberately parallels the interface offered to
Kotlin and Swift, and have moved the implementation details into a submodule
named `internal`. It's my opinionated belief that structuring the crate this
way will help us focus on producing a nice consumer API, which is not always
the same thing as producing a nice Rust crate.

On top of that, I've also revamped the documentation in the crate, leaning
in to the use of `cargo doc` as the source of truth for both developer-
and consumer-facing documentation. Let's consider that an experiment and
see how we like it in practice.

Unfortunately, this is a big PR, but I don't think I could have made it
too much smaller. Hopefully it will be easier to review than its size
suggests since it's mostly additions and deletions rather than complex
changes.
2021-03-09 22:34:58 +11:00
Ryan Kelly 056f4e7ef8 Add `cargo uniffi-bindgen` alias for running uniffi-bindgen.
This is an attempt to simplify how we use `uniffi-bindgen`, by making
it easy to run the version used by the workspace rather than assuming
that the user has a correctly-matching version of it installed in their
system cargo.
2021-02-25 16:13:05 +11:00
Ryan Kelly 006c1d659d
Remove the "lockbox" custom megazord.
The lockwise apps are on a very old version of appservices and I don't believe
we have a plan for updating them anytime soon. Continuing to build the lockbox
megazord does not seem like a good use of CI or local dev resources.

We understand how to bring this back if we need it, but also, if we do need
it again in future it's probably a good opportunity to revisit how we build
custom megazords in the first place.
2020-11-10 09:55:40 +11:00
Edouard Oger aa5dcccb2c
Move rate-limiter to its own support crate 2020-11-09 16:50:28 -05:00
Ryan Kelly 260d10e19c
Import nimbus-sdk as submodule, republish as part of the megazord.
This commit pulls in https://github.com/mozilla/nimbus-sdk as a
git submodule, and adds some build integration to publish it as
part of the application-services megazord. Instead of an all-in-one
nimbus package, we produce two separate packages:

* `org.mozilla.appservices:nimbus` with the Nimbus Kotlin code
* `org.mozilla.appservices:full-megazord` updated to include the
  Nimbus Rust code.
2020-11-09 16:40:21 +11:00
Ryan Kelly 24d8ceeb21
Revert "Import nimbus-sdk as submodule, republish as part of the megazord."
Nimbus SDK and its dependencies are not currently compatible with
Rust v1.43.0, but application-services is pinned to that version
of rust for compatibility with mozilla-central.

This reverts commit 8388372259.
2020-11-09 14:16:50 +11:00