Commit Graph

65413 Commits

Author SHA1 Message Date
Kostia Balytskyi
c238f12d44 types: make macros usable outside mononoke_types
Summary:
This diff prepares some macros to be usable by external crates. Next diff uses
them in `megarepo_api:async_requests`.

The way it makes macros usable externally is by:
1) using abs paths for std types outside of prelude
2) importing necessary traits in methods which need them
3) re-exporting important `mononoke_types`-defined types and third-party
dependencies via `mononoke_types::private` and using `$crate::private` in macro
to access them.

This way someone needs only to depend on `mononoke_types` and only to import
the macro, not any other re-exported definitions.

Reviewed By: krallin

Differential Revision: D28033196

fbshipit-source-id: 3f5fa34388a4f6466969d06c5739c5282f007e68
2021-05-06 09:34:56 -07:00
Stefan Filip
8faf9b07c5 edenapi_service: use custom_cbor_stream for trees
Summary:
The trees endpoint is another example where we try to send errors to the
client.  As it was done previously we would fail to log any errors on the
server side.  This diff corrects that by using custom_cbor_stream.

Reviewed By: kulshrax

Differential Revision: D28111102

fbshipit-source-id: 468095d024647f472b8ad9a9e17ca8364605ff98
2021-05-06 09:14:10 -07:00
Stefan Filip
1852d28c38 edenapi_service: add CustomCborStream
Summary:
Some EdenapiEndpoints serialize their error and send them to the client. This
robs the gotham framework from the change of seeing those errors. This custom
stream takes care of counting those errors and reporting them to gotham for
logging.

There is a slight worry in the back of my head that if we start getting errors,
CPU utilization will increase because we construct so many extra strings.

Reviewed By: kulshrax

Differential Revision: D28109314

fbshipit-source-id: ab39a05227e0f8be9205d6036d32523cb1e45ca4
2021-05-06 09:14:10 -07:00
svcscm svcscm
f144988037 Updating submodules
Summary:
GitHub commits:

125e2a4e76
cfd9a038a7
5c0ee349b1
83ae26888c

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: efdb07fdd25801994382723511e2982535c04d58
2021-05-06 07:43:09 -07:00
svcscm svcscm
8a8eb6d2a6 Updating submodules
Summary:
GitHub commits:

48ccb51b69

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 4ec27232f3a8409225dbde9cbea279be612cf1fc
2021-05-06 07:10:41 -07:00
Thomas Orozco
246d5009c0 mononoke: sample harder in the walker
Summary:
The walker does about 50% of our traffic, but it also has fairly predictable
access patterns. It seems unlikely that we really benefit from logging all
scrub activity with the same precision as we do other traffic.

So, let's sample it. This should make a lot of space in our Scuba table and
make us more resilient to sudden changes in activity.

Reviewed By: StanislavGlebik

Differential Revision: D28254057

fbshipit-source-id: da748a565954c31c2d9e087b7b07747a435427bf
2021-05-06 07:07:02 -07:00
Digant Kasundra
be43635087 Update rust-ini to 0.17.0
Summary: Updated rust-ini from 0.13.0 to 0.17.0

Differential Revision: D28242794

fbshipit-source-id: 249fc7d2ffdc46c4bfb4b575fb7aa8f5858a6e12
2021-05-06 06:50:28 -07:00
svcscm svcscm
07b70a46a1 Updating submodules
Summary:
GitHub commits:

824395063d
ecb2186f32
3008ab72f3
650cc2c968

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: dd860f693e01b4637a0c3697dd16a91fa5508f44
2021-05-06 06:26:59 -07:00
svcscm svcscm
4a565e0128 Updating submodules
Summary:
GitHub commits:

c0dcda2430

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 69716273b87282493118bbd62e6f161b6292195f
2021-05-06 05:54:21 -07:00
Mark Juggurnauth-Thomas
9d6a583988 admin: add blame-v2 to blame compute
Summary:
Add `--blame-v2` to `mononoke_admin blame compute`.  This can be used to compute
blames in the new format and validate that they are correct.

Reviewed By: mitrandir77

Differential Revision: D28183160

fbshipit-source-id: f698a77c109bfce05aeb66cd405c6f20bf158801
2021-05-06 05:45:49 -07:00
Mark Juggurnauth-Thomas
5fe6d54116 blame_v2: add blame_v2 types and implementation
Summary:
Add types and an implementation for blame_v2.  This differs from the existing
blame definition as follows:

