Skip to content

Commit

Permalink
whitespace lint
Browse files Browse the repository at this point in the history
Signed-off-by: Dennis Haney <[email protected]>
  • Loading branch information
davhdavh authored Sep 28, 2023
1 parent 8c5dcb4 commit 66093e7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
31 changes: 15 additions & 16 deletions pkg/services/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ type GitHubStatus struct {

//copy of github:UpdateCheckRunOptions + id + timestamp as string

Check failure on line 53 in pkg/services/github.go

View workflow job for this annotation

GitHub Actions / Lint Go code

File is not `goimports`-ed with -local github.com/argoproj/notifications-engine (goimports)
type GitHubCheckRun struct {
Id string `json:"id"` // check_id, actually an int64, but string since we want it to be template'able. (Optional - create new check-run for revision if missing.)
Name string `json:"name"` // The name of the check (e.g., "code-coverage"). (Required.)
DetailsURL string `json:"details_url,omitempty"` // The URL of the integrator's site that has the full details of the check. (Optional.)
ExternalID string `json:"external_id,omitempty"` // A reference for the run on the integrator's system. (Optional.)
Status string `json:"status,omitempty"` // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.)
Conclusion string `json:"conclusion,omitempty"` // Can be one of "success", "failure", "neutral", "cancelled", "skipped", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".)
CompletedAt string `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.)
Id string `json:"id"` // check_id, actually an int64, but string since we want it to be template'able. (Optional - create new check-run for revision if missing.)
Name string `json:"name"` // The name of the check (e.g., "code-coverage"). (Required.)
DetailsURL string `json:"details_url,omitempty"` // The URL of the integrator's site that has the full details of the check. (Optional.)
ExternalID string `json:"external_id,omitempty"` // A reference for the run on the integrator's system. (Optional.)
Status string `json:"status,omitempty"` // The current status. Can be one of "queued", "in_progress", or "completed". Default: "queued". (Optional.)
Conclusion string `json:"conclusion,omitempty"` // Can be one of "success", "failure", "neutral", "cancelled", "skipped", "timed_out", or "action_required". (Optional. Required if you provide a status of "completed".)
CompletedAt string `json:"completed_at,omitempty"` // The time the check completed. (Optional. Required if you provide conclusion.)
Output *github.CheckRunOutput `json:"output,omitempty"` // Provide descriptive details about the run. (Optional)
Actions []*github.CheckRunAction `json:"actions,omitempty"` // Possible further actions the integrator can perform, which a user may trigger. (Optional.)
}
Expand Down Expand Up @@ -184,7 +184,7 @@ func (g *GitHubNotification) GetTemplater(name string, f texttemplate.FuncMap) (
notification.GitHub.CheckRun.Actions = g.CheckRun.Actions
if g.CheckRun.Output != nil {
notification.GitHub.CheckRun.Output.Annotations = g.CheckRun.Output.Annotations
notification.GitHub.CheckRun.Output.Images = g.CheckRun.Output.Images
notification.GitHub.CheckRun.Output.Images = g.CheckRun.Output.Images
}
}
return nil
Expand Down Expand Up @@ -392,14 +392,14 @@ func (g gitHubService) Send(notification Notification, _ Destination) error {
u[1],
id,
github.UpdateCheckRunOptions{
Name : notification.GitHub.CheckRun.Name,
DetailsURL : &notification.GitHub.CheckRun.DetailsURL,
ExternalID : &notification.GitHub.CheckRun.ExternalID,
Status : &notification.GitHub.CheckRun.Status,
Conclusion : &notification.GitHub.CheckRun.Conclusion,
Name: notification.GitHub.CheckRun.Name,
DetailsURL: &notification.GitHub.CheckRun.DetailsURL,
ExternalID: &notification.GitHub.CheckRun.ExternalID,
Status: &notification.GitHub.CheckRun.Status,
Conclusion: &notification.GitHub.CheckRun.Conclusion,
CompletedAt: timestamp,
Output : notification.GitHub.CheckRun.Output,
Actions : notification.GitHub.CheckRun.Actions,
Output: notification.GitHub.CheckRun.Output,
Actions: notification.GitHub.CheckRun.Actions,
},
)
if err != nil {
Expand All @@ -409,4 +409,3 @@ func (g gitHubService) Send(notification Notification, _ Destination) error {

return nil
}

8 changes: 4 additions & 4 deletions pkg/services/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,11 @@ func TestGetTemplater_Github_PullRequestComment(t *testing.T) {
func TestGetTemplater_Github_CheckRun(t *testing.T) {
title := "{{.sync.status.lastSyncedCommit}}"
n := Notification{
GitHub: &GitHubNotification {
GitHub: &GitHubNotification{
RepoURLPath: "{{.sync.spec.git.repo}}",
RevisionPath: "{{.sync.status.lastSyncedCommit}}",
CheckRun: &GitHubCheckRun {
Output: &github.CheckRunOutput {
CheckRun: &GitHubCheckRun{
Output: &github.CheckRunOutput{
Title: &title,

Check failure on line 254 in pkg/services/github_test.go

View workflow job for this annotation

GitHub Actions / Lint Go code

File is not `goimports`-ed with -local github.com/argoproj/notifications-engine (goimports)
},
},
Expand Down Expand Up @@ -288,4 +288,4 @@ func TestGetTemplater_Github_CheckRun(t *testing.T) {
assert.Equal(t, "https://github.com/argoproj-labs/argocd-notifications.git", notification.GitHub.repoURL)
assert.Equal(t, "0123456789", notification.GitHub.revision)
assert.Equal(t, "0123456789", *notification.GitHub.CheckRun.Output.Title)
}
}

0 comments on commit 66093e7

Please sign in to comment.