Skip to content

Commit

Permalink
Removed feature flag for PR locks (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aayyush authored and msarvar committed Sep 27, 2021
1 parent 21802b1 commit cdfc4a7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
11 changes: 2 additions & 9 deletions server/events/apply_requirement_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"github.com/runatlantis/atlantis/server/events/models"
"github.com/runatlantis/atlantis/server/events/yaml/raw"
"github.com/runatlantis/atlantis/server/events/yaml/valid"
"github.com/runatlantis/atlantis/server/feature"
)

//go:generate pegomock generate -m --package mocks -o mocks/mock_apply_handler.go ApplyRequirement
Expand All @@ -13,8 +12,7 @@ type ApplyRequirement interface {
}

type AggregateApplyRequirements struct {
WorkingDir WorkingDir
FeatureAllocator feature.Allocator
WorkingDir WorkingDir
}

func (a *AggregateApplyRequirements) ValidateProject(repoDir string, ctx models.ProjectCommandContext) (failure string, err error) {
Expand All @@ -38,12 +36,7 @@ func (a *AggregateApplyRequirements) ValidateProject(repoDir string, ctx models.
return "Default branch must be rebased onto pull request before running apply.", nil
}
case raw.UnlockedApplyRequirement:
shouldAllocate, err := a.FeatureAllocator.ShouldAllocate(feature.AtlantisLock, ctx.BaseRepo.FullName)
if err != nil {
ctx.Log.Err("unable to allocate for feature: %s, error: %s", feature.AtlantisLock, err)
}

if shouldAllocate && ctx.PullReqStatus.SQLocked {
if ctx.PullReqStatus.SQLocked {
return "Pull request must be unlocked using the 🔓 emoji before running apply.", nil
}
}
Expand Down
1 change: 0 additions & 1 deletion server/feature/names.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ type Name string

// list of feature names used in the code base. These must be kept in sync with any external config.
const LogStreaming Name = "log-streaming"
const AtlantisLock Name = "atlantis-lock"
3 changes: 1 addition & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,7 @@ func NewServer(userConfig UserConfig, config Config) (*Server, error) {
}

applyRequirementHandler := &events.AggregateApplyRequirements{
WorkingDir: workingDir,
FeatureAllocator: featureAllocator,
WorkingDir: workingDir,
}

projectCommandRunner := &events.DefaultProjectCommandRunner{
Expand Down

0 comments on commit cdfc4a7

Please sign in to comment.