Commit Graph

12258 Commits

Author SHA1 Message Date
Carolyn Busch
f8d6e362da fix http conditional
Summary: Fix bug in httpenabled check. Only local repo has edenapi attribute and not remote.

Reviewed By: quark-zju

Differential Revision: D31059979

fbshipit-source-id: c77f1455949f28b081f8fef86aeb83ecd1c3ceba
2021-09-22 10:22:40 -07:00
Carolyn Busch
7a9cab0157 add method for httpcommitgraph enabled
Summary: Move conditionals for using edenapi commit graph endpoint to a common method. This fixes the conditional check in _pullchangeset which should match the one in pull.

Reviewed By: quark-zju

Differential Revision: D31030783

fbshipit-source-id: e665067bcf12bc8211850d547df42bc48727de48
2021-09-22 10:22:40 -07:00
Carolyn Busch
67380e537e match commit graph url to server
Summary: The url for commit graph on the server is repo/commit/graph and repo/commit/commit_graph on the client. Update client to match server url.

Reviewed By: quark-zju

Differential Revision: D31030784

fbshipit-source-id: fb58c53a9264498f0e488abadd5f2b5480f0c672
2021-09-22 10:22:40 -07:00
Jun Wu
7558f9e6cc edenapi: drop support for unfiltered=false in hash to location endpoint
Summary:
The `unfiltered` field was to support legacy clients that are months old. Drop
support for it to clean the code a bit.

Reviewed By: StanislavGlebik

Differential Revision: D31106176

fbshipit-source-id: 7cfd6827812258776d6d9eac512b497777fecb70
2021-09-22 10:18:22 -07:00
Jun Wu
4e0140653c segmented_changelog: expose inner error message in hash-to-location endpoint
Summary:
Previously it just passes "failed to compute the common descendant and distance
for X", the outmost layer (context) of the error to the client. Make it contain
more messages about the inner error and heads explicitly.

Reviewed By: StanislavGlebik

Differential Revision: D31071741

fbshipit-source-id: ec4f161491e14ae0e0c422f5e92a3849a5a29b56
2021-09-22 10:18:22 -07:00
Jun Wu
3ef445c0a6 dag: make iddag parent lookup support parent range
Summary: This will be used by upcoming changes.

Reviewed By: DurhamG

Differential Revision: D30919581

fbshipit-source-id: 5e4c13004c577d4a87948c1985bdf48ebd1379a3
2021-09-22 10:18:22 -07:00
Jun Wu
a4a8be5d24 dag: extract indexedlog iddag parent key logic to a function
Summary: This method will be used in the next change.

Reviewed By: DurhamG

Differential Revision: D30919580

fbshipit-source-id: a5cab7fad0dda0de15244a9d7c1887534f061f3a
2021-09-22 10:18:22 -07:00
Jun Wu
f46401df93 dag: remove unnecessary methods
Summary:
After D26360561 (aa9dfeff2e), `IdDag<Store>` derefs to `Store` for algorithms. There is no
need to duplicate the methods in `IdDag<Store>`.

Reviewed By: yancouto

Differential Revision: D30911148

fbshipit-source-id: d476e318ab565369b93f4bd8467989a2a2e76f82
2021-09-22 10:18:22 -07:00
Jun Wu
c0a47999ae dag: resolve a bug in vertex to location translation
Summary:
Added checks so the `x` in the returned `x~n` is a parent of a merge that is an
ancestor of requested heads.

Reviewed By: DurhamG

Differential Revision: D30911149

fbshipit-source-id: 09fd6a01ea346a53c8d2ff6042951c8094cb8b04
2021-09-22 10:18:22 -07:00
Liubov Dmitrieva
fd9bd36040 clean up: remove dest option everywhere
Summary:
After migration to Mononoke & EdenAPI supporting different destinations don't make sense.

The destination is always either default path or edenapi endpoint.

Reviewed By: yancouto

Differential Revision: D31081193

