Commit Graph

63164 Commits

Author SHA1 Message Date
generatedunixname89002005307016
c83d9f746b Add annotations to eden/fs/cli/redirect.py
Reviewed By: xavierd

Differential Revision: D26445498

fbshipit-source-id: b77940cd7ed34b077ac0a8888268ee00ac01e043
2021-02-14 12:05:09 -08:00
svcscm
8820e29866 Updating submodules
Summary:
GitHub commits:

380c1dedcb
30ec4f069d
1e6d4b906d
6834ca0672

Reviewed By: jurajh-fb

fbshipit-source-id: ea3d247dff56e132e45b6541b90ad69747867d4d
2021-02-14 12:05:09 -08:00
svcscm
94b1bf9733 Updating submodules
Summary:
GitHub commits:

af1bcd1755
95b52abcb7

Reviewed By: jurajh-fb

fbshipit-source-id: ab0c02ae42058af4025fe21af3160215f0ab52dd
2021-02-13 19:57:31 -08:00
generatedunixname89002005307016
4250ca4932 Add annotations to eden/fs/cli/redirect.py
Reviewed By: xavierd

Differential Revision: D26442089

fbshipit-source-id: 9e96362545bf0d558aefae29b0472c5c8502240f
2021-02-13 17:39:12 -08:00
svcscm
c61754e012 Updating submodules
Summary:
GitHub commits:

01f2a4ae96
2ce5bec82a
49f0fa05e2

Reviewed By: jurajh-fb

fbshipit-source-id: 62b505e487bedc4f36fb2bc334815df0e85d2faa
2021-02-13 17:39:12 -08:00
svcscm
dbf4e9617e Updating submodules
Summary:
GitHub commits:

a983a4a27a
38c6e7e623
5befb06a2b

Reviewed By: jurajh-fb

fbshipit-source-id: 366fc1ab3179f6621e245d9dc60e5a0baa436f3a
2021-02-13 00:57:58 -08:00
Lukas Piatkowski
87ddbe2f74 autocargo v1: update autocargo field format to allow transition to autocargo v2
Summary:
Autocargo V2 will use a more structured format for autocargo field
with the help of `cargo_toml` crate it will be easy to deserialize and handle
it.

Also the "include" field is apparently obsolete as it is used for cargo-publish (see https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields). From what I know this might be often wrong, especially if someone tries to publish a package from fbcode, then the private facebook folders might be shipped. Lets just not set it and in the new system one will be able to set it explicitly via autocargo parameter on a rule.

Reviewed By: ahornby

Differential Revision: D26339606

fbshipit-source-id: 510a01a4dd80b3efe58a14553b752009d516d651
2021-02-12 23:28:25 -08:00
svcscm
e6abc2991d Updating submodules
Summary:
GitHub commits:

20f9ec6fb7

Reviewed By: jurajh-fb

fbshipit-source-id: 9102c2cd32eaa26a364efcc0a3ad3874780ae4a1
2021-02-12 23:28:25 -08:00
svcscm
781d463513 Updating submodules
Summary:
GitHub commits:

f604b03c5e

Reviewed By: jurajh-fb

fbshipit-source-id: e6c18208669fcc3e24dc730264b1faaa680483b4
2021-02-12 18:45:46 -08:00
Arun Kulshreshtha
c97db6b042 auth: rename structs
Summary:
Make the struct and method names in this crate more clearly reflective of what they do:

- `Auth` -> `AuthGroup`
- `Auth::try_from` -> `AuthGroup::new`
- `AuthConfig` -> `AuthSection`
- `AuthConfig::new` -> `AuthSection::from_config`
- `AuthConfig::auth_for_url` -> `AuthSection::best_match_for`

Reviewed By: singhsrb

Differential Revision: D26436095

fbshipit-source-id: a5ec5d9c48d3b75a0ee166b74e5340f9c529eeae
2021-02-12 17:52:29 -08:00
svcscm
15ccaa3756 Updating submodules
Summary:
GitHub commits:

b7131072f9

Reviewed By: jurajh-fb

fbshipit-source-id: d0e471c89a2220fbeeac83a001acf609d927970c
2021-02-12 17:52:28 -08:00
svcscm
edbcbe0cf6 Updating submodules
Summary:
GitHub commits:

718993ea3d
3c4dc138ee
36e90f066f
ace6b88007
b12270577c
ac5c72c3d0

Reviewed By: jurajh-fb

fbshipit-source-id: a885bed0a8d2930e587a7207e8d138f18c16781a
2021-02-12 15:43:41 -08:00
Xavier Deguillard
6834785a45 cli_rs: add uptime
Summary: This implements the same logic as the `edenfsctl uptime`.

Reviewed By: fanzeyi

Differential Revision: D26412789

fbshipit-source-id: ebcf5f0b4767025ea210f7e9c69116b79436d5d0
2021-02-12 15:21:31 -08:00
Jun Wu
c08f68a05a crdump: use max( instead of last() to optimize a revset query
Summary:
In a non-segmented-chanelog repo, `last`, the revset function has suboptimal
path that makes the following query:

    last(::b8f917d4c & public())

take a long time. Use `max` to fix it.

Reviewed By: singhsrb

Differential Revision: D26435439

fbshipit-source-id: dc854b4c6978d2925cab2cb8f217365ed9c7f146
2021-02-12 14:57:14 -08:00
Digant Kasundra
8e32a28416 Update sshcerts to 0.3.11
Summary: The local patch has been upstreamed so switching back to upstream's new version of sshcerts with proper support for our SSH keys and certs

Reviewed By: Imxset21

Differential Revision: D26419743

fbshipit-source-id: c6e6d2a8f77623360636a68febebfc85ad6f5c26
2021-02-12 14:57:13 -08:00
Zeyi (Rice) Fan
5e5d334718 cli: one comma bug
Summary: comma_khan

Reviewed By: singhsrb

Differential Revision: D26408197

fbshipit-source-id: ccdf6d070069a870e3fa71b1d4f1b42239a7c203
2021-02-12 14:53:23 -08:00
Arun Kulshreshtha
916956b264 auth: use scheme from URL prefix if present
Summary: Make `AuthConfig::auth_for_url` match the behavior of the Python `httpconnection.readauthforuri` function when an auth group has a URL prefix with a scheme. Previously, the Rust version did not allow schemes to be specified on the prefix, and instead required them to be specified in the "schemes" fields. The Python code allows a scheme in the prefix, which overrides the contents of the "schemes" field for that auth group if present.

Reviewed By: DurhamG

Differential Revision: D26419721

fbshipit-source-id: 909b52a2e37e2fc908d5eb56740dd41dda826033
2021-02-12 14:47:39 -08:00
svcscm
1211d776a4 Updating submodules
Summary:
GitHub commits:

6d0950677c
ca75232059
b5f688b88a

Reviewed By: jurajh-fb

fbshipit-source-id: 012d51203859a95fe25f7d0501e10b6368e8895f
2021-02-12 14:42:45 -08:00
Xavier Deguillard
621cadd6d6 cli_rs: add a default 3s connection timeout for health checks
Summary:
In Python, no passed in timeout means a 3s connection timeout, let's do the
same in Rust.

Reviewed By: chadaustin

Differential Revision: D26407991

fbshipit-source-id: ad2919e2cb72e5a113499d7e036ae285ecf9ae34
2021-02-12 14:38:22 -08:00
Zeyi (Rice) Fan
18b79205c8 cli: add get_config to EdenFsInstance
Summary: You can use `instance.get_config()` to get access to global EdenFS configurations

Reviewed By: chadaustin

Differential Revision: D26407350

fbshipit-source-id: 022cc59fd86b2711c15cfd781872465c6ada9081
2021-02-12 14:23:17 -08:00
David Tolnay
1ae53c794f Update symlinks for Rust 1.50.0
Summary: Release notes: https://blog.rust-lang.org/2021/02/11/Rust-1.50.0.html

Reviewed By: jsgf, Imxset21

Differential Revision: D26363768

fbshipit-source-id: 25188531cf0a5647128cbeb469225d8dd756d0af
2021-02-12 13:54:50 -08:00
Xavier Deguillard
b63f46c673 cli_rs: add pid command
Summary: This simply queries the pid from thrift.

Reviewed By: kmancini

Differential Revision: D26406797

fbshipit-source-id: 1d5d1b2d526e1de505d72747a5c903001b141d40
2021-02-12 13:47:48 -08:00
svcscm
fdf2b69d6e Updating submodules
Summary:
GitHub commits:

b68b4236a7
4e2469b003
6c67aeda61
bffe796162
5205172542
72095843d2

Reviewed By: jurajh-fb

fbshipit-source-id: d5f6069e01463023c2f740c13cefa1145d505966
2021-02-12 13:47:48 -08:00
svcscm
3703c37fef Updating submodules
Summary:
GitHub commits:

5872507d53
4e1cc23714
6f7d8f37b2
6c927a0840
63c9798ea9

Reviewed By: jurajh-fb

fbshipit-source-id: fb05124286d0b0cb0f83c79368aaaf1c62a59763
2021-02-12 12:37:33 -08:00
Zeyi (Rice) Fan
7de8d6a595 cli_rs: add edenfs-config for configuration loading
Summary:
This diff adds `edenfs-config` for loading EdenFS configurations from various
locations.

Reviewed By: xavierd

Differential Revision: D26391272

fbshipit-source-id: 3d34da98b2d530e13cdd831d3dc204e44304c486
2021-02-12 12:33:48 -08:00
Zeyi (Rice) Fan
8290ea3545 cli_rs: add stack config proc macro
Summary:
**Problem:** EdenFS has the classic hierarchical configuration design. We load from `/etc/eden/edenfs.rc` first, then `/etc/eden/conf.d/*` then `$HOME/.edenrc`. The latter can overwrite the former. At the end we have a complete view of the configurations.

`serde` is great, but it can't give us the information of whether it generated a field from `serde(default)` or from de-serialization. So we can't just deserialize then merge the configuration files. We need that information, and nor serde should give us that functionality.

`stack-config` is created to load configurations with serde. It automatically generates code with the intermediate data structure and taking care of merging of multiple configuration files. It derives a data type based on the original struct but wrap each field with `Option<T>` and mark it with Serde. Then it generates the code to merge and build the final concrete configuration data type.

It does not care what kind of data format the configuration file is, as long as it can deserialize into the generate optional type, it accepts it.

Example, say I have a file with this structure:

```
#[derive(StackConfig)]
struct Config {
  path: String,
}
```

Then this crate will generate:

```
mod __stack_config_private {
  #[derive(serde::Deserialize)]
  pub(super) struct ConfigOpt {
    path: Option<String>
  }

  ...
}

struct ConfigLoader {
  layers: Vec<__stack_config_private::ConfigOpt>,
}

impl ConfigLoader {
  fn new() { ... }
  fn load(&mut self, layer: __stack_config_private::ConfigOpt> { ... }
  fn build(self) -> Config { ... }
}
```

See `examples/parse.rs` for usage.

Reviewed By: xavierd

Differential Revision: D26377547

fbshipit-source-id: 1e07d9867742913fd76ed4f765160f0035a2f2a3
2021-02-12 12:33:47 -08:00
Zeyi (Rice) Fan
d552144478 configparser: move conversion related to a separated module
Summary:
Move these conversion related function and trait out of `hg` module so EdenFS can use it too. Changes:

* Moved `get_opt`, `get_or` and `get_or_default` directly into `ConfigSet`.
* Moved `FromConfigValue` and `ByteCount` into `configparser::convert`.

Reviewed By: quark-zju

Differential Revision: D26355403

fbshipit-source-id: 9096b7b737bc4a0cccee1a3883e89a323f864fac
2021-02-12 12:33:47 -08:00
Zeyi (Rice) Fan
c601c6a46d cli_rs: set up debug logging
Summary: This diff sets up debug logging for EdenFS CLI with tracing.

Reviewed By: chadaustin

Differential Revision: D26354205

fbshipit-source-id: bcc89fe3eaf4c7ae7642b8c20fd74fd3ea6dd4ee
2021-02-12 12:33:47 -08:00
Zeyi (Rice) Fan
bd321ea0e3 cli_rs: reorganize Rust package structure
Summary: This diff splits edenfsctl binary target into several smaller crates.

Reviewed By: chadaustin

Differential Revision: D26349305

fbshipit-source-id: 8c506d50fd2bf8593a02a95ed2c839c0cbc62fb2
2021-02-12 12:33:46 -08:00
Zeyi (Rice) Fan
a3ddd302a5 cli_rs: implement status in Rust
Summary: This diff reimplements `edenfsctl status` in the Rust wrapper.

Reviewed By: chadaustin

Differential Revision: D25759315

fbshipit-source-id: 86ae4e89f74b41446cc52f106afd1e1e78c36d76
2021-02-12 12:33:46 -08:00
generatedunixname89002005307016
d59ae291e7 Add annotations to eden/fs/cli/top.py
Reviewed By: xavierd

Differential Revision: D26424699

fbshipit-source-id: 5980fb10640e904f31d299a8f6c510dd16533fa5
2021-02-12 11:38:44 -08:00
Durham Goode
7ab09f1e5f tests: fix broken test
Summary:
The push-pull test was broken by my recent change to make indexedlog
the default. It wasn't caught because the test is disabled in Python 3. It now
passes with Python 3 so let's enable it.

The repack-remove fix is just some flakiness I've seen lately.

Reviewed By: singhsrb

Differential Revision: D26412998

fbshipit-source-id: be4b648f31bd6dfbf6a6e5d2e382acb084461974
2021-02-12 11:38:43 -08:00
Alex Hornby
1a4e379067 mononoke: update walker to use new bounded_traversal_unique
Summary:
The walker mostly checks for duplicates before emitting a new edge, at the same time recording the edge as visited to prevent duplicate edges.

However for derived data where the node may or may not be present, the node isn't considered visited until the node data is successfully loaded and seen in state.rs record_resolved_visit().  This leaves a gap where we could be executing multiple copies of the same node.

Reviewed By: farnz

Differential Revision: D26319139

fbshipit-source-id: 52ce28f15341f132d94ebc1ff5e8ee2f0dc2564a
2021-02-12 10:14:44 -08:00
Alex Hornby
5d7a62e13c mononoke: add duplicate detecting variant of bounded traversal stream
Summary:
Sometimes many nodes will unfold with a common child, in which case it is desirable that they aren't scheduled at the same time.

This adds bounded_traversal_unique as a new variant to prevent those duplicates.

Doing the duplicate detection inside bounded_traversal_unique means we only need to keep scheduled_max copies of keys and can keep it in a regular HashMap, vs doing it at bounded_traversal_stream call sites which would mean keeping a copy for everything in the unscheduled queue and using DashMap or a lock around HashMap.

Reviewed By: farnz

Differential Revision: D26319137

fbshipit-source-id: 3174ce9e7db4edeb107d26f72575de886e6b2e39
2021-02-12 10:14:44 -08:00
Arun Kulshreshtha
8412d537f8 pyauth: add bindings to auth crate
Summary: Add Python bindings to the Rust `auth` crate, with the intention of replacing `httpconnection.readauthforuri`.

Reviewed By: quark-zju

Differential Revision: D26419447

fbshipit-source-id: dd13bea74961137790beb8c96120ebef99e3c313
2021-02-12 10:04:27 -08:00
Stanislau Hlebik
4599ada4af metagit: add faster repository validaton
Summary:
For some repositories (e.g. configerator-sitevars) running "git gc" is too
slow. At the same time after initial rsync it would be good to run at least
some kind of validation to check that repo is not completely corrupt.

This diff adds that. This code checks that HEAD and 100 of its ancestors have
the object that they reference are reachable.

Reviewed By: krallin

Differential Revision: D26423769

fbshipit-source-id: a3fcd9fc5c30e5bf0fdc1cd0fb9e03bdc2e1371d
2021-02-12 10:00:41 -08:00
Alexandru Dan
ba58535b8f Update dashmap version. (#73)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/73

Pull Request resolved: https://github.com/facebook/relay/pull/3355

Followed [this guide](https://www.internalfb.com/intern/wiki/Rust-at-facebook/Managing_fbsource_third-party_with_Reindeer/) to update the dependecies.

For more context on serde error fixed by this update, check this https://github.com/xacrimon/dashmap/issues/133

Differential Revision: D26423198

fbshipit-source-id: 1a98ffe84d423bd9417a9b3049044dac01639637
2021-02-12 09:37:51 -08:00
svcscm
39fc57db36 Updating submodules
Summary:
GitHub commits:

fbe0e484ff
a747a14f21

Reviewed By: jurajh-fb

fbshipit-source-id: b15334676dd7b04682dced42fc2956dc3f418fe2
2021-02-12 05:54:26 -08:00
Thomas Orozco
db7f9fe76b third-party/rust: update Hyper
Summary:
johansglock pointed out that Hyper is affected by CVE-2021-21299. Let's update
to a fixed version.

Reviewed By: farnz

Differential Revision: D26313854

fbshipit-source-id: 4db04d3044fb9f22a037bda0a88a5314f62f9dfc
2021-02-12 04:56:24 -08:00
Thomas Orozco
0cf4bafcf8 mononoke: disable tokio coop
Summary:
See the earlier diff for what flag controls.

When booting SCS, we poll a lot of nested FuturesUnordered. This results in
very inefficient behavior in Tokio's cooperative scheduling, and results in us
spending 50% of total our CPU (in fact, a full thread) on just yielding, with
most other threads being idle.

With this change, we use 20+ threads running work that is scheduled by the main
thread, which is what we want.

Note that this applies to all Mononoke binaries. This has only been especially
bad in SCS startup, but we've also not benefited from this feature anywhere,
so rather than leaving this footgun in other apps, let's take it out
everywhere.

Reviewed By: markbt, StanislavGlebik

Differential Revision: D26399889

fbshipit-source-id: 0a13e1275d367e49c2342cb85cb6cd0047cda224
2021-02-12 04:56:24 -08:00
Thomas Orozco
2a21e4fb17 third-party/rust: update Tokio to 0.2.25 + add a patch to disable coop scheduling
Summary:
See the patch & motivation here:

818f943db3

Reviewed By: StanislavGlebik

Differential Revision: D26399890

fbshipit-source-id: e184a3f6c1dd03cb4cdb7ea18073c3392d7ce355
2021-02-12 04:56:23 -08:00
Kostia Balytskyi
6b67fe8602 rate_limits: add total file-changes rate limit
Summary: Instead of doing per-repo rate-limiting checks, let's do total ones. All of the business logic stays the same, with the exception of a different counter used.

Reviewed By: farnz

Differential Revision: D26374353

fbshipit-source-id: 92006cd3e5dd194ac9e6531cbb19289fa73a63d2
2021-02-12 01:31:55 -08:00
Kostia Balytskyi
879f85631b thrift: import changes to limits.thrift
Summary: This imports D26374072. See that diff for details.

Reviewed By: farnz

Differential Revision: D26374352

fbshipit-source-id: 71f39b5c606915bfbf421b366812fd40ebb6b4f9
2021-02-12 01:31:55 -08:00
svcscm
550008419d Updating submodules
Summary:
GitHub commits:

f1084fbece

Reviewed By: jurajh-fb

fbshipit-source-id: f09ba133c979212f25a8f0a577c3f268ab60d4c2
2021-02-12 01:31:54 -08:00
svcscm
0a3bd61a99 Updating submodules
Summary:
GitHub commits:

a6b3089ae1
4f197cabbf
ad6bf2707c
651b1f69b0

Reviewed By: jurajh-fb

fbshipit-source-id: 68fc8dc70f34e3e2a8d8efd5ef30d881d7ccf041
2021-02-11 22:48:39 -08:00
Arun Kulshreshtha
92bfc3d63d auth: add extra fields to auth groups
Summary: The Python `readauthforuri` method will include *any* fields specified in the `[auth]` section for a given auth group, even if those fields aren't one of the expect ones (such as `cert`, `key`, etc). This is sometimes used in tests to attach additional information to an auth group. To support this in Rust, let's just collect all unknown fields into a `HashMap`.

Reviewed By: quark-zju

Differential Revision: D26416086

fbshipit-source-id: 0252e340e38850a54e24d54810e9abd77c566f63
2021-02-11 21:06:31 -08:00
Arun Kulshreshtha
9fc3b326fb bindings/pyerror: add CertificateError exception
Summary:
The auth crate is now able to check the presence and expiration of client certificates (D26009207 (9f7d4447fd)). When a problem is detected, it emits an `X509Error`, which specifies exactly what the problem is. Since this error always indicates a certificate issue, we can print out the message configured in `help.tlsauthhelp` (which is more specific than `help.tlshelp` from the previous diff).

Previously, Mercurial would attempt to use the certificate anyway, resulting in a difficult to understand error message. Although the previous diffs in this stack improved the error messages on any TLS failure, the `X509Error` messages are even more helpful.

Users can opt in to this certificate validation with `edenapi.validate-certs`. The functionality is gated on a config option to prevent Mercurial from crashing if certificates are misconfigured, but EdenAPI isn't being used.

Reviewed By: quark-zju

Differential Revision: D26385843

fbshipit-source-id: 9809f612f8aab3f2dd442d6dd8dc348f1af45296
2021-02-11 19:29:22 -08:00
Arun Kulshreshtha
8513949bf2 scmutil: print help.tlshelp on TlsError
Summary: Print out the help text configured in `help.tlshelp` upon hitting a `TlsError`. Note that in this case, we use `help.tlshelp` rather than `help.tlsauthhelp` since all we know in this case is that *some* kind of TLS error occurred.

Reviewed By: quark-zju

Differential Revision: D26385844

fbshipit-source-id: 1fb5280195de75107ecdfc9203ef8ddda2a04052
2021-02-11 19:29:21 -08:00
Arun Kulshreshtha
8b9cf7e7cb bindings/pyerror: add TlsError exception type
Summary: Add a new `TlsError` Python exception type corresponding to `HttpClientError::Tls`.

Reviewed By: quark-zju

Differential Revision: D26385846

fbshipit-source-id: c0df543032461de650a4d24c26c6b8aaab1abbb9
2021-02-11 19:29:21 -08:00
Arun Kulshreshtha
5f0a89ca37 http-client: add HttpClientError variant for TLS errors
Summary:
Add a new `HttpClientError::Tls` variant specifically for TLS errors, separating them from other `curl::Error`s from libcurl.

To determine whether a particular `curl::Error` is a TLS error, we check both the error code and the contents of the error message.

Reviewed By: quark-zju

Differential Revision: D26385845

fbshipit-source-id: fd58f86a3a61fcfb845d19e262fdcb132dc7ec9f
2021-02-11 19:29:21 -08:00