Commit Graph

63126 Commits

Author SHA1 Message Date
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
Andrey Chursin
0b03898f89 checkout: add genereated test cases
Summary: This diff adds auto-generated test cases to checkout code. It generates partially overlapping trees and tests transitions between them

Reviewed By: quark-zju

Differential Revision: D26384962

fbshipit-source-id: 6140bbb7ff8b87843a2235f8325f57829cdd8cae
2021-02-11 19:10:25 -08:00
Andrey Chursin
c8d54af98e types: limit PathComponentBuf arbitrary characters to a-z only
Summary: Currently PathComponentBuf::arbitrary generates any characters. Those characters are ok for unit tests on hg abstractions where they are currently used, but many of them do not work with real filesystems

Reviewed By: quark-zju

Differential Revision: D26384961

fbshipit-source-id: dde1e9276114b30262bc477a3e0f828645f1f32a
2021-02-11 19:10:25 -08:00
Andrey Chursin
881b03690d vfs: reset permissions when overwriting file
Summary:
Currently if VFS overwrites executable file with regular, it preserves exec bit[see added test].
This diff makes sure that file has correct permissions after overwrite

This diff also slightly optimizes write_executable, by calling set_mode on the file handle, instead of path

TODO - we can check if calling stats() before set_permissions will save some time

Reviewed By: quark-zju

Differential Revision: D26379824

fbshipit-source-id: 42d0b2fb79ed860ac37b2de077388002ade69449
2021-02-11 19:10:24 -08:00
Andrey Chursin
0240026f36 vfs: do not follow symlink when overwriting
Summary:
Before this diff VFS::write_regular did not handle correctly use case when file already existed as as symlink - it would write into symlink location, instead of replacing symlink with a regular file (see updated  test_symlink_overwrite that is failing on old implementation)

This diff adds O_NOFOLLOW option on unix when overwriting the file. When destination is a symlink, attempt to write fails with E_LOOP and triggers clear_conflict that removes symlink and allows retry write to succeed.

This also allows one of test cases in checkout that previously did not work

Reviewed By: quark-zju

Differential Revision: D26378893

fbshipit-source-id: 28bcdaba78db283ac7a25bb232c198d3d8f73e5d
2021-02-11 19:10:24 -08:00
Andrey Chursin
38499b36e0 checkout: introduce file system tests
Summary: This diff contains basic test setup for checkout tests - we compare transition between two trees without dirty changes

Reviewed By: quark-zju

Differential Revision: D26359502

fbshipit-source-id: ef670c944200bae1652863c91ada92c6fecce4ac
2021-02-11 19:10:24 -08:00
generatedunixname89002005307016
0eaf0f0dfe Add annotations to eden/fs/cli/top.py
Reviewed By: xavierd

Differential Revision: D26402730

fbshipit-source-id: 391442cae29e6c7ba686970e096a67c94ab0a091
2021-02-11 16:22:30 -08:00
svcscm
48d42abd06 Updating submodules
Summary:
GitHub commits:

a566bfb7df
00519187a6
52e68a8b8e
8db2382c72

Reviewed By: jurajh-fb

fbshipit-source-id: 93cd3085353f1a30f4b0b6da946079a86e04519e
2021-02-11 16:14:31 -08:00
Adam Simpkins
8907208651 update dirsync to allow matching individual files
Summary:
Update the dirsync code to allow mirror and exclude rules to match individual
files rather than just directory prefixes.

This simply appends `/` to all filenames when looking for rule matches.  This
allows us to efficiently match individual filenames in addition to directory
prefixes.

Reviewed By: quark-zju

Differential Revision: D26294583

fbshipit-source-id: 83b283f344f6e0bc0fe53b9068e7e0170f53504b
2021-02-11 15:54:28 -08:00
svcscm
9c54d46213 Updating submodules
Summary:
GitHub commits:

d7125c8db5
40b160ef77
0d1981abd6
f6e50d14f1

Reviewed By: jurajh-fb

