connectors

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package connectors is the package for all connectors struct and its coressponding methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes map[string][]attribute

type IssueInfo

type IssueInfo struct {
	IssueType            string        `json:"issueType"`
	Comment              string        `json:"comment"`
	AutoAnalyzed         bool          `json:"autoAnalyzed"`
	IgnoreAnalyzer       bool          `json:"ignoreAnalyzer"`
	ExternalSystemIssues []interface{} `json:"externalSystemIssues"`
}

IssueInfo is the data structure describing the issue information for the request body.

type IssueItem

type IssueItem struct {
	Issue      IssueInfo `json:"issue"`
	TestItemID string    `json:"testItemId"`
}

IssueItem is a smallest unit in the reuquest body for describing the issue to be updated.

type Issues

type Issues []IssueItem

Issues is a list of IssueItem.

type LogMsgRequestBody added in v1.1.1

type LogMsgRequestBody struct {
	TestItemID []int  `json:"itemIds"`
	LogLevel   string `json:"logLevel"`
}

type RERequestBody added in v1.0.2

type RERequestBody struct {
	ProjectName string `json:"project_name"`
	LogMsg      string `json:"log_message"`
	TeamName    string `json:"TEAM"`
}

RERequestBody is the struct of request body for Recommendation Engine.

type REResult added in v1.0.2

type REResult struct {
	LaunchID     string `json:"launch_id"`
	LaunchName   string `json:"launch_name"`
	TestItemId   string `json:"test_item_id"`
	TestItemName string `json:"test_name"`
	IssueType    string `json:"issue_name"`
	TicketNumber string `json:"ticket_number"`
	TicketURL    string `json:"ticket_url"`
	Team         string `json:"TEAM"`
}

type REResults added in v1.0.2

type REResults []REResult

type RPConnector

type RPConnector struct {
	LaunchID    string `mapstructure:"LAUNCH_ID" json:"launch_id"`
	LaunchUUID  string `mapstructure:"LAUNCH_UUID" json:"uuid"`
	LaunchName  string `mapstructure:"LAUNCH_NAME" json:"launch_name"`
	ProjectName string `mapstructure:"PROJECT_NAME" json:"project_name"`
	TeamName    string `mapstructure:"TEAM_NAME" json:"team_name"`
	AuthToken   string `mapstructure:"AUTH_TOKEN" json:"auth_token"`
	RPURL       string `mapstructure:"PLATFORM_URL" json:"platform_url"`
	Client      *http.Client
	TFAURL      string `mapstructure:"TFA_URL" json:"tfa_url"`
	REURL       string `mapstructure:"RE_URL" json:"re_url"`
}

RPConnector is the class for describing the RPConnector engine.

func (*RPConnector) BuildIssueItemConcurrent

func (c *RPConnector) BuildIssueItemConcurrent(issuesChan chan<- IssueItem, idsChan <-chan string, exitChan chan<- bool,
	add_attributes bool, re bool, auto_finalize_defect_type bool, auto_finalization_thredshold float32)

BuildIssueItemConcurrent method builds Issue Item Concurrently.

func (*RPConnector) BuildIssueItemHelper

func (c *RPConnector) BuildIssueItemHelper(id string, add_attributes bool, re bool, auto_finalize_defect_type bool, auto_finalization_threshold float32) IssueItem

BuildIssueItemHelper method is a helper method for building the issue item struct.

func (*RPConnector) BuildIssues

func (c *RPConnector) BuildIssues(ids []string, concurrent bool, add_attributes bool, re bool, auto_finalize_defect_type bool, auto_finalization_thredshold float32) Issues

BuildIssues method build the issue struct.

func (*RPConnector) BuildIssuesConcurrent

func (c *RPConnector) BuildIssuesConcurrent(ids []string, add_attributes bool, re bool, auto_finalize_defect_type bool, auto_finalization_thredshold float32) Issues

BuildIssuesConcurrent methods builds the issues struct concurrently.

func (*RPConnector) BuildTFAInput

func (c *RPConnector) BuildTFAInput(test_id, messages string, auto_finalize_defect_type bool, auto_finalization_threshold float32) common.TFAInput

BuildTFAInput method builds the TFAInput struct with the test id and messages.

func (*RPConnector) BuildUpdatedList

func (c *RPConnector) BuildUpdatedList(ids []string,
	concurrent bool, add_attributes bool, re bool, auto_finalize_defect_type bool, auto_finalization_thredshold float32) common.GeneralUpdatedList

BuildUpdatedList method is a interface method for tfacon interface it builds a list of issues, it returns GeneralUpdatedList.

func (*RPConnector) GetAllTestIds

func (c *RPConnector) GetAllTestIds() []string

GetAllTestIds returns all test ids from inside a test launch.

func (*RPConnector) GetAttributesByID

func (c *RPConnector) GetAttributesByID(id string) Attributes

func (*RPConnector) GetDetailedIssueInfoForSingleTestID added in v1.0.2

func (c *RPConnector) GetDetailedIssueInfoForSingleTestID(id string) ([]byte, error)

GetIssueInfoForSingleTestId method returns the issueinfo with the issue(test item) id.

func (*RPConnector) GetIssueInfoForSingleTestID

func (c *RPConnector) GetIssueInfoForSingleTestID(id string) IssueInfo

GetIssueInfoForSingleTestId method returns the issueinfo with the issue(test item) id.

func (*RPConnector) GetLaunchID

func (c *RPConnector) GetLaunchID() string

GetLaunchID returns launch id with the launch name this method will be called when user don't have launchid input.

func (*RPConnector) GetLaunchIDByName added in v1.1.1

func (c *RPConnector) GetLaunchIDByName() string

func (*RPConnector) GetLaunchIDByUUID added in v1.1.1

func (c *RPConnector) GetLaunchIDByUUID() string

func (*RPConnector) GetPrediction

func (c *RPConnector) GetPrediction(id string, tfa_input common.TFAInput) string

GetPrediction method returns the prediction extracted from the TFA Classifier.

func (*RPConnector) GetREResult added in v1.0.2

func (c *RPConnector) GetREResult(id string) string

GetREResult can extract the returned re result.

func (*RPConnector) GetTestLog

func (c *RPConnector) GetTestLog(test_id string) []string

GetTestLog returns the test log(test msg) for a test item.

func (*RPConnector) InitConnector

func (c *RPConnector) InitConnector()

InitConnector create defect types before doing all sync/update job this method will run before everything.

func (*RPConnector) RevertUpdatedList

func (c *RPConnector) RevertUpdatedList(verbose bool) common.GeneralUpdatedList

Revert function will set all test items back to the Original defect type.

func (RPConnector) String

func (c RPConnector) String() string

String method is a to string method for the RPConnector instance.

func (*RPConnector) UpdateAll

func (c *RPConnector) UpdateAll(updatedListOfIssues common.GeneralUpdatedList, verbose bool)

UpdateAll method is the interface method for tfacon interface it update the test items with the built updated_list.

func (*RPConnector) Validate

func (c *RPConnector) Validate(verbose bool) (bool, error)

Validate method validates against the input from yaml file, cli flag, and environment variable.

type UpdatedList

type UpdatedList struct {
	IssuesList Issues `json:"issues"`
}

UpdatedList is the finished final list of the request body that contains all finalized information about issues(test items).

func (UpdatedList) GetSelf

GetSelf method returns an GenralUpdatedlist.

Jump to

Keyboard shortcuts

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