Commit Graph

58684 Commits

Author SHA1 Message Date
Durham Goode
e5a9446057 configs: exit debugdynamicconfig early if .hg isn't writable
Summary:
If we're running commands from a user that only has read access, the
debugdynamicconfig commands are going to fail. Let's exit early and quickly if
that's the case, instead of spending a lot of cpu generating a config only to
fail.

Reviewed By: quark-zju

Differential Revision: D22244127

fbshipit-source-id: 24f806772ba5c08e400efb3abc7ebda228d473a5
2020-06-30 09:50:44 -07:00
Durham Goode
b0f4136830 configs: limit how often we query the server for configs
Summary:
Since we are querying intern for remote configs, we don't want to spam
the servers with requests if they're down. Therefore let's implement some basic
rate limiting to prevent us from querying the server too often. The default
behavior is limiting it to once every 5 minutes.

We only generate new configs once every 15 minutes, so generally this rate limit
shouldn't have any effect, but if there are errors in the generation process
it's possible for generation to happen much more frequently, so this will guard
us from hitting the server too frequently.

Reviewed By: quark-zju

Differential Revision: D22243316

fbshipit-source-id: bbccaf63da95af1edc3128f4d2047a32f90e53ba
2020-06-30 09:50:44 -07:00
Durham Goode
3fbb5de94a configs: add an easy way to test config changes locally
Summary:
The HG_TEST_REMOTE_CONFIG environment variable was added to allow tests
to declare custom remote config values, but we can also use it to make canarying
easier.

With this change, users can do `HG_TEST_REMOTE_CONFIG=configerator hg
debugdynamicconfig` to test a change, after running arc build in their
configerator.

We might want to simplify this further in the future to some sort of hidden dev
command line flag, like `hg debugdynamicconfig --canary-remote`

Reviewed By: quark-zju

Differential Revision: D22081459

fbshipit-source-id: 07977097347af9d5872402beeda0ed9160176e7e
2020-06-30 09:50:44 -07:00
Durham Goode
ee51bf871f configs: apply remote configs during dynamic config generation
Summary: Now that we fetch remote configs, let's apply them locally.

Reviewed By: quark-zju

Differential Revision: D22079767

fbshipit-source-id: aafc9a2e1e6a60b7b6087eaf256dafce30ca5a1e
2020-06-30 09:50:44 -07:00
Durham Goode
977155ef99 configs: fetch remote configs during dynamic config generation
Summary:
Fetches configs from a remote endpoint and caches them locally. If the
remote endpoint fails to respond, we use the cached version.

Reviewed By: quark-zju

Differential Revision: D22010684

fbshipit-source-id: bd6d4349d185d7450a3d18f9db2709967edc2971
2020-06-30 09:50:44 -07:00
Durham Goode
4bf346b6ac configs: add hgclient_conf thrift structure to thrift-types
Summary:
Adds the hg client config thrift structure to thrift-types so we can
use it in both buck and make local.

Reviewed By: quark-zju

Differential Revision: D21875370

fbshipit-source-id: 45e585ca5a90307cbeb68240f210006986ec7e84
2020-06-30 09:50:44 -07:00
Mateusz Kwapich
15256a91be add an option to limit commit_history to descendants of commit
Summary: This will be used for commits_between replacement

Differential Revision: D22234236

fbshipit-source-id: c0c8550d97a9e8b42034d605e24ff54251fbd13e
2020-06-30 08:09:30 -07:00
Mateusz Kwapich
66a810a68c new history format
Summary: Some SCMQuery queries need just a list of commit hashes instead of full coverage.

Reviewed By: markbt

Differential Revision: D22165006

fbshipit-source-id: 9eeeab72bc4c88ce040d9d2f1a7df555a11fb5ae
2020-06-30 08:09:30 -07:00
Mateusz Kwapich
398ab603c2 add into_response that would map commit ids across identity schemes
Summary: This way we can go from list of changesets into changet ids that we're returning as an answer in few queries.

Differential Revision: D22165005

fbshipit-source-id: 4da8ab2a89be0de34b2870044e44d35424be5510
2020-06-30 08:09:30 -07:00
svcscm
ca644e16a3 Updating submodules
Summary:
GitHub commits:

ffe8edc295

Reviewed By: wittgenst

fbshipit-source-id: dfd3062a804d3b30ccdc209c8732826ca774c130
2020-06-30 07:24:54 -07:00
Stanislau Hlebik
c43ea517b0 mononoke: move derive_data_for_csids to derived_data_utils
Summary: It can be useful in other places as well, not only in blobimport

Reviewed By: krallin

Differential Revision: D22307314

fbshipit-source-id: f7d8c91101edc2ed4f230f7ef6796e39fbea5117
2020-06-30 06:22:31 -07:00
Mark Thomas
160936b732 bookmarks: convert to new-style BoxFutures and BoxStreams
Summary: Convert the bookmarks traits to use new-style `BoxFuture<'static>` and `BoxStream<'static>`.  This is a step along the path to full `async`/`await`.

Reviewed By: farnz

Differential Revision: D22244489

fbshipit-source-id: b1bcb65a6d9e63bc963d9faf106db61cd507e452
2020-06-30 02:37:34 -07:00
svcscm
eb48a233e2 Updating submodules
Summary:
GitHub commits:

01da43c282

Reviewed By: wittgenst

fbshipit-source-id: c1285dad6c3c85d5fe20f99c4ec82e89b94d2bc2
2020-06-30 02:37:34 -07:00
svcscm
2e61ecc230 Updating submodules
Summary:
GitHub commits:

d3ccb8e336
0ff36eaf68

Reviewed By: wittgenst

fbshipit-source-id: 81babd69ca22f71fe589646240e8206970ea58c2
2020-06-29 21:10:22 -07:00
Adam Simpkins
14a289528d fix a crash in edenfsctl top
Summary:
Older versions of EdenFS do not return the `fetchCountsByPid` field in the
`getAccessCounts()`.

The Python thrift client code returns this as `None` instead of as an empty
dictionary.  This behavior arguably seems like a bug in the thrift code, since
the field is not marked optional.  However, updating the thrift behavior would
have much wider implications for other projects.  Additionally it's probably
not worth putting a lot of effort in to the older "py" thrift generator code.

Update the `edenfsctl` code to explicitly use an empty dictionary if the value
received from the thrift call is `None`

Reviewed By: fanzeyi

Differential Revision: D22302992

fbshipit-source-id: eced35a19d86e34174f73e27fdc61f1e2ba6a57f
2020-06-29 20:43:01 -07:00
Jun Wu
766a404abd util: use tryunlink in gcdir
Summary:
`gcdir` is racy. Use `tryunlink` instead of `unlink` so files deleted by other
processes won't crash hg.

Reviewed By: kulshrax

Differential Revision: D22288395

fbshipit-source-id: c3a162871dd569ca7248df86f43d6287ca6d9aab
2020-06-29 20:39:15 -07:00
Jun Wu
43d7d8ce45 github: do not test stackdesc crate
Summary: It was removed by D22129585 (1020f76e7d). Skip testing it.

Reviewed By: kulshrax

Differential Revision: D22288183

fbshipit-source-id: 07b483028f75df5af9565c9ed693f2299d43f4b2
2020-06-29 20:39:15 -07:00
svcscm
804f9e6312 Updating submodules
Summary:
GitHub commits:

99cd43b87f
1619f3adb2
5be2cb6948

Reviewed By: wittgenst

fbshipit-source-id: 71b841df5d2e5d205072e400cb89d6eeabe68365
2020-06-29 18:56:16 -07:00
Jun Wu
b2ce9d0ef8 run-tests: do not wait for the progress thread
Summary:
Sometimes `Ctrl+C` the test runner does not fully stop it. From gdb it seems
the test runner is waiting for a thread which might have deadlocked. The
progress thread does not have anything critical that need to sync back to
the main program. Avoid waiting for it to make Ctrl+C work better.

Reviewed By: kulshrax

Differential Revision: D22290453

