Skip to content

Commit

Permalink
Merge pull request #43 from augmentable-dev/only-todos
Browse files Browse the repository at this point in the history
Refocuses this tool on TODO comments
  • Loading branch information
patrickdevivo authored Feb 18, 2020
2 parents 8121b07 + d1db82e commit fa7055a
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 563 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v1

- name: Build
run: go build -v .
run: go build -v cmd/main.go

- name: Test
run: go test -v ./...
76 changes: 11 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/augmentable-dev/tickgit)](https://goreportcard.com/report/github.com/augmentable-dev/tickgit)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/augmentable-dev/tickgit)
[![Coverage](http://gocover.io/_badge/github.com/augmentable-dev/tickgit)](http://gocover.io/github.com/augmentable-dev/tickgit)
[![TODOs](https://img.shields.io/endpoint?url=https%3A%2F%2Fapi.tickgit.com%2Fbadge%3Frepo%3Dgithub.com%2Faugmentable-dev%2Ftickgit)](https://www.tickgit.com/browse?repo=github.com/augmentable-dev/tickgit)
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/augmentable-dev/tickgit)](https://www.tickgit.com/browse?repo=github.com/augmentable-dev/tickgit)

## tickgit 🎟️

`tickgit` is a tool to help you manage tickets, todo items, and checklists within a codebase. Use the `tickgit` command to view pending tasks, progress reports, completion summaries and historical data (using `git` history).
`tickgit` is a tool to help you manage latent work in a codebase. Use the `tickgit` command to view pending tasks, progress reports, completion summaries and historical data (using `git` history).

It's not meant to replace full-fledged project management tools such as JIRA or Trello. It will, hopefully, be a useful way to augment those tools with project management patterns that coexist with your code. As such, it's primary audience is software engineers.

### TODOs

`tickgit todos` will scan a codebase and identify any TODO items in the comments. It will output a report like so:
`tickgit` will scan a codebase and identify any TODO items in the comments. It will output a report like so:

```
# tickgit todos ~/Desktop/facebook/react
# tickgit ~/Desktop/facebook/react
...
TODO:
=> packages/scheduler/src/__tests__/SchedulerBrowser-test.js:85:9
Expand All @@ -37,69 +37,16 @@ TODO: useTransition hook instead.
128 TODOs Found 📝
```

Check out [an example](https://todos.tickg.it/?repo=https://github.com/kubernetes/kubernetes) of the TODOs tickgit will surface for the Kubernetes codebase.
Check out [an example](https://www.tickgit.com/browse?repo=github.com/kubernetes/kubernetes) of the TODOs tickgit will surface for the Kubernetes codebase.

#### Coming Soon

- [x] History - get a better sense of how old TODOs are, when they were introduced and by whom
- [x] Blame - get a better sense of how old TODOs are, when they were introduced and by whom
- [ ] Context - more visibility into the lines of code _around_ a TODO for greater context

### Tickets

Tickets are a way of defining more complex tasks in your codebase as config files. Currently, tickets are HCL files that look like the following:

```hcl
# rocketship.tickgit
goal "Build the Rocketship 🚀" {
description = "Finalize the construction of the Moonblaster 2000"
task "Construct the engines" {
status = "done"
}
task "Attach the engines" {
status = "pending"
}
task "Thoroughly test the engines" {
status = "pending"
}
}
```

```
$ tickgit status
=== Build the Rocketship 🚀 ⏳
--- 1/3 tasks completed (2 remaining)
--- 33% completed
✅ Construct the engines
⏳ Attach the engines
⏳ Thoroughly test the engines
```

#### Coming Soon

- [ ] Simpler ticket definitions - in YAML and/or other (less verbose) config languages
- [ ] More complex tickets - more states, dependencies on other tickets, etc

### Checklists

_Coming soon_. Checklists will be a way of parsing Markdown checklists in your codebase (either in `.md` files, or within your comments).


### Why is this useful?

This project is a proof-of-concept. Keeping tickets next to the code they're meant to describe could have the following benefits:

- Tickets live with the code, no need for a 3rd party tool or system (anyone with git access to the repository has access to contributing to the tickets)
- Updating a ticket's status and merging/committing code are the same action, no need to synchronize across multiple tools
- Source of truth for a project's ticket history is now the git history, which can be queried and analyzed
- Current status of a `goal` can be reported by simply parsing the repository's `head`
- Less context switching between the codebase itself and the system describing "what needs to be done"

Generally speaking, this is an experiment in ways to do project management, within the codebase of a project. With a `git` history and some clever parsing, quite a bit of metadata about a project can be gleaned from its codebase. Let's see how useful we can make that information.
- [ ] More `TODO` type phrases to match, such as `FIXME`, `XXX`, `HACK`, or customized alternatives.
- [ ] More configurability (e.g. custom ignore paths)
- [ ] Markdown parsing
- [ ] More thorough historical stats

### Installation

Expand All @@ -110,10 +57,9 @@ brew tap augmentable-dev/tickgit
brew install tickgit
```


### Usage

The most up to date usage will be the output of `tickgit --help`. The most common usage, however, is `tickgit status` which will print a status report of tickets for a given git repository. By default, it uses the current working directory.
The most up to date usage will be the output of `tickgit --help`.

### API

Expand Down
9 changes: 1 addition & 8 deletions cmd/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@ import (
"os"

"github.com/briandowns/spinner"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "tickgit",
Short: "Tickets as config",
Long: `tickgit is a tool for helping you manage tickets and todos in your codebase, as a part of your git history`,
}

// TODO clean this up
func handleError(err error, spinner *spinner.Spinner) {
if err != nil {
Expand All @@ -30,7 +23,7 @@ func handleError(err error, spinner *spinner.Spinner) {

// Execute adds all child commands to the root command and sets flags appropriately.
func Execute() {
if err := rootCmd.Execute(); err != nil {
if err := todosCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
Expand Down
45 changes: 0 additions & 45 deletions cmd/commands/status.go

This file was deleted.

2 changes: 0 additions & 2 deletions cmd/commands/todos.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ var csvOutput bool

func init() {
todosCmd.Flags().BoolVar(&csvOutput, "csv-output", false, "specify whether or not output should be in CSV format")

rootCmd.AddCommand(todosCmd)
}

var todosCmd = &cobra.Command{
Expand Down
29 changes: 9 additions & 20 deletions docs/API.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
## API

If you'd like to access tickgit information about public `git` repositories, you can use our API.

### TODOs
### TODOs Badge

`GET` requests to `https://tickgit.augmentable.dev/todos` with the `repo` query param populated with the URL of a git repo, like so:
`GET` requests to `https://api.tickgit.com/badgen` with a `repo` path segment:

```
https://tickgit.augmentable.dev/todos?repo=https://github.com/facebook/react
https://api.tickgit.com/badgen/github.com/facebook/react
```
Will return a simple JSON response:

Supplying a `branch` segment will lookup a specific branch. `master` is the branch used if none is specified.

```
{"todos":125}
https://api.tickgit.com/badgen/github.com/facebook/react/branch-name
```

Indicating the total count of TODOs found in the `HEAD` of that repository.

To indicate a branch, send a `branch` query param supplying the branch name.

_more coming soon!_

### TODOs Badge

Similarly, `GET` requests to `https://tickgit.augmentable.dev/todos-badge` with the same `repo` query param:
Will return JSON that can be fed into a badgen badge: [https://badgen.net/https](https://badgen.net/https)

```
http://tickgit.augmentable.dev/todos-badge?repo=https://github.com/facebook/react
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/augmentable-dev/tickgit)](https://www.tickgit.com/browse?repo=github.com/augmentable-dev/tickgit)
```

The `branch` query param will also work as above.

Will return JSON that can be fed into a shields.io badge: [https://shields.io/endpoint](https://shields.io/endpoint)
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/augmentable-dev/tickgit)](https://www.tickgit.com/browse?repo=github.com/augmentable-dev/tickgit)
19 changes: 7 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,18 @@ module github.com/augmentable-dev/tickgit
go 1.13

require (
github.com/agext/levenshtein v1.2.2 // indirect
github.com/augmentable-dev/lege v0.0.0-20191028004410-79cb985065a1
github.com/briandowns/spinner v1.8.0
github.com/briandowns/spinner v1.9.0
github.com/dustin/go-humanize v1.0.0
github.com/hashicorp/hcl/v2 v2.2.0
github.com/karrick/godirwalk v1.13.4
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/karrick/godirwalk v1.15.3
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/cobra v0.0.5
github.com/spf13/pflag v1.0.5 // indirect
github.com/src-d/enry/v2 v2.1.0
github.com/zclconf/go-cty v1.2.0 // indirect
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876 // indirect
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 // indirect
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2
golang.org/x/crypto v0.0.0-20200214034016-1d94cc7ab1c6 // indirect
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 // indirect
golang.org/x/sys v0.0.0-20200217220822-9197077df867 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
)
Loading

0 comments on commit fa7055a

Please sign in to comment.