* Changeset IDs and paths are always stored as indexes into a mapping.

* The Changeset ID index is stable for the p1-parent chain of commits.  Although only
  the changeset IDs that are used in the blame are present, the index for a particular
  changeset ID doesn't change, unless it is added in a merged-in parent.

* The notion of rejection is merged into the blame definition.  This makes it more
  explicit that rejected parents are simply ignored by the blame algorithm.

Some bugs in the original blame algorithm are also fixed:

* Initially empty files don't cause a zero-length blame range that can never be deleted.

* Merges correctly recalculate origin offsets.

This blame implementation is not used yet.  It will be introduced in subsequent commits.

Reviewed By: StanislavGlebik

Differential Revision: D28183161

fbshipit-source-id: 3604ff7ff393220e13a69d0ad51247d7bfd80926
2021-05-06 05:45:49 -07:00
Mark Juggurnauth-Thomas
3d0ce2769d mononoke_types: add definition for blame_v2 thrift types
Summary:
Add thrift definitions for blame_v2.  This uses a map from integer id to
changeset id to avoid repeating 32-byte hashes in files with many blame ranges,
and to provide a stable integer index for changesets that can be used to
provide a more human-readable id for each blamed changeset.

Reviewed By: StanislavGlebik

Differential Revision: D28183163

fbshipit-source-id: a6ae01d92c3d3c022a1d412f2ba0046f08c2d9f1
2021-05-06 05:45:49 -07:00
Johan Schuijt-Li
e57f819b6e rage/debug output for schemes
Summary:
Add debug output to rage to make sure we have the relevant information in case
we need to debug issues with schemes.

Reviewed By: quark-zju

Differential Revision: D28222910

fbshipit-source-id: 9499c736d61b2c0e4568e05a3afc0ae9730acedf
2021-05-06 04:39:19 -07:00
Johan Schuijt-Li
c120560edf integrate hgext schemes into fb mercurial
Reviewed By: liubov-dmitrieva

Differential Revision: D28185505

fbshipit-source-id: 1eed74bf492c5f22abb7d616b9492eb2a549aead
2021-05-06 04:39:19 -07:00
Johan Schuijt-Li
395d04cecc import schemes hgext
Summary:
Import from upstream:
https://www.mercurial-scm.org/repo/hg/file/tip/hgext/schemes.py

at revision 47060:fde5bb5d1acf

Reviewed By: mitrandir77

Differential Revision: D28185506

fbshipit-source-id: 651398fb76adf0e05fcd22afd8f39e8f941919d5
2021-05-06 04:39:19 -07:00
Stanislau Hlebik
25bea26213 mononoke: allow duplicate filenodes to be sent
Reviewed By: krallin

Differential Revision: D28249888

fbshipit-source-id: 57e9976dba936c1fae4e3176ec9ea4d4b355c6fa
2021-05-06 03:31:19 -07:00
Stanislau Hlebik
d17de2cdb2 mononoke: avoid duplicates in get_manifests_and_filenodes
Reviewed By: krallin

Differential Revision: D28249720

fbshipit-source-id: b07cc51afdb174a4ff6f00473cf823a02f4e4d4e
2021-05-06 03:31:19 -07:00
svcscm svcscm
37cb232e02 Updating submodules
Summary:
GitHub commits:

60102ee803
40e5a9dc8d
d92dd0e53b
2f9c2704d9

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: ee2c2d0a3c872582d938de2ce4cad0892e707570
2021-05-06 03:21:03 -07:00
svcscm svcscm
abe8548ee7 Updating submodules
Summary:
GitHub commits:

a36ed0e284
e6cede6180
56f349eb8c
dddd7571f1
416940846c
d24f317e67

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 360ebc03c6234901b4d31aee3d60e2d7eec21632
2021-05-06 02:55:29 -07:00
svcscm svcscm
43cdd8216e Updating submodules
Summary:
GitHub commits:

099d79eec6
660318233c
903bc06c41
f50b0cea06
27a1ab6ee8
fdbee17681
fd2c3d267a
970b26038f
7648da13be

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: fbbdb2372198dd8a2abce1ae004689af073f5483
2021-05-06 02:25:48 -07:00
svcscm svcscm
5f887d947b Updating submodules
Summary:
GitHub commits:

500bc1e299
4fc38aa717
a164813237
2238349ca1
5d7a4acabe
beba7791a1
901699448f
c4839c91c1
5bfc563d54
9884fd340d
478eda534f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 31935a2319be291b6940410cf3e5539e04ee125b
2021-05-06 01:57:51 -07:00
svcscm svcscm
21646ca83e Updating submodules
Summary:
GitHub commits:

f796707d43
ea1cdd1ad9
f28e7644ee

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 7a3b9d6f8d964d6bf829a4d522899ad8589768e0
2021-05-06 00:49:51 -07:00
svcscm svcscm
e90f9e4dff Updating submodules
Summary:
GitHub commits:

580f6b2cc5
69b6ccea74
11c3e90b23
8623e854b2
9f66c2958c

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: cd5502de6b75ba538cdf7bafc2a41d180ff08fa2
2021-05-05 23:20:43 -07:00
svcscm svcscm
f57c3678f7 Updating submodules
Summary:
GitHub commits:

9516e8da6b
bc9429ff7c
eaf988198d
7c2ef833c4
3cbd51670b
c44f437b5a

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: a9fa46e25adffff05a11b13e65b0389d4afbbdd9
2021-05-05 22:52:10 -07:00
svcscm svcscm
10a5c59b53 Updating submodules
Summary:
GitHub commits:

c700dab235
7c64109269
53cae3f5a1
caeb6b2093
73543cdd75
ae21e609a3
758f95bc64
5c59713488
373669fe27

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: dc96d057bd58df7d495aaa95c5816207f93d4e3b
2021-05-05 22:26:47 -07:00
svcscm svcscm
b94ed0fcde Updating submodules
Summary:
GitHub commits:

f35142b483
de250d6522
342db746ec
6865bb446f
3880cd3786
549bfe55a5
4796d0eb58
033e40d76e
9039a6c67b
b4d1b4c5df
bde8e34474

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: fc51330610c41041f9d2973b16be4025e7711724
2021-05-05 21:46:57 -07:00
svcscm svcscm
b69cb5b365 Updating submodules
Summary:
GitHub commits:

2fad6225c1
0160eb7a87
d6804f2a67
a8a754aa1e
dd27f371df
1036621c0a
25e04dd78f
7e1bff5807
0ba0003382
0fe7a21c8a

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 55f404c86ea2ba034037cbc47b97b289f0a5a862
2021-05-05 21:12:06 -07:00
svcscm svcscm
0c6d1612bf Updating submodules
Summary:
GitHub commits:

598174dfec
c85d007708
e0e4c51c39
e382d3d807
66e7f0e18e
cd7e064739
6c5dd0d4d9
a435c43b9c
795fc129ca
ce709889de
fa1b165506

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: bbf35c9728ff3c95e004dd576b348b0e2f2726ad
2021-05-05 20:43:17 -07:00
svcscm svcscm
94a02857b3 Updating submodules
Summary:
GitHub commits:

b0b5dd8b47
7263834f05
3df1e50716
7605607e9f
b2c248afa3
c97dab45b7
2c6dca506f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 53da1024d62076ff7b2d71cd3c3d2fb00818214b
2021-05-05 20:15:52 -07:00
svcscm svcscm
fddac8f592 Updating submodules
Summary:
GitHub commits:

fd733a322c
a435d49358
4de29a64cc
411ba81b49
d0de96294b
7284903aa4
ae93ce486f
d8075c6080
9cd4c6d40f

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 34d49880203a0644b552aa97f3ed41bf96e1beb6
2021-05-05 19:42:19 -07:00
svcscm svcscm
2e146a0157 Updating submodules
Summary:
GitHub commits:

564aeaa175
56b55bb0d0
e1231573f0
3c3b0834d6
d87b737709
9bac120102
4815847893
3461dab4da
c8394c8173
3aaea24478
585d0a6695

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 94c195705dbc686df8868abbffcc6b9bade52e2b
2021-05-05 19:15:47 -07:00
svcscm svcscm
529de69654 Updating submodules
Summary:
GitHub commits:

2c3abf8336
4ba903d6d8
fec5e26278
0b29ff6560
5b60f81a76
b71b4597e7
aea71bcc0a
3fc935f1a7
c19814900f
d9f42f914d
40b8def013

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 6c18674b336efcddf7aafe960028f3dc483b0776
2021-05-05 18:38:55 -07:00
Zeyi (Rice) Fan
dfc5480620 cli: disable edenfsctl top for Windows
Summary:
Currently running `edenfsctl top` will crash on Windows:

```
Traceback (most recent call last):
  File "C:\Python38\Lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python38\Lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\tools\eden\bin\edenfsctl.exe\__main__.py", line 3, in <module>
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 2253, in zipapp_main
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 2236, in main
  File "C:\Python38\Lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "C:\Python38\Lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 2212, in async_main
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\main.py", line 1059, in run
  File "C:\tools\eden\bin\edenfsctl.exe\eden\fs\cli\top.py", line 395, in __init__
  File "C:\Python38\Lib\curses\__init__.py", line 13, in <module>
    from _curses import *
ModuleNotFoundError: No module named '_curses'
```

This diff will let it prints an error message.

Reviewed By: xavierd

Differential Revision: D28207330

fbshipit-source-id: a465fe5941b469f4a1ef964f1d4dc8a593639e7c
2021-05-05 18:24:12 -07:00
Zeyi (Rice) Fan
bd08aac957 cli: parse command line args outside asyncio
Summary:
It looks like argparse's exit was not able to handle asyncio event loop well,
causing edenfsctl to generate a long ugly stack trace when the command line
flag does not parse.

Let's just move the arguments parsing outside the asyncio runloop to avoid this
problem as a whole. In theory it should improve our `--help` time a little bit.

Reviewed By: chadaustin

Differential Revision: D28206622

fbshipit-source-id: 881eefaea73b244eadff0165965085e64dad935f
2021-05-05 18:24:12 -07:00
Zeyi (Rice) Fan
70f7b5151b cli: do not call os.getuid on Windows
Summary:
Some user reported to see `edenfsctl restart` crashes due to this call to
os.getuid() since it does not available on Windows. P410914264

https://docs.python.org/3.9/library/os.html#os.getuid

Reviewed By: chadaustin

Differential Revision: D28204262

fbshipit-source-id: 077bf207d8b1b6c014fface63ea93e66057629cd
2021-05-05 18:24:12 -07:00
Jun Wu
7a0765ab25 edenapi: do not dependent on eagerepo
Summary:
eagerepo -> metalog -> git2 -> libgit2-sys -> libgit2 conflicts with edenfs'
non-Rust libgit2 dependency. Rust git2 crate does not seem to provide a way to
depend on specified libgit2.

Quote https://github.com/rust-lang/git2-rs/issues/263#issuecomment-450934287:

> It's expected that git2-rs builds its own copy of libgit2 and doesn't use the
> system version, as the system version is likely incompatible

It also seems non-trivial to make buck C++ use the libgit2 frm `libgit2-sys` crate.

Let's just avoid depending on eagerepo from edenapi directly for now to solve the
issue. This basically revives D27948369 and D27951632.

Reviewed By: xavierd

Differential Revision: D28243784

fbshipit-source-id: 0c38c20c2d3a80c550732129da572fe26a229799
2021-05-05 18:21:00 -07:00
Jun Wu
2cf4957de0 runtests: expand $TESTTMP in hgrc
Summary:
This makes it easier to use `--keep` to investigate tests by using
`--configfile`.

Reviewed By: kulshrax

Differential Revision: D27971122

fbshipit-source-id: 8adcbeab825155858499c24ca74c2979049adeda
2021-05-05 17:53:39 -07:00
svcscm svcscm
1f15cf3b18 Updating submodules
Summary:
GitHub commits:

f803887df1
5b8c5c0715
16833bb599
6b44cc3c69
64224c7d14
bda6e2761e
5bd6e118b1
581f776223
c7a8edad83
ec45d65965
4d78414a26

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: dbd2f7923088baecf5bc4581bf27904d8932b6ad
2021-05-05 17:42:15 -07:00
svcscm svcscm
8af82e5fa2 Updating submodules
Summary:
GitHub commits:

54390806d3
cad4e8eb91
c724ca0028
e2ca17cb61
2b2acdd544
b38c082d9c
7f3a0f5bc6
2a573471e8
3c20752357
839a334e05
62f1e1f31d
9f0712af2f
87c2a839b6

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 4e5bfb200d619748154f5ca4f18cccc9c5878d65
2021-05-05 17:11:36 -07:00
svcscm svcscm
46f76341e0 Updating submodules
Summary:
GitHub commits:

58d9455f6d
f5d4543107
ac755fc5cc
960eca25fa
6ece04fde9
72c0edf6a8
455fe52d4d
3adb30d439
6cd1e8f174
569b057adc
4e53a4fd83

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 9e3717c566071a3f20dfd38c13c0131f662f157b
2021-05-05 15:57:07 -07:00
Stefan Filip
f6c588a7a0 context: rename CoreContext's base constructor
Summary:
Rename `new_with_containers` to `new`. `new` the standard name for
what the fuction does.