fbshipit-source-id: 0b1a9199b8e10b41ac0faf8de7f3cbe2adc326ed
2021-02-11 14:54:01 -08:00
svcscm
0c6ed23015 Updating submodules
Summary:
GitHub commits:

ec27e0679d
ad34281d74
8561e88b1f

Reviewed By: jurajh-fb

fbshipit-source-id: b10b40904e0d4909e7e13a4903c886e54eb641e8
2021-02-11 14:54:00 -08:00
svcscm
56595f67b0 Updating submodules
Summary:
GitHub commits:

02c80c5da4

Reviewed By: jurajh-fb

fbshipit-source-id: 9f29abb7e76d8fe0b1874ae27f87d3d9452092aa
2021-02-11 12:22:17 -08:00
Stefan Filip
93c1231c55 segmented_changelog: update hash_to_location to gracefully handle unknown hashes
Summary:
One of the primary use cases for hash_to_location is translating user provided
hashes. It is then perfectly valid for the hashes that are provided to not
exist.  Where we would previously return an error for the full request if a
hash was invalid, we now omit the hash from the response.

Reviewed By: quark-zju

Differential Revision: D26389472

fbshipit-source-id: c59529d43f44bed7cdb2af0e9babc96160e0c4a7
2021-02-11 12:17:35 -08:00
Stefan Filip
c9f3ae8fa4 edenapi: add commithashtolocation to python client
Summary: Same approach as locationtohash.

Reviewed By: quark-zju

Differential Revision: D26382616

fbshipit-source-id: a06c62c3eebcbe0b07b5c28fce4789a1334d55a4
2021-02-11 12:17:35 -08:00
Stefan Filip
cfed6bb108 edenapi: add commitlocationtohash to python client
Summary:
The approach is very similar to what commitrevlogdata does. You could say
that it's cargo culted.
I am not sure how appropriate it is to return CommitLocationToHashResponse
but I think that it's fine for now.

Reviewed By: quark-zju

Differential Revision: D26374219

fbshipit-source-id: 61d851d5a4fc4223c65078ef434a0c67314a90cd
2021-02-11 12:17:35 -08:00
svcscm
9b1d1bc3ea Updating submodules
Summary:
GitHub commits:

e4c9596345

Reviewed By: jurajh-fb

fbshipit-source-id: 96d3460b9610b958ceedb97d2b34ce3c6ea9f1b9
2021-02-11 11:45:06 -08:00
Alex Hornby
bfdced0f0b mononoke: fix ctime_age in scrub blobstore
Summary: It's totally valid to get a zero ctime_age if storage is quick (e.g. local integration tests), or a negative age if running vs storage without synchronized clocks.

Reviewed By: krallin

Differential Revision: D26404237

fbshipit-source-id: 8a479be8cac8adc81f39eabe0f73048f701a146c
2021-02-11 11:21:28 -08:00
svcscm
2bc670894e Updating submodules
Summary:
GitHub commits:

4d191ec70e
2004298808

Reviewed By: jurajh-fb

fbshipit-source-id: 75b993689fd979dcc566795099e3bfaf119e8d49
2021-02-11 10:22:13 -08:00
Stanislau Hlebik
af2ab0cf10 mononoke: store hydrated tree manifests in .hg
Reviewed By: krallin

Differential Revision: D26401093

fbshipit-source-id: e5050883b0e6f370a7cfbb5f46721aca7469dce1
2021-02-11 10:12:27 -08:00
Durham Goode
d7a4ce4783 py3: remove duplicate constant definition
Summary: This is defined else where in Python 3, so let's get rid of it here.

Reviewed By: quark-zju

Differential Revision: D26381054

fbshipit-source-id: 9746d2c53f83209d9c795ffdd5841d58ef1153ef
2021-02-11 09:50:25 -08:00
Durham Goode
5c6edef11c py3: fix simple Windows py3 issues
Summary: These are just a few one-liners to fix Python 3 on Windows.

Reviewed By: sfilipco

Differential Revision: D26381055

fbshipit-source-id: d9257f2cf35c05f931d74b7d26bdc79f5bf34185
2021-02-11 09:50:25 -08:00
svcscm
3eb36f0da2 Updating submodules
Summary:
GitHub commits:

