feat: [CODE-2312]: Update UI labels for audit service (#2805)

* feat: [CODE-2312]: revert go-sdk changes in all places
* feat: [CODE-2312]: revert go.mod changes
* feat: [CODE-2312]: fresh reset
* feat: [CODE-2312]: go.mod changes
* feat: [CODE-2312]: address resourcename to commit.go
* Merge branch 'main' into akp/CODE-2312
* feat: [CODE-2312]: address resourcename to commit.go
* feat: [CODE-2312]: address resourcename to commit.go
* feat: [CODE-2312]: address failure due to exceeding limit on resource labels
* feat: [CODE-2312]: lint
* feat: [CODE-2312]: MERGE
* feat: [CODE-2312]: Update wire
* feat: [CODE-2312]: update ui labels
* feat: [CODE-2312]: update resource and action
* feat: [CODE-2312]: Audit log new action : bypassed
* feat: [CODE-2312]: audit log object update
* Merge branch 'main' into akp/CODE-2312
* feat: [CODE-2312]: audit logging changes for commit, merge, create and delete branch
* Merge branch 'main' into akp/CODE-2312
* Merge branch 'main' into akp/CODE-2312
* feat: [CODE-2312]: introduce parser and enclosing method
* feat: [CODE-2312]: annotate error
* feat: [CODE-2312]: name change and todo removal
* feat: [CODE-2312]: Annotate errors
* feat: [CODE-2232]: Branch Rules: UserGroup support: Create and List
pull/3576/head
Akhilesh Pandey 2024-10-11 17:05:19 +00:00 committed by Harness
parent 2606389e85
commit 3ef7f9f55a
5 changed files with 26 additions and 0 deletions

View File

@ -568,6 +568,12 @@ func (c *Controller) Merge(
audit.BypassedResourceTypePullRequest,
audit.BypassedResourceName,
strconv.FormatInt(pr.Number, 10),
audit.ResourceName,
fmt.Sprintf(
audit.BypassPullReqLabelFormat,
sourceRepo.Identifier,
strconv.FormatInt(pr.Number, 10),
),
audit.BypassAction,
audit.BypassActionMerged,
),

View File

@ -174,6 +174,11 @@ func (c *Controller) CommitFiles(ctx context.Context,
audit.BypassedResourceTypeCommit,
audit.BypassedResourceName,
commit.CommitID.String(),
fmt.Sprintf(
audit.BypassSHALabelFormat,
repo.Identifier,
commit.CommitID.String()[0:6],
),
),
audit.ActionBypassed,
paths.Parent(repo.Path),

View File

@ -123,6 +123,12 @@ func (c *Controller) CreateBranch(ctx context.Context,
branch.Name,
audit.BypassAction,
audit.BypassActionCreated,
audit.ResourceName,
fmt.Sprintf(
audit.BypassSHALabelFormat,
repo.Identifier,
branch.Name,
),
),
audit.ActionBypassed,
paths.Parent(repo.Path),

View File

@ -110,6 +110,12 @@ func (c *Controller) DeleteBranch(ctx context.Context,
branchName,
audit.BypassAction,
audit.BypassActionDeleted,
audit.ResourceName,
fmt.Sprintf(
audit.BypassSHALabelFormat,
repo.Identifier,
branchName,
),
),
audit.ActionBypassed,
paths.Parent(repo.Path),

View File

@ -31,6 +31,7 @@ var (
)
const (
ResourceName = "resourceName"
RepoName = "repoName"
BypassedResourceType = "bypassedResourceType"
BypassedResourceName = "bypassedResourceName"
@ -43,6 +44,8 @@ const (
BypassActionCreated = "created"
BypassActionCommitted = "committed"
BypassActionMerged = "merged"
BypassSHALabelFormat = "%s @%s"
BypassPullReqLabelFormat = "%s #%s"
)
type Action string