diff --git a/runatlantis.io/docs/autoplanning.md b/runatlantis.io/docs/autoplanning.md index 99d747c603..3461013980 100644 --- a/runatlantis.io/docs/autoplanning.md +++ b/runatlantis.io/docs/autoplanning.md @@ -8,7 +8,7 @@ The algorithm it uses is as follows: 1. Get the directories that those files are in 1. If the directory path doesn't contain `modules/` then try to run `plan` in that directory 1. If it does contain `modules/` look at the directory one level above `modules/`. If it -contains a `main.tf` run plan in that directory, otherwise ignore the change (see below for exceptions.) +contains a `main.tf` run plan in that directory, otherwise ignore the change (see below for exceptions). ## Example Given the directory structure: diff --git a/runatlantis.io/docs/server-configuration.md b/runatlantis.io/docs/server-configuration.md index da1dca8233..a945b5ef36 100644 --- a/runatlantis.io/docs/server-configuration.md +++ b/runatlantis.io/docs/server-configuration.md @@ -142,7 +142,7 @@ By default, changes to modules will not trigger autoplanning. See the flags belo ### `--autoplan-modules` ```bash - atlantis server --autoplan-modules=true' +atlantis server --autoplan-modules ``` Defaults to `false`. When set to `true`, Atlantis will trace the local modules of included projects. @@ -153,7 +153,7 @@ After tracing, Atlantis will plan any project that includes a changed module. Th ### `--autoplan-modules-from-projects` ```bash - atlantis server --autoplan-modules-from-projects='**/init.tf' +atlantis server --autoplan-modules-from-projects='**/init.tf' ``` Enables auto-planing of projects when a module dependency in the same repository has changed. diff --git a/server/events/modules.go b/server/events/modules.go index a9864b4124..b7144bbac8 100644 --- a/server/events/modules.go +++ b/server/events/modules.go @@ -28,8 +28,8 @@ func (m *module) String() string { } type ModuleProjects interface { - // DownstreamProjects returns all projects that depend on the module at moduleDir - DownstreamProjects(moduleDir string) []string + // DependentProjects returns all projects that depend on the module at moduleDir + DependentProjects(moduleDir string) []string } type moduleInfo map[string]*module @@ -40,7 +40,7 @@ func (m moduleInfo) String() string { return fmt.Sprintf("%+v", map[string]*module(m)) } -func (m moduleInfo) DownstreamProjects(moduleDir string) (projectPaths []string) { +func (m moduleInfo) DependentProjects(moduleDir string) (projectPaths []string) { if m == nil || m[moduleDir] == nil { return nil } diff --git a/server/events/modules_test.go b/server/events/modules_test.go index d931428c46..3f7770c033 100644 --- a/server/events/modules_test.go +++ b/server/events/modules_test.go @@ -62,7 +62,7 @@ func Test_findModuleDependants(t *testing.T) { return } for k, v := range tt.want { - projects := got.DownstreamProjects(k) + projects := got.DependentProjects(k) sort.Strings(projects) assert.Equalf(t, v, projects, "%v.DownstreamProjects(%v)", got, k) } diff --git a/server/events/project_finder.go b/server/events/project_finder.go index 4ec130f746..0a1d5096c4 100644 --- a/server/events/project_finder.go +++ b/server/events/project_finder.go @@ -153,7 +153,7 @@ func (p *DefaultProjectFinder) DetermineProjects(log logging.SimpleLogging, modi if projectDir != "" { dirs = append(dirs, projectDir) } else if moduleInfo != nil { - downstreamProjects := moduleInfo.DownstreamProjects(path.Dir(modifiedFile)) + downstreamProjects := moduleInfo.DependentProjects(path.Dir(modifiedFile)) log.Debug("found downstream projects for %q: %v", modifiedFile, downstreamProjects) dirs = append(dirs, downstreamProjects...) }