VCS Status Silencing#
Three server-level flags control whether Atlantis posts PR comments and sets VCS commit statuses when no matching projects are found. They operate at different scopes and combine to handle autoplan, explicit plan/apply, and the autodiscover.ignore_paths early-exit path.
Configuration Flags#
All three flags are declared in server/user_config.go and registered as CLI flags in cmd/server.go:
| Flag | Env var | Scope |
|---|---|---|
--silence-no-projects | ATLANTIS_SILENCE_NO_PROJECTS | Suppresses all PR comments/responses when no projects match |
--silence-vcs-status-no-plans | ATLANTIS_SILENCE_VCS_STATUS_NO_PLANS | Suppresses VCS commit status during autoplan when no plans are found |
--silence-vcs-status-no-projects | ATLANTIS_SILENCE_VCS_STATUS_NO_PROJECTS | Suppresses VCS commit status for all commands when no projects are found |
SilenceNoProjects gates the silencing logic in both plan and apply runners; SilenceVCSStatusNoProjects is a finer-grained toggle within that gate that controls whether VCS statuses are still updated (to 0/0 success) or fully suppressed.
Autoplan: No Projects Found#
In runAutoplan(), when BuildAutoplanCommands returns an empty list:
clearPlansAndPullStatusForNoProjectsdeletes any pending plan files and resets the DB pull status to empty.- If neither
silenceVCSStatusNoPlansnorsilenceVCSStatusNoProjectsis set, Atlantis posts a0/0success status for Plan, PolicyCheck, and Apply β so required checks still pass on PRs with no Terraform changes . - If either flag is set, no commit status is written at all .
Explicit Plan: No Projects Found#
In run(), when BuildPlanCommands returns an empty list and SilenceNoProjects is true:
- Generic plan (
atlantis plan, no-d/-pflags): sets0/0success for Plan, PolicyCheck, and Apply β unlesssilenceVCSStatusNoProjectsis enabled, in which case no status is written . - Specific project plan (
atlantis plan -d ./fooor-p myproject): fetches the existing pull status and resets the commit status to reflect it; if no prior status exists, writes0/0success. IfsilenceVCSStatusNoProjectsis true, skips all updates .
Apply: No Projects Found#
In ApplyCommandRunner.Run(), the guard condition is len(projectCmds) == 0 && a.SilenceNoProjects. When triggered:
- If
silenceVCSStatusNoProjectsis false: a generic apply sets0/0success for Apply; a specific apply resets status from the existing pull status . - If
silenceVCSStatusNoProjectsis true: the runner returns immediately with no VCS update.
Pending Status Suppression#
Both runners call updatePendingCommitStatus() immediately before running project commands. Both check silenceVCSStatusNoProjects first and skip the pending write if it is set .
Why this matters: Before PR #5713, Atlantis set a pending commit status early (in command_runner.go) before determining whether any projects matched. When silence flags were enabled and no projects were found, the pending status was never cleared β leaving PRs stuck and blocking auto-merge. The fix added explicit logic to either clear the pending status (by writing 0/0 success) or skip it entirely when silence is enabled, and moved the pending write to after project discovery .
Autodiscover Mode and ignore_paths#
AutoDiscoverMode (auto / enabled / disabled) determines whether Atlantis discovers projects automatically. The effective mode is resolved in autoDiscoverModeEnabled() with this precedence: global server config β repo-level atlantis.yaml β CLI --autodiscover-mode flag (default: auto). In auto mode, autodiscovery is active only when no projects are explicitly defined in the repo config.
When autodiscover.ignore_paths patterns are configured, a targeted -d <dir> command to a matching directory returns ErrIgnoredTargetedDir from the builder . Both plan and apply runners call MarkCommandSkippedIfIgnoredTargetedDir() , which sets ctx.CommandSkipped = true and returns early β posting no comment and updating no VCS status. This is a separate early-exit path from the SilenceNoProjects family of flags and does not depend on them.
Key Source Files#
| File | Purpose |
|---|---|
server/user_config.go | Flag field definitions |
cmd/server.go | CLI flag registration and descriptions |
server/events/plan_command_runner.go | Plan silencing logic for autoplan and explicit plan |
server/events/apply_command_runner.go | Apply silencing logic |
server/events/project_command_builder.go | Autodiscover mode resolution and ignore_paths handling |