40824414bb
f3edd0035e
5cfa13910c

Reviewed By: jurajh-fb

fbshipit-source-id: 39be11fdeffb0b06f0f81b0944b1a5994f1d6032
2021-02-11 09:45:49 -08:00
Durham Goode
9c1b611dff indexedlog: make writing to indexedlog the default
Summary:
We've rolled both of these out to 100%. Let's make this the default so
we can delete those configs.

Reviewed By: quark-zju

Differential Revision: D26233645

fbshipit-source-id: cd7a08c404483f78ab714763870f5bf0fa801e7a
2021-02-11 09:34:55 -08:00
Durham Goode
ca1249c269 packs: prevent creating mutable packs when using rust store
Summary:
We're seeing cases where Mercurial is creating unused .tmp pack files
and leaving them around. It looks like there are two places this can happen, 1)
in the treemanifest python code we manually instantiate some mutable packs, and
2) when doing a read from the rust data store, when it does a read against the
mutable pack store it will unnecessarily create the MutableDataPackInner struct,
which creates the temp file.

Let's fix those.

Reviewed By: quark-zju

Differential Revision: D26387205

fbshipit-source-id: 5a567c886849084bcc8121949dd2fb0f9e66d570
2021-02-11 09:31:00 -08:00
svcscm
980f20b22c Updating submodules
Summary:
GitHub commits:

db9ebbe5b7
882d651525
3a5deaca7b
1f38dc9f8a
b4c413aef4
bf2480f969
0a1e4063d1
c2abc34687

Reviewed By: jurajh-fb