fbshipit-source-id: 49a02899173690cfcb55bf8fc6aec13b05377ca6
2021-09-22 09:15:43 -07:00
Jan Mazur
32c57e97bf make test-cats less flaky
Summary: It used to be flaky. Perhaps ncat exited by itself in some cases so there was nothing to kill. Just ignore the kill command's output. As long as we get the cats header the test is fine.

Reviewed By: HarveyHunt

Differential Revision: D31108514

fbshipit-source-id: e2791610c49bacdc31c26710f087cbe49f4d734e
2021-09-22 04:52:06 -07:00
Stanislau Hlebik
fd899d6049 mononoke: make it possible to rebase a stack of commits in admin
Summary: It can be useful if we want to rebase a lot of commits at once

Reviewed By: mitrandir77

Differential Revision: D31106975

fbshipit-source-id: 26bb7f3fd166b483c44a4991ede4f0a9a462fff7
2021-09-22 03:15:20 -07:00
CodemodService Bot
8844b556e5 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D31106408

fbshipit-source-id: 6211061e0d15c383f4e5cb3c3a46175837d1f2c0
2021-09-22 01:39:59 -07:00
Yipu Miao
5ca5ef3871 Let download_directory support eden option
Summary: Follow the D30313559, this diff will enable ```download_directory``` with eden option

Reviewed By: Skory

Differential Revision: D30549600

fbshipit-source-id: f87326bd7c17abd975eab823c62ee0ffe3bf7443
2021-09-21 18:41:16 -07:00
Meyer Jacobs
39ec42f832 backingstore: add file aux data support to BackingStore
Summary: Add support for fetching file aux data from BackingStore via scmstore.

Reviewed By: andll

Differential Revision: D31048574

fbshipit-source-id: ccb783272d0ffe32277debdaac45c00fc4df9ddb
2021-09-21 15:19:55 -07:00
Durham Goode
8eda0549d1 eol: remove eol extension
Summary:
We've never really supported this and it has caused weird behavior in
the past. Let's delete it.

Reviewed By: quark-zju

Differential Revision: D31027574

fbshipit-source-id: 297668e35db3c4d5ea17d2a18fc0127ca694cc45
2021-09-21 13:55:08 -07:00
Durham Goode
742240b65f hggit: delete hggit
Summary: This is no longer used, now that configerator does it's sync via SCS.

Reviewed By: quark-zju

Differential Revision: D31006839

fbshipit-source-id: ddf7923a3c80ad47519bce0e5cb3895f62e7ae2e
2021-09-21 13:45:11 -07:00
Mark Juggurnauth-Thomas
6ddb2d3b52 clienttelemetry: split peerinfo from server response
Summary:
The server_realhostname log field no longer contains just the server hostname,
but instead was changed to the format `HOSTNAME session SESSIONID`, so that the
client knows the server session id.

Redefine the response format to `HOSTNAME (INFOKEY INFOVALUE)*`, so that
session is just an info field from the peer, and parse the response and log its
components.

Reviewed By: quark-zju

Differential Revision: D31081922

fbshipit-source-id: 28f963b4a44f7e9bdd75393ac9b14a2d1a4b5bd0
2021-09-21 12:45:17 -07:00
Muir Manders
c73e1c5556 progress: always create rust progress model
Summary:
Create rust progress bar model in python whenever any bar is created, as opposed to only when the bar is rendered. This makes progress metadata always available in rust, regardless of whether progress ends up getting displayed or not. In particular, this enables upcoming "global progress" work to generically expose all hg invocations' progress.

This change necessitated rust to respect more cases where progress should not be displayed. For example, "quiet" mode was previously only respected in python by creating a type of bar that did not end up being registered in rust. Now since all bars are registered, rust needs to know not to render output in this case and others.

Note that I discovered a config discrepancy between python and rust in the norepo=True command mode. Work around for now by changing debugprogress to optionalrepo.

Reviewed By: quark-zju

Differential Revision: D31005075

fbshipit-source-id: 0fa6fb594a15b34b3ae260343526496f8f8b05f8
2021-09-21 11:54:19 -07:00
Muir Manders
67b6925885 configparser: add utility to test for HGPLAIN
Summary:
Add rust utility function to test for HGPLAIN and HGPLAINEXCEPT, analagous to python's ui.plain() method.

I need this so rust can expand its logic of whether to render progress bars or not.

Reviewed By: quark-zju

Differential Revision: D31070840

fbshipit-source-id: 0c394234b9c4337bbddaa08d7a9b1d8ed59dfec0
2021-09-21 11:54:18 -07:00
Jan Mazur
34562e349e send cats with mononokepeer on push
Summary: We'll pass CAT's (Crypto Auth Tokens) from clients to our hooks so we can verify clients' identities.

Reviewed By: StanislavGlebik

Differential Revision: D30666379

fbshipit-source-id: 40bdcc04e05165ff379c34f8a8b5f54c509cce00
2021-09-21 10:30:53 -07:00
Mark Juggurnauth-Thomas
3e9cf0f135 blame_v2: ignore parents if file was copied
Summary:
Mononoke blame derivation differs from Mercurial: if a file is copied over
(i.e., it exists in one or more parents, but also has copy-from info for
a different path), then Mononoke treats this as a merge between the parent
content(s), and the copied-from contents, whereas Mercurial ignores the
parents and just continues the blame from the copied-from contents.

Change Mononoke to match Mercurial behaviour.  This is a breaking change:
blame_v2 derived before this change will not match blame_v2 derived after
this change.  We will rederive blame_v2 for all repositories affected by
this.

Reviewed By: StanislavGlebik

Differential Revision: D31079507

fbshipit-source-id: 33eb4ce54b99712d551ff46e9e96ccd7e5b78d80
2021-09-21 10:22:11 -07:00
Xavier Deguillard
e9de9e1fe5 backingstore: rename refresh method to flush
Summary:
The intent behind the refresh method is to both read new data from the disk,
but also to flush the in-memory write buffer to disk. The name "flush" is used
in the revisionstore code to mean the latter, thus let's use "flush" in the
rest of the codebase.

Reviewed By: kmancini

Differential Revision: D30947873

fbshipit-source-id: c85a6abe770a47d6ce454d6af1fa73e505194a22
2021-09-21 10:22:11 -07:00
Liubov Dmitrieva
d5acd57947 measure pull and push time for cloud sync
Summary:
measure pull and push time for cloud sync

This is needed to be able to analyse this data in scuba

Reviewed By: yancouto

Differential Revision: D31081328

fbshipit-source-id: 404df394443282d62845fad094153a83d71d3150
2021-09-21 08:23:21 -07:00
Digant Kasundra
ffd233228b Add syslog and slog-syslog crates
Summary: ACE will have to run in situations where Chef has not run, but we'll need to be able to reliably write to the auth logs so Blackbird can properly build detections.  So we need these crates so we can build the somewhat foolproof solution to ensure ACE logs all executions.

Reviewed By: farnz

Differential Revision: D31066559

fbshipit-source-id: 9fa3b5778cd2602bdeaac90a9daa758b117babfe
2021-09-21 07:22:38 -07:00
Jan Mazur
25404854aa fix a typo
Summary: a type

Reviewed By: HarveyHunt

Differential Revision: D31081823

fbshipit-source-id: 17e8d8eb8bf87d90bd7122c01ef9248731af31f4
2021-09-21 07:22:38 -07:00
Mark Juggurnauth-Thomas
9423b5c88f mercurial_mutation: chunk database fetches
Summary:
Some requests can occasionally cause fetches from the database for lots of
changesets in one go.  This causes excessive load on a single database
instance.  Chunk these requests into a more reasonable size.

Reviewed By: krallin

Differential Revision: D31056868

fbshipit-source-id: cbc47f7ef40bfbefaca86b1516fb574772cb531e
2021-09-21 03:24:28 -07:00
Mark Juggurnauth-Thomas
ed2f622d66 phabstatus: add commiting and needs final review states
Summary:
Add support for Phabricator's "committing", "recently failed to land", and
"needs final review" states.  These are fake states based on other status
fields in the response from Phabricator.

Reviewed By: quark-zju

Differential Revision: D31055125

