Skip to content

Commit

Permalink
Lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Oded-B committed Sep 10, 2024
1 parent e482495 commit 3c6c902
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/pkg/githubapi/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const githubCommentMaxSize = 65536

type DiffCommentData struct {
DiffOfChangedComponents []argocd.DiffResult
HasSyncableComponents bool
HasSyncableComponents bool
BranchName string
Header string
}
Expand Down Expand Up @@ -244,14 +244,14 @@ func generateArgoCdDiffComments(diffCommentData DiffCommentData, githubCommentMa
// We take the diffCommentData and replace the DiffOfChangedComponents with a single component diff
componentTemplateData := diffCommentData
componentTemplateData.DiffOfChangedComponents = []argocd.DiffResult{singleComponentDiff}

// We also update the header to reflect the current component.
componentTemplateData.Header = fmt.Sprintf("Component %d/%d: %s (Split for comment size)", i+1, totalComponents, singleComponentDiff.ComponentPath)
err, templateOutput := executeTemplate("argoCdDiff", "argoCD-diff-pr-comment.gotmpl", componentTemplateData)
if err != nil {
return comments, fmt.Errorf("failed to generate ArgoCD diff comment template: %w", err)
}

// Even per component comments can be too large, in that case we'll just use the concise template
// Somewhat Happy path, the per-component diff comment is small enough to be posted in one comment
if len(templateOutput) < githubCommentMaxSize {
Expand Down

0 comments on commit 3c6c902

Please sign in to comment.