Commit Graph

985 Commits

Author SHA1 Message Date
Viet Hung Nguyen
5f43a49743 mononoke/repo_import: add a packman config
Summary: A tool to automate repo imports (intern project: https://fburl.com/hlq6cyma)

Reviewed By: krallin

Differential Revision: D22334417

fbshipit-source-id: 21125a73afede5cf555fc66294d8b02c619c6bba
2020-07-01 11:26:31 -07:00
Mark Thomas
60c5a1722b sql_ext: make sqlite LIKE case sensitive
Summary:
SQLite's `LIKE` operator is case insensitive by default.  This doesn't match MySQL, and
also seems like a surprising default.  Set the pragma on every connection to make it
case sensitive.

Reviewed By: farnz

Differential Revision: D22332419

fbshipit-source-id: 4f503eeaa874e110c03c27300467ddc02dc9b365
2020-07-01 11:08:43 -07:00
Mark Thomas
4baaceef2d bookmarks: rename BookmarkHgKind to BookmarkKind
Summary:
Whether a bookmark is publishing or not is not specific to Mercurial - it also affects
whether a commit is draft, so it is interesting to the Bonsai world.

Rename `BookmarkHgKind` to `BookmarkKind` to make this clear.

Since negatives are more awkward to work with, rename `PublishingNotPullDefault` to
`Publishing` and `PullDefault` to `PullDefaultPublishing` to make it clearer that
pull-default bookmarks are also publishing.

We can't rename the database column, so that remains as `hg_kind`.

Reviewed By: StanislavGlebik

Differential Revision: D22307782

fbshipit-source-id: 9e686a98cc5eaf9af722fa62fac5ffd4844967fd
2020-07-01 11:08:43 -07:00
Kostia Balytskyi
a40d9bb264 blobstore healer: improve incomplete batch identification logic
Summary:
Blobstore healer has a logic, which prevents it from doing busy work, when the
queue is empty. This is implemented by means of checking whether the DB query
fetched the whole `LIMIT` of values. Or that is the idea, at least. In
practice, here's what happens:

1. DB query is a nested one: first it gets at most `LIMIT` distinct
`operation_key` entries, then it gets all rows with such entries. In practice
this almost always means `# of blobstores * LIMIT` rows, as we almost always
succeed writing to every blobstore
2. Once this query is done, the rows are grouped by the `blobstore_key`, and a
future is created for each such row (for simplicity, ignore that future may not
be created).
3. We then compare the number of created futures with `LIMIT` and report an
incomplete batch if the numbers are different.

This logic has a flaw: same `blobstore_key` may be written multiple times with
different `operation_key` values. One example of this: `GitSha1` keys for
identical contents. When this happens, grouping from step 2 above will produce
fewer than `LIMIT` groups, and we'll end up sleeping for nothing.

This is not a huge deal, but let's fix it anyway.

My fix also adds some strictly speaking unnecessary logging, but I found it
helpful during this investigation, so let's keep it.

The price of this change is collecting two `unique_by` calls, both of which
allocates a temporary hash set [1] of the size `LIMIT * len(blobstore_key) * #
blobstores` (and another one with `operation_key`). For `LIMIT=100_000`
`len(blobstore_key)=255`, `# blobstores = 3` we have roughly 70 mb for the
larger one, which should be ok.

[1] https://docs.rs/itertools/0.9.0/itertools/trait.Itertools.html#method.unique

Reviewed By: ahornby

Differential Revision: D22293204

fbshipit-source-id: bafb7817359e2c867cf33c319a886653b974d43f
2020-07-01 02:08:54 -07:00
Viet Hung Nguyen
f5db2fdcdc mononoke/repo_import: add rewrite_commit functionality
Summary:
Previous commit: D22233127 (fa1caa8c4e)

In this diff, I added rewrite commit path functionality using Mover https://fburl.com/diffusion/6rnf9q2f to repo_import.
Given a prefix (e.g. new_repo), we prepend the paths of the files extracted from the bonsaichangesets given by gitimport (e.g. folder1/file1 => new_repo/folder1/file1). Previously, we did this manually when importing a git repo (https://www.internalfb.com/intern/wiki/Mercurial/Admin/ImportingRepos/) using convert extension.

Reviewed By: StanislavGlebik

Differential Revision: D22307039

fbshipit-source-id: 322533e5d6cbaf5d7eec589c8cba0c1b9c79d7af
2020-06-30 11:39:35 -07:00
Simon Farnsworth
aa00466319 Sync hook_type change from D22282802
Summary: Also fix up the parser test that now fails with this change

Reviewed By: StanislavGlebik

Differential Revision: D22306340

fbshipit-source-id: 820aad48068471b03cbc1c42107c443bfa680607
2020-06-30 11:20:54 -07:00
Mateusz Kwapich
15256a91be add an option to limit commit_history to descendants of commit
Summary: This will be used for commits_between replacement

Differential Revision: D22234236

fbshipit-source-id: c0c8550d97a9e8b42034d605e24ff54251fbd13e
2020-06-30 08:09:30 -07:00
Mateusz Kwapich
66a810a68c new history format
Summary: Some SCMQuery queries need just a list of commit hashes instead of full coverage.

Reviewed By: markbt

Differential Revision: D22165006

fbshipit-source-id: 9eeeab72bc4c88ce040d9d2f1a7df555a11fb5ae
2020-06-30 08:09:30 -07:00
Mateusz Kwapich
398ab603c2 add into_response that would map commit ids across identity schemes
Summary: This way we can go from list of changesets into changet ids that we're returning as an answer in few queries.

Differential Revision: D22165005

fbshipit-source-id: 4da8ab2a89be0de34b2870044e44d35424be5510
2020-06-30 08:09:30 -07:00
Stanislau Hlebik
c43ea517b0 mononoke: move derive_data_for_csids to derived_data_utils
Summary: It can be useful in other places as well, not only in blobimport

Reviewed By: krallin

Differential Revision: D22307314

fbshipit-source-id: f7d8c91101edc2ed4f230f7ef6796e39fbea5117
2020-06-30 06:22:31 -07:00
Mark Thomas
160936b732 bookmarks: convert to new-style BoxFutures and BoxStreams
Summary: Convert the bookmarks traits to use new-style `BoxFuture<'static>` and `BoxStream<'static>`.  This is a step along the path to full `async`/`await`.

Reviewed By: farnz

Differential Revision: D22244489

fbshipit-source-id: b1bcb65a6d9e63bc963d9faf106db61cd507e452
2020-06-30 02:37:34 -07:00
Jun Wu
4b45a2a185 test-pushrebase: use modern configs
Summary:
Enable narrow-heads.

Changed log revset from `:` to `all()` to make the test compatible.

Reviewed By: krallin

Differential Revision: D22200495

fbshipit-source-id: 148a82e77c953b9e7dbed055ef464c318e56cafa
2020-06-29 13:00:07 -07:00
Jun Wu
4c1634b9fd test-commitcloud: use modern configs
Summary:
Enable narrow-heads, and mutation. Disable obsmarker related features.

Change phase manipulation to `debugmakepublic` which works with narrow-heads.

Reviewed By: krallin

Differential Revision: D22200511

fbshipit-source-id: 8dec050f137e6cc055015fe084eb4cc67faa1216
2020-06-29 13:00:07 -07:00
Jun Wu
42b145a65d test-walker-scrub-blobstore: use modern configs
Summary:
Enable narrow-heads.

The test output seems a bit unstable - sometimes I got 28 there. So I globbed
it out.

Reviewed By: krallin

Differential Revision: D22200497

fbshipit-source-id: f005381a341d88c0bcbb09150e7d1878df7a38f3
2020-06-29 13:00:07 -07:00
Jun Wu
9eb40deffe test-pushrebase-emit-obsmarkers: use modern configs
Summary:
Enable narrow-heads.

Change the revset `:` to `all()`. With narrow-heads, `:` selects all commits
including those that are not referred by visible heads. The `all()` revset
only selects commits reachable from visible heads.

Reviewed By: krallin

Differential Revision: D22200498

fbshipit-source-id: beb863d42069ae898e419a4a75b3a707c72ae1f9
2020-06-29 13:00:07 -07:00
Jun Wu
e0c9b2b87b test-sqlblob: use modern configs
Summary:
Enable remotenames, selectivepull, and narrow-heads. Use the new stream clone
code path.

Selectivepull makes a difference. `hg pull -r HASH` also pulls the selected
bookmarks so an extra `pull` was unnecessary. Change the clone command to use
`-U` to trigger the new clone code path.

Reviewed By: krallin

Differential Revision: D22200499

fbshipit-source-id: 764202098c7e8afdbb5e2ee83679da7570c08c90
2020-06-29 13:00:07 -07:00
Jun Wu
adcf846f2f test-reduction: use modern configs
Summary:
Enable remotenames and narrow-heads.

Local bookmarks are replaced by remote bookmarks, causing the test change.

Reviewed By: krallin

Differential Revision: D22200500

fbshipit-source-id: aeee528d1766e0642c12e78a6c1a50cadc8a579a
2020-06-29 13:00:07 -07:00
Jun Wu
d1da1d70c1 test-push-redirector-sync-job: use modern configs
Summary:
Enable remotenames and narrow-heads.

The commits become 'draft' because there are no remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200514

fbshipit-source-id: 04d0befa7c22756e936a28ffdcdf1305057cf062
2020-06-29 13:00:07 -07:00
Jun Wu
2875942761 test-infinitepush: use modern configs
Summary:
Enable remotenames and narrow-heads.

The test was migrated cleanly. The only change is that local bookmarks are
replaced by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200510

fbshipit-source-id: f5b8cd2ed125e9fc4e5daac897851d91fef5693f
2020-06-29 13:00:07 -07:00
Jun Wu
6ecf255fcf test-infinitepush-mutation: use modern configs
Summary:
Enable remotenames and narrow-heads.

Local bookmarks are replaced by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200503

fbshipit-source-id: 41ac4f4f606011dcaf6d0d9867b01fb77b9a79d8
2020-06-29 13:00:07 -07:00
Jun Wu
95cf4a2a39 test-infinitepush-hydrated: use modern configs
Summary:
Enable remotenames and narrow-heads.

Phase exchange is gone because of narrow-heads.
The remtoenames extension was written suboptimally so it issued a second
bookmarks request (which, hopefully can be removed by having selective
pull everywhere and migrate pull to use the new API).

Reviewed By: krallin

Differential Revision: D22200506

fbshipit-source-id: c522bb9fc1396d813e0f1f380c4290445bab3db3
2020-06-29 13:00:07 -07:00
Jun Wu
ffde9f50e9 test-infinitepush-commits-disabled: use modern configs
Summary:
Enable remotenames and narrow-heads. The `master_bookmark` is no longer a local
bookmark in the client repo.

Reviewed By: krallin

Differential Revision: D22200513

fbshipit-source-id: bc3c1715ce21f45a35bc67148eb00e44944bea6e
2020-06-29 13:00:06 -07:00
Jun Wu
8ecb79a921 test-gettreepack-sparse-update: use modern configs
Summary: Enable remotenames and narrow-heads.

Reviewed By: krallin

Differential Revision: D22201083

fbshipit-source-id: 585dff69db9dd725c8fa1090d47c85b150f979da
2020-06-29 13:00:06 -07:00
Jun Wu
439c029007 test-gettreepack-designated-nodes: use modern configs
Summary:
Enable remotenames and narrow-heads. The server gets one more request from
remotenames.

Reviewed By: krallin

Differential Revision: D22200502

fbshipit-source-id: 26bc28b19438c7be4a19eae6be728c83b113f822
2020-06-29 13:00:06 -07:00
Jun Wu
93318c255b test-bookmark-hg-kind: use modern configs
Summary:
Enable remotenames and narrow-heads. The client gets remote bookmarks instead
of local bookmarks during clone and phases are decided by remote bookmarks.

Reviewed By: krallin

Differential Revision: D22200515

fbshipit-source-id: 12a9e892855b3a8f62f01758565de5f224c4942b
2020-06-29 13:00:06 -07:00
Jun Wu
8bde7d1316 tests: show remotenames in tglogpnr
Summary:
Change the template to show remote bookmarks, which will be more relevant once
we migrate to modern configs. Namely, phases will be decided by remote bookmarks.

The named branches logic was mostly removed from the code base. Therefore
drop the `{branches}` template.

Reviewed By: StanislavGlebik

Differential Revision: D22200512

fbshipit-source-id: 8eca3a71ff88b8614023f4920a448156fcd712d5
2020-06-29 13:00:06 -07:00
Jun Wu
dbd29b7d06 tests: turn on narrow-heads for some tests
Summary: With narrow-heads, the phase exchange step is skipped.

Reviewed By: krallin

Differential Revision: D22200504

fbshipit-source-id: 6ab366e7e68eb3b82f52acaa8f488747435e0ecf
2020-06-29 13:00:06 -07:00
Jun Wu
889beacdf1 tests: enable narrow-heads for Mononoke tests
Summary:
Most tests pass without changes. Some incompatible tests are added to the
special list.

Reviewed By: krallin

Differential Revision: D22200505

fbshipit-source-id: 091464bbc7c9c532fed9ef91f2c955d6e4f2df0b
2020-06-29 13:00:06 -07:00
Stanislau Hlebik
04ce32014d mononoke: log pushed commits to scribe
Summary: This is the final diff of the stack - it starts logging pushed commits to scribe

Reviewed By: farnz

Differential Revision: D22212755

fbshipit-source-id: ec09728408468acaeb1c214d43f930faac30899b
2020-06-29 12:15:22 -07:00
Stanislau Hlebik
6fd54d6b22 mononoke: don't fail if logging to scribe failed
Summary:
Failing push if we failed to log to scribe doesn't make a lot of sense. By that
time the ship has sailed - commit has already been pushed and by failing the
request we can't undo that. It will just create an annoyance by whoever is
pushing.

Instead let's log it to scuba

Reviewed By: farnz

Differential Revision: D22256687

fbshipit-source-id: 2428bbf1db4cef6fa80777ad65184fab1804fa9c
2020-06-29 12:15:22 -07:00
Stanislau Hlebik
8a137ae922 mononoke: add Scribe
Summary:
At the moment we can't test logging to scribe easily - we don't have a way to
mock it. Scribe are supposed to help with that.

They will let us to configure all scribe logs to go to a directory on a
filesystem similar to the way we configure scuba. The Scribe itself will
be stored in CoreContext

Reviewed By: farnz

Differential Revision: D22237730

fbshipit-source-id: 144340bcfb1babc3577026191428df48e30a0bb6
2020-06-29 12:15:22 -07:00
Jun Wu
4902a3300c tests: enable narrow-heads by default
Summary: Many tests are incompatible. But many are passing.

Reviewed By: kulshrax

Differential Revision: D22052475

fbshipit-source-id: 1f30ac2b0fe034175d5ae818ec2be098dbd5283d
2020-06-29 11:29:04 -07:00
Simon Farnsworth
7e9b8dd9e9 Remove last vestiges of Lua hooks from tests
Summary:
For Lua hooks, we needed to know whether to run the hook per file, or per changeset. Rust hooks know this implicitly, as they're built-in to the server.

Stop having the tests set an unnecessary config

Reviewed By: krallin

Differential Revision: D22282799

fbshipit-source-id: c9f6f6325823d06d03341f04ecf7152999fcdbe7
2020-06-29 10:03:22 -07:00
Harvey Hunt
026710c2cd mononoke: Remove --config_path from server arguments
Summary:
D21642461 (46d2b44c0e) converted Mononoke server to use the
`--mononoke-config-path` common argument style to select a config path.

Now that this change has been running for a while, remove the extra logic in
the server that allowed it to accept both the deprecated `--config_path / -P`
and the new arg.

Reviewed By: ikostia

Differential Revision: D22257386

fbshipit-source-id: 7da4ed4e0039d3659f8872693fa4940c58bae844
2020-06-29 07:28:36 -07:00
Stanislau Hlebik
f55fa975a5 mononoke: fix unused imports
Reviewed By: krallin

Differential Revision: D22281331

fbshipit-source-id: 656ba6500193bd179d1e6cd1443de3e85d37c597
2020-06-29 03:22:11 -07:00
Kostia Balytskyi
fb3eea2b56 commit_validator: get rid of unneeded bookmark rewriting
Summary:
`get_entry_with_small_repo_mapings` is a function that turns a `CommitEntry`
struct into `CommitEntryWithSmallReposMapped` struct - the idea being that this
function looks up hashes of commits into which the original commit from the
large repo got rewritten (in practice rewriting may have happened in the small
-> large direction, but it is not important for the purpose of this job). So it
establishes a mapping. Before this
diff, it actually established `Large<ChangesetId> ->
Option<(Small<ChangesetId>, Option<BookmarkName>)>` mapping, meaning that it
recorded into which bookmark large bookmark was rewritten. This was a useless
information (as evidenced by the fact that it was ignored by the
`prepare_entry` function, which turns `CommitEntryWithSmallReposMapped` into
`EntryPreparedForValidation`. It is useless because bookmarks are mutable and
it is impossible to do historic validation of the correctness of bookmark
renaming: bookmarks may have been correctly renamed when commits where pushes,
but they may be incorrectly renamed now and vice-versa. To deal with bookmarks,
we have a separate job, `bookmarks_validator`.

So this diff stops recording this useless information. As a bonus, this will
make migration onto `LiveCommitSyncConfig` easier.

Reviewed By: StanislavGlebik

Differential Revision: D22235389

fbshipit-source-id: c02b3f104a8cbd1aaf76100aa0930efeac475d42
2020-06-29 01:48:52 -07:00
Kostia Balytskyi
b7dba9ff2f cross_repo_sync: expose get_commit_sync_outcome as a public fn
Summary: We need to be able to query `synced_commit_mapping` to understand which `version_name` was used to sync commits. That `version_name` will be needed to produce `CommitSyncConfig` by utilizing upcoming `LiveCommitSyncConfig` APIs. And `CommitSyncConfig` is needed to create `CommitSyncer`. So let's extract this fn out of `CommitSyncer`, as it's an independent functionality really

Reviewed By: farnz

Differential Revision: D22244952

fbshipit-source-id: 53e55139efd423174176720c8bf7e3ecc0dcb0d7
2020-06-27 04:42:54 -07:00
Kostia Balytskyi
c01294e8d6 backsyncer_cmd: use LiveCommitSyncConfig
Summary:
This diff migrates `backsyncer_cmd` (the thing that runs in the separate backsyncer job, as opposed to bakcsyncer, triggered from push-redirector) onto `LiveCommitSyncConfig`. Specifically, this means that on every iteration of the loop, which calls `backsync_latest` we reload `CommitSyncConfig` from configerator, build a new `CommitSyncer` from it, and then pass that `CommitSyncer` to `backsync_latest`.

One choice made here is to *not* create `CommitSyncer` on every iteration of the inner loop of `backsync_latest` and handle live configs outside. The reason for this is twofold:
- `backsync_latest` is called form `PushRedirector` methods, and `PushRedirector` is recreated on each `unbundle` using `LiveCommitSyncConfig`. That call provides an instance of `CommitSyncer` used to push-redirect a commit we want to backsync. It seems strictly incorrect to try and maybe use a different instance.
- because of some other consistency concerns (different jobs getting `CommitSyncConfig` updates at different times), any sync config change needs to go through the following loop:
  - lock the repo
  - land the change
  - wait some time, until all the possible queues (x-repo sync and backsync) are drained
  - unlock the repo
- this means that it's ok to have the config refreshed outside of `backsync_latest`

Reviewed By: farnz

Differential Revision: D22206992

fbshipit-source-id: 83206c3ebdcb2effad7b689597a4522f9fd8148a
2020-06-26 13:40:31 -07:00
Kostia Balytskyi
9a00efc973 cmdlib: expose test-instance and local-configerator-path
Summary:
Before this diff only the main Mononoke server binary was able to use fs-based
`ConfigStore`, which is pretty useful in integration tests.

Reviewed By: farnz

Differential Revision: D22256618

fbshipit-source-id: 493a064a279250d01469c9ff7f747585581caf51
2020-06-26 06:51:07 -07:00
Simon Farnsworth
7938a1957a Support BlobstoreWithLink in Sqlblob
Summary: We designed the schema to make this simple to implement - it's literally a metadata read and a metadata write.

Reviewed By: ikostia

Differential Revision: D22233922

fbshipit-source-id: b392b4a3a23859c6106934f73ef60084cc4de62c
2020-06-26 03:54:42 -07:00
Simon Farnsworth
b1c85aaf4b Switch Blobstore to new-style futures
Summary:
Eventually, we want everything to be `async`/`await`; as a stepping stone in that direction, switch the remaining lobstore traits to new-style futures.

This just pushes the `.compat()` out to old-style futures, but it makes the move to non-'static lifetimes easier, as all the compile errors will relate to lifetime issues.

Reviewed By: krallin

Differential Revision: D22183228

fbshipit-source-id: 3fe3977f4469626f55cbf5636d17fff905039827
2020-06-26 03:54:42 -07:00
Kostia Balytskyi
ef87f564bc add newtype for CommitSyncConfigVersion
Summary:
This is to avoid passing `String` around. Will be useful in one of the next
diffs, where I add querying `LiveCommitSyncConfig` by versions.

Reviewed By: krallin

Differential Revision: D22243254

fbshipit-source-id: c3fa92b62ae32e06d7557ec486d211900ff3964f
2020-06-26 02:45:26 -07:00
Viet Hung Nguyen
fa1caa8c4e mononoke/repo_import: Add gitimport functionality and integration test
Summary: I have previously moved the gitimport functionality (D22159880 (2cf5388835)) into a separate library, since repo_import shares similar behaviours. In this diff, I setup repo_import to be able to call gitimport to get the commits and changes. (Next steps include using Mover to set the paths of the files in the commits given by gitimport)

Reviewed By: StanislavGlebik

Differential Revision: D22233127

fbshipit-source-id: 4680c518943936f3e29d21c91a2bad60108e49dd
2020-06-25 19:54:38 -07:00
Simon Farnsworth
454de31134 Switch Loadable and Storable interfaces to new-style futures
Summary:
Eventually, we want everything to be `async`/`await`; as a stepping stone in that direction, switch some of the blobstore interfaces to new-style `BoxFuture` with a `'static` lifetime.

This does not enable any fixes at this point, but does mean that `.compat()` moves to the places that need old-style futures instead of new. It also means that the work needed to make the transition fully complete is changed from a full conversion to new futures, to simply changing the lifetimes involved and fixing the resulting compile failures.

Reviewed By: krallin

Differential Revision: D22164315

fbshipit-source-id: dc655c36db4711d84d42d1e81b76e5dddd16f59d
2020-06-25 08:45:37 -07:00
Mark Thomas
9a6ed4b6ca mutationstore: deal with history being extended backwards
Summary:
If the first client to send mutation data for a commit is only aware of partial
history for that commit, the primordial commit that is determined will be the
earliest of those commits.  If another client comes along later with a longer
history, the new set of commits will be assigned a different primordial commit.

Make sure that when this happens, we still fetch the full history.  We do this
by including the successor in the search-by-primordial case, which allows us
to join together disconnected histories at the cost of one extra round-trip to
the database.

Note that the fast path for addition of a single mutation will not fill in the
missing history.  This is an acceptable trade-off for the faster performance
in the usual case.

Reviewed By: mitrandir77

Differential Revision: D22206317

fbshipit-source-id: 49141d38844d6cddc543b6388f0c31dbc70dcbc5
2020-06-25 06:29:15 -07:00
Mark Thomas
0f229aff4c mutationstore: deal with cycles when determining primordial changesets
Summary:
By design, the mutation history of a commit should not have any cycles.  However,
synthetic entries created by backfilling obsmarkers may inadvertently create
erroneous cycles, which must be correctly ignored by the mutation store.

The mutation store is affected by cycles in two ways:

* Self-referential entries (created by backfilling "revive" obsmarkers) must
  be dropped early on, as these will overwrite any real mutation data for
  that successor.

* Larger cycles will prevent determination of the primordial commit for
  primordial optimization.  Here we drop all entries that are part of the cycle.
  These entries will not be shareable via the mutation store.

Note that it is still possible for cycles to form in the store if they are
added in multiple requests - the first request with a partial cycle will
allow determination of a primordial commit which is then used in subsequent
requests.  That's ok, as client-side cycle detection will break the cycle in
these entries.

As we move away from history that has been backfilled from obsmarkers, this
will become less of a concern, as cycles in pure mutation data are impossible
to create.

Reviewed By: mitrandir77

Differential Revision: D22206318

fbshipit-source-id: a57f30a19c482c7cde01cbd26deac53b7bb5973f
2020-06-25 06:29:15 -07:00
Stanislau Hlebik
b0e910655a mononoke: allow pushing only a single bookmark during push
Summary:
Push supported multiple bookmarks in theory, but in practice we never used it.
Since we want to start logging pushed commits in the next diffs we need to decide what to do with
bookmarks, since at the moment we can log only a single bookmark to scribe

let's just allow a single bookmark push

Reviewed By: farnz

Differential Revision: D22212674

fbshipit-source-id: 8191ee26337445ce2ef43adf1a6ded3e3832cc97
2020-06-25 05:51:30 -07:00
Stanislau Hlebik
a8209eb712 mononoke: pass PushParams to MononokeRepo
Summary:
In the next diffs it will be passed to unbundle processing so that we can use
scribe category to log pushed commits

Reviewed By: krallin

Differential Revision: D22212616

fbshipit-source-id: 17552bda11f102041a043f810125dc381e478611
2020-06-25 05:51:29 -07:00
Thomas Orozco
ea734ae0af mononoke/repo_client: log perf counters for long running command
Summary: That was like 50% of the point of this change, and somehow I forgot to do it.

Reviewed By: farnz

Differential Revision: D22231923

fbshipit-source-id: 4a4daaeaa844acd219680907c0b5a5fdacdf535c
2020-06-25 04:13:22 -07:00
Kostia Balytskyi
016b101be9 xrepo: add CommitSyncerArgs
Summary:
Similarly to how we have `PushRedirectorArgs`, we need `CommitSyncerArgs`: a struct, which a long-living process can own and periodically create a real `CommitSyncer` out of it, by consuming freshly reloaded `CommitSyncConfig`.

It is a little unfortunate that I am introducing yet another struct to `commit_rewriting/cross_repo_sync`, as it's already pretty confusing with `CommitSyncer` and `CommitSyncRepos`, but hopefully `CommitSyncerArgs`'s purpose is simple enough that it can be inferred from the name. Note that this struct does have a few convenience methods, as we need to access things like `target_repo` and various repo ids before we even create a real `CommitSyncer`. This makes it's purpose a little less singular, but still fine IMO.

Reviewed By: StanislavGlebik

Differential Revision: D22197123

fbshipit-source-id: e2d993e186075e33acec00200d2aab10fb893ffd
2020-06-25 03:28:08 -07:00