Reviewed By: krallin

Differential Revision: D28210005

fbshipit-source-id: 9ad0dad5e8afd89d7538fd32d93de10837e26f9d
2021-05-05 15:29:26 -07:00
Stefan Filip
0eabd94e5f context: remove CoreContext::test_mock_class
Summary:
Refactoring the construction logic for CoreContext.
`test_mock_class` is used in only one place. That usage can be replaced with
`test_mock_session`.

Reviewed By: krallin

Differential Revision: D28210007

fbshipit-source-id: c81ca31cb7255ef640fe641e9b38f239cfb69267
2021-05-05 15:29:26 -07:00
Stefan Filip
86ef0755d4 context: rename CoreContext contructor for bulk processing
Summary:
Refactoring CoreContext construction to express purpose. We will have
a constructor for request processing, for background processing.
Bulk processing is another category that has it's own constructor
already. Renaming it to make it more prominent.

Reviewed By: krallin

Differential Revision: D28210006

fbshipit-source-id: 2bb74d97e2f3588aa539e58c3d6dd6842f898121
2021-05-05 15:29:26 -07:00
svcscm svcscm
b6bab5db73 Updating submodules
Summary:
GitHub commits:

99339ebd35
70e6fa2788
e299825f74
4e46fb838b
72d7ddc39a
8948dc8524
8ceb9ecab0
312d1b4da7
2417f0bc3f
b97400224a
af95c3ff7b
1a545ad0a3
eb47d7a79e
dae9f8ffa0

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 5e409a1171eeaea55a0ddb4458aa94d7d61f4a77
2021-05-05 15:22:30 -07:00
Zeyi (Rice) Fan
9d64cd399d backingstore: fix winhttp linkage issue
Summary:
We have a linker issue on Windows when building EdenFS with CMake:

```
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpSetStatusCallback referenced in function winhttp_connect
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpOpen referenced in function winhttp_connect
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpCloseHandle referenced in function winhttp_close_connection
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpConnect referenced in function winhttp_connect
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpReadData referenced in function winhttp_stream_read
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpWriteData referenced in function winhttp_stream_read
backingstore.lib(winhttp.o) : error LNK2019: unresolved external symbol __imp_WinHttpQueryOption referenced in function certificate_check
```

This fixes that.

Reviewed By: xavierd

Differential Revision: D28230163

fbshipit-source-id: f74e42ee30ec8f3b81c1f80b7cf63a21ea97732c
2021-05-05 15:01:01 -07:00
Zeyi (Rice) Fan
a500f985d3 integration: fix test failure on Windows
Summary: This should fix the test failure introduced in D28203778 (9bee308885) where fsck tests were not skipped on Windows.

Reviewed By: genevievehelsel

Differential Revision: D28227230

fbshipit-source-id: 97ef5717fbda567b48f02a60e1906e374fdc6766
2021-05-05 15:01:01 -07:00
Pedro Eugenio Rocha Pedreira
1648be1bcf Add re2 as a dependency on getpdeps
Summary: Add re2 as a dependency on getpdeps

Reviewed By: funrollloops

Differential Revision: D28208007

fbshipit-source-id: 7e6ab7a0a01f4b2fe264780e09befc34a030a896
2021-05-05 14:37:17 -07:00
Jun Wu
f347dc94f9 remotefilelog: do not use f strings
Summary: The syntax is not supported by Python 2.

Reviewed By: DurhamG

Differential Revision: D28233280

fbshipit-source-id: 9f882827b1357cb339e60180acadb38842c3cf8d
2021-05-05 13:30:11 -07:00
Jun Wu
2e07267f2d remotefilelog: do not use **kwargs,
Summary: The syntax is not supported by Python 2.

Reviewed By: DurhamG

Differential Revision: D28232995

fbshipit-source-id: 62058751b4f00b78a2bd56908100a7bb7a3adfde
2021-05-05 13:22:30 -07:00
Alex Hornby
da5dac311b rust: remove patch for async-compression
Summary: Upstream crate has landed my PR for zstd 1.4.9 support and made a release, so can remove this patch now.

Reviewed By: ikostia

Differential Revision: D28221163

fbshipit-source-id: b95a6bee4f0c8d11f495dc17b2737c9ac9142b36
2021-05-05 12:20:34 -07:00