dmitri.shuralyov.com/website/gido/...

matching by import path pattern misses many packages #5

Opendmitshur opened this issue 1 month ago
dmitshur commented 1 month ago ยท edited

When an issue or change has a path that doesn't match any existing directory, it normally gets assigned to the repository root or "other". Such issues and changes are missed when doing a query by import path pattern.

This happens because they're added using the original paths, without checking that those paths correspond to any existing directory:

if len(paths) > 0 {
	c.Title = ImportPathsToFullPrefix(paths) + title
	switch c.State {
	case change.OpenState:
		// TODO: paths may match zero existing directories,
		// then it can never be matched by an import path pattern.
		// Need to check if all paths are unrecognized, and handle that appropriately.
		openChanges = append(openChanges, ChangeAndPaths{c, paths})
	case change.ClosedState, change.MergedState:
		closedChanges = append(closedChanges, ChangeAndPaths{c, paths})
	}
}

For example, consider https://gochanges.org/golang.org/x/playground which currently shows 4 open CLs, 148 closed CL, and https://gochanges.org/golang.org/x/playground/... which currently matches 0 open CLs and 9 closed CLs (143 CLs are missing).

Write Preview Markdown
to comment.