Commit Graph

5 Commits

Author SHA1 Message Date
Mateusz Kwapich
3ff29a8810 make BonsaiGitMapping repo-specific
Summary:
Nearly all of the Mononoke SQL stores are instantiated once per repo but they don't store the `RepositoryId` anywhere so every method takes it as argument. And because providing the repo_id on every call is not ergonomical we tend to add methods to blob_repo that just call the right method with the right repo_id in on of the underlying stores (see `get_bonsai_from_globalrev` on blobrepo for example).

Because my reviewers [pushed back](https://our.intern.facebook.com/intern/diff/D19972871/?transaction_id=196961774880671&dest_fbid=1282141621983439) when I've tried to do the same for bonsai_git_mapping  I've decided to make it right by adding the repo_id to the BonsaiGitMapping.

Reviewed By: krallin

Differential Revision: D20029485

fbshipit-source-id: 7585c3bf9cc8fa3cbe59ab1e87938f567c09278a
2020-02-27 08:05:13 -08:00
Stanislau Hlebik
19e1e94984 mononoke: add lease renewing to derived data
Summary:
During S196197 lease expired and we were rederiving the same derived data over and over again for a big commit.
this diff adds lease renewal that should help with this problem.

Reviewed By: HarveyHunt

Differential Revision: D20093323

fbshipit-source-id: d139abf6659722f47ea40d9b2f279daa03623ff4
2020-02-25 09:22:46 -08:00
Mateusz Kwapich
6111067524 add git mapping pushrebase hook
Summary:
Let's populate the bonsai<->git mapping on pushrebase of the commits that are
coming from git. By this being a pushrebase hook we can have the accuare mappings
being available as soon as the bonsai commit is available.

Corresponding configerator change: D19951607

Reviewed By: krallin

Differential Revision: D19949472

fbshipit-source-id: b957cbcdd0f14450ceb090539814952db9872576
2020-02-21 05:41:45 -08:00
Mateusz Kwapich
38f7a24364 add a way to update git mappings inside SQL transaction
Summary: During the pushrebase hook phase we'll need to reuse existing transaction.

Reviewed By: krallin

Differential Revision: D19949473

fbshipit-source-id: 7c53308724bec6df6d40933405f703c86be15a7a
2020-02-21 05:41:45 -08:00
Mateusz Kwapich
5a53415bcb add git mapping crate
Summary:
We need a table to store git<->bonsai mappings and a crate that would abrstract operations on it:
 * it's going to be useful immediately to store git hashes for configerator
   commits and doing the hash translations via SCS.
 * it's going to be useful further down the line for real git support.

NOTE: I'm explicitly using the name `SHA1` all over the place to minimize the
confusion if we'll ever want to support other hashing schemes for git commits.
(Git Community is working on SHA256 support nowdays).

The corresponding AOSC diff: D19835975

Reviewed By: krallin

Differential Revision: D19835974

fbshipit-source-id: 113640f4db9681b060892a8cedd93092799ab732
2020-02-21 05:41:44 -08:00