Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(STONEINTG-1125): fix gitlab commitStatus change from pending to pending #1012

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions status/reporter_gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ func (r *GitLabReporter) setCommitStatus(report TestReport) error {
}
existingCommitStatus = r.GetExistingCommitStatus(allCommitStatuses, report.FullName)

// special case, we want to skip updating commit status if the status from running to running, from enque to pending
if existingCommitStatus != nil && (existingCommitStatus.Status == "enqueue" ||
existingCommitStatus.Status == string(gitlab.Running)) {
// special case, we want to skip updating commit status if the status from running to running, from pending to pending
if existingCommitStatus != nil && existingCommitStatus.Status == string(glState) {
hongweiliu17 marked this conversation as resolved.
Show resolved Hide resolved
r.logger.Info("Skipping commit status update",
"scenario.name", report.ScenarioName,
"commitStatus.ID", existingCommitStatus.ID,
Expand All @@ -201,7 +200,7 @@ func (r *GitLabReporter) setCommitStatus(report TestReport) error {

commitStatus, _, err := r.client.Commits.SetCommitStatus(r.sourceProjectID, r.sha, &opt)
if err != nil {
return fmt.Errorf("failed to set commit status: %w", err)
return fmt.Errorf("failed to set commit status to %s: %w", string(glState), err)
}

r.logger.Info("Created gitlab commit status", "scenario.name", report.ScenarioName, "commitStatus.ID", commitStatus.ID, "TargetURL", opt.TargetURL)
Expand Down
Loading