Commit Graph

63574 Commits

Author SHA1 Message Date
svcscm
afd8cda82b Updating submodules
Summary:
GitHub commits:

e37262d4da
14ad881c2c
7319b74d5e

Reviewed By: wittgenst

fbshipit-source-id: 5dfd56a1e3ee375c90bc2de42bc65348ee3f4a52
2021-03-03 13:40:49 -08:00
svcscm
82b8c33803 Updating submodules
Summary:
GitHub commits:

940d589e20
e0a2e71139

Reviewed By: wittgenst

fbshipit-source-id: 8a50571fa4b446b816d778a6c2c92a0b2633a76e
2021-03-03 12:44:12 -08:00
Aida Getoeva
fc0d0732c5 mononoke/validate-owners: implement secure-owners check
Summary: For the OWNERS files in `secure` and `core` we need to check that all the groups and users mentioned in the OWNERS are in the secure owners group.

Reviewed By: StanislavGlebik

Differential Revision: D26761772

fbshipit-source-id: 02ad2bc45c82792e51702cd4d8d092557c76c015
2021-03-03 12:40:07 -08:00
svcscm
355232b627 Updating submodules
Summary:
GitHub commits:

562942c238
6cca267dff
7b1266d32e
11afccafc2

Reviewed By: wittgenst

fbshipit-source-id: e1bc7c66c61166613a9acc355bf2416e08f86979
2021-03-03 12:07:04 -08:00
Stanislau Hlebik
f1772e601f mononoke: use darkstorm repo id as a counter repo id if specified
Summary:
When we are using hg sync job to backup a darkstorm repository we need to read
latest commits from source mononoke repo, however use darkstorm repo id for
counters - otherwise there will be two sync job using the same counter (i.e.
mononoke -> hg and mononoke -> darkstorm) and that wouldn't end well.

This diff does that. I also changed our tests a bit to always set
--darkstorm-repo-id option, since we are going to use it in prod anyway.

Differential Revision: D26782326

fbshipit-source-id: 0f6188047fe3d01dfa7bf7b3eb407e4f2c9a5d09
2021-03-03 12:03:53 -08:00
svcscm
f63d64bc05 Updating submodules
Summary:
GitHub commits:

c1406faeb5
a14ce83cb5

Reviewed By: wittgenst

fbshipit-source-id: fd0f56c9224c4a3dd316f309d51bf9b58445bbb8
2021-03-03 10:16:14 -08:00
Jun Wu
1bde2cd85b doctor: use remotenames serialization APIs from bookmarks.py
Summary: Avoid duplication about the serialization logic.

Reviewed By: DurhamG

Differential Revision: D26707455

fbshipit-source-id: cf2f1926fe74b51bf052f6c2c041b26d6f31de97
2021-03-03 09:33:34 -08:00
Jun Wu
5a155dbb3d remotenames: extract remotenames serialization to a separate method
Summary:
Provide a method that does pure serialization from (name, node) pairs to the
remotenames blob.  This makes it reusable outside `vfs` or `repo` context.

Reviewed By: DurhamG

Differential Revision: D26707454

fbshipit-source-id: c45662922d337e31d17070e5f5828d47e23773b1
2021-03-03 09:33:34 -08:00
svcscm
ef98a1c6d5 Updating submodules
Summary:
GitHub commits:

ffd51f4033

Reviewed By: wittgenst

fbshipit-source-id: 0a25812520c4902d16fa88f13a26b95f8c9db001
2021-03-03 09:14:04 -08:00
Liubov Dmitrieva
02c0705012 previous filter didn't work to get rid of the public commits in commit cloud
Summary:
sometimes in visible heads the hashes of the remote bookmarks are not the latest, so the filtration like it was initially implemented didn't work

if visible heads are polluted, it makes commit cloud operations slow but at least this correct check won't allow public heads to enter workspaces

moreover, after roll out it will fix already existing workspaces with public heads automatically by removing them from workspaces

also, this will allow our magic script to fix remote bookmarks in workspaces to work properly (debugfixcommitcloud), unfortunately now it can break a workspace if we remove bookmarks but not heads

cc quark-zju - could we fix the initial issue how the public heads can enter visible heads in some cases in pull logic? I have a repro if you are interested in.

Reviewed By: singhsrb

Differential Revision: D26778632

fbshipit-source-id: 05dbd4cd415911283ea66ae17772b8d3e458bbd7
2021-03-03 08:56:25 -08:00
svcscm
35f044481e Updating submodules
Summary:
GitHub commits:

2c06b32a70
0315b66020
2ff69026bf
b4829c9f5b
4838648ba7
ea14a78016
c7d18be522
bd6da581ef
dfa3453aee
eaf628a88b
4b3e51f433

Reviewed By: wittgenst

fbshipit-source-id: 11352ceea60386a809dfe62feb8e9dfec26fe428
2021-03-03 08:56:25 -08:00
svcscm
c4a7005400 Updating submodules
Summary:
GitHub commits:

a746db3584
8ff51fef58
d1d3d13ac2
30ba5616c8
7422516dce
8bb5d9f008
aa46cfb791
72d1e258cd
589ad3946e
c4afffca66
8977cc842e
f64122486e
b2e2085eaf
8f933b5915
8f14383583
0b42e07216
b49fc475a8
5ed1e8c3b2
507a0ebbd9
7f07f44428

Reviewed By: wittgenst

fbshipit-source-id: 5c9c9c449759132f4f859392eed80449ae05ad5f
2021-03-03 08:17:30 -08:00
Stanislau Hlebik
85fc62cb0d mononoke: fix ordering in "mononoke_admin bookmarks log"
Summary: Previously they were returned in random order. This diff fixes it.

Reviewed By: krallin

Differential Revision: D26778558

fbshipit-source-id: bb8eef4f6dadb6b09227d7140c2a462a471550b3
2021-03-03 08:08:36 -08:00
Jan Mazur
d5e9c99e09 change hipster action in check_if_trusted
Summary:
It doesn't make a whole lot of sense to user the "tupperware" permission here.
Lets make a distinction in who is allowed to provision mononoke vs. who is allowed to forward identities to it.
I have created a separate action with the same identities allows as in the "tupperware" permission.

https://www.internalfb.com/intern/hipster/acls/view/?type=TIER&consumer=mononoke

Reviewed By: StanislavGlebik

Differential Revision: D26777489

fbshipit-source-id: d3999dc4da7a57ac721572610f65eba664e595e9
2021-03-03 06:35:11 -08:00
Thomas Orozco
ef7045e818 common/rust: use fbinit-tokio
Summary:
This diffs add a layer of indirection between fbinit and tokio, thus allowing
us to use fbinit with tokio 0.2 or tokio 1.x.

The way this works is that you specify the Tokio you want by adding it as an
extra dependency alongside `fbinit` in your `TARGETS` (before this, you had to
always include `tokio-02`).

If you use `fbinit-tokio`, then `#[fbinit::main]` and `#[fbinit::test]` get you
a Tokio 1.x runtime, whereas if you use `fbinit-tokio-02`, you get a Tokio 0.2
runtime.

This diff is big, because it needs to change all the TARGETS that reference
this in the same diff that introduces the mechanism. I also didn't produce it
by hand.

Instead, I scripted the transformation using this script: P242773846

I then ran it using:

```
{ hg grep -l "fbinit::test"; hg grep -l "fbinit::main"  } | \
  sort | \
  uniq | \
  xargs ~/codemod/codemod.py \
&&  yes | arc lint \
&& common/rust/cargo_from_buck/bin/autocargo
```

Finally, I grabbed the files returned by `hg grep`, then fed them to:

```
arc lint-rust --paths-from ~/files2 --apply-patches --take RUSTFIXDEPS
```

(I had to modify the file list a bit: notably I removed stuff from scripts/ because
some of that causes Buck to crash when running lint-rust, and I also had to add
fbcode/ as a prefix everywhere).

Reviewed By: mitrandir77

Differential Revision: D26754757

