From 4ebc0db9b39c8423cce43c2c5091b57e5761675a Mon Sep 17 00:00:00 2001 From: Karan Saraswat Date: Thu, 22 Aug 2024 08:00:22 +0000 Subject: [PATCH] feat: [CODE-2274]: Add repo description and UI url in the webhook emitted info (#2555) * feat: [CODE-2274]: Add repo description and UI url in the webhook emitted info --- app/services/webhook/types.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/services/webhook/types.go b/app/services/webhook/types.go index 7a9cdb70e4..3327dcbafe 100644 --- a/app/services/webhook/types.go +++ b/app/services/webhook/types.go @@ -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"` } @@ -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), }