fbshipit-source-id: bdc5260cbd339cc392728834330609343c0048d3
2020-06-29 18:45:41 -07:00
Arun Kulshreshtha
1fd6e63d5f http_client: use TryInto to construct handles
Summary: Use `TryInto` to convert from a `Request` to a `curl::Easy2` handle, rather than using an inherent method. As with the previous diffs in this stack, the intent is to make it possible to work with handlers in a generic manner.

Reviewed By: quark-zju

Differential Revision: D22201913

fbshipit-source-id: 707c110334b41834f161abf625006a8b81e9d4eb
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
355e69f304 http_client: add trait for configuring handlers
Summary: Add a new `Configure` trait that provides a common interface for configuring handlers. This will allow handlers to be used in generic contexts, which will be important once we have more than one handler type.

Reviewed By: quark-zju

Differential Revision: D22201916

fbshipit-source-id: 3c297439d398e30a882889c51ea3b6cc33e7d12e
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
314f1d9a36 http_client: move header parsing into submodule
Summary: Move the code that splits headers into a new util submodule, so that it can be shared between handlers.

Reviewed By: quark-zju

Differential Revision: D22201911

fbshipit-source-id: ff3bcd1e166042593f3715fee67e87942e4f72f3
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
96f67f862b http_client: move Buffered into submodule
Summary: In preparation for adding a streaming handler, create a handler directory and move `Buffered` to a submodule therein.

Reviewed By: quark-zju

Differential Revision: D22201915

fbshipit-source-id: f90bb6a24dd2137900df825bd23a12201107e9cc
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
3fc3eb749b http_client: make client callback return a Result
Summary: Instead of returning a bool, make the client callback return a `Result`. A new error type called `Abort` has been added which the client can return to signal that the driver should abort all active transfers and return early. This results in more idiomatic code, and gives the callback the ability to specify the reason for the abort.

Reviewed By: quark-zju

Differential Revision: D22201912

fbshipit-source-id: 46d72e28f754132a4ef30defa40c4a5d09fe8e07
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
95a083a0fe http_client: move stats collection into driver
Summary: Move stats collection into `MultiDriver`. This makes sense from a design standpoint since the driver is the thing performing the requests. It will also reduce code duplication when streaming responses are added later in the stack.

Reviewed By: quark-zju

Differential Revision: D22201910

fbshipit-source-id: fd3174bb6f5a452901b405341b2c001dca1a9832
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
8560f22ec5 http_client: make HttpClient implement Send
Summary: Implement `Send` for `HttpClient`. I've split this out into its own diff since unsafe code warrants additional scrutiny. See the comment in the code for details on correctness.

Reviewed By: quark-zju

Differential Revision: D22157713

fbshipit-source-id: 1a92ebb51142a98d3996686197b77ad7500c19db
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
61783baed4 http_client: report transfer stats
Summary: Report transfer stats such as bytes downloaded, uploaded, elapsed time, and number of requests upon completion of a batch of requests. This code was adapted from the EdenAPI client.

Reviewed By: quark-zju

Differential Revision: D22157711

fbshipit-source-id: 57b814e7a923f85467a79ee48bddd48b2f2b253c
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
a99ba6aa42 http_client: add HttpClient
Summary:
Add an `HttpClient` struct that is intended as the primary API for this crate. This struct is a wrapper around libcurl's "multi" interface, which allows sending several requests concurrently. Notably, if HTTP/2 is used, this allows for potentially multiplexing
many requests to the same server over the same connection.

This code is essentially a generalized version of the `multi_request` function from the EdenAPI crate.

Reviewed By: quark-zju

Differential Revision: D22157710

fbshipit-source-id: cbd7f82555444c7d1e1932944257a6949c60f34e
2020-06-29 18:43:49 -07:00
Arun Kulshreshtha
44efb6ee0d http_client: add progress monitoring
Summary: Add the ability for the client to monitor the collective progress of a set of transfers. This will be used in the next diff to allow monitoring several concurrent requests. Most of this code was adapted from the EdenAPI client's progress module, with some modifications.

Reviewed By: quark-zju

Differential Revision: D22157709

fbshipit-source-id: d474cd46db29bebf64049629dce69d975e220e3a
2020-06-29 18:43:48 -07:00
svcscm
447f4a8eea Updating submodules
Summary:
GitHub commits:

