Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Conversation

@noahingh
Copy link
Member

@noahingh noahingh commented Sep 25, 2021

Add Lock tab to lock (or unlock) environment. It provides a fine-grained locking system.

Example

image

Comment on lines +113 to +119
if locked, err := r.i.HasLockOfRepoForEnv(ctx, re, p.Env); locked {
r.log.Info("The env is locked.", zap.String("env", p.Env))
gb.ErrorResponse(c, http.StatusUnprocessableEntity, "The env is locked. You should unlock the env before deploying.")
return
} else if err != nil {
r.log.Error("It has failed to check the lock.", zap.Error(err))
gb.ErrorResponse(c, http.StatusInternalServerError, "It has failed to check the lock.")
Copy link
Member Author

Choose a reason for hiding this comment

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

Check the env lock.

Comment on lines +147 to +149
repov1.GET("/:id/locks", rm.RepoReadPerm(), r.ListLocks)
repov1.POST("/:id/locks", rm.RepoWritePerm(), r.CreateLock)
repov1.DELETE("/:id/locks/:lockID", rm.RepoWritePerm(), r.DeleteLock)
Copy link
Member Author

Choose a reason for hiding this comment

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

Add API for the locking system.

@noahingh noahingh linked an issue Sep 25, 2021 that may be closed by this pull request
@noahingh noahingh modified the milestone: v0.4 Sep 25, 2021
@noahingh noahingh merged commit 9647706 into main Sep 25, 2021
@noahingh noahingh deleted the lock-env branch September 25, 2021 06:44
@noahingh noahingh added this to the v0.4 milestone Sep 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lock the specific environment in UI

2 participants