Summary: Allow the user to specify extra HTTP headers that should be sent with each EdenAPI request in the `edenapi.headers` config option. The field is expected to be a JSON object whose key-value pairs are used as header keys and values.
Reviewed By: quark-zju
Differential Revision: D22591870
fbshipit-source-id: ac1bb669270d667895554dcc5f7176d18736375c
Summary:
This can pick a different common ancestor in criss-cross case.
The test is updated to reflect that.
Reviewed By: DurhamG
Differential Revision: D22368837
fbshipit-source-id: 9f897142b3a4bacd0fc90a4a054b7806f1bde826
Summary: Make the Python EdenAPI client's `health()` method return a dict of server metadata.
Reviewed By: DurhamG
Differential Revision: D22604932
fbshipit-source-id: 51ca60cc95a8dbd15635520b2a9bd72603643cb6
Summary: Will be useful and avoid copy-pasting some code.
Differential Revision: D22592284
fbshipit-source-id: c42df645042722ea26c13d0737cb349fc2e8fbc1
Summary:
`unittestify.py` has logic to discover executables. It is hardcode as Python 2
hg for now. Change it to be aware of the Python 3 versions.
Reviewed By: DurhamG
Differential Revision: D22562875
fbshipit-source-id: 2a19ac6ee805e22fbcc2651ada5f4eaa1bc85f51
Summary: add `--mount` option to `eden debug processfetch` as users might want to know under which checkout they have run those commands.
Reviewed By: kmancini
Differential Revision: D22485225
fbshipit-source-id: df321e6c30064c17abc62584863119b362b2c296
Summary: Eliminate extra blank line in tabulate
Reviewed By: kmancini
Differential Revision: D22477405
fbshipit-source-id: b867bfa5c971fcac0104563e866a314416f24fb0
Summary:
This diff added a sub-command `process_fetch` to `eden debug`, which lists eden processes sorted by their fetch counts.
New argument options will be added in following diffs.
Reviewed By: fanzeyi
Differential Revision: D22456147
fbshipit-source-id: 75f94ec0ad03d59af1a5bf31c37bdf56de70241b
Summary:
Like it says in the title. This would be helpful to understand why a particular
derivation took a given amount of time. To avoid having other work that shares
this CoreContext resulting in biased counters, I set this up so that we start
new perf counters for derivation.
Reviewed By: farnz
Differential Revision: D22595473
fbshipit-source-id: de85d5108aabde23cf6587662f15f25aac0cd650
Summary:
See https://fburl.com/1rft34i8 for context. Ignore the default-push names until
we have cleaned up most repos.
Reviewed By: DurhamG
Differential Revision: D22395806
fbshipit-source-id: fd60dd89d8ba82fb9b7c4d145c8c86c9b11c6e68
Summary:
We have seen cases where `default-push` remote name gets written during pull.
Teach `paths.getname` (new code path) and `remotenames.activepath` (old code
path) to optionally normalize `default-push` to `default` to avoid that.
Reviewed By: DurhamG
Differential Revision: D22395521
fbshipit-source-id: ed16dc30150fc1369f7037296cf77f7f0fc83fee
Summary: Include the name of bad config fields in the error message so the user can more easily fix the problem.
Reviewed By: quark-zju
Differential Revision: D22591871
fbshipit-source-id: e23e2c71e49e0458e7ea5c13e7feac3a990ead0c
Summary: Update `edenapi::Builder` to use the CA certificate bundle specified in the `[auth]` section of the user's config.
Reviewed By: quark-zju
Differential Revision: D22591034
fbshipit-source-id: 3a417adbf50ef7d2c538f4a032e54a038cbd282e
Summary: Allow specifying a CA certificate bundle in the `auth` section of an `hgrc`. This is useful for testing with locally-built servers using self-signed certificates.
Reviewed By: quark-zju
Differential Revision: D22591045
fbshipit-source-id: 023fe006267b0b781a1af16a7505e188c008a8c0
Summary:
Implements based Rust-Python binding layer for error metadata propagation.
We introduce a new type, `TaggedExceptionData`, which carries CommonMetadata and the original (without metadata) error message for a Rust Anyhow error. This class is passed to RustError and can be accessed in Python (somewhat awkwardly) via indexing:
```
except error.RustError as e:
fault = e.args[0].fault()
typename = e.args[0].typename()
message = e.args[0].message()
```
As far as I can tell, due to limitations in cpython-rs, this can't be made more ergonomic without introducing a Python shim around the Rust binding layer, which could adapt the cpython-rs classes to use whatever API we'd like.
Currently, anyhow errors that are not otherwise special-cased will be converted into RustError, with both the original error message and any attached metadata printed as shown below
```
abort: intentional error for debugging with message 'intentional_error'
error has type name taggederror::IntentionalError and fault None
```
We can of course re-raise the error if desired to maintain the previous behavior for handling a RustError.
If we'd like other, specialized Rust Python Exception types to carry metadata (such as `IndexedLogError`), we'll need to modify them to accept a `TaggedExceptionData` like `RustError`.
Renamed the "cause an error in pure rust command" function to `debugcauserusterror`, and instead used the name `debugthrowrustexception` for a command which causes an error in rust which is converted to a Python exception across the binding layer.
Introduced a simple integration test which exercises `debugthrowrustexception`.
Added a basic handler for RustError to scmutil.py
Reviewed By: DurhamG
Differential Revision: D22517796
fbshipit-source-id: 0409489243fe739a26958aad48f608890eb93aa0
Summary:
Flushing behavior changed in Python 3 and now we need to flush the
progress bar after clearing it, since clearing it is part of suspending the
progress and we don't want any stored up redraw bytes to wipe out future writes
from the caller.
Reviewed By: quark-zju
Differential Revision: D22579013
fbshipit-source-id: f3afd560e1365696509f56b137cceababcfed794
Summary: Move the `tokio::Runtime` into `EdenApiRemoteStore` so that if initialization fails, we can propagate the error instead of panicking.
Reviewed By: xavierd
Differential Revision: D22564210
fbshipit-source-id: 9db1be99f2f77c6bb0f6e9dc445d624dc5990afe
Summary:
Add a metadata field to `read_res` containing a `revisionstore::Metadata` struct (which contains the object size and flags). The main purpose of this is to support LFS, which is indicated via a metadata flag.
Although this change affects the `DataEntry` struct which is serialized over the wire, version skew between the client and server should not break things since the field will automatically be populated with a default value if it is missing in the serialized response, and ignored if the client was built with an earlier version of the code without this field.
In practice, version skew isn't really a concern since this isn't used in production yet.
Reviewed By: quark-zju
Differential Revision: D22544195
fbshipit-source-id: 0af5c0565c17bdd61be5d346df008c92c5854e08
Summary: Instead of restricting the allowed characters in a repo name, allow any UTF-8 string. The string will be percent-encoded before being used in URLs.
Reviewed By: quark-zju
Differential Revision: D22559830
fbshipit-source-id: f9caa51d263e06d424531e0947766f4fd37b035f
Summary:
This diff adds a minimal workflow for running integrations tests for Mononoke. Currently only one test is run and it fails.
This also splits the regular Mononoke CI into separate files for Linux and Mac to match the current style in Eden repo.
There are the "scopeguard::defer" fixes here that somehow escaped the CI tests.
Some tweaks have been made to "integration_runner_real.py" to make it runnable outside FB context.
Lastly the change from using "[[ -v ... ]" to "[[ -n "${...:-}" ]]; in "library.sh" was made because the former is not supported by the default Bash version preinstalled on modern MacOS.
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/26
Reviewed By: krallin
Differential Revision: D22541344
Pulled By: lukaspiatkowski
fbshipit-source-id: 5023d147823166a8754be852c29b1e7b0e6d9f5f
Summary:
This fix was originally meant to prevent doing checkunknown files when
it was clear there was no conflict. Unfortunatley, the data doesn't appear to
show it helped, and in some cases it definitely hurt it. Let's back it out for
now until we can do more investigation.
Reviewed By: StanislavGlebik
Differential Revision: D22574000
fbshipit-source-id: aeb644ecd6da046df17e6d10418a72363c1ee532
Summary: APFS volume names have a length limit of 128, so we need to hash mount point to make sure we do not error out. Right now what happens if we get an error, but we do still successfully mount and the volume name is just truncated. Since we errored, we don't store this information anywhere. Instead now, we will check the volume name, and if it is too long, we hash the volume name in order to mitigate the "name too long" error.
Reviewed By: wez
Differential Revision: D22327372
fbshipit-source-id: d68f90472c1d952879078d0541b341d271c17092
Summary: Makes the hostname available for dynamicconfig conditions.
Reviewed By: quark-zju
Differential Revision: D22537946
fbshipit-source-id: 630ee833bb3ec00253d718b3d03bbb8b3d49afca
Summary: Adds support for sharding based on user name.
Reviewed By: quark-zju
Differential Revision: D22537540
fbshipit-source-id: 962f9582c8947335dc9d9d29c500d8c09df69878
Summary:
Turned out we have perfpipe_hgerrors and perfpipe_hg_errors. Having both of
them is quite confusing, so I suggest to only use perfpipe_hg_errors
We don't seem to have any alarms on these tables, so renaming should be esy
Reviewed By: quark-zju
Differential Revision: D22546855
fbshipit-source-id: a450444e8c2270603c3146f4f05072029f935f4d
Summary:
D22526230 (7ab2c54f08) adds extra output.
The test seems to be skipped in buck test due to the hgsql requirement.
Reviewed By: kulshrax
Differential Revision: D22555707
fbshipit-source-id: 8659de3cda517a49296c747e65bfbd0d372c031a
Summary: `int / int` gives `float` on Python 3 and that can cause issues.
Reviewed By: singhsrb
Differential Revision: D22563891
fbshipit-source-id: 443245710a0d2de660019f03845bed0077d62889
Summary: We have several repos whose names contain various non-alphanumeric/underscore/hyphen characters, so we need to be more permissive about accepting repo names.
Reviewed By: quark-zju
Differential Revision: D22554846
fbshipit-source-id: e7bb030e0b8fb6aa275c119ba0aa540405b29186
Summary:
Previously, the EdenAPI stores would not report errors returned from the remote store. The intention behind this pattern in other stores is to prevent `KeyError`s from aborting the operation since the local store might still have the key.
However, in the case of the EdenAPI store, EdenAPI will simply omit missing keys in its response rather than returning an error. Instead, any error returned by the EdenAPI store indicates a more fundamental problem (e.g., unable to reach the server, connection reset, etc) which should cause an abort and return the error.
Reviewed By: quark-zju
Differential Revision: D22544031
fbshipit-source-id: e01e8d88b75e46dcebd2eef5203e3a0edde69fc7
Summary: When working with large CBOR responses, it is sometimes useful to limit processing to the first N entries to prevent the operation from taking a long time. This diff adds an option to the `read_res` tool to only look at the first N entries in a data or history response.
Reviewed By: quark-zju
Differential Revision: D22544451
fbshipit-source-id: 5e8e2c7212aa3b315a25bd4cf9273009a5e43f72
Summary:
The pure Python `nodesbetween` implementation relies on raw revlog details and
weirdness (ex. `index[len(repo)]` returns `nullid`). Replace them with cleaner
code paths.
Reviewed By: DurhamG
Differential Revision: D22368831
fbshipit-source-id: c7eb0c2bb2759e9fb574afc63ad2b398d7b17d38
Summary:
We got user reports about failing hg log call -
https://fb.workplace.com/groups/scm/permalink/3016242448425355/.
If we can't fetch the data from graphql then we try to e.msg, however we don't
have such a field. We have e.message instead.
This diff fixes it, and also adds new line to make formatting better.
Reviewed By: quark-zju
Differential Revision: D22548251
fbshipit-source-id: 117489d8e6a22ab5bc43be1154697398086508d0
Summary: Some repos do not have `remotefilelog.reponame` set, so this shouldn't be a required config item.
Reviewed By: fanzeyi
Differential Revision: D22553141
fbshipit-source-id: a0fe9c289a1a32650572a4c123cda60af90e79ec
Summary:
Introduce new rust library, taggederror, which contains utilities for attaching metadata to errors. The library provides two main methods for attaching metadata to an error, the TaggedError wrapper type, and the AnyhowExt trait methods. Provides a struct, CommonMetadata, which contains all the metadata types introduced by taggederror (fault, transience, category, and typename), which can also be attached individually (and the same pattern can be used to attach other metadata).
Introduce a new native rust command, debugthrowrustexception, which causes the command to return an error, with some attached metadata.
Modify hg rust native command dispatch error handling to use debug formatter to print anyhow::Error errors. This will print out the source chain, contexts, and backtrace if available, which will cause the metadata we attach as a wrapper error or context to be printed.
Reviewed By: DurhamG
Differential Revision: D22420941
fbshipit-source-id: d38c5a10b686d86b69a2c0a19f5bcbf4ca24dff6
Summary:
Increase the max limits for repo_list_bookmarks and commit_list_descendant_bookmarks
from 1,000 to 10,000. The higher number is still reasonable for a single request,
and this reduces the number of round-trips when there are lots of bookmarks.
This updates the constants in the thrift definition. The server was updated to accept
higher limits in a previous diff.
Reviewed By: mitrandir77
Differential Revision: D22524891
fbshipit-source-id: bc47c1e50af35f213ebcfbca1574669e79b2fe92
Summary:
ODS counters are helpful to know if the feature is turned on or off without
requiring a traffic spike, so let's log them. Also, let's add timeouts in here,
so we know if things aren't working as expected (I did check in the Mononoke
LFS dataset — 10ms is a very conservative number, that's way beyond the p99 of
batch requests, which include potentially many counter checks).
To make this easier to iterate on, let's also add tests.
Reviewed By: StanislavGlebik
Differential Revision: D22545853
fbshipit-source-id: 02ea4484a4e4ba0dfd4a71030c129eb5c6bb1ec9