Documentation
¶
Index ¶
- func BuildDescription(issue db.Issue, baseURL, projectID string, latestStacktrace string) string
- func CheckAndCreateIssue(ctx context.Context, queries *db.Queries, baseURL string, projectID uuid.UUID, ...)
- func MatchesRule(rule db.GithubRule, issue db.Issue, userCount int32, ...) bool
- func TestConnection(cfg Config) error
- type Config
- type CreateIssueResult
- type Handler
- func (h *Handler) CreateIssueHandler(w http.ResponseWriter, r *http.Request)
- func (h *Handler) CreateRule(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteRule(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListRules(w http.ResponseWriter, r *http.Request)
- func (h *Handler) TestConnection(w http.ResponseWriter, r *http.Request)
- func (h *Handler) UpdateRule(w http.ResponseWriter, r *http.Request)
- type RuleRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDescription ¶
BuildDescription creates a formatted description for a GitHub issue from a GoSnag issue.
func CheckAndCreateIssue ¶
func CheckAndCreateIssue(ctx context.Context, queries *db.Queries, baseURL string, projectID uuid.UUID, issue db.Issue)
CheckAndCreateIssue evaluates GitHub rules for an issue and creates a GitHub issue if matched.
func MatchesRule ¶
func MatchesRule(rule db.GithubRule, issue db.Issue, userCount int32, evalCtx *conditions.EvalContext) bool
MatchesRule checks whether an issue satisfies all conditions of a GitHub rule.
func TestConnection ¶
TestConnection verifies that the GitHub config is valid by fetching the repo.
Types ¶
type Config ¶
type Config struct {
Token string
Owner string
Repo string
Labels string // comma-separated label names
}
Config holds GitHub connection settings from a project.
func ConfigFromSettings ¶
func ConfigFromSettings(settings projectcfg.ProjectSettings) Config
func (Config) IsConfigured ¶
IsConfigured returns true if the project has GitHub configured.
type CreateIssueResult ¶
CreateIssueResult holds the result of creating a GitHub issue.
func CreateIssue ¶
func CreateIssue(cfg Config, title, body string) (*CreateIssueResult, error)
CreateIssue creates a new issue in GitHub.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) CreateIssueHandler ¶
func (h *Handler) CreateIssueHandler(w http.ResponseWriter, r *http.Request)
CreateIssueHandler manually creates a GitHub issue from a GoSnag issue.
func (*Handler) CreateRule ¶
func (h *Handler) CreateRule(w http.ResponseWriter, r *http.Request)
CreateRule creates a new GitHub auto-creation rule.
func (*Handler) DeleteRule ¶
func (h *Handler) DeleteRule(w http.ResponseWriter, r *http.Request)
DeleteRule deletes a GitHub rule.
func (*Handler) ListRules ¶
func (h *Handler) ListRules(w http.ResponseWriter, r *http.Request)
ListRules lists all GitHub rules for a project.
func (*Handler) TestConnection ¶
func (h *Handler) TestConnection(w http.ResponseWriter, r *http.Request)
TestConnection tests the GitHub connection for a project.
func (*Handler) UpdateRule ¶
func (h *Handler) UpdateRule(w http.ResponseWriter, r *http.Request)
UpdateRule updates a GitHub rule.