Skip to content

Commit

Permalink
rename Downstream->Dependent; docs cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
iamnoah committed Oct 25, 2022
1 parent 3785456 commit 02dd5dc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion runatlantis.io/docs/autoplanning.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions runatlantis.io/docs/server-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions server/events/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion server/events/modules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion server/events/project_finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}
Expand Down

0 comments on commit 02dd5dc

Please sign in to comment.