fbshipit-source-id: 326b1c4efc9a57ea89db9b1d390677bcd2ab985e
2021-03-03 04:09:15 -08:00
Thomas Orozco
a17cd28156 common/rust: introduce fbinit-tokio
Summary:
This introduces a couple "trampoline" crates to use alongside fbinit in order
to let callers choose which version of Tokio they want by selecting one or the
other and adding it to their `TARGETS` alongside `fbinit` (right now, they
need to include `tokio` there).

The entrypoints here will be called by the expansion of the `#[fbinit::main]`
and `#[fbinit::test]` macros for `async fn`-s.

Right now, this isn't wired up: that happens in the next diff. In this diff,
I'm just adding the two entrypoints.

Reviewed By: mitrandir77

Differential Revision: D26754751

fbshipit-source-id: 1966dadf8bbe427ce4a1e90559a81790d8e56e7a
2021-03-03 04:09:15 -08:00
Ilia Medianikov
58b9ac23ef mononoke: Don't create separate ConfigStore's in tests
Summary:
Atm in tests a separate ConfigStore with file source is created for some configs and then a reference to it is dropped immediately ([see get_config_handle function in mod.rs](https://fburl.com/diffusion/fpkj7ekv)). This is uncomfortable as we may need a reference to e.g. force update configs in tests.

Instead of creating separate stores we can reuse static configerator which already uses local files (in tests).

Reviewed By: krallin

Differential Revision: D26725515

fbshipit-source-id: 24269cd93b7d35216c025807c3f3eb527688b72b
2021-03-03 03:52:41 -08:00
Mark Juggurnauth-Thomas
472e1f8ce2 mononoke_api: list public bookmarks from the warm bookmarks cache
Summary:
For public bookmarks, we can avoid querying the database and instead serve
`list_bookmarks` from the warm bookmarks cache.  The listed bookmarks might
be slightly old, but only because derived data is still in progress, and so
listing the older bookmark value is a better choice.

The tests now need a way to make sure that the warm bookmark cache is
up-to-date, so add a `sync` method that waits for a complete cycle of the warm
bookmark cache update thread.

Reviewed By: StanislavGlebik

Differential Revision: D26693444

fbshipit-source-id: 7145964bdb8c22d98ab6a2bb8c5091c19addd03e
2021-03-03 02:43:49 -08:00
Xavier Deguillard
ec1307cacb eden: only fetch data during a prefetch
Summary: EdenFS doesn't need the history, therefore let's not spend time prefetching it.

Reviewed By: fanzeyi

Differential Revision: D26767634

fbshipit-source-id: 7113f4ce79fdef5455a2bb238ab9d51b7339d8b6
2021-03-02 19:37:38 -08:00
Jun Wu
eb56d0ce7c remotenames: extract remotenames parsing to a separate method
Summary:
Parsing the remotenames (blob) into a list of name -> node pairs.
This makes it reusable outside `vfs` or `repo` context.

Reviewed By: DurhamG

Differential Revision: D26707457

fbshipit-source-id: e6c8bd9ff14d0fea9209c25b89fe733675da747e
2021-03-02 18:16:13 -08:00
Jun Wu
2297596687 absorb: use new memctx APIs
Summary:
Use the new memctx.mirror and memctx.__setitem__ APIs. This simplifies the
code.

Reviewed By: DurhamG

Differential Revision: D26726474

fbshipit-source-id: 044616137b883ca250e6d84c0ecfcc70458ec07a
2021-03-02 18:12:35 -08:00
Jun Wu
fb55069903 dirsync: improve performance for codemods
Summary:
Use the Rust tree matcher to rule out files that do not need dirsync quickly.
This should make codemod faster to commit.

I created 5000 files outside dirsync config in fbsource (with 494 lines of
dirsync config), and `hg add` them:

  $ mkdir unused
  $ cd unused
  $ for f in `seq 5000`; do touch $f; done
  $ hg add .

Baseline "status":

  In [3]: %time repo.status();1
  CPU times: user 111 ms, sys: 10.2 ms, total: 122 ms
  Wall time: 148 ms

Before, dirsync overhead is ~8x "status":

  In [1]: %time x.dirsync.dirsyncctx(repo[None])
  CPU times: user 1.37 s, sys: 28.8 ms, total: 1.4 s
  Wall time: 1.79 s
  Out[1]: (<workingctx f23d7c84c5a7+>, set())

  In [2]: %time x.dirsync.dirsyncctx(repo[None])
  CPU times: user 1.07 s, sys: 8.41 ms, total: 1.08 s
  Wall time: 1.11 s
  Out[2]: (<workingctx f23d7c84c5a7+>, set())

After, dirsync overhead is ~1/2 of "status":

  In [1]: %time x.dirsync.dirsyncctx(repo[None])
  CPU times: user 203 ms, sys: 18.9 ms, total: 222 ms
  Wall time: 245 ms
  Out[1]: (<workingctx 8ff14e46c9d8+>, set())

  In [2]: %time x.dirsync.dirsyncctx(repo[None])
  CPU times: user 154 ms, sys: 24.1 ms, total: 178 ms
  Wall time: 202 ms
  Out[2]: (<workingctx 8ff14e46c9d8+>, set())

Reviewed By: DurhamG

Differential Revision: D26726476

fbshipit-source-id: e34218769c779c9a4ee64c654c75298b7c79f213
2021-03-02 18:12:35 -08:00
Jun Wu
7f2e472696 dirsync: add a test about in-memory rebase
Summary: Now dirsync works with IMM rebase. Add a test for it.

Reviewed By: DurhamG

Differential Revision: D26726478

fbshipit-source-id: 6712538d7e903ddb0e3c3df44f7dde638276e99d
2021-03-02 18:12:35 -08:00
Jun Wu
82b71b144c dirsync: add a test about absorb
Summary: Now dirsync works with absorb. Add a test for it.

Reviewed By: DurhamG

Differential Revision: D26726477

fbshipit-source-id: 4505ad6c1e1fd03bfb2cf12b46bd07c98f2bcc2b
2021-03-02 18:12:35 -08:00
Jun Wu
5ceeb5311d dirsync: improve in-memory commit compatibility
Summary:
Previously, dirsync wraps `repo.commit`, requires an on-disk working copy,
and dirstate to work properly. This diff updates dirsync to wrap
`repo.commitctx` instead, do commit edits purely in memory, then sync the
commit back to disk. It makes dirsync compatible with absorb and in-memory
rebase (and potentially other things like drawdag, if drawdag's context APIs
are improved).

To sync the changes made in-memory back to the filesystem, a dirstate callback
is added to write back mirrored files from commit to disk. This works for both
amend and absorb so the special wrapper about amend is dropped. It is
also optimal for absorb, because it only writes the mirrored files once for
the "final" commit, instead of writing the files for each commit in the stack.

Some `O(N^2)`s (N: len(status)) complexities were avoided:
- `applytomirrors` was called N times.
- `allchanges = set(status.modified + status.removed + status.added)` in
  `applytomirrors` was O(N).
- `sourcepath in status.removed` in `applytomirrors` was O(N).
- `mirrorpath in status.removed` in `applytomirrors` was O(N).

Note there is still a suboptimal complexity of `getmirrors` called per changed
path, `O(N*M)` (N: len(status), M: len(dirsync_conig)). That will be addressed
in a later diff.

Reviewed By: DurhamG

Differential Revision: D26726479

fbshipit-source-id: 482c6c830ab65cc0d9cd569a51ec610a1dac49cc
2021-03-02 18:12:34 -08:00
Luca Niccolini
c2b72cab87 disable --allow-system-packages for generate-github-actions
Summary: Fix github actions builds for projects depending on zstd

Reviewed By: wez

Differential Revision: D26743251

fbshipit-source-id: a3fd8a14750227d025bff763cca8aa683b26a422
2021-03-02 16:32:03 -08:00
Xavier Deguillard
c8f7601481 fs: remove TreeInode::getAttrLocked
Summary: This is unused, and it has a hard dependency on Fuse, so let's remove it.

Reviewed By: chadaustin

Differential Revision: D26742212

fbshipit-source-id: 091556be39e599512d34920503083d03d4c5a0c2
2021-03-02 15:06:34 -08:00
Xin Tong
e882926adb configs: add hostprefix configuration condition to Mercurial
Summary:
## Why this diff
we want hostname prefix to support targeting configs at clients in corp ("corp" means laptop, labs, and other machines that are not in "prod" datacenters), like FRL machines, that don't support our existing tier mechanism.

## Changes
* Extract hostname prefix in `dynamicconfig.rs` and add a getter function `hostname_prefix()` for it.
*A hostname prefix only consists of alphabetical letters and dashes, which is followed by one or more digits in the hostname. If no valid match, the prefix is set to the empty string.*

* Use `gen.hostname_prefix()` in the `evaluate()` fn inside `mod.rs` to check the generator's prefix against a list of given prefixes.
* Copy changes from `configerator/source/scm/hg/hgclientconf/hgclient.thrift` to `fbsource/fbcode/configerator/structs/scm/hg/hgclientconf/hgclient.thrift`.
* Rebuild in `eden/scm/`.

Reviewed By: DurhamG

Differential Revision: D26706686

fbshipit-source-id: 725506a1c1f0983e981b0b3f3993c7c14510b1db
2021-03-02 12:58:05 -08:00
Durham Goode
752c5ccff5 tests: remove test environment when running system hg
Summary:
dynamicconfig has logic to avoid loading remote configs during tests,
by checking the TESTTMP variable. Unfortunately, the tests currently run system
hg with that environment set, which causes it to generate incorrect
configuration for the real repository (i.e. fbsource).

Let's get rid of all test specific environment variables when running the system
hg. There's a comment in the code saying this breaks some tests (from 2017
03a31be593db), but as far as I can see they still work.

Reviewed By: quark-zju

Differential Revision: D26758364

fbshipit-source-id: 945cbd36f7eccc98149772a42421cbc51b157c5b
2021-03-02 12:53:57 -08:00
Durham Goode
6451219968 tests: fix test-doctor.t on OSX
Summary:
The new test case failed on Mac because it didn't want to copy over a
symlink or something. Didn't dig too deep because 'rm -rf' works around it.

Reviewed By: sfilipco

Differential Revision: D26758985

fbshipit-source-id: 22ad7e23813bd6bfe86b91535d46c21ee59dfcd1
2021-03-02 11:47:30 -08:00
Jun Wu
72e808693f context: support nonfilelogfctx.cmp(nonfilelogfctx)
Summary:
`nonfilelogfctx` means the `fctx` does not have a backing filelog, is in-memory.
Previously, one of the `fctx` is assumed to be backed by a concrete filelog,
it will crash if that is no satisfied.

Reviewed By: DurhamG

Differential Revision: D26731810

fbshipit-source-id: f758f43dc140dbf6cc9b6234681c4830482e767a
2021-03-02 11:05:23 -08:00
Jun Wu
5b929eb82c context: fix memctx.status.removed corner case
Summary:
In a corner case, `mctx[f]` is `None`, and `f` does not exist in both parents.
The `f` should not appear in te `added` status list.

Fix it and remove a duplicated call to `managing`.

Reviewed By: DurhamG

Differential Revision: D26726482

fbshipit-source-id: f386ad9eb27bf053fb671e0f187aaada4699e84e
2021-03-02 11:05:23 -08:00
Jun Wu
6a31518480 context: support workingfilectx.cmp(workingfilectx)
Summary:
This is used by next diffs.

Test code:

  In [3]: v=repo[None]['.gitignore']
  In [4]: v.cmp(v)

Before:

  RuntimeError: maximum recursion depth exceeded

After:

  Out[4]: False

Reviewed By: DurhamG

Differential Revision: D26726481

fbshipit-source-id: c27a8f414313f262d0f596b058df580f9216e8fc
2021-03-02 11:05:22 -08:00
Jun Wu
2e52c0da0e context: add memctx.mirror for making context mutable
Summary:
Not all context objects support the `__setitem__` API. Instead of adding supports
for all of them, let's add an API to create a `memctx` that mirrors the changes
from another `ctx` so one can them do mutations on the `memctx`. This will be
used by dirsync.

This might also be useful in other "amend" cases, because the `mirror` API takes
various kinds of context (workingctx, changectx, memctx), and is straihtforward
to use:

  In [2]: v=m.context.memctx.mirror(repo['.'])

  In [3]: v.commit()
  Out[3]: 'b\xdeF\xbb\xbb&\xe5\xdbvJ\x16\xf2\xc3\x92\x96Mr\xb7\x85\xbb'

  In [4]: repo['.'].node()
  Out[4]: 'b\xdeF\xbb\xbb&\xe5\xdbvJ\x16\xf2\xc3\x92\x96Mr\xb7\x85\xbb'

  In [5]: v['x']=v['.gitignore']

  In [6]: v.commit()
  Out[6]: 'b\xdeF\xbb\xbb&\xe5\xdbvJ\x16\xf2\xc3\x92\x96Mr\xb7\x85\xbb'

Reviewed By: DurhamG

Differential Revision: D26726480

fbshipit-source-id: 629cfc721f79d29ef395d4e1d6b3381f0095d573
2021-03-02 11:05:22 -08:00
Jun Wu
691bc90d13 context: make memctx mutable
Summary:
Add `memctx.__setitem__(path, fctx)` API to change a file in memctx. This will
be used in upcoming dirsync changes.

Regarding on `memctx` vs `overlayworkingctx`. Both need some changes to fit the
dirsync use-case (overlayworkingctx needs "amend", not "commit on top of",
memctx needs to be mutable).

The main difference is `overlayworkingctx` uses a concrete `cache` dict for
path, data, and metadata. `memctx` uses a concrete list of file paths, but file
data, metadata is abstracted - it uses a function that returns fctx. I would
like to preserve the laziness of reading files and metadata (especially for LFS),
so I picked the `memctx` instead of `overlayworkingctx` as the starting point.

Reviewed By: DurhamG

Differential Revision: D26726475

fbshipit-source-id: 7c16980ffa1c83fe0ff6d70c60b1daae5e266683
2021-03-02 11:05:21 -08:00
Jun Wu
71adfaf595 http-client: move streaming request report to report_result_and_drop_receiver
Summary: This simplifies the code a bit.

Reviewed By: kulshrax

Differential Revision: D26681779

fbshipit-source-id: 393565790ab711dd09ae6cfa6f9c4b19c930eb93
2021-03-02 10:40:08 -08:00
Jun Wu
24b52eb508 http-client: HandlerExt::monitor_progress -> RequestEventListeners::on_progress
Summary:
Similar to D26670318, use the EventListeners APIs to implement the progress
callback.  Now HandlerExt only has RequestContext related "as_ref" logic.

Reviewed By: kulshrax

Differential Revision: D26681778

fbshipit-source-id: b7f6e07ced43e0ae043e859337c06b69bd5dfc95
2021-03-02 10:40:08 -08:00
Jun Wu
2a63701b19 http-client/progress: drop mut on ProgressUpdater
Summary: This makes it useful in non-mut callbacks.

Reviewed By: kulshrax

Differential Revision: D26681784

fbshipit-source-id: 97312df8bf3f900a36cbeb27206a2946bb6c702c
2021-03-02 10:40:08 -08:00
Jun Wu
3232dd18bd http-client/progress: Rc<RefCell> -> Arc
Summary: This makes ProgressUpdater Send + Sync so it can be used in the new callback APIs once `mut` gets dropped.

Reviewed By: kulshrax

Differential Revision: D26681781

fbshipit-source-id: 9c622b1d78b4091e3359c28972b6624f0b53734d
2021-03-02 10:40:07 -08:00
Jun Wu
33474a3258 http-client/progress: move "if_changed" check from Inner to Reporter
Summary:
This removes more mutable fields. Note the new code is more correct because
curl can call the `progress` callback periodically even if no progress is made.
According to https://curl.se/libcurl/c/CURLOPT_PROGRESSFUNCTION.html:

  This function gets called by libcurl instead of its internal equivalent with
  a frequent interval. While data is being transferred it will be called very
  frequently, and during slow periods like when nothing is being transferred it
  can slow down to about one call per second.

Reviewed By: kulshrax

Differential Revision: D26681780

fbshipit-source-id: 19aa4bcb4c56623e3f0408b06041b3a894f197e7
2021-03-02 10:40:07 -08:00
Jun Wu
bdfed84cb9 http-client/progress: use interior mutability for total_progress
Summary:
This makes the `total_progress` field use lock-free interior mutability. The
goal is to eventually drop Rc and RefCell.

Reviewed By: kulshrax

Differential Revision: D26681782

fbshipit-source-id: ec0a6abbb2115c17c674db2255d196aaec847705
2021-03-02 10:40:07 -08:00
Jun Wu
b5bb45cdbf http-client/progress: Option -> OnceCell
Summary: This removes the need for `mut` for this field.

Reviewed By: kulshrax

Differential Revision: D26681783

fbshipit-source-id: 10ed9adfb62081b0e6839abd9534db92d4e056c5
2021-03-02 10:40:07 -08:00
Jun Wu
1a83932440 http-client/progress: only keep total progress for ProgressInner
Summary:
The ProgressInner only exposes APIs for total (aggregated) progress.  There is
no API to read individual progress. Make it only track the total progress. This
would make it easier to implement interior, lock-free mutability on ProgressInner.

The updater now needs `mut` temporarily, which will be dropped later (D26681784).

A test case is tweaked so progress does not go backwards.

Reviewed By: kulshrax

Differential Revision: D26681777

fbshipit-source-id: 4ad1b9173d5a2c2326e00c030d51f77e9b9458f3
2021-03-02 10:40:06 -08:00
Jun Wu
5bd50aa886 http-client: make request clonable only in tests
Summary: This avoids misuses.

Reviewed By: kulshrax

Differential Revision: D26681776

fbshipit-source-id: 604cc5dd746a596bd6598a9d531261294b809cec
2021-03-02 10:40:06 -08:00
Jun Wu
0e6d628a19 http-client: add tests about event listeners
Summary: Test both the HttpClient and Request events.

Reviewed By: kulshrax

Differential Revision: D26670325

fbshipit-source-id: ffbc4268f7de698830411434a769c8b1a4acd863
2021-03-02 10:40:06 -08:00
Jun Wu
0dbdbcb95a http-client: move with_stats_reporting to event listener
Summary:
This simplifies the code a bit and makes it look consistent with other event
listeners.

Reviewed By: kulshrax

Differential Revision: D26670318

fbshipit-source-id: f6eda9403bb6eb09a074544e672a45c84f38e2b1
2021-03-02 10:40:05 -08:00
Jun Wu
17bc6238bf http-client: impl event listeners on RequestContext
Summary:
Add `RequestContext.event_listeners()` to register callbacks, and trigger the callbacks
when related events happen.

Reviewed By: kulshrax

Differential Revision: D26670323

fbshipit-source-id: 9b92b715444e83957c06b06f1ce696d4de3c0023
2021-03-02 10:40:05 -08:00
Jun Wu
ae7a37fd93 http-client: move HTTP body to RequestContext
Summary:
This simplifies the logic a bit. There is no need for
`HandlerExt::with_payload` that is similar to `Request::body`.

Reviewed By: kulshrax

Differential Revision: D26670326

fbshipit-source-id: 9fe755821062ad6f2a74d6d5ba345620669f0f63
2021-03-02 10:40:05 -08:00
Jun Wu
a5a11c0301 http-client: avoid cloning RequestContext
Summary: We're going to make RequestContext larger. Avoid cloning it.

Reviewed By: DurhamG

Differential Revision: D26670316

fbshipit-source-id: 75f500163391a71947b027b63ea266010b04f751
2021-03-02 10:40:05 -08:00
Zeyi (Rice) Fan
ee7b9b71e8 overlay: add option to turn on TreeOverlay
Summary:
This diff adds a gflag option to turn on `TreeOverlay`. As this diff, this
option only works on Windows.

Reviewed By: xavierd

Differential Revision: D25223471

fbshipit-source-id: ccab4c85cf4b08980e67814238457a8eb83af3dc
2021-03-02 09:58:18 -08:00