atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

Atlantis wont unlock declined PRs

Open ryan-dyer-sp opened this issue 4 years ago • 7 comments
trafficstars

Atlantis should allow the unlock command for declined PRs. Currently it says "Atlantis commands can't be run on closed pull requests". There are multiple bugs and scenarios which can prevent atlantis from removing locks automatically when a PR is closed.

  • Disk full issues
  • Network issues with the webhook
  • #1202

ryan-dyer-sp avatar Feb 10 '21 18:02 ryan-dyer-sp

We had a similar situation:

  • Someone opened a PR and Atlantis ran the plan
  • Someone opened another PR which had the same commits from the first PR and more
  • The second PR was merged
  • Developer deleted the branch of the first PR to clean things (PR is showing as merged but I think it's just GitHub being smart)
  • Atlantis did not deleted plans for first PR... and the PR is closed.
  • Atlantis refuses to run atlantis unlock on first PR saying it's already closed.

gtirloni avatar Jun 28 '22 12:06 gtirloni

Still suffering from this same issue. We have a closed PR that is currently still locking all our plans except one which got applied before the PR was closed and now we cannot unlock since the PR is closed.

starkpister avatar Jul 19 '22 18:07 starkpister

this is affecting us too

halradaideh avatar Jul 25 '22 07:07 halradaideh

you can do it from the UI

but I would prefer a CLI cmd or a force-unlock comment on the PR to unlock all related plans

halradaideh avatar Jul 25 '22 07:07 halradaideh

is this still an issue with v0.19.8?

jamengual avatar Aug 26 '22 02:08 jamengual

We just had issue on v0.19.4.

gszakonyNitro avatar Sep 06 '22 13:09 gszakonyNitro

Just reproduced, had to unlock manually in web ui

okgolove avatar Sep 07 '22 12:09 okgolove

Need this feature 🙏

bilenkis avatar Sep 30 '22 11:09 bilenkis

Have the same issue. PR closed and merged as normal, underlying branch deleted, opened new PR, says there is a lock from the closed PR, try to run atlantis unlock on closed PR, atlantis replies that you can't.

GCCree avatar Oct 27 '22 17:10 GCCree

Would be nice to have the ability to run atlantis unlock and pass in a specific plan identifier so you could unlock from any PR, not just the PR that the plan is associated with.

GCCree avatar Oct 27 '22 17:10 GCCree

we have an Atlantis /api but no unlock command yet, that will be another option to solve this programmatically.

On Thu, Oct 27, 2022, 10:29 a.m. GCCree @.***> wrote:

Would be nice to the ability to run atlantis unlock and pass in a specific plan identifier so you could unlock from any PR, not just the PR that the plan is associated with.

— Reply to this email directly, view it on GitHub https://github.com/runatlantis/atlantis/issues/1393#issuecomment-1293848266, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ3ERE2G74FMH6VJMSDAB3WFK3YXANCNFSM4XNO2STQ . You are receiving this because you commented.Message ID: @.***>

jamengual avatar Oct 27 '22 20:10 jamengual

In my case the issue turned out to be that I hadn't updated my local repo before I created my branch and eventually opened a PR on it. The PR that it said had the lock didn't actually have any lock on it. Issue went away when I updated my local repo, then created a new PR from my branch.

GCCree avatar Oct 27 '22 20:10 GCCree

we have an Atlantis /api but no unlock command yet, that will be another option to solve this programmatically.

I thought we could run atlantis unlock command to unlock and we have a way to do this programmatically because the web frontend allows unlocking plans?

nitrocode avatar Nov 05 '22 17:11 nitrocode

Also happens if MR is merged before the plan is applied. Gitlab doesn't prevent the merge, and afterwards the plan is locked and cannot be unlocked from gitlab.

Lapeth avatar Jan 11 '23 16:01 Lapeth

I thinks this should be resolved by : https://github.com/runatlantis/atlantis/pull/2916 you can test the prerelease from yesterday

jamengual avatar Jan 11 '23 18:01 jamengual