Skip to main content

Limit changed directories

tfaction >= v1.17.0, #2744

You can limit the number of changed working directories and modules in one pull request. By default, there is no limit.

image

--

modules

Why is the limit necessary?

You shouldn't change many working directories and modules in one pull request.

  • It's difficult to review many changes. You can miss unexpected changes
  • CI becomes unstable
    • API rate limit
  • Inefficient
    • If you fix a directory, you need to run CI on all changed directories
  • Changes can be blocked due to a directory
    • If a directory has some trouble like drift, you can't merge the pull request

How to limit

tfaction-root.yaml

limit_changed_dirs:
working_dirs: 5 # The maximum number of changed working directories in one pull request
modules: 5 # The maximum number of changed modules in one pull request

If working_dirs and modules are less than 1, they are ignored.

How to resolve the failure

If CI fails due to this limit, you have two options:

  1. Split changes to multiple pull requests
  2. Fix tfaction-root.yaml and increase the limit. If you want to disable the limit, remove limit_changed_dirs or change working_dirs and modules to 0
limit_changed_dirs:
working_dirs: 0 # no limit
modules: 0 # no limit