diff --git a/server/events/vcs/github_client.go b/server/events/vcs/github_client.go index b248ef068b..f98d5dc55a 100644 --- a/server/events/vcs/github_client.go +++ b/server/events/vcs/github_client.go @@ -24,9 +24,9 @@ import ( "github.com/Laisky/graphql" "github.com/google/go-github/v31/github" "github.com/pkg/errors" + "github.com/runatlantis/atlantis/server/core/config" "github.com/runatlantis/atlantis/server/events/models" "github.com/runatlantis/atlantis/server/events/vcs/common" - "github.com/runatlantis/atlantis/server/core/config" "github.com/runatlantis/atlantis/server/logging" "github.com/shurcooL/githubv4" ) @@ -455,7 +455,7 @@ func (g *GithubClient) ExchangeCode(code string) (*GithubAppTemporarySecrets, er // if BaseRepo had one repo config file, its content will placed on the second return value func (g *GithubClient) DownloadRepoConfigFile(pull models.PullRequest) (bool, []byte, error) { opt := github.RepositoryContentGetOptions{Ref: pull.HeadBranch} - fileContent, _, resp, err := g.client.Repositories.GetContents(g.ctx, pull.BaseRepo.Owner, pull.BaseRepo.Name, yaml.AtlantisYAMLFilename, &opt) + fileContent, _, resp, err := g.client.Repositories.GetContents(g.ctx, pull.BaseRepo.Owner, pull.BaseRepo.Name, config.AtlantisYAMLFilename, &opt) if resp.StatusCode == http.StatusNotFound { return false, []byte{}, nil diff --git a/server/events/vcs/gitlab_client.go b/server/events/vcs/gitlab_client.go index 2f95929c06..623ba8cd52 100644 --- a/server/events/vcs/gitlab_client.go +++ b/server/events/vcs/gitlab_client.go @@ -365,7 +365,7 @@ func (g *GitlabClient) GetTeamNamesForUser(repo models.Repo, user models.User) ( func (g *GitlabClient) DownloadRepoConfigFile(pull models.PullRequest) (bool, []byte, error) { opt := gitlab.GetRawFileOptions{Ref: gitlab.String(pull.HeadBranch)} - bytes, resp, err := g.Client.RepositoryFiles.GetRawFile(pull.BaseRepo.FullName, yaml.AtlantisYAMLFilename, &opt) + bytes, resp, err := g.Client.RepositoryFiles.GetRawFile(pull.BaseRepo.FullName, config.AtlantisYAMLFilename, &opt) if resp.StatusCode == http.StatusNotFound { return false, []byte{}, nil } diff --git a/server/server.go b/server/server.go index 275f933cb2..dda8c9e5d2 100644 --- a/server/server.go +++ b/server/server.go @@ -31,8 +31,8 @@ import ( "time" "github.com/mitchellh/go-homedir" - "github.com/runatlantis/atlantis/server/core/db" "github.com/runatlantis/atlantis/server/core/config/valid" + "github.com/runatlantis/atlantis/server/core/db" "github.com/runatlantis/atlantis/server/handlers" assetfs "github.com/elazarl/go-bindata-assetfs" @@ -42,6 +42,7 @@ import ( events_controllers "github.com/runatlantis/atlantis/server/controllers/events" "github.com/runatlantis/atlantis/server/controllers/templates" "github.com/runatlantis/atlantis/server/controllers/websocket" + cfgParser "github.com/runatlantis/atlantis/server/core/config" "github.com/runatlantis/atlantis/server/core/locking" "github.com/runatlantis/atlantis/server/core/runtime" "github.com/runatlantis/atlantis/server/core/runtime/policy" @@ -52,7 +53,6 @@ import ( "github.com/runatlantis/atlantis/server/events/vcs/bitbucketcloud" "github.com/runatlantis/atlantis/server/events/vcs/bitbucketserver" "github.com/runatlantis/atlantis/server/events/webhooks" - "github.com/runatlantis/atlantis/server/core/config" "github.com/runatlantis/atlantis/server/logging" "github.com/runatlantis/atlantis/server/static" "github.com/urfave/cli" @@ -394,7 +394,7 @@ func NewServer(userConfig UserConfig, config Config) (*Server, error) { DB: boltdb, } - validator := &config.ParserValidator{} + validator := &cfgParser.ParserValidator{} globalCfg := valid.NewGlobalCfgFromArgs( valid.GlobalCfgArgs{