Commit Graph

294 Commits

Author SHA1 Message Date
Viet Hung Nguyen
578207d0dc mononoke/repo_import: add hg sync checker
Summary:
Related diff: D22816538 (3abc4312af)

In repo_import tool once we move a bookmark to reveal commits to users, we want to check if hg_sync has received the commits. To do this, we extract the largest log id from bookmarks_update_log to compare it with the mutable_counter value related to hg_sync. If the counter value is larger or equal to the log id, we can move the bookmark to the next batch of commits. Otherwise, we sleep, retry fetching the mutable_counter value and compare the two again.
mutable_counters is an sql table that can track bookmarks log update instances with a counter.
This diff adds the functionality to extract the mutable_counters value for hg_sync.

======================
SQL query fix:
In the previous diff (D22816538 (3abc4312af)) we didn't cover the case where we might not get an ID which should return None. This diff fixes this error.

Reviewed By: StanislavGlebik

Differential Revision: D22864223

fbshipit-source-id: f3690263b4eebfe151e50b01a13b0193009e3bfa
2020-08-03 04:01:27 -07:00
Alex Hornby
5f71745810 mononoke: fix flaky test test-walker-corpus.t
Summary:
This is expected to fix flakyness in test-walker-corpus.t

The problem was that if a FileContent node was reached via an Fsnode it did not have a path associated.  This is a race condition that I've not managed to reproduce locally, but I think is highly likely to be the reason for flaky failure on CI

Reviewed By: ikostia

Differential Revision: D22866956

fbshipit-source-id: ef10d92a8a93f57c3bf94b3ba16a954bf255e907
2020-07-31 10:22:34 -07:00
Liubov Dmitrieva
cc2b5c04ca imrove authentication handling
Summary:
There have been lots of issues with user experience related to authentication
and its help messages.

Just one of it:
certs are configured to be used for authentication and they are invalid but the `hg cloud auth`
command will provide help message about the certs but then ask to copy and
paste a token from the code about interactive token obtaining.

Another thing, is certs are configired to use, it was not hard to
set up a token for Scm Daemon that can be still on tokens even if cloud
sync uses certs.

Now it is possible with `hg auth -t <token>` command

Now it should be more cleaner and all the messages should be cleaner as well.

Also certs related help message has been improved.

Also all tests were cleaned up from the authentication except for the main
test. This is to simplify the tests.

Reviewed By: mitrandir77

Differential Revision: D22866731

fbshipit-source-id: 61dd4bffa6fcba39107be743fb155be0970c4266
2020-07-31 10:16:59 -07:00
Lukas Piatkowski
417d61f4b6 mononoke/mononoke_x_repo_sync_job: make mononoke_x_repo_sync_job and related public (#40)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/40

Those tools are being used in some integration tests, make them public so that the tests might pass

Reviewed By: ikostia

Differential Revision: D22844813

fbshipit-source-id: 7b7f379c31a5b630c6ed48215e2791319e1c48d9
2020-07-31 09:02:33 -07:00
Lukas Piatkowski
e78c6d58c3 mononoke/integration tests: use C locale by default (#41)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/41

As of D22098359 (7f1588131b) the default locale used by integration tests is en_US.UTF-8, but as the comment in code mentiones:
```
The en_US.UTF-8 locale doesn't behave the same on all systems and trying to run
commands like "sed" or "tr" on non-utf8 data will result in "Illegal byte
sequence" error.
That is why we are forcing the "C" locale.
```

Additionally I've changed the test-walker-throttle.t test to use "/bin/date" directly. Previously it was using "/usr/bin/date", but the "/bin/date" is a more standard path as it works on MacOS.

Reviewed By: krallin

Differential Revision: D22865007

fbshipit-source-id: afd1346e1753df84bcfc4cf88651813c06933f79
2020-07-31 09:02:33 -07:00
Lukas Piatkowski
203d186f68 mononoke/integration tests: remove test-gitimport-octopus.t from OSS tests
Summary: It fails now, unknown reason, will work on it later

Reviewed By: mitrandir77, ikostia

Differential Revision: D22865324

fbshipit-source-id: c0513bfa2ce9f6baffebff472053e8a5d889c9ba
2020-07-31 08:02:46 -07:00
Stanislau Hlebik
43ac2a1c62 mononoke: use WarmBookmarkCache in repo_client
Summary:
This is the (almost) final diff to introduce WarmBookmarksCache in repo_client.
A lot of this code is to pass through the config value, but a few things I'd
like to point out:
1) Warm bookmark cache is enabled from config, but it can be killswitched using
a tunable.
2) WarmBookmarksCache in scs derives all derived data, but for repo_client I
decided to derive just hg changeset. The main motivation is to not change the
current behaviour, and to make mononoke server more resilient to failures in
other derived data types.
3) Note that WarmBookmarksCache doesn't obsolete SessionBookmarksCache that was
introduced earlier, but rather it complements it. If WarmBookmarksCache is
enabled, then SessionBookmarksCache reads the bookmarks from it and not from
db.
4) There's one exception in point #3 - if we just did a push then we read
bookmarks from db rather than from bookmarks cache (see
update_publishing_bookmarks_after_push() method). This is done intentionally -
after push is finished we want to return the latest updated bookmarks to the
client (because the client has just moved a bookmark after all!).
I'd argue that the current code is a bit sketchy already - it doesn't read from
master but from replica, which means we could still see outdated bookmarks.

