Skip to content

Commit

Permalink
ci: use context instead of name for pipeline identity
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed May 11, 2024
1 parent 7b4cc0a commit 180c0ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/scm/gitlab/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
go_gitlab "github.com/xanzy/go-gitlab"
)

var pipelineName = go_gitlab.Ptr("scm-engine")

// Ensure the GitLab client implements the [scm.Client]
var _ scm.Client = (*Client)(nil)

Expand Down Expand Up @@ -68,7 +70,7 @@ func (client *Client) Start(ctx context.Context) error {

_, _, err := client.wrapped.Commits.SetCommitStatus(state.ProjectID(ctx), state.CommitSHA(ctx), &go_gitlab.SetCommitStatusOptions{
State: go_gitlab.Running,
Name: go_gitlab.Ptr("scm-engine"),
Context: pipelineName,
Description: go_gitlab.Ptr("Currently evaluating MR"),
})

Expand All @@ -91,7 +93,7 @@ func (client *Client) Stop(ctx context.Context, err error) error {

_, _, err = client.wrapped.Commits.SetCommitStatus(state.ProjectID(ctx), state.CommitSHA(ctx), &go_gitlab.SetCommitStatusOptions{
State: status,
Name: go_gitlab.Ptr("scm-engine"),
Context: pipelineName,
Description: go_gitlab.Ptr(message),
})

Expand Down

0 comments on commit 180c0ce

Please sign in to comment.