devdashboard

package module
v0.0.0-...-4d863f5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

README

devdashboard

Build Status Go Report Card GoDoc GitHub release

devdashboard collects various information on the development process across issue tracking and version control systems, so you can tell at a glance whats going on.

Disclaimer

devdashboard is not yet ready to use. The application and API may break at any time until the first stable release.

Preview

Example

devdashboard is inspired by and based on maintner and gido. Some of the code is copied from these projects, which are also licensed under a BSD style license. This is mentioned in the copyright notice of each affected file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Corpus

type Corpus struct {

	// issue tracker data:
	Projects     map[string]*Project
	TrackerUsers map[string]*IssueTrackerUser
	Milestones   map[string]*Milestone
	Releases     map[string]*Release
	Issues       map[string]*Issue

	// source data:
	GitRepos map[string]*GitRepo
	// contains filtered or unexported fields
}

func (*Corpus) Check

func (c *Corpus) Check() error

Check verifies the internal structure of the Corpus data structures. It is intended for tests and debugging.

func (*Corpus) Initialize

func (c *Corpus) Initialize(ctx context.Context, src MutationSource) error

Initialize populates the corpus using the data from the MutationSource. It returns once it's up-to-date. To incrementally update it later, use the Update method.

func (*Corpus) RLock

func (c *Corpus) RLock()

RLock grabs the corpus's read lock. Grabbing the read lock prevents any concurrent writes from mutating the corpus. This is only necessary if the application is querying the corpus and calling its Update method concurrently.

func (*Corpus) RUnlock

func (c *Corpus) RUnlock()

RUnlock unlocks the corpus's read lock.

func (*Corpus) Update

func (c *Corpus) Update(ctx context.Context) error

Update incrementally updates the corpus from its current state to the latest state from the MutationSource passed earlier to Initialize. It does not return until there's either a new change or the context expires.

Update must not be called concurrently with any other Update calls. If reading the corpus concurrently while the corpus is updating, you must hold the read lock using Corpus.RLock.

type DiskMutationLogger

type DiskMutationLogger struct {
	// contains filtered or unexported fields
}

DiskMutationLogger logs mutations to disk.

func NewDiskMutationLogger

func NewDiskMutationLogger(directory string) *DiskMutationLogger

NewDiskMutationLogger creates a new DiskMutationLogger, which will create mutations in the given directory.

func (*DiskMutationLogger) ForeachFile

func (d *DiskMutationLogger) ForeachFile(fn func(fullPath string, fi os.FileInfo) error) error

func (*DiskMutationLogger) GetMutations

func (d *DiskMutationLogger) GetMutations(ctx context.Context) <-chan MutationStreamEvent

func (*DiskMutationLogger) Log

Log will write m to disk. If a mutation file does not exist for the current day, it will be created.

type GitCommit

type GitCommit struct {
	Sha1     string
	Raw      string
	DiffTree map[string]*GitDiffTreeFile
	// contains filtered or unexported fields
}

type GitDiffTreeFile

type GitDiffTreeFile struct {
	// contains filtered or unexported fields
}

type GitRef

type GitRef struct {
	Ref  string
	Sha1 string
	// contains filtered or unexported fields
}

type GitRepo

type GitRepo struct {
	URL string
	// contains filtered or unexported fields
}

type Issue

type Issue struct {
	ID       string
	IssueKey string

	Created time.Time
	Updated time.Time

	Title string
	Body  string

	Owner     *IssueTrackerUser
	Assignees map[string]*IssueTrackerUser

	Milestones map[string]*Milestone

	Status string
	Closed bool

	ClosedAt time.Time
	ClosedBy *IssueTrackerUser

	Labels  map[string]struct{}
	Commits map[string]*GitCommit

	URL string
	// contains filtered or unexported fields
}

func (*Issue) GenMutationDiff

func (a *Issue) GenMutationDiff(b *Issue) *devdashpb.IssueMutation

type IssueTrackerUser

type IssueTrackerUser struct {
	ID    string
	Name  string
	Email string
}

func (*IssueTrackerUser) GenMutationDiff

func (a *IssueTrackerUser) GenMutationDiff(b *IssueTrackerUser) *devdashpb.TrackerUser

type Milestone

type Milestone struct {
	ID string

	Name        string
	Description string
	Closed      bool

	Issues map[string]*Issue
	// contains filtered or unexported fields
}

func (*Milestone) GenMutationDiff

func (a *Milestone) GenMutationDiff(b *Milestone) *devdashpb.TrackerMilestone

func (*Milestone) Project

func (m *Milestone) Project() *Project

type MutationLogger

type MutationLogger interface {
	Log(*devdashpb.Mutation) error
}

A MutationLogger logs mutations.

type MutationSource

type MutationSource interface {
	// GetMutations returns a channel of mutations or related events.
	// The channel will never be closed.
	// All sends on the returned channel should select
	// on the provided context.
	GetMutations(context.Context) <-chan MutationStreamEvent
}

A MutationSource yields a log of mutations that will catch a corpus back up to the present.

type MutationStreamEvent

type MutationStreamEvent struct {
	Mutation *devdashpb.Mutation

	// Err is a fatal error reading the log. No other events will
	// follow an Err.
	Err error

	// End, if true, means that all mutations have been sent and
	// the next event might take some time to arrive (it might not
	// have occurred yet). The End event is not a terminal state
	// like Err. There may be multiple Ends.
	End bool
}

MutationStreamEvent represents one of three possible events while reading mutations from disk. An event is either a mutation, an error, or reaching the current end of the log. Only one of the fields will be non-zero.

type Project

type Project struct {
	ID          string
	Name        string
	Description string

	Issues     map[string]*Issue
	Milestones map[string]*Milestone
	// contains filtered or unexported fields
}

func (*Project) GenMutationDiff

func (a *Project) GenMutationDiff(b *Project) *devdashpb.ProjectMutation

type Release

type Release struct {
	ID          string
	Name        string
	Description string

	FreezeDate  time.Time
	ReleaseDate time.Time
	Closed      bool

	Milestones map[string]*Milestone
	// contains filtered or unexported fields
}

func (*Release) GenMutationDiff

func (a *Release) GenMutationDiff(b *Release) *devdashpb.ReleaseMutation

func (*Release) IsFrozen

func (r *Release) IsFrozen() bool

func (*Release) IsReleased

func (r *Release) IsReleased() bool

Directories

Path Synopsis
cmd
Package devdashdata loads the project's corpus into memory to allow easy analysis without worrying about APIs and their pagination, quotas, and other nuisances and limitations.
Package devdashdata loads the project's corpus into memory to allow easy analysis without worrying about APIs and their pagination, quotas, and other nuisances and limitations.
Package reclog contains readers and writers for a record wrapper format used by maintner.
Package reclog contains readers and writers for a record wrapper format used by maintner.

Jump to

Keyboard shortcuts

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