git-ticket

command module
v0.0.0-...-ed48b6f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

README

git-ticket

Build Status GoDoc Go Report Card

git-ticket is a bug tracker that:

  • is fully embedded in git: you only need your git repository to have a bug tracker
  • is distributed: use your normal git remote to collaborate, push and pull your bugs!
  • works offline: in a plane or under the sea? Keep reading and writing bugs!
  • prevents vendor lock-in: your usual service is down or went bad? You already have a full backup.
  • is fast: listing bugs or opening them is a matter of milliseconds
  • doesn't pollute your project: no files are added in your project
  • integrates with your tooling: use the UI you like (CLI, terminal, web) or integrate with your existing tools through the CLI or the GraphQL API
  • bridges to other bug trackers: use bridges to import and export to other trackers.

🚧 This is now more than a proof of concept, but still not fully stable. Expect dragons and unfinished business. 🚧

Installation

git clone git@github.com:daedaleanai/git-ticket.git
make install

If it's not done already, add the golang binary directory in your PATH:

export PATH=$PATH:$(go env GOROOT)/bin:$(go env GOPATH)/bin

Workflows

There are multiple ways to use git-bug:

Native workflow

Native workflow

This is the pure git-bug experience. In a similar fashion as with code, use git bug push and git bug pull to push and pull your bugs between git remotes and collaborate with your teammate.

Bridge workflow

Bridge workflow

As git-bug has bridges with other bug-trackers, you can use it as your personal local remote interface. Sync with git bug bridge pull and git bug bridge push, work from your terminal, integrate into your editor, it's up to you. And it works offline !

Web UI workflow (WIP)

Web UI workflow

Often, projects needs to have their bug-tracker public and accept editions from anyone facing a problem. To support this workflow, git-bug aims to have the web UI accept external OAuth authentication and act as a public portal. However the web UI is not up to speed for that yet. Contribution are very much welcome!

CLI usage

Create a new identity:

git ticket user create

Create a new ticket:

git ticket add

Your favorite editor will open to write a title and a message.

You can push your new entry to a remote:

git ticket push [<remote>]

And pull for updates:

git ticket pull [<remote>]

List existing tickets:

git ticket ls

Filter and sort tickets using a query:

git ticket ls "status:open sort:edit"

You can now use commands like show, comment, open or close to display and modify tickets. For more details about each command, you can run git ticket <command> --help or read the command's documentation.

Interactive terminal UI

An interactive terminal UI is available using the command git ticket termui to browse and edit tickets.

Termui recording

Web UI

A simple experimental read-only web UI is available using the command git ticket webui to browse tickets on a kanban-style board. git ticket will expose the web UI on a local port (defaults to 3333, but can be changed using the --port parameter).

Filtering and Sorting

Tickets shown in the web UI can filtered and sorted by providing a query as the q URL parameter. See here for a documentation of the query language.

Coloring

In addition, the web UI also supports a color-by qualifier in queries to color tickets based on author, assignee or labels.

Qualifier Example
color-by:author colors tickets by author
color-by:assignee colors tickets by assignee
color-by:label:some-prefix colors tickets based on labels starting with some-prefix

Bookmarks

Queries can be bookmarked by storing a JSON array with the following structure in the local git config key git-bug.webui.bookmarks. Bookmarks are organized in named groups, with each bookmark having a label and an associated query property.

[
    {
        "group": "me",
        "bookmarks": [
            {
                "label": "created",
                "query": "author:me"
            },
            {
                "label": "assigned",
                "query": "assignee:me"
            }
        ]
    },
    {
        "group": "milestones",
        "bookmarks": [
            {
                "label": "milestone 1",
                "query": "label:milestone-1"
            },
            {
                "label": "milestone 2",
                "query": "label:milestone-2"
            }
        ]
    }
]

Note: The git config value may not contain any newlines. E.g., the bookmarks from the above example can be configured by running the following command:

git config --local git-bug.webui.bookmarks '[ { "group": "me", "bookmarks": [ { "label": "created", "query": "author:me" }, { "label": "assigned", "query": "assignee:me" } ] }, { "group": "milestones", "bookmarks": [ { "label": "milestone 1", "query": "label:milestone-1" }, { "label": "milestone 2", "query": "label:milestone-2" } ] } ]'

Cross-References

The detailed ticket view supports rendering certain patterns in the ticket's title, description or comments as clickable links. This behavior is controlled by a set of rules, which can be configured via the git ticket config key webui. The configuration is a JSON object with a single key xref that contains a array of rule objects. Each rule consists of a regular expression (pattern) and a link template. Each match of a pattern is transformed to a clickable link. The link target is constructed by instantiating the link template associated with the pattern. The Nth capture groups of the regular expression can be referenced in the link template by using {{ index . N}} notation. Capture group 0 always refers to the full match.

The following examples create links for URLs and create links to the detailed ticked view of this web UI for ticket IDs, respectively, and can be set by running git ticket config webui.

{
  "xref": [
    {
      "pattern": "\\bhttps?://\\S+\\b",
      "link": "{{ index . 0 }}"
    },
    {
      "pattern": "\\b[a-f0-9]{7,64}\\b",
      "link": "/ticket?id={{ index . 0 }}"
    }
  ]
}

Internals

Interested by how it works ? Have a look at the data model and the internal bird-view.

Misc

Planned features

  • media embedding
  • more bridges
  • extendable data model to support arbitrary bug tracker
  • inflatable raptor

License

Unless otherwise stated, this project is released under the GPLv3 or later license © Michael Muré.

The git-bug logo by Viktor Teplov is released under the Creative Commons Attribution 4.0 International (CC BY 4.0) license © Viktor Teplov.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
bug
Package bug contains the bug data model and low-level related functions
Package bug contains the bug data model and low-level related functions
Package cache contains a caching layer on top of the low-level bug and identity functions to provide efficient querying, filtering, sorting.
Package cache contains a caching layer on top of the low-level bug and identity functions to provide efficient querying, filtering, sorting.
Package commands contains the CLI commands
Package commands contains the CLI commands
Package entity contains the base common code to define an entity stored in a chain of git objects, supporting actions like Push, Pull and Merge.
Package entity contains the base common code to define an entity stored in a chain of git objects, supporting actions like Push, Pull and Merge.
Package identity contains the identity data model and low-level related functions
Package identity contains the identity data model and low-level related functions
Package input contains helpers to use a text editor as an input for various field of a bug
Package input contains helpers to use a text editor as an input for various field of a bug
Package repository contains helper methods for working with the Git repo.
Package repository contains helper methods for working with the Git repo.
Package termui contains the interactive terminal UI
Package termui contains the interactive terminal UI
util

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL