Summary: Has the same behaviour as the contruction of warm bookmarks cache in Repo::new_test_common. To keep the same behaviour this required making TestRepoFactory into an async builder and modifying all of its callsites.
Reviewed By: RajivTS
Differential Revision: D45227318
fbshipit-source-id: 51303d48bebc0c4b915a359a7d0942bf485e8db5
Summary:
Note: this is a re-land of D44623815, which was was reverted because of a land race with D44626072
In particular this fixes `FlattenUnordered` having a nasty deadlock, but also
some other bugs:
```
# 0.3.28 - 2023-03-30
* Update to syn 2. This raises MSRV of utility crates to 1.56. (#2730, #2733)
* Fix bug in `FlattenUnordered` (#2726, #2728)
# 0.3.27 - 2023-03-11
* Add `TryFlattenUnordered` (#2577, #2590, #2606, #2607)
* Add `AbortHandle::is_aborted` (#2710)
* Add `AbortRegistration::handle` (#2712)
* Make `BiLock` strict-provenance compatible (#2716)
# 0.3.26 - 2023-01-30
* Add `Either::as_pin_mut` and `Either::as_pin_ref` (#2691)
* Add `Shared::ptr_eq` and `Shared::ptr_hash` (#2691)
* Implement `FusedStream` for `Buffered` (#2676)
* Implement `FusedStream` for all streams in `ReadyChunks` (#2693)
* Fix bug in `FuturesOrdered::push_front` (#2664)
* Remove `Fut::Output: Clone` bounds from some `Shared` methods (#2662)
* Remove `T: Debug` bounds from `Debug` implementations of `mpsc` and `oneshot` types (#2666, #2667)
# 0.3.25 - 2022-10-20
* Fix soundness issue in `join!` and `try_join!` macros (#2649)
* Implement `Clone` for `sink::Drain` (#2650)
# 0.3.24 - 2022-08-29
* Fix incorrect termination of `select_with_strategy` streams (#2635)
# 0.3.23 - 2022-08-14
* Work around MSRV increase due to a cargo bug.
```
Reviewed By: zertosh
Differential Revision: D44632588
fbshipit-source-id: bdd87cb02b3aef63a65b1f9b852579225adfedbd
Summary:
In a future diff, we want to separate the concepts of `BookmarkName` which represents the name of a bookmark with that of `BookmarkKey`, which refers to a unique bookmark, namespaced by a category: `Branch`, `Tag` or `Note`.
This will allow us to represent different types of refs importing from git repositories that may have conflicting names, but are semantically different.
Since `BookmarkName` is widely referred to in mononoke, start with a pure renaming diff for ease of reviewing.
This code change is a pure refactoring and has no effect on the behaviour of Mononoke.
Reviewed By: RajivTS
Differential Revision: D43350002
fbshipit-source-id: e64a84f7b3b70c4254702ebd7ace4d645cd00eff
Summary: Currently fetching a tunable (except by repo ones) returns the default value when the tunable is not set. This can be error prune as it doesn't enforce handling the not set case and makes it awkward to set default values, it's also not consistent with the by repo tunables which return an option instead. This diff changes tunable fetching to make it return an option, and adds a .unwrap_or_default() at every callsite to maintain the current behaviour.
Reviewed By: yancouto
Differential Revision: D43123305
fbshipit-source-id: 32cb69ba78d52bc22979250c6e16edd1800cd1de
Summary:
I changed both traits `Changesets` and `ChangesetFetcher` to take context by reference instead of by value. This removes a lot of unnecessary cloning we were doing.
It was really annoying because A LOT of places use this. I fixed all of them to get them to compile, but not all of them to do the minimal number of clones, as there's other stuff that still unnecessarily takes context by value.
Reviewed By: mitrandir77
Differential Revision: D42547207
fbshipit-source-id: 2d852abb8bf7825026b3b2ffe647ba0fc9e35b56
Summary:
Make `BlobRepo` like an ordinary facet container by removing its specialized methods.
In this diff, we remove the specialized changeset fetcher methods in favour of the facet traits.
Reviewed By: mitrandir77
Differential Revision: D42314302
fbshipit-source-id: d35e9cb94549b4a1447701dcad7007884b0cfb2f
Summary:
Make `BlobRepo` like an ordinary facet container by removing its specialized methods.
In this diff, we remove the specialized bonsai mapping methods in favour of the facet traits.
Reviewed By: mitrandir77
Differential Revision: D42311252
fbshipit-source-id: ac4cbdedf711b4cc6eaf8f2093579948efb0083e
Summary:
Make `BlobRepo` like an ordinary facet container by removing its specialized methods.
In this diff, we remove the specialized bookmarks methods in favour of the facet traits.
Reviewed By: mitrandir77
Differential Revision: D42296644
fbshipit-source-id: abd5faa348e21929b01112cadbc3fb4944fce1dc
Summary: raw-api allows access to the underlying DashMap shards, which I need.
Reviewed By: davidbarsky
Differential Revision: D42132672
fbshipit-source-id: 22b753f3ec95c85526f96a9e26d28379b2b4179b
Summary:
Replaces D41855449.
This diff updates:
- rust-analyzer to 2022-12-12's release.
- bumps `dashmap` to 5.4.0 from 5.2.0
- bumps `windows-sys` to 0.42, which unfortunately necessary because `dashmap` bumped their minimum version of `parking_lot` internally.
- bumps `notify` from the pre-release builds to 5.0
allow-large-files
Reviewed By: zertosh
Differential Revision: D41971461
fbshipit-source-id: 51c1d969d0cdcabcc37f2381e8c942fd0d0af765
Summary: This is the latest version number [on crates](https://crates.io/crates/fbinit_macros/0.1.2).
Reviewed By: jsgf
Differential Revision: D40536148
fbshipit-source-id: 86fc58f09cdb716e2aed8571a8ddee65f5dfc844
Summary: This release makes async trait methods work better with rust-analyzer's "go to definition" and other IDE functionality.
Reviewed By: zertosh
Differential Revision: D40532047
fbshipit-source-id: 1871d1819ebe1aab0846b0135f051c45e6e8821b
Summary:
Remove `auto-impl` where it is not necessary. Add documentation for cases
where it's known to be necessary for valid reasons.
Reviewed By: quark-zju
Differential Revision: D40357646
fbshipit-source-id: d37c8ae36c1034bbb3e646d278b54c84d183ed58
Summary:
Some of these lints must have come from the update to rust 1.64.0. Some might have slipped through recent diffs.
These three categories were encountered:
* [unnecessary_lazy_evaluations](https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations) (this is an older lint, but the `then_some` case must be recent)
```
warning: unnecessary closure used with `bool::then`
--> eden/mononoke/tools/facebook/derived_data_metrics_tailer/src/main.rs:314:28
|
314 | anyhow::Ok(is_ancestor.then(|| c))
| ^^^^^^^^^^^^----------
| |
| help: use `then_some(..)` instead: `then_some(c)`
|
= note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
```
* [manual_retain](https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain) (new in 1.64.0)
```
warning: this expression can be written more simply using `.retain()`
--> eden/mononoke/reachabilityindex/skiplist/src/lib.rs:365:9
|
365 | / bfs_layer = bfs_layer
366 | | .into_iter()
367 | | .filter(|(hash, _gen)| !skip_list_edges.mapping.contains_key(hash))
368 | | .collect();
| |______________________^ help: consider calling `.retain()` instead: `bfs_layer.retain(|hash, &mut _gen| !skip_list_edges.mapping.contains_key(hash))`
|
= note: `#[warn(clippy::manual_retain)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
```
* [needless_borrow](https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow) (this is not new, so probably due to regressions on master)
```
warning: this expression borrows a value the compiler would automatically borrow
--> eden/mononoke/mercurial/types/src/blobnode.rs:239:45
|
239 | let pid1: Option<HgNodeHash> = Some((&p1).nodeid());
| ^^^^^ help: change this to: `p1`
|
= note: `#[warn(clippy::needless_borrow)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
```
Reviewed By: mitrandir77
Differential Revision: D39885511
fbshipit-source-id: 835045999d621f01392baefdc5e790a2292fc498
Summary:
`BlobRepo` provides a few helper methods for calling bookmarks code
with specific arguments. In order to remove `BlobRepo`, these helper methods
can be moved into an extension trait - `BookmarksMaybeStaleExt`.
Add the `BookmarksMaybeStaleExt` extension trait and remove
`get_heads_maybe_stale` from `BlobRepo`. In a future diff I will update callers
to use `BookmarksMaybeStaleExt::get_publishing_bookmarks_maybe_stale`, but
first I need to do some renaming.
Differential Revision: D39509512
fbshipit-source-id: 62eebf19c5156013fa899a939bbb7fc3888a497d
Summary:
Bonsai changesets are the default in Mononoke and hg specific methods
are inside of `blobrepo_hg`. Rename the `get_bonsai_heads_maybe_stale`
method to `get_heads_maybe_stale`.
Reviewed By: yancouto
Differential Revision: D39509515
fbshipit-source-id: fdf945fac08b015bc7f8a47a4c7b36453349f56d
Summary:
This method is a smaller wrapper around `bookmarks().get()`. Remove it
to make removing dependencies on `BlobRepo` easier in the future.
Differential Revision: D39509513
fbshipit-source-id: 52e634038db48d347c52f9b0df554737b08736be
Summary: D39418421 (a1593af094) prematurely upgraded `thiserror`. Various projects in fbcode use nightly features including std::backtrace but the current fbcode Rust toolchain is 1.63.0, in which the backtrace API is different from the API of the latest nightlies.
Reviewed By: quark-zju
Differential Revision: D39562441
fbshipit-source-id: d1f8a993ec776cf82b1736b242bd4466def21230
Summary:
I ran `arc clippy-check //eden/mononoke/...` and the handled the type of errors like in the title with clippy's suggestion.
I didn't use a global regex over files. I only made changes in lines and files that clippy complained about.
Reviewed By: yancouto
Differential Revision: D38246419
fbshipit-source-id: a474de9de28363ff3f04904f8a488e35b8eabce1
Summary:
let's not even bother traversing skiplist in this case - it would short circut
few steps later but I think it makes the entire code easier to read once we get
this assumption sorted.
Reviewed By: farnz
Differential Revision: D37603995
fbshipit-source-id: 8636ed6345463c35b59a149c627cdacc3a5887d8
Summary:
Not sure how we got there but I'm pretty sure that we didn't intent to have
those between imports.
Reviewed By: stepancheg
Differential Revision: D37494565
fbshipit-source-id: 40ada0f5f63b0a5f31d2cccc8bedd5b6fff12311
Summary:
This is a pretty in depth third party library being added. The main changes are...
**version bumping**:
dunce = "1.0.0" => "1.0.2"
once_cell = "1.8" => "1.12"
tracing = "0.1.32" => "0.1.35"
adding ethers-rs fork:
https://github.com/rlkelly/ethers-rs.git
this depends on forks of:
coins-bip32 = https://github.com/rlkelly/bitcoins-rs.git
coins-bip39 = https://github.com/rlkelly/bitcoins-rs.git
eth-keystore = https://github.com/rlkelly/eth-keystore-rs.git
this was necessary to remove the wasm target, which creates a cyclic dependency for "indexmap". This was ran into previously here:
https://fb.workplace.com/groups/rust.language/permalink/8603206789727860/
also, some fixups were created for a few packages to facilitate build. I'm not a fan of libraries creating a build step to generate documentation...
----
This still does not have the ethers-middleware crate or the ethers-solc crate because it has the external build dependency of solc, which would make this a bit more complex to add:
https://docs.soliditylang.org/en/latest/installing-solidity.html
adding the crates without solc makes the process of integrating this library much easier, but it would be beneficial in the future.
@public
update rust deps
Reviewed By: jsgf
Differential Revision: D37320246
fbshipit-source-id: 251bd1c3c0e51733347a534fa597dea33d1df74b
Summary:
When given a (commit, path) pair, `AclRegions` facet returns all Hipster ACLs that permit accessing that (commit, path). See D34272143 for how configuration works.
To answer those queries effectively, we precompute a trie over all path prefixes from rules in the config. Then, for each (commit, path) query:
1. Use the trie to extract all rules that match by path.
2. For all rules we got from #1 naively check that the given commit matches them.
Design doc: https://docs.google.com/document/d/1MQBk-N-kRS7L-7IoFzkN0BdCif1UfyDQd0P1qOnx8TQ/edit?usp=sharing
Reviewed By: markbt
Differential Revision: D34674134
fbshipit-source-id: b7ca5c6a1651cd6ef379e5a4d12068f15492c496
Summary: Segmented Changelog requires `CoreContext` for construction, so we can create a test mock if `TestRepoFactory` has a `FacebookInit`.
Reviewed By: markbt, mitrandir77
Differential Revision: D35251021
fbshipit-source-id: 57051e227804669794f19fc2ca130f52cb938b0c