Skip to content

Commit

Permalink
feat: [CODE-2274]: Add repo description and UI url in the webhook emi…
Browse files Browse the repository at this point in the history
…tted info (#2555)

* feat: [CODE-2274]: Add repo description and UI url in the webhook emitted info
  • Loading branch information
karansaraswat19 authored and Harness committed Aug 22, 2024
1 parent 98e5f7c commit 4ebc0db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/services/webhook/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ type RepositoryInfo struct {
ID int64 `json:"id"`
Path string `json:"path"`
Identifier string `json:"identifier"`
Description string `json:"description"`
DefaultBranch string `json:"default_branch"`
URL string `json:"url"`
GitURL string `json:"git_url"`
GitSSHURL string `json:"git_ssh_url"`
}
Expand All @@ -114,13 +116,15 @@ func (r RepositoryInfo) MarshalJSON() ([]byte, error) {
})
}

// repositoryInfoFrom gets the RespositoryInfo from a types.Repository.
// repositoryInfoFrom gets the RepositoryInfo from a types.Repository.
func repositoryInfoFrom(ctx context.Context, repo *types.Repository, urlProvider url.Provider) RepositoryInfo {
return RepositoryInfo{
ID: repo.ID,
Path: repo.Path,
Identifier: repo.Identifier,
Description: repo.Description,
DefaultBranch: repo.DefaultBranch,
URL: urlProvider.GenerateUIRepoURL(ctx, repo.Path),
GitURL: urlProvider.GenerateGITCloneURL(ctx, repo.Path),
GitSSHURL: urlProvider.GenerateGITCloneSSHURL(ctx, repo.Path),
}
Expand Down

0 comments on commit 4ebc0db

Please sign in to comment.