Commit Graph

21 Commits

Author SHA1 Message Date
Johan Schuijt-Li
a7ae42d3ca move to common shared directory
Summary: Allow this to be used by more utilities.

Reviewed By: DurhamG

Differential Revision: D29958512

fbshipit-source-id: b6a1a7017102a4ff4ad252246d3252903bbb793f
2021-08-10 10:27:16 -07:00
Liubov Dmitrieva
3dbac2ff63 commitcloud CLEAN UP remove last bits code with interngraph proxy
Summary:
commitcloud CLEAN UP: remove last bits code related to an old interngraph commit cloud proxy

The configs are not used, the service_url in scm daemon is not used, the interngraph proxy is not used

Reviewed By: singhsrb

Differential Revision: D30160471

fbshipit-source-id: 07fee2b8733afa29659467cb296df3b47fe1b54b
2021-08-09 07:17:44 -07:00
Liubov Dmitrieva
6d86a24632 add support for issue CAT commit cloud tokens on corp
Summary:
Add support for issue CAT commit cloud tokens on corp Macs.

This is needed to support enabling Scm Daemon for all mac users **automatically**.

The tool `corp_clicat` is probably not yet deployed everywhere but it will work once deployed.

The current manual way will remain working as well.

The current way is manual:

* obtaining OAuth token from https://our.intern.facebook.com/intern/oauth/184975892288525

* running `hg cloud auth -t <token>` (the command stores the token into Mac keychain, Scm Daemon fetches from it).

The problem with the manual way is that users are not aware about scm daemon and the features it provides. The manual way worked fine when the tokens were also used for hg commit cloud extension as well but now they are not used.

Reviewed By: markbt

Differential Revision: D29791737

fbshipit-source-id: 2391a196167e1f17d53a3231dbf58f7cb2bcd39a
2021-07-23 06:51:23 -07:00
Davide Cavalca
b82c5672fc Update several rust crate versions
Summary: Update versions for several of the crates we depend on.

Reviewed By: danobi

Differential Revision: D29165283

fbshipit-source-id: baaa9fa106b7dad000f93d2eefa95867ac46e5a1
2021-06-17 16:38:19 -07:00
CodemodService Bot
e2a64a3088 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: krallin

Differential Revision: D28319288

fbshipit-source-id: fc879fab6d7c2abd5184ccfbacf2aa2a8f3d8003
2021-05-10 05:06:45 -07:00
Digant Kasundra
be43635087 Update rust-ini to 0.17.0
Summary: Updated rust-ini from 0.13.0 to 0.17.0

Differential Revision: D28242794