Reviewed By: krallin

Differential Revision: D22820879

fbshipit-source-id: 64a0aa0311edf17ad4cb548993d1d841aa320958
2020-07-31 03:09:24 -07:00
Jun Wu
b57b6f8705 changegroup: do not print 'adding changeset X' with --debug
Summary:
The debug print abuses the `linkmapper`. The Rust commit add logic does not
use `linkmapper`. So let's remove the debug message to be consistent with
the Rust logic.

Reviewed By: DurhamG

Differential Revision: D22657189

fbshipit-source-id: 2e92087dbb5bfce2f00711dcd62881aba64b0279
2020-07-30 20:32:35 -07:00
Arun Kulshreshtha
d691e06abd tests: allow multiple curl error codes in test-lfs-server-https.t
Summary: When a TLS connection fails due to a missing client certificate, the `curl` command may fail with either code 35 or 56 depending on the TLS version used. With TLS v1.3, the error is explicitly reported as a missing client certificate, whereas in TLS v1.2, it is reported as a generic handshake failure. This is because TLS v1.3 defines an explicit [`certificate_required`](https://tools.ietf.org/html/rfc8446#section-4.4.2.4) alert, which is [not present](https://github.com/openssl/openssl/issues/6804) in earlier TLS versions.

Reviewed By: krallin

Differential Revision: D22834527

fbshipit-source-id: a15d6a169d35ece6ed5a54b37b8ca9bbc506b3da
2020-07-30 10:27:35 -07:00
Stanislau Hlebik
ffa578ed1f mononoke: change warm bookmark cache to store BookmarkKind
Summary:
The overall goal of this stack is to add WarmBookmarksCache support to
repo_client to make Mononoke more resilient to lands of very large
commits.

We'd like to use WarmBookmarkCache in repo client, and to do that we need to be
able to tell Publishing and PullDefault bookmarks apart. Let's teach
WarmBookmarksCache about it.

Reviewed By: krallin

Differential Revision: D22812478

fbshipit-source-id: 2642be5c06155f0d896eeb47867534e600bbc535
2020-07-30 07:28:44 -07:00
Lukas Piatkowski
9962321103 mononoke/regenerate_hg_filenodes: make regenerate_hg_filenodes public (#39)
Summary: Pull Request resolved: https://github.com/facebookexperimental/eden/pull/39

Reviewed By: krallin

Differential Revision: D22816308

fbshipit-source-id: e64b2b5f5b319814265fdb0129f2bce6b1a72a98
2020-07-30 06:50:54 -07:00
Lukas Piatkowski
4ccff9c2ef mononoke/megarepotool: make megarepotool public (#38)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/38

The tool is used in some integration tests, make it public so that the tests might pass

Reviewed By: ikostia

Differential Revision: D22815283

fbshipit-source-id: 76da92afb8f26f61ea4f3fb949044620a57cf5ed
2020-07-30 06:50:54 -07:00
Lukas Piatkowski
db2f711159 mononoke/hg_sync_job: make mononoke_hg_sync_job public (#37)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/37

mononoke_hg_sync_job is used in integration tests, make it public

Reviewed By: krallin

Differential Revision: D22795881

fbshipit-source-id: 7a32c8e8adf723a49922dbb9e7723ab01c011e60
2020-07-30 02:52:56 -07:00
Lukas Piatkowski
0b5ac21f79 mononoke/backsyncer_cmd: make backsyncer_cmd public (#36)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/36

This command is used in some integration tests, make it public.

Reviewed By: krallin

Differential Revision: D22792846

fbshipit-source-id: 39ac89b1a674ea63dc924cafa07107dbf8e5a098
2020-07-30 02:52:56 -07:00
Viet Hung Nguyen
f1ef619284 mononoke/repo_import: add phabricator lag checker
Summary:
Once we start moving the bookmark across the imported commits (D22598159 (c5e880c239)), we need to check dependent systems to avoid overloading them when parsing the commits. In this diff we added the functionality to check Phabricator. We use an external service (jf graphql - find discussion here: https://fburl.com/nr1f19gs) to fetch commits from Phabricator. Each commit id starts with "r", followed by a call sign (e.g FBS for fbsource) and the commit hash (https://fburl.com/qa/9pf0vtkk). If we try to fetch an invalid commit id (e.g not having a call sign), we should receive an error. Otherwise, we should receive a JSON.
An imported commit should have the following query result: https://fburl.com/graphiql/20txxvsn - nodes has one result with the imported field true.
If the commit hasn't been recognised by Phabricator yet, the nodes array will be empty.
If the commit has been recognised, but not yet parsed, the imported field will be false.
If we haven't parsed the batch, we will try to check Phabricator again after sleeping for a couple of seconds.
If it has parsed the batch of commits, we move the bookmark to the next batch.

Reviewed By: krallin

Differential Revision: D22762800

fbshipit-source-id: 5c02262923524793f364743e3e1b3f46c921db8d
2020-07-28 08:09:21 -07:00
Lukas Piatkowski
22f90df1db mononoke/integration tests: use a combination of kill and wait to kill a process
Summary: On MacOS if you kill a process without waiting on it to be killed you will receive a warning on the terminal saying that the process was killed. To suppress that output, which is messing with the integratino tests, use a combination of kill and wait (the custom "killandwait" bash function). It will wait for the process to stop which is probably what most integration tests would prefer to do

Reviewed By: krallin

Differential Revision: D22790485

fbshipit-source-id: d2a08a5e617e692967f8bd566e48f5f9b50cb94d
2020-07-28 08:02:52 -07:00
Lukas Piatkowski
9db04f2daa mononoke/integration tests: use "date" command directly rather than via path
Summary: Using "/usr/bin/date" rather than just "date" is very limiting, not all systems have common command line tools installed in the same place, just use "date".

Reviewed By: krallin

Differential Revision: D22762186

fbshipit-source-id: 747da5a388932fb5b9f4c068014c01ee90a91f9b
2020-07-28 08:02:52 -07:00
Lukas Piatkowski
ec9be535eb mononoke/integration tests: use LC_ALL=C locale
Summary: On MacOS the default localisation configuration (UTF-8) won't allow operations on arbitrary bytes of data via some commands, because not all sequences of bytes are valid utf-8 characters. That is why when handling arbitrary bytes it is better to use the "C" locale, which can be achieved by setting the LC_ALL env variable to "C".

Reviewed By: krallin

Differential Revision: D22762189

fbshipit-source-id: aa917886c79fba5ea61ff7168767fc4b052a35a1
2020-07-28 08:02:52 -07:00
Lukas Piatkowski
16182e626b mononoke/integration tests: use newer bash version on MacOS GitHub CI runs
Summary: Use brew on MacOS GitHub CI runs to update bash from 3.* to 5.*.

Reviewed By: krallin

Differential Revision: D22762195

fbshipit-source-id: b3a4c9df7f8ed667e88b28aacf7d87c6881eb775
2020-07-28 08:02:52 -07:00
Lukas Piatkowski
88782c8f69 mononoke/integration tests: use GNU command lines to run tests on MacOS
Summary: MacOS uses FreeBSD version of command line tools. This diff uses brew to install the GNU tooling on GitHub CI and uses it to run the integration tests.

Reviewed By: krallin

Differential Revision: D22762198

fbshipit-source-id: 1f67674392bf6eceea9d2de02e929bb3f9f7cadd
2020-07-28 08:02:52 -07:00
Alex Hornby
c01ba6abfa mononoke: log route to step on unexpected errors from walker
Summary:
On unexpected errors like missing blobstore keys the walker will now log the preceding node (source) and an interesting step to this node (not necessarily  the immediately preceding, e.g. the affected changeset).

Validate mode produces route information with interesting tracking enabled,  scrub currently does not to save time+memory. Blobstore errors in scrub mode can be reproduced in validate mode when the extra context from the graph route is needed.

Reviewed By: farnz

Differential Revision: D22600962

fbshipit-source-id: 27d46303a2f2c07219950c20cc7f1f78773163e5
2020-07-28 05:21:48 -07:00
Harvey Hunt
e5b249cefc mononoke: lfs_server: Use enforce_acl_check as a killswitch for ACL enforcement
Summary:
Now that we can configure ACL checking on a per-repo basis, use the
`enforce_acl_check` config option as a killswitch to quickly disable ACL
enforcement, if required.

Further, remove the `acl_check` config flag that was always set to True.

As part of this change I've refactored the integration test a little and
replaced the phrase "ACL check" with "ACL enforcement", as we always check the
ACL inside of the LFS server.

Reviewed By: krallin

Differential Revision: D22764510

fbshipit-source-id: 8e09c743a9cd78d54b1423fd2a5cfc9bf7383d7a
2020-07-28 04:57:01 -07:00
Lukas Piatkowski
d52ea235c7 mononoke/integration tests: sqlite - cast BLOB to TEXT before applying LIKE operation
Summary: Some versions of sqlite don't allow using LIKE operation on BLOB data, so first cast it to TEXT. This test was failing on Linux runs on GitHub.

Reviewed By: krallin

Differential Revision: D22761041

fbshipit-source-id: 567d68050297c3a2ac781b252d3e9b21ea5b2201
2020-07-27 14:35:01 -07:00
Lukas Piatkowski
d5dd156cfb mononoke/integration tests: install missing jq command on MacOS
Reviewed By: krallin

Differential Revision: D22762192

fbshipit-source-id: 73f12e65c3ab63910638f16197e5629a7d6efb2c
2020-07-27 14:35:01 -07:00
Lukas Piatkowski
db06969e0d mononoke/integration tests: create exclusion list of integration tests
Summary: Have a comprehensive list of OSS tests that do not pass yet.

Reviewed By: krallin

Differential Revision: D22762196

fbshipit-source-id: 19ab920c4c143179db65a6d8ee32974db16c5e3d
2020-07-27 14:35:01 -07:00
Harvey Hunt
cce86abf14 mononoke: lfs_server: Enforce ACL checks on a per repo basis
Summary:
Update the LFS server to use the `enforce_lfs_acl_check` to enforce
ACL checks for specific repos and also reject clients with missing idents.

In the next diff, I will use the existing LFS server config's
`enforce_acl_check` flag as a killswitch.

Reviewed By: krallin

Differential Revision: D22762451

fbshipit-source-id: 61d26944127711f3503e04154e8c079ae75dc815
2020-07-27 11:04:59 -07:00
Mark Thomas
89bc34035b scuba: add log sequence numbers
Summary:
Add log sequence numbers to the scuba sample builder.  This provides an ordering
over the logs made by an individual instance of Mononoke, allowing them to be
sorted.

Reviewed By: krallin

Differential Revision: D22728880

fbshipit-source-id: 854bde51c7bfc469677ad08bb738e5097cb05ad5
2020-07-27 07:10:07 -07:00
Lukas Piatkowski
006b80bf1b mononoke/integration tests: fix for test-security-whitelist.t - override allowed id
Reviewed By: krallin

Differential Revision: D22760347

fbshipit-source-id: 613bca3073e404b02c55c557a3835d0738c10102
2020-07-27 02:45:58 -07:00
Lukas Piatkowski
2c5cc232fc mononoke/x509 identity: add OSS parsing of x509 certificates (#32)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/32

This parsing uses the standard "subject name" field of a x509 certificate to create MononokeIdentity.

Reviewed By: farnz

Differential Revision: D22627150

fbshipit-source-id: 7f4bfc87dc2088bed44f95dd224ea8cdecc61886
2020-07-24 09:05:52 -07:00
Stanislau Hlebik
4ddf071f7e mononoke: update walker to visit content referenced by fsnodes
Summary: If fsnodes point to non-existent content we should be able to detect that.

Reviewed By: farnz

Differential Revision: D22723866

fbshipit-source-id: 31510aada5e21109b498a26e28e0f6f3b7358ec4
2020-07-24 09:03:47 -07:00
Stanislau Hlebik
4e252cbf2e mononoke: add --limit to backfill_derived_data
Summary: It's nice to have this flag available

Reviewed By: krallin

Differential Revision: D22693732

fbshipit-source-id: 9d0d8f44cb0f5f7263a33e86e9c5b8a9927c0c85
2020-07-23 13:33:16 -07:00
Mateusz Kwapich
2bf5cf7ca1 add descendants_of argument to commit_path_history
Differential Revision: D22502592

fbshipit-source-id: 8e3acf00a6c4dc9b651551a6723b582d9bcaca39
2020-07-23 07:34:52 -07:00
Alex Hornby
6a0b614a90 mononoke: fix flaky test-walker-validate.t
Summary: Fix flaky test-walker-validate.t.   There can be more than one route to the bad filenode, so wildcard the src and via fields when matching the output.

Reviewed By: StanislavGlebik

Differential Revision: D22664371

fbshipit-source-id: f4d880187ec2b557fb5f69ad546c2486d150b337
2020-07-22 11:05:48 -07:00
Stanislau Hlebik
aaafd7a707 mononoke: allow specifying list to redact in a file
Summary:
For large lists it's much more convenient to specify them in a file - we are
not limited by cmd line size limit.

Reviewed By: krallin

Differential Revision: D22595023

fbshipit-source-id: 93035208700f981453eaf98f84341a86f2f1c04d
2020-07-22 07:37:36 -07:00
Kostia Balytskyi
1e5a0dc4db admin: add crossrepo config subcommand
Summary: This is to be able to inspect `LiveCommitSyncConfig` from our admin tooling.

Reviewed By: StanislavGlebik

Differential Revision: D22497065

fbshipit-source-id: 3070890b7dc2a4075a5c15aca703494e33ee6530
2020-07-22 07:34:59 -07:00
Lukas Piatkowski
808a00ea73 mononoke/integration tests: provide localhost certs for OSS test runs (#30)
Summary: Pull Request resolved: https://github.com/facebookexperimental/eden/pull/30

Reviewed By: johansglock

Differential Revision: D22596741

fbshipit-source-id: e8cf5da09f5c8c812b78b44aac969f52e195684f
2020-07-22 03:29:19 -07:00
Kostia Balytskyi
dd4fcd7aee commit_validator: validate according to recorded sync config version
Summary: `commit_validator` cannot just use latest `CommitSyncConfig` to validate how a commit was synced between large and small repos. Instead, when querying `synced_commit_mapping`, it needs to pay attention to `version_name` used to create the mapping. Then it needs to query `LiveCommitSyncConfig` for a config of this version and use it as a validation basis.

Reviewed By: StanislavGlebik

Differential Revision: D22525606

fbshipit-source-id: 6c32063b18461d592d931316aec7fd041bcc1ae4
2020-07-21 10:19:44 -07:00
Kostia Balytskyi
fc61c74f23 live_commit_sync_config: make scs xrepo-lookup watch live changes
Summary:
When we change `CommitSyncConfig`, we want to not have to restart `scs` servers, and instead have them pick up the new config by using `LiveCommitSyncConfig`.

This diff turned out larger than I expected, mainly due to the need to introduce various things around `TestLiveCommitSyncConfig`:
- `TestLiveCommitSyncConfig`: the trait implementer to use in `mononoke_api::Repo`
- `TestLiveCommitSyncConfigSource`: the helper struct to keep around for new values injection (very similar to how our `ConfigStore` has an inner `ConfigSource`, which can also be `TestSource`, but here injected values can be `CommitSyncConfig` instead of JSON).
- all the places in integration tests, where `setup_configerator_configs` is now needed (I plan to start setting up configerator configs always in a separate diff, as it is cheap)

Here are the explanations for a few things I think may be not immediately obvious:
- I removed the `Clone` bound from `LiveCommitSyncConfig` trait, as `Clone` traits [cannot be made into trait objects](https://doc.rust-lang.org/book/ch17-02-trait-objects.html#object-safety-is-required-for-trait-objects)
- `TestLiveCommitSyncConfigSource` vs `TestLiveCommitSyncConfigSourceInner` discrepancy is to ensure nobody should instantiate `TestLiveCommitSyncConfigSourceInner` outside of `live_commit_sync_config/src`
- I am aware of the ugly discrepancy between the main `--mononoke-config-path`, which is used to load initial configuration and can be both a file-based and a configerator-based config; and `--local-configerator-path`, used to override config sources for `Tunables` and `LiveCommitSyncConfig`. Ideally these two should just be unified somehow, but that is a little out of scope of this diff (I've already added it to the dirt doc though).
- in `mononoke_api::Repo` there are methods `new_test_xrepo` and `new_test_common`, which changed from maybe accepting just a `CommitSyncConfig` to now maybe accepting both `CommitSyncConfig` and `LiveCommitSyncConfig`. It can be made a bit cleaner: I can just query `CommitSyncConfig` from `LiveCommitSyncConfig` in `new_test_common` and avoid having two args. I was too lazy to do this, lmk if you feel strongly about it.

Reviewed By: StanislavGlebik

Differential Revision: D22443623

fbshipit-source-id: 0d6bbda2223e77b89cc59863b703db5081bcd601
2020-07-21 09:09:23 -07:00
Viet Hung Nguyen
c5e880c239 mononoke/repo_import: Add bookmark moving functionality
Summary: After we derived the bonsaichangesets (D22455297 (c315c56c05)), we want to move a bookmark in small increments to reveal the commits to the users (https://fburl.com/wiki/zp9hgd7z step 8). This diff adds this functionality to repo_import and automate this step.

Reviewed By: StanislavGlebik

Differential Revision: D22598159

fbshipit-source-id: 01db898f07a0b7be50c3f595e78931204f33bb46
2020-07-21 06:47:51 -07:00
Jun Wu
0562c1220f tests: enable template-new-builtin
Summary: This makes tests depend less on revision numbers.

Reviewed By: DurhamG

Differential Revision: D22468669

fbshipit-source-id: 74a06930faa3e6ee9d246ecc718c2a3740f57a54
2020-07-20 17:27:53 -07:00
Alex Hornby
5348068572 mononoke: walker: log changeset missing link nodes were reached via
Summary: log changeset missing link nodes were reached via.

Reviewed By: farnz

Differential Revision: D20124059

fbshipit-source-id: 412a88245abb3b761c2363c33c28206ab749d572
2020-07-20 04:58:16 -07:00
Alex Hornby
d07a69f71e mononoke: walker: log changeset non-public commits were reached via
Summary: Log changeset non-public commits were reached via.

Reviewed By: krallin

Differential Revision: D20115443

fbshipit-source-id: b2bed03b42c26785f845e055b984fda8d5af63e9
2020-07-20 04:58:16 -07:00
Jun Wu
eb4c007145 changelog: use Rust RevlogIndex for partialmatch
Summary:
I dropped the special case of wdir handling. With the hope that we will handle
the virtual commits differently eventually (ex. drop special cases, insert real
commits to Rust DAG but do not flush them to disk, support multiple wdir
virtual commits, null is no longer an ancestor of every commit).

`test-listkeyspatterns.t` is changed because `0` no longer resolves to `null`.

Reviewed By: DurhamG

Differential Revision: D22368836

fbshipit-source-id: 14b9914506ef59bb69363b602d646ec89ce0d89a
2020-07-17 22:23:04 -07:00
Lukasz Piatkowski
0dd3c4e4bb add Mononoke integration tests CI (#26)
Summary:
This diff adds a minimal workflow for running integrations tests for Mononoke. Currently only one test is run and it fails.

This also splits the regular Mononoke CI into separate files for Linux and Mac to match the current style in Eden repo.
There are the "scopeguard::defer" fixes here that somehow escaped the CI tests.
Some tweaks have been made to "integration_runner_real.py" to make it runnable outside FB context.
Lastly the change from using "[[ -v ... ]" to "[[ -n "${...:-}" ]]; in "library.sh" was made because the former is not supported by the default Bash version preinstalled on modern MacOS.

Pull Request resolved: https://github.com/facebookexperimental/eden/pull/26

Reviewed By: krallin

Differential Revision: D22541344

Pulled By: lukaspiatkowski

fbshipit-source-id: 5023d147823166a8754be852c29b1e7b0e6d9f5f
2020-07-16 12:16:10 -07:00
Simon Farnsworth
ae4b55ccaf Sort test output in test-cmd-manual-scrub.t
Reviewed By: krallin

Differential Revision: D22570814

fbshipit-source-id: bd1ef5defb2c401a3a6d19c4102c8904a211289d
2020-07-16 05:48:07 -07:00
Jun Wu
f6d838bc0e extensions: enable lz4revlog by default
Summary: Some native code (ex. RevlogIndex) only knows the lz4 format.

Reviewed By: DurhamG

Differential Revision: D22368825

fbshipit-source-id: d33cee235e3aa4fbf2cfb441319e3c12728d8b5b
2020-07-14 14:33:43 -07:00
Thomas Orozco
2e99b4b7cd mononoke/lfs_server: blob popularity: skip consistent routing for hot blobs
Summary:
If a particular is blob is too popular, we can saturate a LFS host through
consistent routing, and possibly OOM the host as well.

Historically, we haven't had enough traffic to LFS to make this a problem, but
we're getting there now.

This diffs adds support for reporting the popularity of a blob through SCS (not
Mononoke SCS — the couting one), and for using this popularity to identify when
we should stop consistently-routing a given blob.

The idea is that if e.g. something was requested 300 times in the last 20
seconds, it'll take a second for all the hosts to have it in cache, so we might
as well distribute this load.

There are plenty of things we could do slightly better here, such as making the
interval configurable, or having something in-between "consistently route to a
single host" and "don't consistently route at all". That said, I don't think
those are necessary right now, so let's start simple and find out.

Reviewed By: HarveyHunt

Differential Revision: D22503748

fbshipit-source-id: 48827bcfb7658ad22c88a8433359e29b0d56ad5a
2020-07-13 13:00:36 -07:00
Viet Hung Nguyen
c315c56c05 mononoke/repo_import: add deriving data functionality
Summary: After we shifted the bonsaichangesets (D22307039 (f5db2fdcdc)), we want to derive all the data types available in the target repo. Previously, we used a script to specify what we want to derive (https://fburl.com/wiki/ivk76muf step 4). This diff adds this functionality to repo_import and automate this step.

Reviewed By: StanislavGlebik

Differential Revision: D22455297

fbshipit-source-id: b38ac68606687350ace57d68464e68ca8229f7a5
2020-07-13 03:28:33 -07:00
Mark Thomas
fb5fdb9c15 bookmarks: remove repo_id from Bookmarks methods
Summary:
Remove the `repo_id` parameter from the `Bookmarks` trait methods.

The `repo_id` parameters was intended to allow a single `Bookmarks` implementation
to serve multiple repos.  In practise, however, each repo has its own config, which
results in a separate `Bookmarks` instance for each repo.  The `repo_id` parameter
complicates the API and provides no benefit.

To make this work, we switch to the `Builder` pattern for `SqlBookmarks`, which
allows us to inject the `repo_id` at construction time.  In fact nothing here
prevents us from adding back-end sharing later on, as these `SqlBookmarks` objects
are free to share data in their implementation.

Reviewed By: StanislavGlebik

Differential Revision: D22437089

fbshipit-source-id: d20e08ce6313108b74912683c620d25d6bf7ca01
2020-07-10 04:50:25 -07:00
Mark Thomas
3afceb0e2c bookmarks: extract BundleReplayData from BookmarkUpdateReason
Summary:
Separate out the `BundleReplayData` from the `BookmarkUpdateReason` enum.  There's
no real need for this to be part of the reason, and removing it means we can
abstract away the remaining dependency on Mercurial changeset IDs from
the main bookmarks traits.

Reviewed By: mitrandir77, ikostia

Differential Revision: D22417659

fbshipit-source-id: c8e5af7ba57d10a90c86437b59c0d48e587e730e
2020-07-10 04:50:24 -07:00