summaryrefslogtreecommitdiff
path: root/etc/evergreen_lint.yml
diff options
context:
space:
mode:
authorRichard Samuels <richard.l.samuels@gmail.com>2022-05-20 19:08:19 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-20 19:34:50 +0000
commit9b2f55b513951af5ced5d3854219e11d319eb957 (patch)
treeec446bc065467cc7db0c7fecd39aa929ee8d6ad8 /etc/evergreen_lint.yml
parentdc3050634f173e286c2dfc2360bc27200172f47b (diff)
downloadmongo-9b2f55b513951af5ced5d3854219e11d319eb957.tar.gz
SERVER-65697 Document motivations behind evergreen config lints
Diffstat (limited to 'etc/evergreen_lint.yml')
-rw-r--r--etc/evergreen_lint.yml30
1 files changed, 27 insertions, 3 deletions
diff --git a/etc/evergreen_lint.yml b/etc/evergreen_lint.yml
index 7112dd9aef7..1e211133af2 100644
--- a/etc/evergreen_lint.yml
+++ b/etc/evergreen_lint.yml
@@ -4,18 +4,42 @@ files:
help_url: https://wiki.corp.mongodb.com/pages/viewpage.action?pageId=133273894
rules:
- # this is a list of all rules available, their parameters, and their
- # default values. Comment out a rule to disable it
+ # keyval.inc is a deprecated command. This rule is to prevent the
+ # proliferation of it.
- rule: "limit-keyval-inc"
# the maximum number of keyval.inc commands to allow in your YAML
limit: 4
- - rule: "shell-exec-explicit-shell"
+ # With the extraction of shell scripts from the Evergreen YAML, we expect
+ # users to source a script called `prelude.sh`. This script requires that
+ # the user be in ${workdir}, so we forbid users from `cd`ing with
+ # `working_dir` parameter.
- rule: "no-working-dir-on-shell"
+ # Embedding shell.exec scripts in the Evergreen yaml has been a historical
+ # source of pain:
+ # * No ability to lint/shellcheck
+ # * Distraction from the build matrix
+ # * Tons of scrolling to get anywhere.
+ # We completed a project to completely eject all shell scripts from the
+ # YAML, and now require this of all shell scripts. Add your scripts to the
+ # evergreen/ directory, and make use of subprocess.exec.
- rule: "no-shell-exec"
+ # Historically, expansions.update has been used to inject shell scripts
+ # into expansions, which were then used to inject commonly used snippets
+ # as required. With the extraction of the shell scripts, the correct
+ # paradigm is to source a script in the evergreen/ directory, or to add a
+ # function to `evergreen/prelude.sh`.
- rule: "no-multiline-expansions-update"
+ # To prevent the proliferation of undocumented build-parameters, we require
+ # params to have a non-empty description, and a name matching [a-z][a-z0-9_]*.
- rule: "invalid-build-parameter"
+ # To ensure that the expansions file loaded by prelude.sh is not stale, we
+ # require the user to add sometimes superfluous expansions.write calls to
+ # ere on side of correctness.
# - rule: "required-expansions-write"
# regex: .*\/evergreen\/.*\.sh
+ # Generated tests must depend on build_variant_gen (which generates the
+ # tasks that contain them) and archive_dist_test (which contains
+ # built assets).
- rule: "dependency-for-func"
dependencies:
generate resmoke tasks: ["build_variant_gen", "archive_dist_test"]