fbshipit-source-id: 16b17e1934efcb5d829dd8d4c72ea8465687ab46
2021-09-21 01:30:04 -07:00
Chad Austin
49e49f9fc2 replace most folly:format uses
Summary:
folly:format is deprecated in lieu of fmt and std::format. Migrate
most of EdenFS to fmt instead.

Differential Revision: D31025948

fbshipit-source-id: 82ed674d5e255ac129995b56bc8b9731a5fbf82e
2021-09-20 16:23:22 -07:00
Zeyi (Rice) Fan
56d461a85c ignore lfs requires
Reviewed By: quark-zju

Differential Revision: D31032551

fbshipit-source-id: 1b686b02541d82faa63c0fbcb000e0ae5fef0eb9
2021-09-20 13:28:49 -07:00
Stanislau Hlebik
37962b1ca3 mononoke: log how long it took to derive all the data for the whole stack in derived data tailer
Summary: It's useful to have this data

Reviewed By: mitrandir77

Differential Revision: D31053459

fbshipit-source-id: cbe9a3fad30563812218b8b9b5d4c3aaeb279285
2021-09-20 12:27:58 -07:00
Stanislau Hlebik
10084d12f0 mononoke: log reponame to derived data tailer scuba set
Summary:
It's useful to know the repo name (we can get it from tw handle name, but
that's less convenient).

Reviewed By: mitrandir77

Differential Revision: D31053458

fbshipit-source-id: fa7e92c510ea6160c52561d4a7a7c44776c528dc
2021-09-20 12:27:58 -07:00
Zeyi (Rice) Fan
18dbf379df ring: backport kSecRandomDefault is NULL to fix macOS build
Summary:
Backport: https://github.com/briansmith/ring/pull/1334

This will allow us to unpin Rust compiler to 1.53.0 and update to 1.55.0.

Reviewed By: xavierd

Differential Revision: D31039024

fbshipit-source-id: f6a9c918e836d93d03c34c77c12bbe63cf7cbe09
2021-09-20 11:22:49 -07:00
Durham Goode
05a2cdbc76 repo: separate peer and repo setup
Summary:
Previously repo and peer instantiation were in one unified path. This
allowed treating repo's and peers somewhat interchangably. We're moving to a
world where peers and local repos are quite different, so let's separate these
two paths.

This will be useful in the next diff where we remote the file peer, but want to
keep the ability to instantiate local file non-peer repos.

Reviewed By: quark-zju

Differential Revision: D30975887

fbshipit-source-id: 5e676b522c7cfdd5449aeb6a750947dcb023183f
2021-09-20 10:26:37 -07:00
Durham Goode
dc89f2c417 httppeer: remove httppeer
Summary:
We don't use this at Facebook, and most of the tests don't even touch
it anymore. Let's delete it. This will also help us remove our tests dependency
on hg having server logic, once we also delete sshpeer and filepeer.

This will mean we can't use FB hg to clone from http bitbucket though, which is
probably fine.

Differential Revision: D30970713

fbshipit-source-id: 76d96edfbcb7db2168b4b11bfaf8b487406d7f3d
2021-09-20 10:26:37 -07:00
Mark Juggurnauth-Thomas
91c4748c5b blame: switch to manager-based derivation
Summary:
Switch derivation of `blame` to the `DerivedDataManager`.

This is mostly the same as the existing derivation implementation.  The main difference is that `blame` derivation using the backfilling config
will use the backfilling config for the unodes that it depends on, too.

Reviewed By: mitrandir77

Differential Revision: D30974102

fbshipit-source-id: 5f69f8c218806bb7606b2af4b831e2104b8440d6
2021-09-20 06:26:21 -07:00
Mark Juggurnauth-Thomas
aef6b3f453 unodes: switch to manager-based derivation
Summary: Switch derivation of `unodes` to the `DerivedDataManager`.

Reviewed By: yancouto

Differential Revision: D30944564

fbshipit-source-id: 41f63cd47cffdd1e24d57b470afef57aa6fe0264
2021-09-20 06:26:21 -07:00
Yan Soares Couto
0c80a0aac7 Fix build warnings
Summary: Why not, right? Fixes a few build warnings that showed up to me while building.

Reviewed By: kulshrax

Differential Revision: D30933487

fbshipit-source-id: 318fbd2c5697914fd0bfa723e678dc710524dc02
2021-09-20 06:26:21 -07:00
Yan Soares Couto
84118416a2 Simplify code for FsnodeId
Summary: There were already helpers to make this code less copy-pasty, this diff just uses them.

Reviewed By: markbt

Differential Revision: D30933408

fbshipit-source-id: acc27a0904425eccfc71fee884a8f2035ed0c37f
2021-09-20 06:26:21 -07:00
Yan Soares Couto
7725ca63b9 Simplify code for WireHgId
Summary:
We already have a macro to make it easier to create wire representation of hash types, let's use it on `HgId` to reduce copy-pasting.

Changes:
- Added `Ord` implementations to wire hash types, as `WireHgId` used it.
- Added from/into implementations on `HgId` to byte arrays, which were used by the macro.
- Changed Debug implementation so it prints hex instead of an actual array of bytes

Reviewed By: krallin

Differential Revision: D30933067

fbshipit-source-id: c88911bfc91e44e07f2f658098036b766495d05f
2021-09-20 06:26:21 -07:00
Yan Soares Couto
f1cb23d4e1 Add --clean option to snapshot restore
Summary:
I imagine a pretty common case (specially for automation that's trying to keep two clones in sync), will be that you need to restore a snapshot and then restore another snapshot after that.

Currently, this doesn't work very well, as it fails on (some but not all) cases where there is uncommitted changes. It's kind of boring bc to handle that you need to run `hg purge && hg revert -a -C`.

This diff adds a `--clean` option to `hg snapshot restore` that will clean the working copy before updating to given snapshot. Now the command will also fail if you try to update to a snapshot while you have untracked files.

Reviewed By: markbt

Differential Revision: D30903851

fbshipit-source-id: 387eeeee882093389649dc337c861291c35f4b94
2021-09-20 06:26:21 -07:00
Mark Juggurnauth-Thomas
044ae9f1f0 backfill_derived_data: fix tests to ensure batch invariants
Summary:
The `backfill_batch_dangerous` method requires that the caller ensures
that all dependencies of the batch have been derived, otherwise errors,
such as mappings being written out before the things they map to, can
occur.

When the derived data manager takes over batch derivation, it will enforce this
requirement, so that it is no longer dangerous.  However, The backfiller tests
were not ensuring the invariant, so the tests will fail with the new derivation
implementation.

Fix the tests by ensuring the parent commits are always derived before a
batch is started.  The test is also extended to expose the failure mode
of accidentally deriving batch parents.  This will be fixed in the next
commit.

Reviewed By: yancouto

Differential Revision: D30959132

fbshipit-source-id: 8489a5d0b375692a903854294e3810846c9e13de
2021-09-20 03:23:17 -07:00
Mark Juggurnauth-Thomas
45963588b3 derived_data_utils: implement manager-based DerivedUtils
Summary:
Implement `DerivedUtils` using the `DerivedDataManager`.

This is just for migration.  In the future `DerivedUtils` will be replaced by the manager.

Reviewed By: yancouto

Differential Revision: D30944568

fbshipit-source-id: 32376e3b4aeb959e63f66e989a663c21dee30ba5
2021-09-20 03:23:17 -07:00
Mark Juggurnauth-Thomas
fd388aac1a derived_data_manager: implement data derivation
Summary:
Implement a new version of data derivation in the derived data manager.  This is different from the old version in a few ways:

* `derived_data::BonsaiDerivable` is replaced by `derived_data_manager::BonsaiDerivable`.  This trait defines both how to perform derivation and how to store and retrieve mapping values.  Derivation is performed with reference to the derived data manager, rather than `BlobRepo`.

* The old `Mapping` structs and traits are replaced with a direct implementation in the derived data manager, using the `BonsaiDerivable` trait to handle the derived-data-type-specific parts.

* The new implementation assumes we will stick with parallel derivation, and doesn't implement serial derivation.

Code is copied from the `derived_data` crate, as it is intended to be a replacement once all the derived data types are migrated, and re-using code would create a circular dependency during migration.

This only covers the basic derivation implementation used during production.  The derived data manager will also take over backfilling, but that will happen in a later diff.

Reviewed By: yancouto

Differential Revision: D30805046

fbshipit-source-id: b9660dd957fdf762f621b2cb37fc2eea7bf03074
2021-09-20 03:23:17 -07:00
Mark Juggurnauth-Thomas
0741a4815d derived_data_utils: extract find_oldest_underived
Summary:
The `find_oldest_underived` method of `DerivedUtils` is used outside tests by
exactly one client (the backfiller in tailing mode).  Simplify the
`DerivedUtils` trait by extracting this method from the trait, and replacing
with a more general one that will be easier to implement in terms of the
derived data manager.

Reviewed By: yancouto

Differential Revision: D30944567

fbshipit-source-id: a1d408e091d145297241a5eebc02a87155bc3765
2021-09-20 03:23:17 -07:00
Mark Juggurnauth-Thomas
8fc9f7159a derived_data: split BonsaiDerived trait
Summary:
Split the `BonsaiDerived` type in two:

* `BonsaiDerived` is now just the interface which is used by callers
  who want to derive some derived data type.  It will be implemented by
  both old and new derivation.

* `BonsaiDerivedOld` is the interface that old derivation uses to
  determine the default mapping for derivation.  This will not be
  implemented by new derivation, and will be removed once migration is
  complete.

Reviewed By: yancouto

Differential Revision: D30944566

fbshipit-source-id: 5d30a44da22bcf290ed3123844eb712c7b37dea4
2021-09-20 03:23:17 -07:00
Mark Juggurnauth-Thomas
4776c94ae7 derived_data_manager: remove builder
Summary:
The builder pattern turned out to be unnecessary, as mappings don't need to be
stored in the manager after all.

Reviewed By: StanislavGlebik

Differential Revision: D30944565

fbshipit-source-id: 4300cdcc871c89f98e42d5b47600ac640b4b94eb
2021-09-20 03:23:17 -07:00
Mark Juggurnauth-Thomas
b1ecec2b14 filenodes: make derivation not depend on BlobRepo
Summary:
Make the derivation process for mercurial filenodes not depend on `BlobRepo`.
Instead, use the repo attributes (`RepoBlobstore` and `Filenodes`) directly.
This will allow us to migrate to using `DerivedDataManager` in preparation
for removing `BlobRepo` from derivation entirely.

The existing use of `changesets` for determining the commit's parents is
changed to use the parents from the bonsai changeset.  For normal derivation,
the bonsai changeset is already loaded, so this saves a database round-trip.
For batch derivation we currently need to load the changeset, but it should
be in cache anyway, as other derived data types will also have loaded it.

We still need to keep a `BlobRepo` reference at the moment.  This is because
filenodes depend on the mercurial derived data.  The recursive derivation is
hidden in the call to `repo.get_hg_from_bonsai_changeset`.  When derivation
is migrated to the derived data manager, we can replace this will a direct
derivation.

Reviewed By: StanislavGlebik

Differential Revision: D30765254

fbshipit-source-id: 20cc17c2eb611544869e5f1c15d858663cd60fd1
2021-09-20 03:23:17 -07:00
Stanislau Hlebik
06705f701c mononoke: add names to the fixtures repos
Summary:
Let's give them a more descriptive names so that it's easier to understand
what's going on.

Reviewed By: markbt

Differential Revision: D31022612

fbshipit-source-id: 8e4f516f3d0b1cd661b1a8fceba80a8f85a2ed4f
2021-09-18 00:25:06 -07:00
Stanislau Hlebik
99dd200e34 mononoke: add FileChangeAggregation to split_batch_in_linear_stacks
Summary:
This is a new option in split_batch_in_linear_stacks - it either aggregates
file changes from all ancestors in the stack or not. Currently all of our
callsites wants Aggregate, but in the next diff we'll add a new callsite that
doesn't

Reviewed By: markbt

Differential Revision: D31022444

fbshipit-source-id: ce0613863855163f26ab18c7f35142ae569eb31a
2021-09-18 00:25:06 -07:00