Documentation ¶
Index ¶
- Constants
- Variables
- type Activity
- type AffiliationClient
- type AssignedTo
- type AssigneeResponse
- type Auth0Client
- type BugDetailResponse
- type BugDetailXML
- type BugEnrich
- type BugRaw
- type BugResponse
- type Comment
- type ESClientProvider
- type Enricher
- type Fetcher
- type HTTPClientProvider
- type HitSource
- type Hits
- type Manager
- type NHits
- type NestedHits
- type NestedRawHits
- type Param
- type Params
- type Person
- type RawHits
- type SearchFields
- type SlackProvider
- type TopHits
Constants ¶
const ( // Category type Category = "bug" // Bugzilla - DS name Bugzilla string = "bugzilla" )
Variables ¶
var ( // BugzillaRawMapping - bugzilla raw index mapping BugzillaRawMapping = []byte(`{"mappings": {"dynamic":true, "properties":{ "metadata__updated_on":{"type":"date"}, "metadata__timestamp":{"type":"date"}, "creation_ts":{"type":"date"}, "changed_at":{"type":"date"}, "delta_ts":{"type":"date"}, "short_description":{"type":"text","index":true}, "backend_version":{"type":"keyword"}, "backend_name":{"type":"keyword"}, "bug_status":{"type":"keyword"}, "priority":{"type":"keyword"}, "severity":{"type":"keyword"} }}}`) // BugzillaEnrichMapping - bugzilla enriched index mapping BugzillaEnrichMapping = []byte(`{"mappings":{"dynamic_templates":[{"notanalyzed":{"match":"*","match_mapping_type":"string","mapping":{"type":"keyword"}}},{"int_to_float":{"match":"*","match_mapping_type":"long","mapping":{"type":"float"}}},{"formatdate":{"match":"*","match_mapping_type":"date","mapping":{"format":"strict_date_optional_time||epoch_millis","type":"date"}}}]}}`) )
Functions ¶
This section is empty.
Types ¶
type AffiliationClient ¶
type AffiliationClient interface { GetIdentityByUser(key string, value string) (*libAffiliations.AffIdentity, error) AddIdentity(identity *libAffiliations.Identity) bool }
AffiliationClient manages user identity
type AssignedTo ¶
AssignedTo get assigned to xml field tag name and value
type AssigneeResponse ¶
AssigneeResponse represents Assignee response model
type BugDetailResponse ¶
type BugDetailResponse struct {
Bug BugDetailXML `xml:"bug"`
}
BugDetailResponse data model represents Bugzilla get bugDetail results
type BugDetailXML ¶
type BugDetailXML struct { ID int `xml:"bug_id"` CreationTS string `xml:"creation_ts"` DeltaTS string `xml:"delta_ts"` Priority string `xml:"priority"` Severity string `xml:"bug_severity"` OpSys string `xml:"op_sys"` RepPlatform string `xml:"rep_platform"` Keywords []string `xml:"keywords"` StatusWhiteboard string `xml:"status_whiteboard"` Resolution string `xml:"resolution"` Reporter AssignedTo `xml:"reporter"` AssignedTo AssignedTo `xml:"assigned_to"` Summary string `xml:"summary"` LongDesc []Comment `xml:"long_desc"` }
BugDetailXML ...
type BugEnrich ¶
type BugEnrich struct { UUID string `json:"uuid"` Project string `json:"project"` Labels []string `json:"labels"` Changes int `json:"changes"` Priority string `json:"priority"` Severity string `json:"severity"` OpSys string `json:"op_sys"` ChangedAt string `json:"changed_at"` Product string `json:"product"` Component string `json:"component"` Platform string `json:"platform"` BugID int `json:"bug_id"` Status string `json:"status"` TimeOpenDays float64 `json:"timeopen_days"` Category string `json:"category"` ChangedDate time.Time `json:"changed_date"` Tag string `json:"tag"` IsBugzillaBug int `json:"is_bugzilla_bug"` URL string `json:"url"` ResolutionDays float64 `json:"resolution_days"` CreationDate time.Time `json:"creation_date"` DeltaTs time.Time `json:"delta_ts"` Whiteboard string `json:"whiteboard"` Resolution string `json:"resolution"` Assigned string `json:"assigned"` ReporterID string `json:"reporter_id"` ReporterUUID string `json:"reporter_uuid"` ReporterName string `json:"reporter_name"` ReporterUserName string `json:"reporter_user_name"` ReporterDomain string `json:"reporter_domain"` ReporterOrgName string `json:"reporter_org_name"` ReporterMultiOrgName []string `json:"reporter_multi_org_names"` ReporterBot bool `json:"reporter_bot"` AuthorID string `json:"author_id"` AuthorUUID string `json:"author_uuid"` AuthorName string `json:"author_name"` AuthorUserName string `json:"author_user_name"` AuthorDomain string `json:"author_domain"` AuthorOrgName string `json:"author_org_name"` AuthorMultiOrgName []string `json:"author_multi_org_names"` AuthorBot bool `json:"author_bot"` AssignedToID string `json:"assigned_to_id"` AssignedToUUID string `json:"assigned_to_uuid"` AssignedToName string `json:"assigned_to_name"` AssignedToUserName string `json:"assigned_to_user_name"` AssignedToDomain string `json:"assigned_to_domain"` AssignedToOrgName string `json:"assigned_to_org_name"` AssignedToMultiOrgName []string `json:"assigned_to_multi_org_names"` AssignedToBot bool `json:"assigned_to_bot"` MainDescription string `json:"main_description"` MainDescriptionAnalyzed string `json:"main_description_analyzed"` Summary string `json:"summary"` SummaryAnalyzed string `json:"summary_analyzed"` Comments int `json:"comments"` RepositoryLabels *[]string `json:"repository_labels"` MetadataUpdatedOn time.Time `json:"metadata__updated_on"` MetadataTimestamp time.Time `json:"metadata__timestamp"` MetadataEnrichedOn time.Time `json:"metadata__enriched_on"` MetadataFilterRaw *string `json:"metadata__filter_raw"` MetadataBackendName string `json:"metadata__backend_name"` MetadataBackendVersion string `json:"metadata__backend_version"` TimeToClose float64 `json:"time_to_close"` }
BugEnrich ...
type BugRaw ¶
type BugRaw struct { BackendVersion string `json:"backend_version"` BackendName string `json:"backend_name"` UUID string `json:"uuid"` BugID int `json:"bug_id"` Origin string `json:"origin"` Tag string `json:"tag"` Product string `json:"product"` Component string `json:"component"` Assignee Person ShortDescription string `json:"short_description"` LongDesc []Comment `json:"long_desc"` BugStatus string `json:"bug_status"` MetadataUpdatedOn time.Time `json:"metadata__updated_on"` MetadataTimestamp time.Time `json:"metadata__timestamp"` Timestamp float64 `json:"timestamp"` Category string `json:"category"` CreationTS time.Time `json:"creation_ts"` Priority string `json:"priority"` Severity string `json:"severity"` OpSys string `json:"op_sys"` ChangedAt time.Time `json:"changed_at"` ActivityCount int `json:"activity_count"` SearchFields *SearchFields `json:"search_fields"` DeltaTs time.Time `json:"delta_ts"` Keywords []string `json:"keywords"` RepPlatform string `json:"rep_platform"` StatusWhiteboard string `json:"status_whiteboard"` Resolution string `json:"resolution"` Reporter Person `json:"reporter"` AssignedTo string `json:"assigned_to"` Summary string `json:"summary"` Activities []Activity `json:"activities"` }
BugRaw data model represents es schema
type BugResponse ¶
type BugResponse struct { ID int `json:"id"` Product string `json:"product"` Component string `json:"component"` AssignedTo *AssigneeResponse `json:"assigned_to"` ShortDescription string `json:"short_description"` CreationTS time.Time `json:"creation_ts"` Priority string `json:"priority"` BugStatus string `json:"bug_status"` ChangedAt string `json:"changed_at"` }
BugResponse data model represents Bugzilla get bugsList results
type Comment ¶
type Comment struct { Commentid int `xml:"commentid"` Who string `xml:"who"` BugWhen string `xml:"bug_when"` Thetext string `xml:"thetext"` }
Comment of a bug
type ESClientProvider ¶
type ESClientProvider interface { Add(index string, documentID string, body []byte) ([]byte, error) CreateIndex(index string, body []byte) ([]byte, error) Bulk(body []byte) ([]byte, error) Get(index string, query map[string]interface{}, result interface{}) (err error) GetStat(index string, field string, aggType string, mustConditions []map[string]interface{}, mustNotConditions []map[string]interface{}) (result time.Time, err error) BulkInsert(data []elastic.BulkData) ([]byte, error) DelayOfCreateIndex(ex func(str string, b []byte) ([]byte, error), uin uint, du time.Duration, index string, data []byte) error }
ESClientProvider used in connecting to ES server
type Enricher ¶
type Enricher struct { DSName string BackendVersion string Project string // contains filtered or unexported fields }
Enricher enrich Bugzilla raw
func NewEnricher ¶
func NewEnricher(backendVersion string, project string, affiliationsClient AffiliationClient, auth0Client Auth0Client, httpClientProvider HTTPClientProvider, affBaseURL string, projectSlug string) *Enricher
NewEnricher intiate a new enricher instance
type Fetcher ¶
type Fetcher struct { DSName string // Datasource will be used as key for ES HTTPClientProvider HTTPClientProvider ElasticSearchProvider ESClientProvider BackendVersion string Endpoint string }
Fetcher contains Bugzilla fetch logic
func NewFetcher ¶
func NewFetcher(params *Params, httpClientProvider HTTPClientProvider, esClientProvider ESClientProvider) *Fetcher
NewFetcher initiates a new bugZilla fetcher
func (*Fetcher) HandleMapping ¶
HandleMapping updates bugzilla raw mapping
type HTTPClientProvider ¶
type HTTPClientProvider interface { Request(url string, method string, header map[string]string, body []byte, params map[string]string) (statusCode int, resBody []byte, err error) RequestCSV(url string) ([][]string, error) }
HTTPClientProvider used in connecting to remote http server
type Manager ¶
type Manager struct { Endpoint string FetcherBackendVersion string EnricherBackendVersion string Fetch bool Enrich bool ESUrl string ESUsername string ESPassword string ESIndex string FromDate *time.Time HTTPTimeout time.Duration Project string FetchSize int EnrichSize int Retries uint Delay time.Duration GapURL string AffAPI string ProjectSlug string AffBaseURL string ESCacheURL string ESCacheUsername string ESCachePassword string AuthGrantType string AuthClientID string AuthClientSecret string AuthAudience string Auth0URL string Environment string Slug string WebHookURL string Auth0 Auth0Client // contains filtered or unexported fields }
Manager describes bugzilla manager
func NewManager ¶
NewManager initiates bugzilla manager instance
type NestedHits ¶
NestedHits is the actual hit data
type NestedRawHits ¶
NestedRawHits is the actual hit data
type Param ¶
type Param struct { EndPoint string FetcherBackendVersion string EnricherBackendVersion string Fetch bool Enrich bool ESUrl string EsUser string EsPassword string EsIndex string FromDate *time.Time Project string FetchSize int EnrichSize int Retries uint Delay time.Duration GapURL string AffAPI string ProjectSlug string AffBaseURL string ESCacheURL string ESCacheUsername string ESCachePassword string AuthGrantType string AuthClientID string AuthClientSecret string AuthAudience string Auth0URL string Environment string Slug string WebHookURL string }
Param required for creating a new instance of Bugzilla manager
type Params ¶
type Params struct { Name string Endpoint string FromDate time.Time Order string Project string Component string Category string BackendVersion string }
Params required parameters for bugzilla fetcher
type SearchFields ¶
type SearchFields struct { Component string `json:"component"` Product string `json:"product"` ItemID string `json:"item_id"` }
SearchFields ...