githubasana

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 11 Imported by: 0

README

GitHub Asana Request Review Action

When a reviewer is assigned on GitHub, creates a review subtask on an Asana task specified in a pull request description.

Screenshots

  • Before create a pull request.

  • Create a pull request.

  • After assigned someone as code reviewer on the pull request.

Documentation

Overview

Package githubasana provides GitHub and Asana pull request task integration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCodeReviewSubtask

func AddCodeReviewSubtask(client *asana.Client, taskID string, prID int, requester *Account, reviewer *Account, dueDate asana.Date, pr *github.PullRequestEvent) (*asana.Task, error)

func AddCodeReviewSubtaskComment added in v1.1.0

func AddCodeReviewSubtaskComment(client *asana.Client, subtask *asana.Task, requester *Account, reviewer *Account, pr *github.PullRequestReviewEvent) (*asana.Story, error)

func AddPullRequestCommentToTask

func AddPullRequestCommentToTask(client *asana.Client, taskID string, requester *Account, pr *github.PullRequestEvent) (*asana.Story, error)

func FindSubtaskByName

func FindSubtaskByName(client *asana.Client, taskID string, findString string) (*asana.Task, error)

FindSubtaskByName finds a subtask which contains specified string.

func FindTaskComment

func FindTaskComment(client *asana.Client, taskID string, findString string) (*asana.Story, error)

FindTaskComment finds a story which contains specified string.

func NextBusinessDay added in v1.1.0

func NextBusinessDay(n int, base time.Time, holidays map[string]bool) time.Time

NextBusinessDay returns next n business day. If n is zero, it returns most recent business day including `base` day.

func UpdateCodeReviewSubtask added in v1.1.0

func UpdateCodeReviewSubtask(client *asana.Client, subtask *asana.Task, requester *Account, pr *github.PullRequestEvent) error

func UpdateTaskComment

func UpdateTaskComment(client *asana.Client, storyID string, requester *Account, pr *github.PullRequestEvent) (*asana.Story, error)

Types

type Account added in v1.0.2

type Account struct {
	Name         string
	AsanaUserGID string
	GitHubLogin  string
}

func NewAccount added in v1.0.2

func NewAccount(client *asana.Client, userGID string, githubLogin string) (*Account, error)

func NewNoAsanaAccount added in v1.0.2

func NewNoAsanaAccount(githubLogin string) *Account
func (u *Account) GetUserPermalink() string

func (*Account) String added in v1.0.2

func (u *Account) String() string

type AsanaGID

type AsanaGID = string

type Config

type Config struct {
	DueDate  int                      `yaml:"due_date"`
	Holidays map[string]bool          `yaml:"holidays"`
	Accounts map[GithubLogin]AsanaGID `yaml:"accounts"`
}

func LoadConfig

func LoadConfig(data []byte) (*Config, error)

type GithubLogin

type GithubLogin = string

type Handler added in v1.0.2

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

func NewHandler added in v1.0.2

func NewHandler(conf *Config, asanaClient *asana.Client, githubClient *github.Client) *Handler

func (*Handler) Handle added in v1.0.2

func (h *Handler) Handle(eventName string, eventPayload []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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