fbshipit-source-id: 37b6a610a3827d1dc2d7cb0a670c1fac14ad7b4e
2021-02-11 08:49:12 -08:00
Jeremy Fitzhardinge
1e2c466fd0 third-party/rust: refresh vendored sources
Summary:
For whatever reason, the metadata and vendored sources do not match
the actual upstream sources. I deleted all of third-party/rust/vendor/** and
revendored.

Notable changes:
- libra-crypto and libra-canonical-serialization picked up changes from D25098952 (Nov 2020)

D25986058 updated the source location of z3, but didn't update the sources.
Unfortunately the updated location seems completely unbuildable, so for now
this doesn't update any of z3 until jagill can fix it.

Reviewed By: wangbj

Differential Revision: D26377549

fbshipit-source-id: d30dbaa7502c82c4b7cd64f8c80ab978a5646271
2021-02-11 06:45:20 -08:00
Stanislau Hlebik
5eccc41cef mononoke: fix phases mononoke admin
Summary: It was failing because caching was not initialized. This diff fixes it

Reviewed By: mitrandir77

Differential Revision: D26374106

fbshipit-source-id: 7481c145c56db9080e065908a4b5e9b136a18317
2021-02-11 06:06:27 -08:00
svcscm
cf9c8bf29f Updating submodules
Summary:
GitHub commits:

a81eb03225
2540a73fb2
3a3602f5ca

Reviewed By: jurajh-fb

fbshipit-source-id: 673cf56b02d08e8c339ba98c5f58418d63bad261
2021-02-11 03:40:13 -08:00
Alex Hornby
ffa4f49428 mononoke: shift code left in walk.rs walk_exact
Summary: Change from .map_ok() to async move to shift code left a bit

Differential Revision: D26366419

fbshipit-source-id: 833066b45702f36a4ce8d579994d1abb2d739f9e
2021-02-11 03:16:58 -08:00
Leszek Nowaczyk
8a9ec43d3e change logging.warn to logging.warning
Summary: logging.warn() is deprecated since Python 3.3 in favor of logging.warning()

Reviewed By: ahornby, mannatsingh, klshuster

Differential Revision: D25870738

fbshipit-source-id: d866a7925300ad3404a5c8da29e380d5d01d7dc2
2021-02-11 02:42:51 -08:00
svcscm
9aa08afa55 Updating submodules
Summary:
GitHub commits:

86c0460951
b6dd001573
d1c510baec

Reviewed By: jurajh-fb

fbshipit-source-id: f5f3965aa397166b2f3c336dc7d50be7bc59968b
2021-02-11 02:42:51 -08:00
svcscm
cbeabafe42 Updating submodules
Summary:
GitHub commits:

ffb1d8ab75
d9862cb9ad

Reviewed By: jurajh-fb

fbshipit-source-id: a0dd41a0f3690b4ff6f65bd530c2001ebb05adbd
2021-02-10 20:43:09 -08:00
Xavier Deguillard
7a0dec91ec cli: strictify all of the cli tests
Summary:
While I was fixing the cli_test I realized that the rest of the tests didn't
enforce strict type checking, let's make sure it is enabled so `pyre -l eden`
works for all the tests now and in the future.

Reviewed By: chadaustin

Differential Revision: D26356267

fbshipit-source-id: 4f026b6f96c410115a6a38d772f8e06ab977293b
2021-02-10 20:11:04 -08:00
Xavier Deguillard
ddb7859ffd cli: make macOS new clone case-insensitive
Summary:
The default filesystem on macOS (APFS) is case-insensitive, but EdenFS has so
far been case-sensitive except on Windows. Some of the native tools (Unity for
instance), expect macOS to always be case-insensitive, and is thus breaking due
to that.

The safe behavior would be to have EdenFS behave exactly the same as APFS: be
case insensitive. For now, to avoid breaking users this will be done on new
mounts only, and once fully validated, this will be made the default and forced
on.

Reviewed By: chadaustin

Differential Revision: D26356269

fbshipit-source-id: 96ca331d8c9726213520dff3e3563019d0400a95
2021-02-10 20:11:04 -08:00
svcscm
6d23734764 Updating submodules
Summary:
GitHub commits:

a39e7f0b4e
e54ae54c11
a8d97dcb34
9578d70ddf
4af213ceeb

Reviewed By: jurajh-fb

fbshipit-source-id: 6681da952f8f3a0aba3bfeace7f51c9b400dbe65
2021-02-10 19:35:44 -08:00
Durham Goode
8c08a42d22 dynamicconfig: introduce configs.allowedconfigs
Summary:
In our upcoming migration away from chef/static rc files, we'll be
marking certain files as "allowed". Our hope is that that list only includes
things like .hg/hgrc, ~/.hgrc, etc.

There are cases however where it's convienent to continue to use chef, for
instance when we condition on machine type. To support this, let's add an
allowed_config option, which will allow configs from non-supported locations.

This will also be useful when remediating issues that come up when we start
enforcing allow_location, without rolling back the entire thing.

Reviewed By: quark-zju

Differential Revision: D26233451

fbshipit-source-id: 71789e0361923a6f80de4aef7f012afc0269440d
2021-02-10 19:30:35 -08:00
svcscm
a4339ac009 Updating submodules
Summary:
GitHub commits:

b669bb9cac
029aff282b

Reviewed By: jurajh-fb

fbshipit-source-id: 5e03681012b67dad432604b4b4b004f3e1fa7102
2021-02-10 18:56:55 -08:00
Sean Kamath
ae5db40fdd Changing commit hash length to 9 in hg prompt
Summary:
Copied from D17312417 (e1f4dbeb3d), because that did what I needed done, but incremented by 1.

I would like to change the length of the displayed hash in scm-prompt
to 9. Why such an impactful diff? Because hg sl shows 9 characters, and I
always get confused when the hash in my prompt doesn't match hg sl

Reviewed By: kulshrax

Differential Revision: D25934253

fbshipit-source-id: 15f2bc8bc7d666de1a077d2bafd74ab3c9753341
2021-02-10 17:07:35 -08:00
Zeyi (Rice) Fan
dc22fd8777 add a wrapper to combine both Python & Rust EdenFS CLI
Reviewed By: xavierd

Differential Revision: D25792324

fbshipit-source-id: 2e54f27caa830076168b7f178b6a95718eeb9f92
2021-02-10 16:52:07 -08:00