Skip to content

Commit

Permalink
fix: cross-repo dependencies were broken
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Sep 6, 2018
1 parent 79ad48b commit 6827155
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (i Issue) IsReady() bool {
}

func (i Issue) NodeName() string {
return fmt.Sprintf(`"%s#%d"`, i.FullRepo(), *i.Number)
return fmt.Sprintf(`%s#%d`, i.FullRepo(), *i.Number)
}

func (i Issue) NodeTitle() string {
Expand Down Expand Up @@ -159,8 +159,8 @@ func (i Issue) AddEdgesToGraph(g *gographviz.Graph) error {
}
//log.Print("edge", i.NodeName(), "->", dependency.NodeName())
if err := g.AddEdge(
i.NodeName(),
dependency.NodeName(),
escape(i.NodeName()),
escape(dependency.NodeName()),
true,
attrs,
); err != nil {
Expand Down Expand Up @@ -202,7 +202,7 @@ func (i Issue) AddNodeToGraph(g *gographviz.Graph, parent string) error {
//log.Print("node", i.NodeName(), parent)
return g.AddNode(
parent,
i.NodeName(),
escape(i.NodeName()),
attrs,
)
}
Expand Down Expand Up @@ -249,11 +249,11 @@ func (issues Issues) prepare() error {
for _, match := range dependsOnRegex.FindAllStringSubmatch(*issue.Body, -1) {
num := match[len(match)-1]
if num[0] == '#' {
num = fmt.Sprintf(`"%s%s"`, issue.FullRepo(), num)
num = fmt.Sprintf(`%s%s`, issue.FullRepo(), num)
}
dep, found := issues[num]
if !found {
issue.Errors = append(issue.Errors, fmt.Errorf("dep %q not found", num))
issue.Errors = append(issue.Errors, fmt.Errorf("parent %q not found", num))
continue
}
issue.DependsOn = append(issue.DependsOn, dep)
Expand All @@ -265,11 +265,11 @@ func (issues Issues) prepare() error {
for _, match := range blocksRegex.FindAllStringSubmatch(*issue.Body, -1) {
num := match[len(match)-1]
if num[0] == '#' {
num = fmt.Sprintf(`"%s%s"`, issue.FullRepo(), num)
num = fmt.Sprintf(`%s%s`, issue.FullRepo(), num)
}
dep, found := issues[num]
if !found {
issue.Errors = append(issue.Errors, fmt.Errorf("dep %q not found", num))
issue.Errors = append(issue.Errors, fmt.Errorf("child %q not found", num))
continue
}
issues[num].DependsOn = append(dep.DependsOn, issue)
Expand Down

0 comments on commit 6827155

Please sign in to comment.