Skip to content

Commit

Permalink
Fix context builder test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
msarvar committed Sep 27, 2021
1 parent dd0a3e6 commit c9a3f17
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions server/events/project_command_context_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ func NewProjectCommandContextBulder(policyCheckEnabled bool, commentBuilder Comm
CommentBuilder: commentBuilder,
}

contextBuilderWithStats := &CommandScopedStatsProjectCommandContextBuilder{
ProjectCommandContextBuilder: projectCommandContextBuilder,
ProjectCounter: scope.NewCounter("projects"),
}

if policyCheckEnabled {
return &PolicyCheckProjectCommandContextBuilder{
CommentBuilder: commentBuilder,
ProjectCommandContextBuilder: projectCommandContextBuilder,
ProjectCommandContextBuilder: contextBuilderWithStats,
}
}

return &CommandScopedStatsProjectCommandContextBuilder{
ProjectCommandContextBuilder: projectCommandContextBuilder,
ProjectCounter: scope.NewCounter("projects"),
}
return projectCommandContextBuilder
}

type ContextFlags struct {
Expand Down Expand Up @@ -143,8 +145,8 @@ func (cb *DefaultProjectCommandContextBuilder) BuildProjectContext(
}

type PolicyCheckProjectCommandContextBuilder struct {
ProjectCommandContextBuilder *DefaultProjectCommandContextBuilder
CommentBuilder CommentBuilder
ProjectCommandContextBuilder
CommentBuilder CommentBuilder
}

func (cb *PolicyCheckProjectCommandContextBuilder) BuildProjectContext(
Expand Down

0 comments on commit c9a3f17

Please sign in to comment.