Commit Graph

84886 Commits

Author SHA1 Message Date
Jun Wu
fbf6a71490 python: prefer python 3.11 with non-buck build
Summary:
Change the default Python to prefer 3.11 instead of (CentOS 8 default) 3.8.
This matches the buck build more closely.

Reviewed By: sggutier

Differential Revision: D49710053

fbshipit-source-id: 6f521b994da32999eb977ebff63ade7d2dd012f5
2023-09-27 16:46:30 -07:00
Jun Wu
c00def6131 pymodules: use ModuleSpec from importlib
Summary:
Previously, we defined our own `ModuleSpec` to avoid importing the `importlib`
on disk. That can cause issues with code that wants to set random attributes
on the `ModuleSpec` (heap) object. For example, Python 3.11 wants to set the
`_uninitialized_submodules` attribute, which fails with the current pymodules
implementation.

Actually, we can get the `ModuleSpec` from the frozen `_frozen_importlib`.
That does not hit the filesystem. Switch to the stdlib `ModuleSpec` for better
compatibility.

Reviewed By: sggutier

Differential Revision: D49710052

fbshipit-source-id: e0e5ad0267e29d659da25d167f9e7254adf198b9
2023-09-27 16:46:30 -07:00
Jun Wu
7a82590920 isl: fix compatibility with Python < 3.11
Summary:
The `filter='data'` support needs Python 3.10.12 or 3.11:
241f2e54a6

Detect it and skip providing the filter keyword parameter.

Reviewed By: muirdm

Differential Revision: D49706544

fbshipit-source-id: 7b9d00c7bf5a915b3f21d172bfc8d543bf53dc72
2023-09-27 14:46:52 -07:00
Open Source Bot
8e939b01c0 Updating submodules
Summary:
GitHub commits:

35a0250293
77a3297e50
215d05b81b
7fcb7f4354

Reviewed By: bigfootjon

fbshipit-source-id: 99d2d6796eae136a1bf2383d14ade293fc57e243
2023-09-27 14:00:55 -07:00
Rajiv Sharma
eefd2822fb Tests for GitDeltaManifest generation
Summary:
This diff introduces test for `GitDeltaManifest` that validate the following:
- The manifest gets generated without error for different types of commits and branching structures
- The manifest includes the entries for modifications wherever appropriate
- The manifest include multiple delta variants for merge commits
- The manifest excludes files in merge commits that are already present in both parents
- The manifest always includes an entry for root directory
- The manifest only include non-delta entries for files and directories in root commits

There were certain bugs discovered and fixed as part of this testing which I have included along with this diff. Note that this does not guarantee that `GitDeltaManifest` works 100% how we expect it to, but it does give us a good degree of confidence

Reviewed By: mitrandir77

Differential Revision: D49187571

fbshipit-source-id: d199de9b356fe9ad94e85338f2e8588f00ce906c
2023-09-27 14:00:46 -07:00
Andres Suarez
e013c47b53 Reviewed By: aaronabramov
Differential Revision: D49677877

fbshipit-source-id: 7ef9f3b504fa2bde9cce83f69e81fca8b579d885
2023-09-27 13:42:42 -07:00
Evan Krause
a2a0a06e35 Add tests for discarding
Summary:
I noticed we had no tests for some cases here, namely:
- deleting an untracked file
- bulk discarding all files
- bulk discarding a subset of files

This is stuff affected by the commits earlier in this stack, so let's add tests for this moving forward

Reviewed By: quark-zju

Differential Revision: D49617784

fbshipit-source-id: 2107c4f5e7481d14bbbcfcae322c9d8c989e5455
2023-09-27 13:30:34 -07:00
Evan Krause
6208ef0e0b Use purge instead of a manual delete file function
Summary:
Apparently `sl purge` is capable of deleting individual files. This is much nicer than what we did before, which was to just run `rm` ourselves. By running this through `sl`, we can queue it up, show optimistic state, handle cancelling, etc.

Plus, it's nice from a security perspective to not have an exposed way to delete arbitrary paths. I think we handled the security correctly, but it's better to not have to think about it at all.

Reviewed By: quark-zju

Differential Revision: D49616814

fbshipit-source-id: 8e1e4bef34310d357f4eaf7b2b38a8cf1932560e
2023-09-27 13:30:34 -07:00
Evan Krause
b9a7e6b716 Fix partial bulk discard button not deleting untracked files
Summary:
Bug:
- have some uncommitted changes, with some files untracked
- if you select a subset of files including untracked files
- then click the bulk discard button
- it would run `sl revert`, but that would skip the untracked files, causing them to not get reverted.
- what's worse, our optimistic state assumed we did delete these files, so it would hide them visually until we got the next refresh or invalidated the optimistic state.

The fix is to use `sl purge file1 file2 ...` to delete the files. I didn't think this command took a list of files, but it seems it actually does. I think it's intended to be used for directories, but it definitely works for files too.

Reviewed By: quark-zju

Differential Revision: D49616813

