issues

package
v0.0.0-...-b433dbc Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-3-Clause Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	MONORAIL_BASE_URL_TMPL = "https://monorail-prod.appspot.com/_ah/api/monorail/v1/projects/%s/issues"

	PROJECT_ANGLE    = "angleproject"
	PROJECT_CHROMIUM = "chromium"
	PROJECT_PDFIUM   = "pdfium"
	PROJECT_SKIA     = "skia"
	PROJECT_WEBRTC   = "webrtc"
)

Variables

Functions

This section is empty.

Types

type CommentRequest

type CommentRequest struct {
	Content string `json:"content"`
}

type Issue

type Issue struct {
	ID    int64  `json:"id"`
	Title string `json:"title"`
	State string `json:"state"`
}

Issue is an individual issue returned from the project hosting response.

type IssueRequest

type IssueRequest struct {
	Status      string           `json:"status"`
	Owner       MonorailPerson   `json:"owner"`
	CC          []MonorailPerson `json:"cc"`
	Labels      []string         `json:"labels"`
	Summary     string           `json:"summary"`
	Description string           `json:"description"`
	Components  []string         `json:"components,omitempty"`
}

type IssueResponse

type IssueResponse struct {
	Items []Issue `json:"items"`
}

IssueResponse is used to decode JSON responses from the project hosting API.

type IssueTracker

type IssueTracker interface {
	// FromQueury returns issue that match the given query string.
	FromQuery(q string) ([]Issue, error)
	// AddComment adds a comment to the issue with the given id
	AddComment(id string, comment CommentRequest) error
	// AddIssue creates an issue with the passed in params.
	AddIssue(issue IssueRequest) error
}

IssueTracker is a genric interface to an issue tracker that allows us to connect issues with items (identified by an id).

func NewMonorailIssueTracker

func NewMonorailIssueTracker(client *http.Client, project string) IssueTracker

type MonorailIssueTracker

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

MonorailIssueTracker implements IssueTracker.

Note that, in order to use a MonorailIssueTracker from GCE, the client id of the project needs to be known to Monorail. Also note that the https://www.googleapis.com/auth/userinfo.email scope is needed.

func (*MonorailIssueTracker) AddComment

func (m *MonorailIssueTracker) AddComment(id string, comment CommentRequest) error

AddComment adds a comment to the issue with the given id

func (*MonorailIssueTracker) AddIssue

func (m *MonorailIssueTracker) AddIssue(issue IssueRequest) error

AddIssue creates an issue with the passed in params.

func (*MonorailIssueTracker) FromQuery

func (m *MonorailIssueTracker) FromQuery(q string) ([]Issue, error)

FromQuery is part of the IssueTracker interface. See documentation there.

type MonorailPerson

type MonorailPerson struct {
	Name     string `json:"name"`     // Email address
	HtmlLink string `json:"htmlLink"` // Links to user id
	Kind     string `json:"kind"`     // Is always "monorail#issuePerson"
}

Directories

Path Synopsis
issues_helper is a simple command-line application for the monorail issue tracker.
issues_helper is a simple command-line application for the monorail issue tracker.

Jump to

Keyboard shortcuts

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