Documentation
¶
Overview ¶
Package jira provides utilities for the Jira API.
Index ¶
- type Client
- func (c *Client) AddCommentToTicket(ticketKey string, comment string) error
- func (c *Client) AuthType() string
- func (c *Client) CreateFlakyTestTicket(req FlakyTestTicketRequest) (*TicketResponse, error)
- func (c *Client) GetTicketStatus(ticketKey string) (*TicketStatus, error)
- func (c *Client) IsOAuthEnabled() bool
- type CreateIssueRequest
- type FlakyTestTicketRequest
- type IClient
- type IssueFields
- type IssueType
- type Option
- type Project
- type TicketResponse
- type TicketStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL *url.URL
HTTPClient *http.Client
// contains filtered or unexported fields
}
Client implements Interface
func (*Client) AddCommentToTicket ¶
AddCommentToTicket adds a comment to an existing Jira ticket
func (*Client) CreateFlakyTestTicket ¶
func (c *Client) CreateFlakyTestTicket(req FlakyTestTicketRequest) (*TicketResponse, error)
CreateFlakyTestTicket creates a new Jira ticket for a flaky test
func (*Client) GetTicketStatus ¶
func (c *Client) GetTicketStatus(ticketKey string) (*TicketStatus, error)
GetTicketStatus retrieves the current status of a Jira ticket
func (*Client) IsOAuthEnabled ¶
IsOAuthEnabled returns true if OAuth authentication is configured
type CreateIssueRequest ¶
type CreateIssueRequest struct {
Fields IssueFields `json:"fields"`
}
CreateIssueRequest represents the request body for creating a Jira issue.
type FlakyTestTicketRequest ¶
type FlakyTestTicketRequest struct {
RepoName string `json:"repo_name"`
TestPackageName string `json:"test_package_name"`
FilePath string `json:"file_path"`
TrunkID string `json:"trunk_id"` // UUID
Details string `json:"details"` // JSON string with additional details (trunk Payload for example)
}
FlakyTestTicketRequest represents the data needed to create a Jira ticket for a flaky test
type IClient ¶
type IClient interface {
CreateFlakyTestTicket(req FlakyTestTicketRequest) (*TicketResponse, error)
GetTicketStatus(ticketKey string) (*TicketStatus, error)
AddCommentToTicket(ticketKey string, comment string) error
}
IClient is the interface that wraps the basic Jira client methods. Helpful for mocking in tests.
type IssueFields ¶
type IssueFields struct {
Project Project `json:"project"`
Summary string `json:"summary"`
Description string `json:"description"`
IssueType IssueType `json:"issuetype"`
Labels []string `json:"labels"`
}
IssueFields represents the fields for a Jira issue
type IssueType ¶
type IssueType struct {
Name string `json:"name"`
}
IssueType represents a Jira issue type
type Option ¶
type Option func(*jiraClientOptions)
Option is a function that sets a configuration option for the Jira client.
func WithBaseURL ¶
WithBaseURL sets the base URL for the Jira client.
func WithConfig ¶
WithConfig sets the config to use for the Jira client.
func WithLogger ¶
WithLogger sets the logger to use for the Jira client.
type TicketResponse ¶
type TicketResponse struct {
ID string `json:"id"`
Key string `json:"key"`
Self string `json:"self"`
}
TicketResponse represents the response from Jira when creating a ticket
type TicketStatus ¶
type TicketStatus struct {
Key string `json:"key"`
Status struct {
Name string `json:"name"`
StatusCode string `json:"statusCategory"`
} `json:"status"`
Fields struct {
Status struct {
Name string `json:"name"`
StatusCategory struct {
Key string `json:"key"`
Name string `json:"name"`
} `json:"statusCategory"`
} `json:"status"`
} `json:"fields"`
}
TicketStatus represents the status information of a Jira ticket
func (*TicketStatus) IsResolved ¶
func (jts *TicketStatus) IsResolved() bool
IsResolved returns true if the ticket is in a resolved/closed state