tracker

package
v0.0.0-...-0945915 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

This package is used to get bugs and issues from different vendors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRequestTimeout

func SetRequestTimeout(timeout int)

Types

type Bug

type Bug struct {
	*Bugzilla
	sync.Mutex
	Blocks              []int         `json:"blocks"`
	IsCcAccessible      bool          `json:"is_cc_accessible"`
	Keywords            []string      `json:"keywords"`
	URL                 string        `json:"url"`
	QaContactID         string        `json:"qa_contact"`
	UpdateToken         string        `json:"update_token"`
	CcDetail            []User        `json:"cc_detail"`
	Summary             string        `json:"summary"`
	Platform            string        `json:"platform"`
	Version             string        `json:"version"`
	Deadline            interface{}   `json:"deadline"`
	IsCreatorAccessible bool          `json:"is_creator_accessible"`
	IsConfirmed         bool          `json:"is_confirmed"`
	Priority            string        `json:"priority"`
	AssignedTo          User          `json:"assigned_to_detail"`
	CreatorID           string        `json:"creator"`
	LastChangeTime      time.Time     `json:"last_change_time"`
	Creator             User          `json:"creator_detail"`
	Cc                  []string      `json:"cc"`
	SeeAlso             []interface{} `json:"see_also"`
	Groups              []interface{} `json:"groups"`
	AssignedToID        string        `json:"assigned_to"`
	CreationTime        time.Time     `json:"creation_time"`
	Whiteboard          string        `json:"whiteboard"`
	ID                  int           `json:"id"`
	DependsOn           []int         `json:"depends_on"`
	DupeOf              int           `json:"dupe_of"`
	QaContact           User          `json:"qa_contact_detail"`
	Resolution          string        `json:"resolution"`
	Classification      string        `json:"classification"`
	Alias               []string      `json:"alias"`
	OpSys               string        `json:"op_sys"`
	Status              string        `json:"status"`
	IsOpen              bool          `json:"is_open"`
	Severity            string        `json:"severity"`
	Flags               []Flag        `json:"flags"`
	Component           string        `json:"component"`
	TargetMilestone     string        `json:"target_milestone"`
	Product             string        `json:"product"`
	History             []*History    `json:"history"`
	Comments            []*Comment    `json:"comments"`
	Description         Comment
	// custom fields
	CustomFields interface{}
}

func (*Bug) GetAssignee

func (bug *Bug) GetAssignee() (*User, error)

func (*Bug) GetComments

func (bug *Bug) GetComments() error

func (*Bug) GetHistory

func (bug *Bug) GetHistory() error

func (*Bug) Update

func (bug *Bug) Update(update *BugUpdate) error

type BugUpdate

type BugUpdate struct {
	ID              []int               `json"ids"`
	Aliases         UpdateFieldAlias    `json:"alias,omitempty"`
	AssignedTo      string              `json:"assigned_to,omitempty"`
	Blocks          UpdateFieldBlocks   `json:"blocks,omitempty"`
	Depends         UpdateFieldDepends  `json:"depends_on,omitempty"`
	CC              UpdateFieldCC       `json:"cc,omitempty"`
	CCAccessible    bool                `json:"is_cc_accessible,omitempty"`
	Comment         UpdateFieldComment  `json:"comment,omitempty"`
	PrivateComments []int               `json:"comment_is_private,omitempty"`
	CommentTags     []string            `json:"comment_tags,omitempty"`
	Keywords        UpdateFieldKeyWords `json:"keywords,omitempty"`
}

type Bugzilla

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

func NewBugzilla

func NewBugzilla(conf TrackerConfig) (*Bugzilla, error)

func (*Bugzilla) GetBug

func (b *Bugzilla) GetBug(id int) (*Bug, error)

func (*Bugzilla) GetUser

func (b *Bugzilla) GetUser(id string) (*User, error)

func (*Bugzilla) Search

func (b *Bugzilla) Search(args map[string]string) ([]*Bug, error)

type Comment

type Comment struct {
	Time         time.Time `json:"time"`
	Text         string    `json:"text"`
	BugID        int       `json:"bug_id"`
	Count        int       `json:"count"`
	AttachmentID int       `json:"attachment_id"`
	IsPrivate    bool      `json:"is_private"`
	IsMarkdown   bool      `json:"is_markdown"`
	Tags         []string  `json:"tags"`
	Creator      string    `json:"creator"`
	CreationTime time.Time `json:"creation_time"`
	ID           int       `json:"id"`
}

type Flag

type Flag struct {
	TypeID           int       `json:"type_id"`
	ModificationDate time.Time `json:"modification_date"`
	Name             string    `json:"name"`
	Status           string    `json:"status"`
	ID               int       `json:"id"`
	Setter           string    `json:"setter"`
	Requestee        string    `json:"requestee"`
	CreationDate     time.Time `json:"creation_date"`
}

type History

type History struct {
	When    time.Time `json:"when"`
	Who     string    `json:"who"`
	Changes []struct {
		Added     string `json:"added"`
		FieldName string `json:"field_name"`
		Removed   string `json:"removed"`
	} `json:"changes"`
}

type Tracker

type Tracker interface {
	GetBug(id int) (*Bug, error)
	Search(map[string]string) ([]*Bug, error)
	GetUser(string) (*User, error)
}

func NewTracker

func NewTracker(vendor VendorType, conf TrackerConfig) (Tracker, error)

type TrackerConfig

type TrackerConfig struct {
	Url      string
	Endpoint string
	ApiKey   string
}

type UpdateFieldAlias

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

type UpdateFieldBlocks

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

type UpdateFieldCC

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

type UpdateFieldComment

type UpdateFieldComment struct {
	Body     string `json:"comment"`
	Private  bool   `json:"is_private"`
	MarkDown bool   `json:"is_markdown"`
}

type UpdateFieldDepends

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

type UpdateFieldKeyWords

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

type User

type User struct {
	*Bugzilla
	Email    string        `json:"email"`
	RealName string        `json:"real_name"`
	Name     string        `json:"name"`
	Groups   []interface{} `json:"groups"`
	CanLogin bool          `json:"can_login"`
	ID       int           `json:"id"`
}

func (*User) Bugs

func (u *User) Bugs(filter map[string]string) ([]*Bug, error)

type VendorType

type VendorType string
const (
	BUGZILLA VendorType = "bugzilla"
	NVBUG    VendorType = "NVIDIA"
	GITHUB   VendorType = "Github"
)

Jump to

Keyboard shortcuts

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