Commit Graph

84915 Commits

Author SHA1 Message Date
Open Source Bot
720f0deab8 Updating submodules
Summary:
GitHub commits:

03ac976138

Reviewed By: bigfootjon

fbshipit-source-id: 491d2362c3e1cce3a5cf5810cebae944b9e3d20a
2023-09-27 03:29:58 -07:00
Open Source Bot
fb876df1ef Updating submodules
Summary:
GitHub commits:

cb19e0b4c4
25bde289dc
41cbf4cf3c
25cadf3e3f
93bfbe98a7

Reviewed By: bigfootjon

fbshipit-source-id: 1bae6d1eb49b271cfc508bf982e9ea5b1faa772d
2023-09-26 16:44:24 -07:00
Liubov Dmitrieva
df99c914cb pass client info into thrift services (land service, derived data
Summary:
pass client info into thrift services (land service, derived data
service)

we need to extract the client info from the metadata and pass it in a
persistent header in thrift

Reviewed By: RajivTS

Differential Revision: D49640441

fbshipit-source-id: 512fcbde0ebe249770eac78f0766e0043f447a4a
2023-09-26 15:33:51 -07:00
Open Source Bot
3afc9250b9 Updating submodules
Summary:
GitHub commits:

e6dee5de26
fa4121777c
ee2dce548b
782e8a52cb
12b1d9201b
62435de6a0
aa0cf1919c
012a4ed6ad
4d92b618c3
13e49f7149
964943c7f5

Reviewed By: bigfootjon

fbshipit-source-id: cd765a39cac77d5e3545c3857a03b1e51216da7c
2023-09-26 13:06:36 -07:00
Open Source Bot
0370f6a85d Updating submodules
Summary:
GitHub commits:

77aa51f0f3
16048f21b6
cbe039dedf
c3f2f551c7
aafc329eb3
6d2d00a361
22c199870c
719f5511f6
038a86f637
79831e406c
3b4f7edda7
1d2bde69e9
c65cbc0a74
2b62e50caf
c1c14e24f4
1c07ec3808

Reviewed By: bigfootjon

fbshipit-source-id: d8d88e44f65f0fd419fce111fce48f24f81af62c
2023-09-26 12:13:22 -07:00
Manikandan Somasundaram
92aaec8821 Remove libmnl dependency for fboss
Summary:
X-link: https://github.com/facebookincubator/velox/pull/6685

libmnl-static has not been used for fboss in centos8. It is not
available in centos9. fboss builds fine without limnl dependency

Reviewed By: srikrishnagopu

Differential Revision:
D49380161

Privacy Context Container: L1125642

fbshipit-source-id: e1382a9d04c0fc962b4083c4aa7edba6bc1e02ae
2023-09-26 11:09:19 -07:00
Open Source Bot
f908c79602 Updating submodules
Summary:
GitHub commits:

496db27cd7
a384a2a594

Reviewed By: bigfootjon

fbshipit-source-id: 3fd6a05f060213e22c7425adf9d3e4e373479652
2023-09-26 10:28:10 -07:00
Saul Gutierrez
5e82c92b59 smartlog: use ZoneInfo instead of pytz
Summary: We ship Python 3.9+ everywhere, so now we can use `ZoneInfo` instead of `pytz`, [which is what the `pytz` developers recommend](https://github.com/stub42/pytz/blob/master/src/README.rst#issues--limitations).

Reviewed By: muirdm

Differential Revision: D49624253

fbshipit-source-id: 70f97ed350bde146197bb930c2280ed7c9b875d9
2023-09-26 10:15:10 -07:00
Saul Gutierrez
9babcac11b build: prefer recent Python versions to Python 3
Summary: Recently we made changes to which Python version to prefer. In some cases, the `python3` binary that comes first in the path might be older than 3.8, which is the minimal Python version we support. This changes it so that 3.10 and 3.8 are preferred

Reviewed By: muirdm

Differential Revision: D49623917

fbshipit-source-id: ca1c17cf4694a90fc1f6e1641ab231cee6b7cae5
2023-09-26 10:15:10 -07:00
Gustavo Galvao Avena
7a434f1552 Extract tests from partial_commit_graph into separate module
Summary:
I'm adding more test cases to cover the partial_commit_graph logic in the next diffs and the file was starting to get too big...

I prefer having smaller files because I can open related code side-by-side and more granular crates to improve buck build (see [the wiki](https://www.internalfb.com/intern/wiki/Rust-at-meta/Buck/rust-in-fbcode/#optimizing-build-time)).

Differential Revision: D49634613

fbshipit-source-id: bfd78f51b5ba970379ad6cb9404856f36705c4c7
2023-09-26 10:02:41 -07:00
Gustavo Galvao Avena
ef3eaf9cbb Use drawdag in test utils
Summary:
When I set up the unit tests, I didn't know that I could also use drawdag there. I thought it was available only  for integration tests.

Drawdag makes everything more succint and easier to understand/maintain.

Differential Revision: D49536292

fbshipit-source-id: a3786e1d74f1f802ab1ff29bca15b2cd6c6fd610
2023-09-26 10:02:41 -07:00
Gustavo Galvao Avena
766f3c451f Display progress bar when rewriting changesets
Summary:
To display progress when processing very large/old directories.

I'm only displaying the progress bar when the log level is set to INFO or lower, so it doesn't show up on the integration tests.

Differential Revision: D49452508

fbshipit-source-id: 17988c9140df6f1219fd63dd8ae305a6b0aa5ba0
2023-09-26 10:02:41 -07:00
Gustavo Galvao Avena
05f4554f4d Set new parent in copy_from file changes
Summary:
## Bug
See D49366697 and D49369883 for context on the bug.

## Solution
The comments on the code should explain the solution (please LMK if that's not the case).
The **TL;DR** is that any files that are copied  in a changeset `A` should only be copied from a changeset that are is being exported to the git repo, and thus have been rewritten before `A` and will be present in the `remapped_parents` map.

## What's next
Stop relying on the temporary hack of manually passing the name of the old directory as an export path by automatically getting the name of the old directories and all the changesets that affected it.

Differential Revision: D49416858

fbshipit-source-id: d084427a2db0c835ddb6ba39c4148bd2a4df82f7
2023-09-26 10:02:41 -07:00
Zhaolong Zhu
cf8d4006da clientinfo: delete unused dependency
Summary:
the `Config` usages were deleted from D49593287, let's remove the
unused dependency as well

Reviewed By: muirdm

Differential Revision: D49605511

fbshipit-source-id: 77921c814e9d94036d39f9e6773bfb6165bc5875
2023-09-26 07:04:09 -07:00
Liubov Dmitrieva
791965d646 test diff for tracking ClientInfo
Summary: test diff for tracking ClientInfo

Reviewed By: RajivTS

Differential Revision: D49636635

fbshipit-source-id: edf1a4b94bbf53aae812494576c2a5e733244193
2023-09-26 05:12:30 -07:00
Gustavo Galvao Avena
124951d54b Get ChangesetPathHistoryContext from each path individually
Summary:
## Context
D49366697 adds an integration test to cover a bug that was surfaced when running the tool in a real directory.

The **TL;DR** of the bug is that gitexport crashes when we pass `foo` as the export directory and at some point in history `foo` was created by renaming an entire directory named `bar`.

## Temporary solution
Manually pass `bar` as an export directory.

However, this doesn't work out of the box because of the way that the `paths_with_history` method works.

The documentation of `paths_with_history` says that it will not basically ignore any paths that don't exist in the changeset from which the method was called.

This means that passing `bar` as an export directory has no effect, since it doesn't exist in the starting changeset anymore.

By calling `path_with_history` for each path, we'll get the changesets affecting the old directories, even if they don't exist in the starting changeset anymore.

This unblocks the fix in D49416858.

Differential Revision: D49369883

fbshipit-source-id: dc3a44752cdcf76f03efdcd5e0e76a1435972026
2023-09-26 03:48:24 -07:00
Open Source Bot
dae44478b1 Updating submodules
Summary:
GitHub commits:

06b9dca73c
f45afb9aea
3f0b3a6ada
de7c831c50

Reviewed By: bigfootjon

fbshipit-source-id: 7fd404b3621c8cb0c8cd996d89bc9b649dc8f69a
2023-09-26 01:59:59 -07:00
Open Source Bot
85dab94b5a Updating submodules
Summary:
GitHub commits:

7293c3404d
d79142a8f1
58d47266a1

Reviewed By: bigfootjon

fbshipit-source-id: 2f7c4262a5ddde6befc5f6dda55ee99b8130f50e
2023-09-26 01:05:58 -07:00
Saul Gutierrez
a1e038b1c9 build: make Windows OSS build work again with Python 3.10
Summary: Recently we changed the way we pick the preferred Python version. This affected parts of our OSS build, which this diff fixes.

Reviewed By: muirdm

Differential Revision: D49612380

fbshipit-source-id: ea39893f992025c2ad97c24eff03bc5dfe7b2581
2023-09-25 16:02:21 -07:00
Open Source Bot
5dd8a7b26a Updating submodules
Summary:
GitHub commits:

0e0c66b1b3
09ae110f7c
3d33c4cae3
35b63b120a
25847a6251
b2d1e94e1a
ff09e42287
e53f40752f
14a77f5ade
5f3101939d
be9b511730

Reviewed By: bigfootjon

fbshipit-source-id: fc1bd7446ecf8f0c930b00506c515b41ca970cbd
2023-09-25 15:51:00 -07:00
Muir Manders
852d3aef06 Makefile: add "hg" target that only builds hg executable
Summary:
This skips the ISL build and the "other" Rust binaries (scm_daemon and mkscratch).

I tweaked things so "make oss" shares the same body as "make local".

Reviewed By: quark-zju

Differential Revision: D49605727

fbshipit-source-id: a29213a059e11876454b302324c1c5d7752feabe
2023-09-25 14:57:55 -07:00
Open Source Bot
b4ce8881d4 Updating submodules
Summary:
GitHub commits:

c5db865cc6
30eeb3dbb8
6bd301a646
eca35f8b8c
18fad4e74d
ed614992f8
8efd8a6e7c
711f657a58
29d8d3dfb3
5539dfc937
ba34cf9deb
b1772ed1ad

Reviewed By: bigfootjon

fbshipit-source-id: d0b47242731589ca6dcecdbf1c03d56537adb40e
2023-09-25 14:54:10 -07:00
Muir Manders
5020978503 tests: fix a couple failing tests
Summary: This slipped by after recent logging changes.

Reviewed By: quark-zju, zzl0

Differential Revision: D49605728

fbshipit-source-id: 1055fc5dceff833af48b622f329373d5621facce
2023-09-25 14:49:46 -07:00
Muir Manders
d22d2920d7 rename edenscm to sapling
Summary:
X-link: https://github.com/facebookincubator/velox/pull/6734

This is phase 1 of "sapling" rename. Later we will move out of the "eden" directory.

These were the high level steps I took:
1. "hg mv edenscm sapling" + "hg mv edenscmnative saplingnative"
2. s/edenscm/sapling/g
3. s/EdenSCM/Sapling/g
4. Update autocargo config
5. Update mercurialshim.py to support "edenscm" as legacy module (this is the critical part that keeps backwards compat w/ extensions and hooks that import from "edenscm")

Reviewed By: sggutier

Differential Revision: D49326692

fbshipit-source-id: 843db9ece03c7b80c666ff805bd855211614ac62
2023-09-25 13:58:05 -07:00
Muir Manders
c4bb7e497d run network doctor if error message looks cert related
Summary:
When error messages are bouncing between processes it is hard to keep things categorized. For example, if "hg checkout" calls into EdenFS which calls back into the hg import helper, the "is-network-error" knowledge is long lost.

Add fallback detection that turns UncategorizedNativeErrors into TlsErrors if the error message looks cert related.

Reviewed By: zzl0

Differential Revision: D49607587

fbshipit-source-id: 51f72feda2c970feb5b7178ebcddf4c3f22a9eff
2023-09-25 13:47:37 -07:00
Open Source Bot
844e7db8e0 Updating submodules
Summary:
GitHub commits:

cd83e626bb
90c149f7e5
85de33b873
2460dc6a81

Reviewed By: bigfootjon

fbshipit-source-id: 920fb8986b306f7a6b774734649bdcd92e47b919
2023-09-25 13:05:49 -07:00
Open Source Bot
4534ade962 Updating submodules
Summary:
GitHub commits:

c4c429b6d3
269b18aa44
c7275cebd7
ac024e19b3
8f70f1697e
ad848d6750
1b1a081273
ac553a9b22
c48b8b69f8
43f26cb055
14396e489d
aa6dbca6c3
3cf9d5f0d3
fed7ad61aa

Reviewed By: bigfootjon

fbshipit-source-id: 2aa92f90ed12ba7325867f3ae4fec46c3471d510
2023-09-25 12:13:10 -07:00
John Elliott
149e85f921 Add counter for in-memory BlobCache hits
Summary: We previously had counters to provide visibility into the in-memory blob metadata cache's hit rate, but we lacked corresponding counters for the in-memory blob and tree caches.  This adds BlobCache hit counters.

Reviewed By: genevievehelsel

Differential Revision: D49564626

fbshipit-source-id: 2fdd1e51fb8944607a032e0aef8610b9bf8dabcf
2023-09-25 11:58:24 -07:00
Saul Gutierrez
af283917f0 symlinks: fix bug with POSIX-style paths on Windows symlinks
Summary: Before this change there was a bug where trying to read symlinks with POSIX-style paths (e.g., `/foo/bar`) would fail. This applied both to reading symlinks directory or trying to list the contents of their parent directories.

Reviewed By: genevievehelsel

Differential Revision: D49601495

fbshipit-source-id: 403d06c580d676d61fb6bd8233e5ac45b072c2df
2023-09-25 11:50:49 -07:00
Michael Cuevas
73d2490db2 add fetch time to FetchMetrics
Summary:
We want to be able to understand how much time is being spent fetching data from EdenAPI. Let's add a time field to FetchMetrics so we can record time spent doing each fetch.

Disclaimer: EdenAPI stats only tracks the time spent fetching each BATCH, not each request. Therefore we can't get a per-fetch request metric, only a per-batch-fetch metric.

In addition, the ODS timer will record the total amount of time spent doing fetches for ALL fetch occurrences. To get an "average" fetch time, you'd have to divide the time by the total number of keys (or requests, if you want a per-batch number).

Reviewed By: quark-zju

Differential Revision: D49521776

fbshipit-source-id: cb3fa1a01c077284f8b3959d8cfb7e72708d4b27
2023-09-25 11:25:10 -07:00
Michael Cuevas
46d94ac7ee add EdenAPI metrics to FetchMetrics
Summary: We were previously not counting EdenAPI hits/misses in our FileStoreFetchMetric data. Let's include that data so that we have an idea of how often we're making requests to EdenAPI and how often we're "missing" or getting errors. EdenAPI can't really "miss", so any non-hit results are errors.

Differential Revision: D49521775

fbshipit-source-id: 6f50f62db8caf27060320b4d1aedde47fd59b9d7
2023-09-25 11:25:10 -07:00
Zhaolong Zhu
996493910c hg-http: add ClientRequestInfo to ClientInfo
Summary:
intializae ClientInfo with default ClientRequestInfo, let's use this
to do integration tests. The following diff will make it support config

Reviewed By: genevievehelsel

Differential Revision: D49558716

fbshipit-source-id: d90dbe59c1716b624a3f6c546fbc7fc67db1be16
2023-09-25 11:15:11 -07:00
Open Source Bot
36db21ce5e Updating submodules
Summary:
GitHub commits:

f955966efb
ede5292ff0
e404ea5d69
3337961355
3cbabc2265
11a1646bd5
dd6b48261d
fe8ca8263f
aa5588c911
1c871a4d86
a994fd22a1
fbe9d41a6e
fcdc2f1086
8e985600c9
32da0bcc01
884f834127
711a46b694
15d0a410f0
eb4d90873d
7f4d60a171
ff78a93db2
1692617299
3647f5a377
5e23653cb8
e26130d97c

Reviewed By: bigfootjon

fbshipit-source-id: ced6939230599de52fa0e49e7532a7d9d8b1e369
2023-09-25 10:57:52 -07:00
Zhaolong Zhu
9ddf4e0634 pyclientinfo: expose get_client_request_info() to Python
Summary: expose it to Python world, so we can use the same global static variable.

Reviewed By: liubov-dmitrieva

Differential Revision: D49556642

fbshipit-source-id: d4e31d2f54def60810a72614153a85edc8e465c4
2023-09-25 10:56:43 -07:00
Zhaolong Zhu
2a92650202 clientinfo: add static client request info
Summary: add a static global client request info object,  we will use it for storing request info

Reviewed By: liubov-dmitrieva

Differential Revision: D49548930

fbshipit-source-id: 330eed86fa7179dd590e52358d3dac5c80c683f5
2023-09-25 10:56:43 -07:00
Zhaolong Zhu
69058d5c54 clientinfo: move request info to a separate file
Summary: we will add more code for client request info, so let's move it to a separate file

Reviewed By: liubov-dmitrieva

Differential Revision: D49521918

fbshipit-source-id: c765dedfab4136e952e8c8127d1dd35bc79bb009
2023-09-25 10:56:43 -07:00
Jan Mazur
f8849ae2c7 remove Config from dependency
Summary: It's used only for one feature we have never used. The u64token structure in ClientInfo. Let's get rid of it because it will make passing and creating the ClientInfo through FFI boundaries easier in following diff.

Reviewed By: liubov-dmitrieva

Differential Revision: D49593287

fbshipit-source-id: 43438ac43040f199be19395827348a39d420c1f7
2023-09-25 08:40:41 -07:00
Mark Shroyer
f32f8f7666 Add counter for in-memory TreeCache hits
Summary:
We previously had counters to provide visibility into the in-memory blob
metadata cache's hit rate, but we lacked corresponding counters for the
in-memory blob and tree caches.  This adds TreeCache hit counters.

Reviewed By: chadaustin

Differential Revision: D49396499

fbshipit-source-id: 5622874b8df9f8aece61df24989a1a12c9ff4331
2023-09-25 05:47:41 -07:00
Gustavo Galvao Avena
3efdc20804 Add integration test for renamed export path
Summary:
Adding an integration test case to repro the issue currently blocking gitexport.

The problem is that, even though we properly set the new parents in the bonsai changeset, there are still references to the old parents in the `copy_from` field of the `TrackedFileChange`.

Example: we export directory `foo` and have the following 3 changesets `A <- B <- C`, where
- A changes the directory `bar`
- B changes a random directory
- C renames `bar` to `foo`

This would crash because `C` will have file changes referencing `B`.
This will be fixed in the next few diffs by properly updating those references the same way we update the parents.

**Note:** I added two calls to `gitexport` on the test: one passing the old path name manually and another without doing that. That's because the former will work with some small tweaks that will unblock the use of the tool while the proper fix is under development.

Differential Revision: D49366697

fbshipit-source-id: c13b76abcee5f780c4a0f46e65e047ef4f8745d8
2023-09-25 01:39:01 -07:00
Gustavo Galvao Avena
31f998d021 Improve logs
Summary:
Adding multiple logs and changing the severity of the existing ones to make sure some progress is shown and it's still possible to debug small repros in detail.

- All `info` logs are supposed to show progress on a high level to the end user.
- `debug` logs show progress in very granular detail, but can still be used when running the tool for a large directory in production.
- I'm using `trace` for the logs that scale based on the size/age of the directory (e.g. printing commit messages, sorted changeset vector).

Differential Revision: D49370152

fbshipit-source-id: a56f0ece417f085153fc4c49046f72951eef0607
2023-09-25 01:39:01 -07:00
Gustavo Galvao Avena
084656ccb5 Add option for oldest commit timestamp
Summary:
## What
Expose an argument for a timestamp that sets the lower bound of the commits. It's just exposing the one from `ChangesetPathHistoryOptions` so that we're able to export history only up to a specific date.

Differential Revision: D49230397

fbshipit-source-id: dad7b78d6a9b88072c13cd9c409fd5e0b9d56c92
2023-09-25 01:39:01 -07:00
Gustavo Galvao Avena
14af66ba2b Add option for starting changeset
Summary:
## What

Expose an argument to specify which changeset to start the history search from. We currently use the master bookmark, which will remain the default behaviour if one isn't provided.

I'm also adding some `info` logs that will be helpful to track the progress of the tool.
## RFC
I had to add the `BonsaiSvnrevMapping` trait to the `Repo` definition of MononokeAPI in order to use the `parse_commit` function in the CLI (which I extracted in D48896898).

Can that be a problem? None of the tests failed, so there shouldn't be any impact on business logic, but just wondering if there are other consequences that I'm not aware of... Asking because I imagine that the `Repo` in Mononoke API is a dependency of many other things.

Differential Revision: D48954151

fbshipit-source-id: c3a815bccd3d8372f2ff0caacd7b06e9f8c9456f
2023-09-25 01:39:01 -07:00
Jun Wu
6b13508388 packaging: build and install isl-dist.tar.xz along with main executable
Summary: Build and install the isl-dist.tar.xz so `hg isl` can use it on *nix platforms.

Reviewed By: sggutier

Differential Revision: D49560037

fbshipit-source-id: 3664707e371cd58b97f4c702c6cc36c1642e5aa9
2023-09-23 10:47:58 -07:00
Jun Wu
a292e6e4ea contrib: improve Windows compatibility for pick-python.py
Summary:
Update the pick-python logic so it:
- Prefer `PYTHON_SYS_EXECUTABLE` if set.
- Support missing `CFLAGS` in sysconfig. It's not set on Windows.

Reviewed By: sggutier

Differential Revision: D49560365

fbshipit-source-id: 96327157593a65bbc2c2b0475ebceff11aff4bce
2023-09-23 10:47:58 -07:00
Jun Wu
ac4791fc75 setup: build isl-dist.tar.xz
Summary:
Let `make local`, `make oss` that use `setup.py` generate the `isl-dist.tar.xz`
in the `setup.py` directory.

Reviewed By: sggutier

Differential Revision: D49558559

fbshipit-source-id: 813f4843adfaef95d3b76b141c86f8991e647a50
2023-09-23 10:47:58 -07:00
Jun Wu
410726c7cc isl: launch isl from isl-dist.tar.xz
Summary:
Change ISL logic from using dotslash and (OSS) Javascript source tree to the
`isl-dist.tar.xz`. This is one step towards unifying OSS, internal non-buck,
and buck builds.

The locations of `node` and `isl-dist.tar.xz` are configurable.

Reviewed By: sggutier

Differential Revision: D49558560

fbshipit-source-id: 6f19f66ae31081ca1cfc79290c2cfe219b47ebe4
2023-09-23 10:47:58 -07:00
Jun Wu
ef66438f73 pydirs: expose some methods from Rust dirs
Summary: The data local or cache directories are handy in the Python world too.

Reviewed By: sggutier

Differential Revision: D49558557

fbshipit-source-id: 5f57a4e89ba88a68cc0b91c332fed57b74788956
2023-09-23 10:47:58 -07:00
Jun Wu
85cc5614ee build-tar: script to build ISL to a tarball
Summary:
This script takes the ISL source, uses `yarn` to build, then write the built
result to a tarball. It maintains a "source_hash" and skips building if the
destination "source_hash" does not change.

The yarn build commands and directories to include are from `isl/release.js`.

Reviewed By: evangrayk

Differential Revision: D49558562

fbshipit-source-id: 060fec91a1f65cda51efa525ec291cd8483cf42b
2023-09-23 10:47:58 -07:00
Clara Rull
b6d53bc1f0 Add logging for hg edendebugimporter
Summary:
Add logging for `hg edendebugimporter`
HgBackingStore will:
- Attempt to get the data from local cache
- Fetch it remotely from Mononoke
- Or, as a last resort, fall back to using `hg edendebugimporter`. This is a path we would like to deprecate and logging accesses will help us understand who is falling back to this.

Reviewed By: jdelliot

Differential Revision: D49424377

fbshipit-source-id: 959c6a42bb5a5c3df6b9bc206527d0ed28253bbe
2023-09-22 19:14:17 -07:00
Muir Manders
16c7833e4d status: use up-to-date dirstate p1 in eden request
Summary: During multi-step operations like rebase, we move the working copy to different parents. Previously the Rust workingcopy's "status" calls to EdenFS were not using an up-to-date parent id in the "status" args, resulting in the "requested parent commit is out-of-date" error. Fix by pulling the parent id out of the treestate for every "status" call.

Reviewed By: quark-zju

Differential Revision: D49509139

fbshipit-source-id: 7dff48e826c073897c5fd1f683ac76f2f0068753
2023-09-22 19:08:34 -07:00