diff --git a/server/events/github_app_working_dir_test.go b/server/events/github_app_working_dir_test.go index ae0654a90..28983da87 100644 --- a/server/events/github_app_working_dir_test.go +++ b/server/events/github_app_working_dir_test.go @@ -5,7 +5,6 @@ import ( "testing" . "github.com/petergtz/pegomock/v4" - pegomock "github.com/petergtz/pegomock/v4" "github.com/runatlantis/atlantis/server/events" eventMocks "github.com/runatlantis/atlantis/server/events/mocks" "github.com/runatlantis/atlantis/server/events/models" @@ -59,7 +58,7 @@ func TestClone_GithubAppNoneExisting(t *testing.T) { } func TestClone_GithubAppSetsCorrectUrl(t *testing.T) { - pegomock.RegisterMockTestingT(t) + RegisterMockTestingT(t) workingDir := eventMocks.NewMockWorkingDir() diff --git a/server/events/plan_command_runner_test.go b/server/events/plan_command_runner_test.go index e388ef249..80ed066d7 100644 --- a/server/events/plan_command_runner_test.go +++ b/server/events/plan_command_runner_test.go @@ -496,7 +496,6 @@ func TestPlanCommandRunner_ExecutionOrder(t *testing.T) { } planCommandRunner.Run(ctx, cmd) - type RepoModel interface{ models.Repo } for i := range c.ProjectContexts { projectCommandRunner.VerifyWasCalled(c.RunnerInvokeMatch[i]).Plan(c.ProjectContexts[i]) diff --git a/server/events/project_command_builder.go b/server/events/project_command_builder.go index cfd6b2483..2b56d60a6 100644 --- a/server/events/project_command_builder.go +++ b/server/events/project_command_builder.go @@ -734,7 +734,7 @@ func (p *DefaultProjectCommandBuilder) buildProjectCommandCtx(ctx *command.Conte if repoCfgPtr.ParallelPlan != nil { parallelPlan = *repoCfgPtr.ParallelPlan } - abortOnExcecutionOrderFail = *&repoCfgPtr.AbortOnExcecutionOrderFail + abortOnExcecutionOrderFail = repoCfgPtr.AbortOnExcecutionOrderFail } if len(matchingProjects) > 0 { diff --git a/server/events/project_command_context_builder.go b/server/events/project_command_context_builder.go index c4e2b03cc..2170bfb8e 100644 --- a/server/events/project_command_context_builder.go +++ b/server/events/project_command_context_builder.go @@ -194,7 +194,7 @@ func (cb *PolicyCheckProjectCommandContextBuilder) BuildProjectContext( terraformClient, ) - if cmdName == command.Plan && prjCfg.PolicyCheck != false { + if cmdName == command.Plan && prjCfg.PolicyCheck { ctx.Log.Debug("Building project command context for %s", command.PolicyCheck) steps := prjCfg.Workflow.PolicyCheck.Steps diff --git a/server/events/project_finder.go b/server/events/project_finder.go index 8d5ecafe5..661495faf 100644 --- a/server/events/project_finder.go +++ b/server/events/project_finder.go @@ -224,7 +224,7 @@ func (p *DefaultProjectFinder) DetermineProjectsViaConfig(log logging.SimpleLogg // If any of the modified files matches the pattern then this project is // considered modified. for _, file := range modifiedFiles { - match, err := pm.Matches(file) + match, err := pm.MatchesOrParentMatches(file) if err != nil { log.Debug("match err for file %q: %s", file, err) continue @@ -266,7 +266,7 @@ func (p *DefaultProjectFinder) filterToFileList(log logging.SimpleLogging, files if p.shouldIgnore(fileName) { continue } - match, err := patternMatcher.Matches(fileName) + match, err := patternMatcher.MatchesOrParentMatches(fileName) if err != nil { log.Debug("filter err for file %q: %s", fileName, err) continue diff --git a/server/events/working_dir_locker.go b/server/events/working_dir_locker.go index 464014cdb..06af44ec5 100644 --- a/server/events/working_dir_locker.go +++ b/server/events/working_dir_locker.go @@ -63,9 +63,9 @@ func (d *DefaultWorkingDirLocker) TryLockPull(repoFullName string, pullNum int) pullKey := d.pullKey(repoFullName, pullNum) for _, l := range d.locks { if l == pullKey || strings.HasPrefix(l, pullKey+"/") { - return func() {}, fmt.Errorf("The Atlantis working dir is currently locked by another" + + return func() {}, fmt.Errorf("the Atlantis working dir is currently locked by another" + " command that is running for this pull request.\n" + - "Wait until the previous command is complete and try again.") + "Wait until the previous command is complete and try again") } } d.locks = append(d.locks, pullKey) @@ -82,9 +82,9 @@ func (d *DefaultWorkingDirLocker) TryLock(repoFullName string, pullNum int, work workspaceKey := d.workspaceKey(repoFullName, pullNum, workspace, path) for _, l := range d.locks { if l == pullKey || l == workspaceKey { - return func() {}, fmt.Errorf("The %s workspace at path %s is currently locked by another"+ + return func() {}, fmt.Errorf("the %s workspace at path %s is currently locked by another"+ " command that is running for this pull request.\n"+ - "Wait until the previous command is complete and try again.", workspace, path) + "Wait until the previous command is complete and try again", workspace, path) } } d.locks = append(d.locks, workspaceKey) diff --git a/server/events/working_dir_locker_test.go b/server/events/working_dir_locker_test.go index a61d724f1..11c21ea15 100644 --- a/server/events/working_dir_locker_test.go +++ b/server/events/working_dir_locker_test.go @@ -33,9 +33,9 @@ func TestTryLock(t *testing.T) { // Now another lock for the same repo, workspace, and pull should fail _, err = locker.TryLock(repo, 1, workspace, path) - ErrEquals(t, "The default workspace at path . is currently locked by another"+ + ErrEquals(t, "the default workspace at path . is currently locked by another"+ " command that is running for this pull request.\n"+ - "Wait until the previous command is complete and try again.", err) + "Wait until the previous command is complete and try again", err) // Unlock should work. unlockFn()