Giter Club home page Giter Club logo

todo-tracks's Introduction

TODO Tracks

TODO Tracks is a tool to let users get a handle on the various TODOs they or their teammate have added over time. This allows people to track progress by examining the TODOs remaining.

The tool examines all the branches in a git repo (local and remote), finds the TODOs in the different revisions, and presents them to the user.

Use cases:

  • List the TODOs in a branch.
  • Examine when a TODO was added, removed, and who added it.
  • Show which branches a TODO is in.

Disclaimer

This is not an official Google product.

Prerequisites

Building requires the Go tools and GNU Make. Running the built binary requires the git command line tool.

Building the source code

First checkout the code from the git repo:

git clone [email protected]:google/todo-tracks.git

Build the binary:

make

And then launch it:

bin/todos

The tracker requires that it be started in a directory that contains at least one git repo, and it shows the TODOs from every git repo under that directory.

The UI for the tracker is a webserver which defaults to listening on port 8080. To use a different port, pass it as an argument to the "--port" flag:

bin/todos --port=12345

For more details about the supported command line flags, pass in the "--help" flag.

bin/todos --help

todo-tracks's People

Contributors

benceszalai avatar k4leung4 avatar nicolai86 avatar ojarjur avatar tmc avatar wzheng2310 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

todo-tracks's Issues

test issues

Sorry i didnt realize i wasn't on my personal repo. I can't find a way to delete it...

Building broken - cannot make

Cannot build it. First try results in:

gofmt -w `find ./ -name '*.go'`
mkdir -p bin
go build -o bin/resource-constants utils/resource-constants.go
if [ ! -e "resources" ]; then mkdir resources; fi
bin/resource-constants --base_dir /my/local/path/to/todo-tracks/ui/ > resources/constants.go
go test ./...
pattern ./...: directory prefix . does not contain main module or its selected dependencies
make: *** [test] Error 1

Make only succeeds if I first run this command:

go mod init "github.com/google/todo-tracks"

Line numbers are off if file starts with newlines

Whenever a file start with newline character, in other words with empty lines, the ToDo items are detected with wrong line numbers.

Lets consider 4 files:

  • test1.ts has the first word character in the 1st line
  • test2.ts has the first word character in the 2nd line, the 1st line is empty
  • test3.ts has the first word character in the 3rd line, the 1st and the 2nd lines are empty
  • test4.ts has the first word character in the 4th line, the 1st, 2nd and the 3rd lines are empty

In the list view the UI shows this:

  • test1.ts: Line: 1, Content // ToDo: this todo item is in line 1
  • test2.ts: Line: 1, Content ``
  • test3.ts: Line: 1, Content ``
  • test4.ts: Line: 1, Content ``

From this it looks like the code truncates newlines from the beginning of the file when detecting in which line the ToDo items are, so it says 1 for all files, however it than reads that detected line (1) from the actual file resulting in the content to be that of the 1st line, which is an empty line.

If I look at any of the files over the UI (http://localhost:12345/raw?repo=36...51&revision=b8...59&fileName=test2.ts&lineNumber=1) it shows a preview for all files with the ToDo item in the first line, no newlines on the top.

To see more complex behaviour let's look at this file:




// This is line 4

// This is line 6
// This is line 7
// This is line 8

// ToDo: this todo item is in line 10

// This is line 12
// This is line 13
// This is line 14
// This is line 15

// This is line 16

Now we have this line for this test5.ts file in the list:

  • test5.ts: Line: 7, Content // This is line 7

This shows us that instead of the ToDo in line 10 it determined it to be in line 7, an offset of 3, the same as the number of empty lines on the top of the file. However once the wrong line numbers are determined, the contents of those lines are read correctly, so we get an odd result not only because the line numbers are incorrect, but because the preview doesn't even have a ToDo in them.

Now if i follow the link on the preview (http://localhost:12345/ui/todo_details.html#?repo=3651&revision=7ba3&fn=test5.ts&ln=7) the Context section shows the ToDo in the center showing that either the context is extracted by the correct line number 10 or is read from the version of the file which has the leading linebreaks trimmed. I think the case is probably the latter, as visiting the file link (http://localhost:12345/raw?repo=36...51&revision=7b..a3&fileName=test5.ts&lineNumber=1) the ToDo item is shown to be in line 7, with the empty lines removed from the top.

fatal error: concurrent map read and map write

I compiled the binary and opened the todo-tracks repo and was able to browse it, but when I tried on my private personal repo I got the following. I do have submodules, not sure what the restrictions currently are.

โฏ ../todo-tracks/bin/todos
fatal error: concurrent map read and map write

goroutine 856 [running]:
runtime.throw(0x7d52c5, 0x21)
/usr/lib/go-1.9/src/runtime/panic.go:605 +0x95 fp=0xc4204d55c0 sp=0xc4204d55a0 pc=0x42bf15
runtime.mapaccess1_faststr(0x7621c0, 0xc42008f0b0, 0xc4201da0ac, 0x28, 0xc4204d5660)
/usr/lib/go-1.9/src/runtime/hashmap_fast.go:217 +0x43a fp=0xc4204d5618 sp=0xc4204d55c0 pc=0x40d21a
repo.(*gitRepository).asyncLoadFileTodos(0xc420114340, 0xc42019e0a8, 0x28, 0xc42018bf25, 0x1b, 0xc4201da0ac, 0x28, 0x7d9fb8, 0x30, 0xc4201c84e0)
/home/joetoth/projects/todo-tracks/src/repo/git.go:314 +0x6d fp=0xc4204d5790 sp=0xc4204d5618 pc=0x6f89ad
runtime.goexit()
/usr/lib/go-1.9/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc4204d5798 sp=0xc4204d5790 pc=0x459c21
created by repo.(*gitRepository).asyncLoadRevisionTodos
/home/joetoth/projects/todo-tracks/src/repo/git.go:287 +0x178

goroutine 1 [IO wait]:
internal/poll.runtime_pollWait(0x7f98c7cf1f70, 0x72, 0xffffffffffffffff)
/usr/lib/go-1.9/src/runtime/netpoll.go:173 +0x57
internal/poll.(*pollDesc).wait(0xc420130098, 0x72, 0xc420065b00, 0x0, 0x0)
/usr/lib/go-1.9/src/internal/poll/fd_poll_runtime.go:85 +0xae
internal/poll.(*pollDesc).waitRead(0xc420130098, 0xffffffffffffff00, 0x0, 0x0)
/usr/lib/go-1.9/src/internal/poll/fd_poll_runtime.go:90 +0x3d
internal/poll.(*FD).Accept(0xc420130080, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/lib/go-1.9/src/internal/poll/fd_unix.go:335 +0x1e2
net.(*netFD).accept(0xc420130080, 0x7f98c7d2d000, 0x0, 0x7e2448)
/usr/lib/go-1.9/src/net/fd_unix.go:238 +0x42
net.(*TCPListener).accept(0xc42000e050, 0xc420065cc0, 0x412828, 0x30)
/usr/lib/go-1.9/src/net/tcpsock_posix.go:136 +0x2e
net.(*TCPListener).AcceptTCP(0xc42000e050, 0xc42008f3b0, 0xc42008f3b0, 0x75be60)
/usr/lib/go-1.9/src/net/tcpsock.go:234 +0x49
net/http.tcpKeepAliveListener.Accept(0xc42000e050, 0xc42001a180, 0x75be60, 0x9be060, 0x7b8fa0)
/usr/lib/go-1.9/src/net/http/server.go:3120 +0x2f
net/http.(*Server).Serve(0xc420156d00, 0x993000, 0xc42000e050, 0x0, 0x0)
/usr/lib/go-1.9/src/net/http/server.go:2695 +0x1b2
net/http.(*Server).ListenAndServe(0xc420156d00, 0xc420156d00, 0xc42001ae60)
/usr/lib/go-1.9/src/net/http/server.go:2636 +0xa9
net/http.ListenAndServe(0xc42001ae60, 0x5, 0x0, 0x0, 0x1, 0xc42001ae60)
/usr/lib/go-1.9/src/net/http/server.go:2882 +0x7f
main.serveDashboard(0xc42008f050, 0x7d9fb8, 0x30, 0x0, 0x0)
/home/joetoth/projects/todo-tracks/src/main.go:87 +0x500
main.main()
/home/joetoth/projects/todo-tracks/src/main.go:132 +0xf1

goroutine 5 [chan receive]:
repo.(*gitRepository).LoadRevisionTodos(0xc420114340, 0xc42019e0a8, 0x28, 0x7d9fb8, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0)
/home/joetoth/projects/todo-tracks/src/repo/git.go:255 +0xef
repo.NewGitRepository.func1(0xc420114340, 0x7d9fb8, 0x30, 0x0, 0x0)
/home/joetoth/projects/todo-tracks/src/repo/git.go:66 +0xa0
created by repo.NewGitRepository
/home/joetoth/projects/todo-tracks/src/repo/git.go:63 +0x13c

goroutine 20 [runnable]:
os/exec.(*Cmd).Start(0xc420744000, 0xc420051c01, 0xc4204fc000)
/usr/lib/go-1.9/src/os/exec/exec.go:358 +0x1e5
os/exec.(*Cmd).Run(0xc420744000, 0xc4204fc000, 0xc420051cc0)
/usr/lib/go-1.9/src/os/exec/exec.go:286 +0x2b
os/exec.(*Cmd).Output(0xc420744000, 0xc4200160e4, 0x4, 0xc420744000, 0xc42027c000, 0xc4205721c0)
/usr/lib/go-1.9/src/os/exec/exec.go:485 +0x119
repo.(*gitRepository).runGitCommand(0xc420114340, 0xc420744000, 0xc420051d98, 0x3, 0x3, 0xc420744000)
/home/joetoth/projects/todo-tracks/src/repo/git.go:82 +0x55
repo.(*gitRepository).getFileBlob(0xc420114340, 0xc42019e0a8, 0x28, 0xc42018bfc5, 0x13, 0x9cd380, 0xc420051e50, 0x4351fb, 0xc420051e28)
/home/joetoth/projects/todo-tracks/src/repo/git.go:181 +0xc4
repo.(*gitRepository).getFileBlobOrDie(0xc420114340, 0xc42019e0a8, 0x28, 0xc42018bfc5, 0x13, 0xc42018bf25, 0x1b)
/home/joetoth/projects/todo-tracks/src/repo/git.go:196 +0x69
repo.(*gitRepository).asyncLoadRevisionTodos(0xc420114340, 0xc42019e0a8, 0x28, 0x7d9fb8, 0x30, 0x0, 0x0, 0xc42015c0c0)
/home/joetoth/projects/todo-tracks/src/repo/git.go:284 +0x221
created by repo.(*gitRepository).LoadRevisionTodos
/home/joetoth/projects/todo-tracks/src/repo/git.go:254 +0xbc

goroutine 185 [runnable]:
regexp.(*inputString).step(0xc42067c318, 0x2f51, 0xc42067c268, 0x2f4f)
/usr/lib/go-1.9/src/regexp/regexp.go:294 +0xc0
regexp.(*machine).match(0xc42067c240, 0x994400, 0xc42067c318, 0x2f4f, 0xa0)
/usr/lib/go-1.9/src/regexp/exec.go:175 +0x2cb
regexp.(*Regexp).doExecute(0xc4205ea1e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4211ceb71, 0x5f9d, 0x0, 0x0, ...)
/usr/lib/go-1.9/src/regexp/exec.go:447 +0x11d
regexp.(*Regexp).doMatch(0xc4205ea1e0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc4211ceb71, 0x5f9d, 0x0)
/usr/lib/go-1.9/src/regexp/exec.go:412 +0xc8
regexp.(*Regexp).MatchString(0xc4205ea1e0, 0xc4211ceb71, 0x5f9d, 0x0)
/usr/lib/go-1.9/src/regexp/regexp.go:435 +0x6c
regexp.MatchString(0x7d9fb8, 0x30, 0xc4211ceb71, 0x5f9d, 0x0, 0x0, 0x0)
/usr/lib/go-1.9/src/regexp/regexp.go:462 +0x83
repo.(*gitRepository).asyncLoadFileTodos(0xc420114340, 0xc42019e0a8, 0x28, 0xc42018a9e5, 0x16, 0xc4205d89bc, 0x28, 0x7d9fb8, 0x30, 0xc42024b1a0)
/home/joetoth/projects/todo-tracks/src/repo/git.go:319 +0x20d
created by repo.(*gitRepository).asyncLoadRevisionTodos
/home/joetoth/projects/todo-tracks/src/repo/git.go:287 +0x178

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.