github

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package github provides GitHub issue management functionality for DataQL.

Index

Constants

View Source
const (
	LabelBug           = "bug"
	LabelAutoReported  = "auto-reported"
	LabelFileHandler   = "file-handler"
	LabelDatabase      = "database"
	LabelStorage       = "storage"
	LabelMCP           = "mcp"
	LabelREPL          = "repl"
	LabelExport        = "export"
	LabelEnhancement   = "enhancement"
	LabelDocumentation = "documentation"
)

Common labels used for DataQL issues.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides methods for interacting with GitHub issues.

func NewClient

func NewClient(config Config) *Client

NewClient creates a new GitHub client with the given configuration.

func NewDefaultClient

func NewDefaultClient() *Client

NewDefaultClient creates a new GitHub client with default DataQL configuration.

func (*Client) AddComment

func (c *Client) AddComment(issueNumber int, body string) error

AddComment adds a comment to an existing issue.

func (*Client) CreateIssue

func (c *Client) CreateIssue(req IssueCreateRequest) (*Issue, error)

CreateIssue creates a new issue with the given details.

func (*Client) FindDuplicates

func (c *Client) FindDuplicates(errorKeywords string) ([]Issue, error)

FindDuplicates searches for issues that might be duplicates of the given title/error. Returns issues that have similar titles or contain similar error messages.

func (*Client) IsAuthenticated

func (c *Client) IsAuthenticated() bool

IsAuthenticated checks if the gh CLI is authenticated.

func (*Client) IsDuplicate

func (c *Client) IsDuplicate(title string, errorMessage string) (*Issue, error)

IsDuplicate checks if there's likely a duplicate issue for the given error. Returns the duplicate issue if found, nil otherwise.

func (*Client) SearchIssues

func (c *Client) SearchIssues(query string, state string, limit int) ([]Issue, error)

SearchIssues searches for issues matching the given query. Returns a list of matching issues.

type CommentRequest

type CommentRequest struct {
	Body string `json:"body"`
}

CommentRequest represents a request to add a comment to an issue.

type Config

type Config struct {
	Owner string
	Repo  string
}

Config holds the configuration for GitHub operations.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for DataQL repository.

type Issue

type Issue struct {
	Number      int      `json:"number"`
	Title       string   `json:"title"`
	Body        string   `json:"body"`
	State       string   `json:"state"`
	Labels      []string `json:"labels"`
	URL         string   `json:"url"`
	HTMLURL     string   `json:"html_url"` //nolint:tagliatelle // GitHub API naming
	CreatedAt   string   `json:"created_at"`
	UpdatedAt   string   `json:"updated_at"`
	ClosedAt    string   `json:"closed_at,omitempty"`
	CommentsURL string   `json:"comments_url"`
}

Issue represents a GitHub issue. Fields use GitHub API JSON naming convention.

type IssueCreateRequest

type IssueCreateRequest struct {
	Title  string   `json:"title"`
	Body   string   `json:"body"`
	Labels []string `json:"labels,omitempty"`
}

IssueCreateRequest represents a request to create a new issue.

type IssueSearchResult

type IssueSearchResult struct {
	Issues     []Issue `json:"items"` //nolint:tagliatelle // GitHub API naming
	TotalCount int     `json:"total_count"`
}

IssueSearchResult represents the result of searching for issues. Uses GitHub API field names.

Jump to

Keyboard shortcuts

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