Documentation
¶
Index ¶
- func BuildURI(org, project, repoName string) string
- type AzureClient
- func (c *AzureClient) BranchStatus(ctx context.Context, owner, repo string, sourceBranch, targetBranch string) (*scm.GitBranchStats, error)
- func (c *AzureClient) Comment(ctx context.Context, owner, repo string, number int, body string) error
- func (c *AzureClient) CommentClose(ctx context.Context, owner, repo string, number int, key string) error
- func (c *AzureClient) CommentUpdate(ctx context.Context, owner, repo string, number int, key, body string) error
- func (c *AzureClient) FetchRepositoryMetadata(ctx context.Context, identifier string) (*model.RepositoryMetadata, error)
- func (c *AzureClient) GetChangedStacks(ctx context.Context, owner, repo string, number int) ([]string, error)
- func (c *AzureClient) GetPullRequest(ctx context.Context, owner, repo string, number int) (*scm.PullRequest, error)
- func (c *AzureClient) MergePR(ctx context.Context, owner, repo string, number int, headSHA string) error
- func (c *AzureClient) ParseWebhook(r *http.Request) (*scm.WebhookEvent, error)
- func (c *AzureClient) SetStatus(ctx context.Context, owner, repo, sha string, state string, description string, ...) error
- type URIComponents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AzureClient ¶
type AzureClient struct {
Connection *azuredevops.Connection
GitClient git.Client
Project string
WebhookUsername string
WebhookPassword string
}
func (*AzureClient) BranchStatus ¶
func (c *AzureClient) BranchStatus(ctx context.Context, owner, repo string, sourceBranch, targetBranch string) (*scm.GitBranchStats, error)
func (*AzureClient) Comment ¶
func (c *AzureClient) Comment(ctx context.Context, owner, repo string, number int, body string) error
Comment creates a new PR thread. Always posts a new comment, no deduplication.
func (*AzureClient) CommentClose ¶
func (c *AzureClient) CommentClose(ctx context.Context, owner, repo string, number int, key string) error
CommentClose resolves a PR thread identified by key by setting its status to Closed.
func (*AzureClient) CommentUpdate ¶
func (c *AzureClient) CommentUpdate(ctx context.Context, owner, repo string, number int, key, body string) error
CommentUpdate upserts a PR comment identified by key. If a previous comment with the same key exists it is updated; otherwise a new one is created.
func (*AzureClient) FetchRepositoryMetadata ¶
func (c *AzureClient) FetchRepositoryMetadata(ctx context.Context, identifier string) (*model.RepositoryMetadata, error)
FetchRepositoryMetadata busca metadados completos do repositório do Azure DevOps Aceita URI (https://dev.azure.com/org/proj/_git/repo) ou GUID do repositório
func (*AzureClient) GetChangedStacks ¶
func (c *AzureClient) GetChangedStacks(ctx context.Context, owner, repo string, number int) ([]string, error)
GetChangedStacks Refatorado com Type Switch
func (*AzureClient) GetPullRequest ¶
func (c *AzureClient) GetPullRequest(ctx context.Context, owner, repo string, number int) (*scm.PullRequest, error)
func (*AzureClient) ParseWebhook ¶
func (c *AzureClient) ParseWebhook(r *http.Request) (*scm.WebhookEvent, error)
type URIComponents ¶
type URIComponents struct {
Organization string // Nome da organização (ex: "myorg")
Project string // Nome do projeto (ex: "myproject")
RepoName string // Nome do repositório (ex: "myrepo")
}
URIComponents contém os componentes extraídos de uma URI do Azure DevOps
func ParseURI ¶
func ParseURI(uri string) (*URIComponents, error)
ParseURI extrai os componentes de uma URI do Azure DevOps Formatos suportados: - https://dev.azure.com/org/project/_git/repo - https://user@dev.azure.com/org/project/_git/repo - https://org.visualstudio.com/project/_git/repo (formato legado)