c34b8c4616
26e0787f7c
8c2467b40c
58547e533b
ed15145b2b

Reviewed By: wittgenst

fbshipit-source-id: 6631984be29efad81f3234b595dc61211aa7c8f9
2020-06-29 18:43:48 -07:00
svcscm
fa8fa0174b Updating submodules
Summary:
GitHub commits:

c81f790346
8ef6f55cef
7e6a92c1d1
8fd23f5316

Reviewed By: wittgenst

fbshipit-source-id: bfd1ac112eabb5b4c3135d3a0abf837a6a27f6dd
2020-06-29 16:50:38 -07:00
Xavier Deguillard
426e1ee41d inodes: fix typo in EdenDispatcher
Summary: The method name is symlink, not rmdir.

Reviewed By: genevievehelsel

Differential Revision: D22291297

fbshipit-source-id: 5dc37b053e06c965fd47df79990fc40adc097f87
2020-06-29 16:17:21 -07:00
svcscm
53eff5d356 Updating submodules
Summary:
GitHub commits:

9fe65e2511
c0338e1d1c
9a5886bd8c

Reviewed By: wittgenst

fbshipit-source-id: 86476bc189d14f7ccda30efbfb8c185a489165f0
2020-06-29 15:57:17 -07:00
Jun Wu
01e3ea0f8f tests: enable narrow-heads for test-[bc]*
Summary: Most of them need extra server-side bookmarks for deciding phases.

Reviewed By: DurhamG

Differential Revision: D22117739

fbshipit-source-id: 711bf96063913fd6148125a5628f0b0f4efbf489
2020-06-29 13:53:04 -07:00
svcscm
f322f58d89 Updating submodules
Summary:
GitHub commits:

0891265827
71ce4580a0
14b97cd718
f151ea0bed
1b85d57cf5
5943ba4420
23e616852a
6c4f96a77c
04d6018618
ee85f13db1
a88d2b40fe
a8c2a602ae

Reviewed By: wittgenst

fbshipit-source-id: f9066744432d9dc80a128999278c434288e4ba73
2020-06-29 13:07:28 -07:00
Jun Wu
4b45a2a185 test-pushrebase: use modern configs
Summary:
Enable narrow-heads.

Changed log revset from `:` to `all()` to make the test compatible.

Reviewed By: krallin

Differential Revision: D22200495

fbshipit-source-id: 148a82e77c953b9e7dbed055ef464c318e56cafa
2020-06-29 13:00:07 -07:00
Jun Wu
4c1634b9fd test-commitcloud: use modern configs
Summary:
Enable narrow-heads, and mutation. Disable obsmarker related features.

Change phase manipulation to `debugmakepublic` which works with narrow-heads.

Reviewed By: krallin

Differential Revision: D22200511

fbshipit-source-id: 8dec050f137e6cc055015fe084eb4cc67faa1216
2020-06-29 13:00:07 -07:00
Jun Wu
42b145a65d test-walker-scrub-blobstore: use modern configs
Summary:
Enable narrow-heads.

The test output seems a bit unstable - sometimes I got 28 there. So I globbed
it out.

Reviewed By: krallin

Differential Revision: D22200497

fbshipit-source-id: f005381a341d88c0bcbb09150e7d1878df7a38f3
2020-06-29 13:00:07 -07:00
Jun Wu
9eb40deffe test-pushrebase-emit-obsmarkers: use modern configs
Summary:
Enable narrow-heads.

Change the revset `:` to `all()`. With narrow-heads, `:` selects all commits
including those that are not referred by visible heads. The `all()` revset
only selects commits reachable from visible heads.

Reviewed By: krallin

Differential Revision: D22200498

fbshipit-source-id: beb863d42069ae898e419a4a75b3a707c72ae1f9
2020-06-29 13:00:07 -07:00
Jun Wu
e0c9b2b87b test-sqlblob: use modern configs
Summary:
Enable remotenames, selectivepull, and narrow-heads. Use the new stream clone
code path.

Selectivepull makes a difference. `hg pull -r HASH` also pulls the selected
bookmarks so an extra `pull` was unnecessary. Change the clone command to use
`-U` to trigger the new clone code path.

Reviewed By: krallin

Differential Revision: D22200499

fbshipit-source-id: 764202098c7e8afdbb5e2ee83679da7570c08c90
2020-06-29 13:00:07 -07:00
Jun Wu
adcf846f2f test-reduction: use modern configs
Summary:
Enable remotenames and narrow-heads.

Local bookmarks are replaced by remote bookmarks, causing the test change.

Reviewed By: krallin

Differential Revision: D22200500

fbshipit-source-id: aeee528d1766e0642c12e78a6c1a50cadc8a579a
2020-06-29 13:00:07 -07:00
Jun Wu
d1da1d70c1 test-push-redirector-sync-job: use modern configs
Summary:
Enable remotenames and narrow-heads.

The commits become 'draft' because there are no remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200514

fbshipit-source-id: 04d0befa7c22756e936a28ffdcdf1305057cf062
2020-06-29 13:00:07 -07:00
Jun Wu
2875942761 test-infinitepush: use modern configs
Summary:
Enable remotenames and narrow-heads.

The test was migrated cleanly. The only change is that local bookmarks are
replaced by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200510

fbshipit-source-id: f5b8cd2ed125e9fc4e5daac897851d91fef5693f
2020-06-29 13:00:07 -07:00
Jun Wu
6ecf255fcf test-infinitepush-mutation: use modern configs
Summary:
Enable remotenames and narrow-heads.

Local bookmarks are replaced by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200503

fbshipit-source-id: 41ac4f4f606011dcaf6d0d9867b01fb77b9a79d8
2020-06-29 13:00:07 -07:00
Jun Wu
95cf4a2a39 test-infinitepush-hydrated: use modern configs
Summary:
Enable remotenames and narrow-heads.

Phase exchange is gone because of narrow-heads.
The remtoenames extension was written suboptimally so it issued a second
bookmarks request (which, hopefully can be removed by having selective
pull everywhere and migrate pull to use the new API).

Reviewed By: krallin

Differential Revision: D22200506

fbshipit-source-id: c522bb9fc1396d813e0f1f380c4290445bab3db3
2020-06-29 13:00:07 -07:00
Jun Wu
ffde9f50e9 test-infinitepush-commits-disabled: use modern configs
Summary:
Enable remotenames and narrow-heads. The `master_bookmark` is no longer a local
bookmark in the client repo.

Reviewed By: krallin

Differential Revision: D22200513

fbshipit-source-id: bc3c1715ce21f45a35bc67148eb00e44944bea6e
2020-06-29 13:00:06 -07:00
Jun Wu
8ecb79a921 test-gettreepack-sparse-update: use modern configs
Summary: Enable remotenames and narrow-heads.

Reviewed By: krallin

Differential Revision: D22201083

fbshipit-source-id: 585dff69db9dd725c8fa1090d47c85b150f979da
2020-06-29 13:00:06 -07:00
Jun Wu
439c029007 test-gettreepack-designated-nodes: use modern configs
Summary:
Enable remotenames and narrow-heads. The server gets one more request from
remotenames.

Reviewed By: krallin

Differential Revision: D22200502

fbshipit-source-id: 26bc28b19438c7be4a19eae6be728c83b113f822
2020-06-29 13:00:06 -07:00
Jun Wu
93318c255b test-bookmark-hg-kind: use modern configs
Summary:
Enable remotenames and narrow-heads. The client gets remote bookmarks instead
of local bookmarks during clone and phases are decided by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200515

fbshipit-source-id: 12a9e892855b3a8f62f01758565de5f224c4942b
2020-06-29 13:00:06 -07:00
Jun Wu
8bde7d1316 tests: show remotenames in tglogpnr
Summary:
Change the template to show remote bookmarks, which will be more relevant once
we migrate to modern configs. Namely, phases will be decided by remote bookmarks.

The named branches logic was mostly removed from the code base. Therefore
drop the `{branches}` template.

Reviewed By: StanislavGlebik

Differential Revision: D22200512

fbshipit-source-id: 8eca3a71ff88b8614023f4920a448156fcd712d5
2020-06-29 13:00:06 -07:00