Summary:
The one existing user has MPath in hand (and so does my upcoming code).
Also, defer the error context to avoid copying bytes (again) when there is no error. Note that the ParseError returned by RepoPathBuf::from_utf8 itself contains the bad bytes, but there doesn't seem to be a good way to share those bytes without losing context.
Reviewed By: mitrandir77
Differential Revision: D44596605
fbshipit-source-id: d9b1f635a7e5b90828f934707845a2efcb5c08a5
Summary:
These mirror the Mononoke BlameV2 derived data.
I tweaked the #[auto_wire] macro to support a new #[no_default] attribute. This made it possible to stick a Result<_, ServerError> into my type without having to hand implement anything else (since Result doesn't implement Default, which otherwise was required for #[auto_wire]).
Reviewed By: quark-zju
Differential Revision: D44596607
fbshipit-source-id: 9f2cc22d9ef43deefd32d4cfff67d350045ea845
Summary:
I noticed a bug where closing ISL and re-opening it would cause the vscode extension to no longer report uncommitted changes. There was a "webview is disposed" error in the console too.
Looks like this was an error introduced by adding more complex subscriptions. We just need to dispose those subscriptions when disposing the entire connection. This connection disposal happens when the webview is closed. Re-opening causes an error to be thrown in the repo code path, so it never sent the message back to the new server, even though non-subscription messages make it through just fine.
Reviewed By: muirdm
Differential Revision: D44693737
fbshipit-source-id: 27a0330f7f9a52bd1a4b8b7d53fe1017814c5e7a
Summary: I noticed file name tooltips were overflowing outside the tooltip. We should just allow aggressive word-break so that it always wraps
Reviewed By: muirdm
Differential Revision: D44643364
fbshipit-source-id: acca14f75c8d9db54aa41249dad2d152b5e524e2
Summary:
We were previously being fancy and using `text-direction: rtl` (right-to-left) to display file paths. This was combined with `text-overflow: ellipsis`, so that long paths would be truncated on the left side with `...`:
```
...ittedChanges.tsx
```
This way, among a list of many files, you're not seeing the same base path for each of them, but rather the ending of the file name which is what you care about.
However, we made a change to use disambiguated file paths anyway, which means we don't often show full file paths. It only really happens now if you have two files with the same name and subfolders causing long disambiguation, or you have a very short screen width.
Regardless, the fancy rtl system has several major downsides. `rtl` is intended to set the text rendering format, not to control ellipses. This means certain characters are re-arranged in a very confusing way. `.gitignore` becomes `gitignore.` for example.
I found a way to work around this, using `unicode-bidi: bidi-override`. But rtl brings a lot of weird issues. To do this, we'd have to reverse the letters in the label of the text. The `rtl` then un-reverses them. But this means the DOM has reversed characters, and if you tried to select it and copy it you'd copy reversed text. It's bad for accessibility.
We can approximate this feature without the ellipsis just by being a bit more crafty in our CSS, and it works pretty much fine without any of these weird accessibility downsides.
This also fixes the `gitignore.` issue.
Reviewed By: muirdm
Differential Revision: D44641831
fbshipit-source-id: 16dcbab7d4cffee16d0fe16a60ec7adb1dcf1b0d
Summary:
We previously would show 4 spinners while going to a new commit, which is a bit much.
1 next to "you're moving here"
1 next to "you were here..."
2 due to `sl status` fetch, next to each "you are here"
We don't need a spinner next to "you were here", nor do we need 2 `sl status` spinners
Reviewed By: muirdm
Differential Revision: D44651533
fbshipit-source-id: d2a776c2fd4e9affb8598c112c529d69726e494c
Summary:
Original commit changeset: e0a130c04c80
Original Phabricator Diff: D44694398
Solving the `arc feature` problem in favor of D44695559
Reviewed By: muirdm
Differential Revision: D44713896
fbshipit-source-id: 4b870d0288e6e81577d8d398b1fb42d4e8b68dc9
Summary:
Currently WBC on each bookmark change will try to find all underived cs_ids and will request derivation for them one-by-one. This is redundand because both old path (using derivation manager) and new path (DDS) doing that discovery internally and will derive all dependency.
This diff just removing the part when WBC asks for derivation of each commits and just requests the latest underived commit, however it will still doing discovery of underived commits.
The next step would be to add an API for DDS to answer queries about derived bookmarks locations. This way we could remove discovery part completely.
Reviewed By: RajivTS
Differential Revision: D44536860
fbshipit-source-id: 3867abdf095141b89da44242a35327da02ab05f8
Summary: Recently D44515578 removed remotenames from the set of names, but internal internal tooling was depending on that.
Reviewed By: fanzeyi
Differential Revision: D44694398
fbshipit-source-id: e0a130c04c803e51a6e7f8a284b572047ffc0ee9
Summary: Now that the dependent logic is in place, this diff parses the git commits and extracts the git headers. It then passes these git headers while creating the corresponding changeset at Mononoke end using SCS's `repo_create_commit` method.
Differential Revision: D44705976
fbshipit-source-id: 464695e273908ef7642514b08158be4affc32ac2
Summary:
Introduce **h2** support into mononoke server.
Remove alpn crate that repeats the standard "select_next_proto" method
Server now offers the following protocols: hgcli, h2, http/1.1 in this order in protocol negotiation.
We will select the first protocol supported by the server which is also supported by the client.
This will add h2 support server side but won't change protocols currently used (because h2 is not offered client side right now, while http/1.1 is explicitly set).
We then later will switch **only** Eden Api Traffic to H2 by enabling the following config client side via slow rollout:
```
[edenapi]
http-version=2
```
We might need to tune some settings on proxygen side before that.
Wireproto traffic will continue to be obliged to set http/1.1 client side explicitly, which is totally fine because it needs web socket upgrade.
### At a high level, HTTP/2:
* is binary, instead of textual
* is fully multiplexed, instead of ordered and blocking
can therefore use one connection for parallelism
* uses header compression to reduce overhead
* allows servers to “push” responses proactively into client caches
Reviewed By: mzr
Differential Revision: D44540283
fbshipit-source-id: 560d80d68d5d364adee122881d12cf61ba9f1695
Summary:
Double writing is enabled for all repos for a long time, so it's safe to delete enable_writing_to_new_commit_graph.
enable_reading_from_new_commit_graph was never used since we needed more granular tunables.
Reviewed By: Croohand
Differential Revision: D44624559
fbshipit-source-id: a06a0f2079bb735e93d72d0d24bbc7ae684600a7
Summary:
Our logs are currently full of messages about the duration of
semifuture_getScmStatusV2(), which isn't very helpful. This drops the default
level to DBG3 so that we only log at DBG2 when the request takes longer than
one second.
Reviewed By: xavierd
Differential Revision: D44693481
fbshipit-source-id: 9ff8e04ab39e960050e64930a023949962360b9c
Summary: As title says. Compiling on Windows has been kind of annoying lately due to the number of warnings I've seen, which this cleans.
Reviewed By: muirdm
Differential Revision: D44690961
fbshipit-source-id: 37ae8e48e4aa181ac909b3ec90c76a1438b24489
Summary:
There is an issue where children sl processes inherit SCM_SAMPLING_FILEPATH and write to the same file as the parent process. This messed up the sampled data since the child's "command_duration", for example, could clobber the parent's.
Fix by only allowing one process to create SCM_SAMPLING_FILEPATH. This way the child (e.g. backgroundfsync hook) will not be able to output metrics.
Reviewed By: zzl0
Differential Revision: D44645799
fbshipit-source-id: 11f41343107802f9fd9ae2dc0fc7a9e1925859d8
Summary: Expose sampling-category-for-key and append-sampling-event methods from Rust to Python to replace relevant logic in ui.py. This consolidates things, and may fix the issue where corrupted keys like "foo{" were getting into the sampled data.
Reviewed By: zzl0
Differential Revision: D44645798
fbshipit-source-id: e158ed7434435e1d29222cda2fc1cf0ee345010a
Summary: This makes it easier to share the sampling config with Python. In particular I want to get down to only having a single place open the SCM_SAMPLING_FILEPATH file to make it easy to fix a couple bugs (see next diff).
Reviewed By: zzl0
Differential Revision: D44645800
fbshipit-source-id: 12a0da6d1356b6c116224a3c3552692bd5aa656a
Summary: I want to expose the sampling file to Python, so first let's move it to a non-tracing related crate.
Reviewed By: zzl0
Differential Revision: D44645801
fbshipit-source-id: 14da917acdc3529e17502d81846229e3ae8854e2
Summary:
On Windows, this should always be set to true. Unfortunately, we've rolled out
a bad EdenFS release that overwrote all of these configs and set them to false,
breaking several users.
Reviewed By: fanzeyi
Differential Revision: D44683911
fbshipit-source-id: 4d8efb3402f967b2e35fd333c858fe939307e6f0
Summary:
On Windows, the sqlite overlay is always enabled despite what the config says,
encode this in the code.
Reviewed By: MichaelCuevas
Differential Revision: D44682918
fbshipit-source-id: 751a763a59f43ebcac30b8884eaf1fbd4033d1cf
Summary:
The latest "main" contains all the patches that we were carrying on my
fork so far. Bonus point, hyperx is not a depedency anymore so we can also get
rid of this.
Reviewed By: zertosh
Differential Revision: D44682428
fbshipit-source-id: cbb1da18edce7478a5454d1a3ba70bd8767e089c
Summary: The hg stable commands fail to work on Windows. This is because the hg code calls a shell script to run the necessary hg commands. This diff adds a port of the shell script into python to let it work on Windows.
Reviewed By: skotchvail
Differential Revision: D44591662
fbshipit-source-id: 5d376702ccc648fe01f541b2d673ae39f954739b
Summary:
[Code Tour](https://github.com/microsoft/codetour) is an extension which allows you to annotate an ordered list of code pointers with descriptions, as a way of touring you through a codebase.
This diff adds a couple of tour files which are loadable by anyone who has the extension and loads this tour.
This tour walks through how we process "write requests" in the PrjFS version of Eden.
Reviewed By: chadaustin
Differential Revision: D44654254
fbshipit-source-id: e7e00e301e9445cc4f5875689a35c40bf5ad8b99
Summary:
[Code Tour](https://github.com/microsoft/codetour) is an extension which allows you to annotate an ordered list of code pointers with descriptions, as a way of touring you through a codebase.
This diff adds a couple of tour files which are loadable by anyone who has the extension and loads this tour.
This tour walks through how we process "read requests" in the PrjFS version of Eden.
Reviewed By: chadaustin
Differential Revision: D44645249
fbshipit-source-id: 5a3a620139d95f9298d9b0ce81064d49c1c297d2
Summary:
This is a slight behavior change, but I need queue events published to
ActivityBuffer so I can track the live set of fetches.
The impact will be that `eden trace hg --retroactive` will show 2/3 of
the number of events that it did. We can bump the capacity if that's
problematic.
Reviewed By: xavierd
Differential Revision: D44594520
fbshipit-source-id: 5b22169403402d729ff929b4b4bec6bb76d54737
Summary:
ActivityBuffer is enabled by default and we rely on `eden trace hg
--retroactive` working. For HgQueuedBackingStore, unconditionally
enable ActivityBuffer, and give a capacity config setting independent
from the others.
Reviewed By: xavierd
Differential Revision: D44593656
fbshipit-source-id: 284bad0d19315d250a4ab69f06439393dbeaf5d1
Summary: We only capitalize type names.
Reviewed By: xavierd
Differential Revision: D44593407
fbshipit-source-id: 9f0d841e6ff5c40d6a6c6ca3637a40fefcf5d084
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:
When this check was previously enabled, we saw 2 issues from users:
- The check failing due to status taking more than 5s,
- The check having false positive.
The first one can be fixed by increasing the timeout on the Thrift client, the
second one is anything but clear at first sight. Digging a bit deeper, one
issue became apparent. In:
if modified_file not in diff:
The type of `modified_file` is a `Path`, while the type of `diff` was a
`Set[str]` (the type annotation was wrong). If we manually test this, here is
what we get:
% python3
Python 3.8.6 (default, Feb 10 2023, 17:15:29)
[GCC 11.x 20221024 (Facebook) 11.2.1+] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> a = {"a/b.c", "c/d.c"}
>>> a
{'c/d.c', 'a/b.c'}
>>> Path('c/d.c') in a
False
>>> a = {Path("a/b.c"), Path("c/d.c")}
>>> Path('c/d.c') in a
True
>>>
The check would have thus failed, which would have led to false positives.
Lastly, this also fixes a potential false negative, where the number of
modified files could be the same as the files in diff when the latter includes
an added/remove file but is missing one of the modified file. Removing the
check comparing both is sufficient to avoid this issue.
Reviewed By: chadaustin
Differential Revision: D44558090
fbshipit-source-id: 0cc83a87758a5feeff78c38b210ebd91fa5d58f5
Summary:
Context
==
When the code being changed is called from a test or program using Python 3.10, deprecation warnings appear.
`DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead`
Python 3.10 is rolling out in fbcode, so it will be nice to have one less DeprecationWarning.
Implementation
==
* sed -i -E 's/(\s+)(.*)\.setDaemon\(True\)/\1\2.daemon = True/'
Reviewed By: muirdm
Differential Revision: D44620221
fbshipit-source-id: b243b5e8947c918f865efa3c46ffdc8c0e530243
Summary: These are the tests that passed after adding "$ eagerepo". I attempted to turn on eagerepo for all tests that didn't contain "$ eagerepo" or "configure modern".
Reviewed By: quark-zju
Differential Revision: D44445379
fbshipit-source-id: b283be6d5249f74e11a3205622961e457587e93b
Summary:
While reading through our uses of ActivityBuffer, I noticed an
opportunity to amortize the cost of publishing import events.
Add some comments to note that.
Reviewed By: xavierd
Differential Revision: D44643270
fbshipit-source-id: 1b68f904b86d91fab91af01a4e8b169dc381ad33
Summary:
This should reduce the number of allocations when pushing and popping
events into ActivityBuffer.
Also, remove -inl.h because our clangd does not support it.
Reviewed By: xavierd
Differential Revision: D44593366
fbshipit-source-id: 7dc0f2aa457b44bebe9471edd3c7e688d09534f5
Summary:
`std::deque` has poor performance and bucketing in GNU libstdc++, and
sometimes we just need a ring buffer without paying for folly's
LockFreeRingBuffer.
Introduce a simple RingBuffer atop `std::vector` for later use in
ActivityBuffer.
Reviewed By: xavierd
Differential Revision: D44593248
fbshipit-source-id: 13303c27b184002fc74aec9ae6e9133c70bab6bb