Use Git Commit type in GitHub mergedAs edge (#407)
Test plan: `yarn travis` passes
This commit is contained in:
parent
448fb3e1a8
commit
24a7547e16
|
@ -83,8 +83,9 @@ Object {
|
|||
"5",
|
||||
],
|
||||
"dstParts": Array [
|
||||
"sourcecred",
|
||||
"git",
|
||||
"commit",
|
||||
"COMMIT",
|
||||
"123",
|
||||
],
|
||||
"srcParts": Array [
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
import {
|
||||
type Edge,
|
||||
type EdgeAddressT,
|
||||
type NodeAddressT,
|
||||
EdgeAddress,
|
||||
NodeAddress,
|
||||
} from "../../core/graph";
|
||||
import * as GithubNode from "./nodes";
|
||||
import * as GitNode from "../git/nodes";
|
||||
|
||||
export opaque type RawAddress: EdgeAddressT = EdgeAddressT;
|
||||
|
||||
|
@ -65,11 +65,11 @@ export const createEdge = Object.freeze({
|
|||
}),
|
||||
mergedAs: (
|
||||
pull: GithubNode.PullAddress,
|
||||
commitAddress: NodeAddressT /* TODO: Make this a Git commit node address. */
|
||||
commit: GitNode.CommitAddress
|
||||
): Edge => ({
|
||||
address: toRaw({type: MERGED_AS_TYPE, pull}),
|
||||
src: GithubNode.toRaw(pull),
|
||||
dst: commitAddress,
|
||||
dst: GitNode.toRaw(commit),
|
||||
}),
|
||||
hasParent: (
|
||||
child: GithubNode.ChildAddress,
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
// @flow
|
||||
|
||||
import {type EdgeAddressT, NodeAddress, edgeToParts} from "../../core/graph";
|
||||
import {type EdgeAddressT, edgeToParts} from "../../core/graph";
|
||||
import {createEdge, fromRaw, toRaw} from "./edges";
|
||||
import * as GE from "./edges";
|
||||
import * as GN from "./nodes";
|
||||
import {COMMIT_TYPE} from "../git/nodes";
|
||||
|
||||
describe("plugins/github/edges", () => {
|
||||
const nodeExamples = {
|
||||
|
@ -45,8 +46,8 @@ describe("plugins/github/edges", () => {
|
|||
authors: () =>
|
||||
createEdge.authors(nodeExamples.user(), nodeExamples.issue()),
|
||||
mergedAs: () => {
|
||||
const commitAddress = NodeAddress.fromParts(["git", "commit", "123"]);
|
||||
return createEdge.mergedAs(nodeExamples.pull(), commitAddress);
|
||||
const commit = {type: COMMIT_TYPE, hash: "123"};
|
||||
return createEdge.mergedAs(nodeExamples.pull(), commit);
|
||||
},
|
||||
hasParent: () =>
|
||||
createEdge.hasParent(nodeExamples.reviewComment(), nodeExamples.review()),
|
||||
|
|
Loading…
Reference in New Issue