fbshipit-source-id: 249fc7d2ffdc46c4bfb4b575fb7aa8f5858a6e12
2021-05-06 06:50:28 -07:00
Jun Wu
39ed1257bf lib: remove #![deny(warnings)]
Summary:
It is considered an anti-pattern (https://rust-unofficial.github.io/patterns/anti_patterns/deny-warnings.html)
and is causing Github CI breakage unnecessarily (https://github.com/facebookexperimental/eden/runs/2402094456):

  error: function is never used: `example_blob`
      --> src/lfs.rs:1860:8
       |
  1860 |     fn example_blob() -> (Sha256, usize, Bytes) {
       |        ^^^^^^^^^^^^
       |
  note: the lint level is defined here
      --> src/lib.rs:125:9
       |
  125  | #![deny(warnings)]
       |         ^^^^^^^^
       = note: `#[deny(dead_code)]` implied by `#[deny(warnings)]`

Reviewed By: andll

Differential Revision: D27911477

fbshipit-source-id: df8d642fe74fe311eb0f329d977b9b8270c27bf4
2021-04-21 12:24:47 -07:00
Lukas Piatkowski
ad106958f2 eden/scm/lib: autogenerate all Cargo.toml files with autocargo
Summary: This diff removes the split between manually managed and autocargo managed Cargo.toml files in `eden/scm/lib`, now all files are autogenerated.

Reviewed By: quark-zju

Differential Revision: D26830884

fbshipit-source-id: 3a5d8409a61347c7650cc7d8192fa426c03733dc
2021-03-05 04:29:49 -08:00
Liubov Dmitrieva
7076cda874 fix order of arguments in error message
Summary: The order has been incorrect and led to a confusing message

Reviewed By: krallin

Differential Revision: D25559963

fbshipit-source-id: 4fcb3e53cedcb08675b60b25cbb5da2ca52c08ed
2020-12-16 06:23:00 -08:00
Liubov Dmitrieva
b83f4e3243 remove old subscription
Summary:
BE: remove old subscription to save resources in IceBreaker. The client code will recreate it anyway if missing but cleaning up will help us to reduce number of unused subscriptions.

Classic example: repo opsfiles or configerator maybe needed once and then a user don't use

Another example: switching workspaces failed and it could be result in subscriptions are not cleaned up properly

Reviewed By: markbt

Differential Revision: D24859931

fbshipit-source-id: 6df6c7e5f95859946726e04bce8bc8f3ac2d03df
2020-11-11 05:17:47 -08:00
Liubov Dmitrieva
01615ae4de improve scm daemon checks and check workspace name as well
Summary:
Move bunch of code into a separate file (scm daemon related options). Move them
out of cloud sync.

Also introduce additional check that the `hg cloud sync` command scm daemon
runs is intended for the current connected workspace

In theory when we switch a subscription, the SCM daemon gets notified but races possible and it is better to have this additional check, so SCM daemon triggers cloud sync where it is supposed to.

Reviewed By: markbt

Differential Revision: D23783616

fbshipit-source-id: b91a8b79189b7810538c15f8e61080b41abde386
2020-09-18 14:01:11 -07:00
David Tolnay
e83e05ff25 Update formatter to rustfmt 2.0
Reviewed By: zertosh

Differential Revision: D23591028

fbshipit-source-id: f458503fc2b9c25023fa1643eca5e166882a4811
2020-09-09 07:52:34 -07:00
Xavier Deguillard
4f5455cfa5 silence some Rust warnings
Summary: This is causing noise when compiling, let's silence them.

Reviewed By: kulshrax

Differential Revision: D22925881

fbshipit-source-id: 10b48f1f05ff8931e23d07a9d7e9504339fceca0
2020-08-05 00:16:33 -07:00
Liubov Dmitrieva
2c38313e9a remove dead code about secret tool
Summary:
Better Engineering: remove dead code about secret tool.

Secret tool is a FB specific tool (keychain like) and has been used to transfer OAuth token between
different devservers without user's involvement. We have migrated to certs on devservers, so it is not needed anymore.

Also, it is FB specific and doesn't make sense for open source either.

Reviewed By: mitrandir77

Differential Revision: D22827264

fbshipit-source-id: cd89168ad75ca041d2a0f18d63474dd1eaad483d
2020-07-30 06:10:18 -07:00
Lukas Piatkowski
0eb9d79a46 rust/reindeer: update eventsource to 0.5
Summary: The 0.3 version (currently being used only in one crate eden/scm/lib/commitcloudsubscriber) is using an old openssl crate which doesn't work with openssl library installed on most machines (Both in FB and on GitHub Actions).

Reviewed By: mitrandir77

Differential Revision: D22430649

fbshipit-source-id: b8fa930841dbcdd4c085d8c9488d768b3526e1c4
2020-07-08 04:15:21 -07:00
Xavier Deguillard
be7ae642ea commitcloudsubscriber: silence compiler warning
Summary:
While compiling on Windows, this file issues a bunch of warnings, use `if
cfg!` instead of `#[cfg]` to silence them. The behavior is the same, but the
later allows the compiler to recognize that some is not unused.

Reviewed By: quark-zju

Differential Revision: D20241104

fbshipit-source-id: 2cd7f171c7a2f7220cc73bea9be3359260de19b2
2020-03-04 09:49:14 -08:00
David Tolnay
d1d8fb939a Switch from failure::Fail trait to std::error::Error for errors
Summary:
This diff replaces eden's dependencies on failure::Error with anyhow::Error.

Failure's error type requires all errors to have an implementation of failure's own failure::Fail trait in order for cause chains and backtraces to work. The necessary methods for this functionality have made their way into the standard library error trait, so modern error libraries build directly on std::error::Error rather than something like failure::Fail. Once we are no longer tied to failure 0.1's Fail trait, different parts of the codebase will be free to use any std::error::Error-based libraries they like while still working nicely together.

Reviewed By: xavierd

Differential Revision: D18576093

fbshipit-source-id: e2d862b659450f2969520d9b74877913fabb2e5d
2019-11-22 08:53:31 -08:00
David Tolnay
6ff01a57ec commitcloudsubscriber: Consolidate CommitCloudHttpError into ErrorKind enum
Summary: The CommitCloudHttpError seems to have been working around a limitation of failure's derive that no longer applies to thiserror.

Reviewed By: xavierd

Differential Revision: D18523907

fbshipit-source-id: 54efaedc405911a412ce842dff6285fb80d875b8
2019-11-18 11:44:52 -08:00
David Tolnay
9c6f253858 rust: Replace derive(Fail) with derive(Error)
Summary:
This diff replaces code of the form:

```
use failure::Fail;

#[derive(Fail, Debug)]
pub enum ErrorKind {
    #[fail(display = "something failed {} times", _0)]
    Failed(usize),
}
```

with:

```
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ErrorKind {
    #[error("something failed {0} times")]
    Failed(usize),
}
```

The former emits an implementation of failure 0.1's `Fail` trait while the latter emits an impl of `std::error::Error`. Failure provides a blanket impl of `Fail` for any type that implements `Error`, so these `Error` impls are strictly more general. Each of these error types will continue to have exactly the same `Fail` impl that it did before this change, but now also has the appropriate `std::error::Error` impl which sets us up for dropping our various dependencies on `Fail` throughout the codebase.

Reviewed By: Imxset21

Differential Revision: D18523700

fbshipit-source-id: 0e43b10d5dfa79820663212391ecbf4aeaac2d41
2019-11-14 22:04:38 -08:00
David Tolnay
b1793a4416 rust: Rename Fallible<T> to Result<T>
Summary:
This diff is preparation for migrating off of failure::Fail / failure::Error for errors in favor of errors that implement std::error::Error. The Fallible terminology is unique to failure and in non-failure code we should be using Result<T>. To minimize the size of the eventual diff that removes failure, this codemod replaces all use of Fallible with Result by:

- In modules that do not use Result<T, E>, we import `failure::Fallible as Result`;
- In modules that use a mix of Result<T, E> and Fallible<T> (only 5) we define `type Result<T, E = failure::Error> = std::result::Result<T, E>` to allow both Result<T> and Result<T, E> to work simultaneously.

Reviewed By: Imxset21

Differential Revision: D18499758

fbshipit-source-id: 9f5a54c47f81fdeedbc6003cef42a1194eee55bf
2019-11-14 14:11:01 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00