fbshipit-source-id: f488ce12f01b98424a04f21fe192a4762970c1ac
2023-09-27 13:30:34 -07:00
Evan Krause
6c8a819c63 Add partition util
Summary: Small util to split an array into two halves, those which pass a predicate and those which don't.

Reviewed By: quark-zju

Differential Revision: D49616812

fbshipit-source-id: 03c33b6610de63262482ee517c783a241bd575fd
2023-09-27 13:30:34 -07:00
Jun Wu
534b0e3e1f system-command: fix cmd /c quoting
Summary:
It turns out `cmd` always wants the `/c` argument to be "(naively) quoted":

  # This is what Python `subprocess.run(shell=True)` does:
  cmd /c "{cmd}"

No need to worry about double quoting:

  # Works fine
  cmd /c ""\Program Files\nodejs\node.exe""

  # Works fine
  cmd /c ""\Program Files\nodejs\node.exe" "my script.js""

But not triple quoting:

  cmd /c """\Program Files\nodejs\node.exe"""
  # '""\Program' is not recognized

Without quoting it is problematic:

  cmd /c \Program Files\nodejs\node.exe
  # '\Program' is not recognized

Change system-command to quote on Windows, but avoid triple-quoting, to be
compatible with D49694880.

Reviewed By: muirdm

Differential Revision: D49697875

fbshipit-source-id: a0ad289c3d807bc686857b2ea39783cbf89c63a4
2023-09-27 12:10:21 -07:00
Jun Wu
1a0d1489de commandserver: move "shell command" construction to a separate crate
Summary:
This is quite error prone. So let's move it to a separate crate to avoid
reinventing it in wrong ways.

Reviewed By: muirdm

Differential Revision: D49697876

fbshipit-source-id: 1667ca29af2151438e9f537eac5d7824e3352f05
2023-09-27 12:10:21 -07:00
Zhaolong Zhu
55024aeea1 request_info: add a warning if the client entry_point value is invalid
Reviewed By: liubov-dmitrieva

Differential Revision: D49687258

fbshipit-source-id: f1dc67cce12f9a02a6f6669f23c67d96f1f4798c
2023-09-27 10:41:03 -07:00
Zhaolong Zhu
47b6e604c9 clientinfo: log client request info metrics
Summary: log client request info metrics when calling http_config()

Differential Revision: D49671996

fbshipit-source-id: 540a80ff00825fff0ded0b2cb66e0d63d23baaa9
2023-09-27 09:30:24 -07:00
Zhaolong Zhu
048ae081a6 hg-http: fix lint warning
Summary: removed unnecessary `into_inter()`

Differential Revision: D49671997

fbshipit-source-id: f0740df5d4d3f69bce29772ea29fa0cbd768ba07
2023-09-27 09:30:24 -07:00
Zhaolong Zhu
f090235884 clientinfo: make CLIENT_REQUEST_INFO initializer supports env vars
Summary:
Adding env vars support, so ISL can use env vars to pass correlator
and entry_point info

Reviewed By: liubov-dmitrieva

Differential Revision: D49660376

fbshipit-source-id: 3f2bf770a0642d223177a7a7b330f46cf20a8e71
2023-09-27 09:30:24 -07:00
Liubov Dmitrieva
37749c120c pass client request info into EdenFs
Summary:
pass client request info into EdenFs

create an equivalent thrift type to the ClientRequestInfo type

we have to use thrift params (adding a new field into existing params) since thrift headers are not supported in the underlying transport used (tried in D49635948).

SocketTransport relies on FramedTransport which only transfers a payload, but no header metadata per frame.

Reviewed By: genevievehelsel

Differential Revision: D49656897

fbshipit-source-id: ac8b1ac22b20470cce903552c46672081478b59d
2023-09-27 08:53:34 -07:00
Nathan Hawkes
5d1a32b32b cargo update regex-*
Summary: Update crates

Reviewed By: zertosh

Differential Revision: D49682661

fbshipit-source-id: a7ea4c25acde6cfb86fc004ce9cb30077de75070
2023-09-27 08:49:49 -07:00
Zhaolong Zhu
66c36ac50a clientinfo: update update_client_request_info() and add docs
Differential Revision: D49660377

fbshipit-source-id: c1dc3b00fd3c957d4536a9e31a5301837489bbe4
2023-09-27 08:07:23 -07:00
Zhaolong Zhu
c0f31fdf8d scmstore: removed unused method
Summary: fix a compiler warning of unused method

Differential Revision: D49660378

fbshipit-source-id: 33347efce2f1e153bcb857c1d14f78d6779104a5
2023-09-27 08:07:23 -07:00
Mark Juggurnauth-Thomas
4170133355 hooks: export error type precisely
Summary:
Use of `*` in imports is discouraged, and doubly so when the import is re-exported with `pub use`.  We only want to export the error type, so specify exactly that.

This fixes a new warning that shows up in the latest compiler version about the shadowing of `NonRootMPath` through the blanket import.

Differential Revision: D49680495

fbshipit-source-id: 7fd939d2a7c9e9a42e3f6d31679564a7aea7fcd0
2023-09-27 03:33:06 -07:00
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