sapling/tests
Matthew Dippel 3fdda29376 Adding support for is_ancestor queries to the Mononoke API server
Summary:
Adding support to the Mononoke API server for naive is_ancestor queries using a BFS.

The API server now supports queries as:
Request URL: "{repo}/is_ancestor/{proposed_ancestor}/{proposed_descendent}"
 where the arguments in the URL are:
    - repo: the name of the repo to query reachability in
    - proposed_ancestor: a 20 byte hex encoded string representing a node hash
    - proposed_descendent: a 20 byte hex encoded string representing a node hash

Response: One of:
    - the string, "true", if 'proposed_ancestor' is an ancestor of 'proposed_descendent' in 'repo'.
    - the string, "false", if the above condition isn't satisfied.
    - an error if the query couldn't be performed

This involved adding:
- new enum values for the MononokeRepoQuery and MononokeRepoResponse structs for 'IsAncestor' queries and responses.
- a dependency on the 'mononoke/reachabilityindex' crate.
- a 'is_ancestor' function to the MononokeRepoActor struct, which delegates queries to a GenerationNumberBFS index.
- appropriate url handling to the server object in main
- New enums to the API server ErrorKind, and appropriate down casting from the ReachabilityIndex ErrorKind.
- Integration tests which made the test repo in test-apiserver.t have a few branches, and queries the API server for reachability of pairs of commits.

Reviewed By: fanzeyi

Differential Revision: D8844221

fbshipit-source-id: 1ba102fede378688243827850ff67aabc587a748
2018-07-23 09:23:07 -07:00
..
fixtures fixtures: fix and update fixtures 2018-07-17 11:08:18 -07:00
integration Adding support for is_ancestor queries to the Mononoke API server 2018-07-23 09:23:07 -07:00
performance rename new_blobimport to blobimport 2018-06-12 15:40:10 -07:00
utils mononoke: add simple utility to generate dependencies in TARGETS files 2017-09-20 04:19:45 -07:00