azure

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildURI

func BuildURI(org, project, repoName string) string

BuildURI constrói uma URI do Azure DevOps a partir dos componentes

Types

type AzureClient

type AzureClient struct {
	Connection      *azuredevops.Connection
	GitClient       git.Client
	Project         string
	WebhookUsername string
	WebhookPassword string
}

func NewClient

func NewClient(ctx context.Context, cfg config.Config) (*AzureClient, error)

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) MergePR

func (c *AzureClient) MergePR(ctx context.Context, owner, repo string, number int, headSHA string) error

func (*AzureClient) ParseWebhook

func (c *AzureClient) ParseWebhook(r *http.Request) (*scm.WebhookEvent, error)

func (*AzureClient) SetStatus

func (c *AzureClient) SetStatus(ctx context.Context, owner, repo, sha string, state string, description string, targetURL string) 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)

Jump to

Keyboard shortcuts

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