Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global atlantis lock new release branch #1473

Merged
merged 2 commits into from
Apr 1, 2021

Conversation

msarvar
Copy link
Contributor

@msarvar msarvar commented Mar 25, 2021

This PR add two additional lock APIs

  • apply/lock - Disables apply command globally until lock is released using apply/unlock.
  • apply/unlock - Releases the global apply lock, when locks are not present it will return an error.

Both APIs will return an error if --disable-apply flag is set.

There is also a basic UI to lock/unlock apply command. Here are some example screenshots of what it looks like in the atlantis dashboard and PR.

  1. Default UI view without a lock.

Screen Shot 2021-03-31 at 1 28 34 PM

  1. UI view with a lock.

Screen Shot 2021-03-31 at 1 28 47 PM

  1. Applying changes with global lock.
    Screen Shot 2021-03-31 at 4 54 27 PM

Note: This PR doesn't implement authentication, anyone with an access to atlantis will be able to lock, unlock applies.

* Adding CommandLocker to boltDB and exposing it through locker interface

* Apply lock ui and apply command lock controller

* Minor comments

* Adding more tests and refactorinng

* Linting fixes

* creating applyLockingClient variable to fix interface error

* nullsink for stats

* Addressing PR comments

* fixing e2e tests

* linting fix fml

* Update outdated function descriptions

Address PR comments

* revert stats sink changes
@msarvar msarvar requested a review from a team as a code owner March 25, 2021 04:49
@msarvar msarvar changed the title Orca 679 global atlantis lock new release branch (#49) Global atlantis lock new release branch Mar 25, 2021
@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #1473 (e0941c0) into master (f8e991c) will increase coverage by 0.35%.
The diff coverage is 90.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1473      +/-   ##
==========================================
+ Coverage   69.58%   69.93%   +0.35%     
==========================================
  Files          93       94       +1     
  Lines        6332     6447     +115     
==========================================
+ Hits         4406     4509     +103     
- Misses       1549     1558       +9     
- Partials      377      380       +3     
Impacted Files Coverage Δ
server/events/locking/locking.go 100.00% <ø> (ø)
server/events/models/models.go 74.10% <0.00%> (-1.09%) ⬇️
server/server.go 64.97% <66.66%> (-0.01%) ⬇️
server/events/db/boltdb.go 75.21% <92.30%> (+4.56%) ⬆️
server/events/apply_command_runner.go 73.86% <100.00%> (+1.57%) ⬆️
server/events/locking/apply_locking.go 100.00% <100.00%> (ø)
server/locks_controller.go 88.00% <100.00%> (+1.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8e991c...e0941c0. Read the comment docs.

Copy link
Contributor

@nishkrishnan nishkrishnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind posting screenshots of this for others to see?

@msarvar
Copy link
Contributor Author

msarvar commented Mar 31, 2021

@nishkrishnan done

@msarvar msarvar merged commit ad76385 into runatlantis:master Apr 1, 2021
@msarvar msarvar deleted the add-global-apply-lock-api branch April 1, 2021 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants