From 189b0591efb176f4be0e320d3b2bfa52138d9647 Mon Sep 17 00:00:00 2001 From: marc bassil Date: Fri, 26 Oct 2018 14:03:08 -0400 Subject: [PATCH] Updating message when project is locked. --- .gitignore | 3 ++- server/events/project_locker.go | 3 ++- server/events/project_locker_test.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 14349d26b5..2034818dd9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ output .terraform/ node_modules/ **/.vuepress/dist -helm/test-values.yaml \ No newline at end of file +helm/test-values.yaml +*.swp diff --git a/server/events/project_locker.go b/server/events/project_locker.go index d3fe6735fe..b15ec4f75b 100644 --- a/server/events/project_locker.go +++ b/server/events/project_locker.go @@ -63,7 +63,8 @@ func (p *DefaultProjectLocker) TryLock(log *logging.SimpleLogger, pull models.Pu } if !lockAttempt.LockAcquired && lockAttempt.CurrLock.Pull.Num != pull.Num { failureMsg := fmt.Sprintf( - "This project is currently locked by #%d. The locking plan must be applied or discarded before future plans can execute.", + "**Unable to run `plan`**. This project is currently locked by an unapplied plan from pull #%d. To continue, delete the lock from #%d or apply that plan and merge the pull request.\n\nOnce the lock is released, comment `atlantis plan` here to re-plan.", + lockAttempt.CurrLock.Pull.Num, lockAttempt.CurrLock.Pull.Num) return &TryLockResponse{ LockAcquired: false, diff --git a/server/events/project_locker_test.go b/server/events/project_locker_test.go index 3dc0db9375..0a6dd86e27 100644 --- a/server/events/project_locker_test.go +++ b/server/events/project_locker_test.go @@ -52,7 +52,7 @@ func TestDefaultProjectLocker_TryLockWhenLocked(t *testing.T) { Ok(t, err) Equals(t, &events.TryLockResponse{ LockAcquired: false, - LockFailureReason: "This project is currently locked by #2. The locking plan must be applied or discarded before future plans can execute.", + LockFailureReason: "**Unable to run `plan`**. This project is currently locked by an unapplied plan from pull #2. To continue, delete the lock from #2 or apply that plan and merge the pull request.\n\nOnce the lock is released, comment `atlantis plan` here to re-plan.", }, res) }