Skip to content

fix for long status names #1907

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

Merged
merged 1 commit into from
Mar 24, 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
26 changes: 16 additions & 10 deletions libs/ci/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,18 @@ func (svc GithubService) SetStatus(prNumber int, status string, statusContext st
if err != nil {
log.Printf("error getting pull request : %v", err)
return fmt.Errorf("error getting pull request : %v", err)

}

// previously was setting description as "statusContext" but
// faced some issues with too long strings of > 140 chars:
// 422 Validation Failed [{Resource:Status Field:description Code:custom Message:description is too long (maximum is 140 characters)}]
// since description isn't shown in ui setting to blank for now
description := ""

_, _, err = svc.Client.Repositories.CreateStatus(context.Background(), svc.Owner, svc.RepoName, *pr.Head.SHA, &github.RepoStatus{
State: &status,
Context: &statusContext,
Description: &statusContext,
Description: &description,
})
return err
}
Expand Down Expand Up @@ -490,9 +496,9 @@ func ConvertGithubPullRequestEventToJobs(payload *github.PullRequestEvent, impac
RequestedBy: *payload.Sender.Login,
CommandEnvProvider: CommandEnvProvider,
CommandRoleArn: cmdRole,
StateRoleArn: stateRole,
StateRoleArn: stateRole,
StateEnvProvider: StateEnvProvider,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
SkipMergeCheck: skipMerge,
})
} else if *payload.Action == "opened" || *payload.Action == "reopened" || *payload.Action == "synchronize" {
Expand All @@ -516,9 +522,9 @@ func ConvertGithubPullRequestEventToJobs(payload *github.PullRequestEvent, impac
RequestedBy: *payload.Sender.Login,
CommandEnvProvider: CommandEnvProvider,
CommandRoleArn: cmdRole,
StateRoleArn: stateRole,
StateRoleArn: stateRole,
StateEnvProvider: StateEnvProvider,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
SkipMergeCheck: skipMerge,
})
} else if *payload.Action == "closed" {
Expand All @@ -542,9 +548,9 @@ func ConvertGithubPullRequestEventToJobs(payload *github.PullRequestEvent, impac
RequestedBy: *payload.Sender.Login,
CommandEnvProvider: CommandEnvProvider,
CommandRoleArn: cmdRole,
StateRoleArn: stateRole,
StateRoleArn: stateRole,
StateEnvProvider: StateEnvProvider,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
SkipMergeCheck: skipMerge,
})
} else if *payload.Action == "converted_to_draft" {
Expand Down Expand Up @@ -575,9 +581,9 @@ func ConvertGithubPullRequestEventToJobs(payload *github.PullRequestEvent, impac
RequestedBy: *payload.Sender.Login,
CommandEnvProvider: CommandEnvProvider,
CommandRoleArn: cmdRole,
StateRoleArn: stateRole,
StateRoleArn: stateRole,
StateEnvProvider: StateEnvProvider,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
CognitoOidcConfig: project.AwsCognitoOidcConfig,
SkipMergeCheck: skipMerge,
})
}
Expand Down
Loading