Commit Graph

9 Commits

Author SHA1 Message Date
Jun Wu
cae849f562 edenapi: use Vec instead of Response for lookup related endpoints
Summary:
See previous diff for context. This makes the endpoint a bit easier to use.

Also add retry, since it's now easier with the Vec type.

Reviewed By: yancouto

Differential Revision: D31416217

fbshipit-source-id: 40de6d14cf5cd088cd69156758699706bc7b8b8b
2021-10-12 15:05:14 -07:00
Liubov Dmitrieva
48cfd2e7ee EdenApiUploads: eliminate extra lookup if no stacks
Summary:
EdenApiUploads: eliminate extra lookup if no stacks

In EdenApiUploads we filter heads first and then we filter the commits belonging to these stacks.

However, in some usecases users don't use stacks. If there is no any single stack, the second lookup would be redundant and it would be nice to avoid it completely.

We can pass a flag to the upload code saying that extra filtering is not needed.

For example, in configerator repo users usually don't do stacks.

Reviewed By: markbt

Differential Revision: D31203489

fbshipit-source-id: 0921a01198bfc377afc3af3f7319fd0c5fec04d7
2021-09-27 10:27:16 -07:00
Liubov Dmitrieva
aa85540932 optimization for edenapi uploads
Summary:
optimization for edenapi upload

Lookup for filenodes and trees can be done in parallel. Usually we have a small number of trees to check and a small number of filenodes, it is better to send them in a single lookup request, so they all can be checked in parallel. Parallelism limit for the lookup request is few thousands, so almost always if we merge the requests here, they will be parallelised.

Reviewed By: yancouto

Differential Revision: D31127401

fbshipit-source-id: 8014b27a2ba9d082babe2e0cd7bebf43c8b46082
2021-09-24 07:49:15 -07:00
Liubov Dmitrieva
b16b45f902 add scuba metrics for stages of EdenApi Uploads
Summary:
add scuba metrics for stages of EdenApi Uploads

add cloud sync reason for manual run

This is an effort to improve our Eden Api Uploads metrics and Commit Cloud metrics, so we can analyse and improve its performance.

Reviewed By: markbt

Differential Revision: D31109948

fbshipit-source-id: ee5a449e2652ea1798997ae2c52c4672f55e3eae
2021-09-24 05:33:23 -07:00
Yan Soares Couto
5961e2b4ca edenapi: Delete commitcloud bonsai upload client code
Summary:
Using bonsai upload on commitcloud was useful to get things started, but it's not really necessary, and by removing we can simplify things a bit, since for snapshots it's a single commit.

This diff removes the client code. The server code is still used by snapshots, but will be simplified in a following diff.

Reviewed By: liubov-dmitrieva

Differential Revision: D30018157

fbshipit-source-id: 98bf0d30959de0c63b01bd11442f0bb3c538fcc7
2021-08-05 09:29:45 -07:00
Yan Soares Couto
abc853aacf snapshot: Populate author, date, parents and file type correctly
Summary:
These fields had placeholder values and are now populated properly. I found out about `workingctx` which has most information I need about uncommitted changes that will create the snapshot.

TODO on next diffs:
- Remove code for uploading commit cloud stuff via bonsai, and simplify API.
- Verify created bonsai is valid before persisting it
- Store files and bonsai blobs in the created ephemeral bubble
- Modify bonsai changeset objects so they can contain snapshot information

Reviewed By: liubov-dmitrieva

Differential Revision: D30013238

fbshipit-source-id: c509d25c59d6396d922435cc3a97fc837d3fe51b
2021-08-05 09:29:44 -07:00
Liubov Dmitrieva
8e99088d58 Update backup state in hg cloud upload command
Summary:
Update backup state in `hg cloud upload` command

The backup state is used by `hg sl`, so it would be nice to keep it up-to-date after `hg cloud upload` command, similar to old `hg cloud backup`.

Also, we should add heads what we filtered in order to update the backup state correctly.

So, it will now returned list of uploaded heads as nodes (including filtered) and list of failed commits as nodes (not only heads).

Reviewed By: markbt

Differential Revision: D29878296

fbshipit-source-id: 5848e9f86175fbdc56db123cf7ba0d5fc51273b0
2021-07-29 12:11:57 -07:00
Yan Soares Couto
4bde7b7488 Use bonsai changeset upload on client
Summary:
## High level goal

This stack aims to add a way to upload commits directly using the bonsai format via edenapi, instead of using the hg format and converting on server.

The reason this is necessary is that snapshots will be uploaded on bonsai format directly, as hg format doesn't support them. So this is a stepping stone to do that, first being implemented on commit cloud upload, as that code already uses eden api, and later will be used by the snapshotting commands.

## This diff

This diff actually ties everything together from the stack and makes it work end to end. By creating the following client side changes:
- Add some config to use the bonsai format when uploading via EdenApi. The config is disabled by default.
- Add wrapper around new uploadfileblobs method (from D29799484 (8586ae1077))
- Getting the correct data to call the bonsai changeset upload endpoint created on D29849963 (b6548a10cb)
  - Some fields are String and not bytes
  - Some fields are renamed
  - File size and type can be acquired from file context. file content id, which is also required, is obtained as a response from the uploadfileblobs method: Behaviour added on D29879617 (9aae11a5ab)

Reviewed By: liubov-dmitrieva

Differential Revision: D29849964

fbshipit-source-id: a039159f927f49bbc45d4e0160ec1d3a01334eca
2021-07-28 02:16:35 -07:00
Liubov Dmitrieva
bf41088ef2 Move EdenApi Uploads code from commit cloud extension to core
Summary:
Move EdenApi Uploads code from commit cloud extension to core

So this can be later used for pushes as well. The code is not commit cloud specific.

The function takes revs and returns uploaded, failed lists that are also revs.

Reviewed By: yancouto

Differential Revision: D29846299

fbshipit-source-id: e3a7fbc56f0b651c738dc06da7fdb7cde4feedf7
2021-07-22 11:52:57 -07:00