Add first-pass lint CI for pgcopydb-helpers and pgcopydb-templates - #69
Add first-pass lint CI for pgcopydb-helpers and pgcopydb-templates#69teknogeek0 wants to merge 2 commits into
Conversation
Runs on any push or PR touching those two folders. Three parallel jobs: - shell: bash -n + shellcheck on all .sh files. Gates at warning severity; benign/unfixable codes (SC1090, SC2088, SC2034) are disabled in a repo-root .shellcheckrc, each with a note to tighten later. - cloudformation: cfn-lint on the AWS CloudFormation template. - terraform: fmt -check, init, validate, and tflint, matrixed over the aws and gcp template dirs. Also normalizes the two .tf files with terraform fmt (alignment only) so the fmt gate passes. All actions are pinned to full commit SHAs.
|
Two follow-ups on the first-pass lint CI. Pin every linter. Only cfn-lint was pinned; shellcheck came from whatever the Drop the Also add -recursive to terraform fmt, which otherwise checks only the named Verified locally at the pinned versions: shellcheck 0.11.0 exits 0 with the |
First pass at CI/linting for the two actively-developed migration paths. Designed to be extended — tighten the gates and add jobs over time.
What runs
Triggers on any push or PR that touches
pgcopydb-helpers/**,pgcopydb-templates/**, or the CI config. Three parallel jobs:bash -n+shellcheckon all 17.shfiles across both folders.cfn-linton the AWS CloudFormation template.fmt -check,init -backend=false,validate, andtflint, matrixed over the aws and gcp template dirs.Design notes
--severity=warningwith a repo-root.shellcheckrcdisabling three codes, each documented as a ratchet point:SC1090— scriptssource ~/.env; the path is dynamic and unresolvable statically.SC2088— current hits are tildes that are correct by construction (message strings, abash -cpayload).SC2034— current hits are intentional positional field-skips inread.terraform fmtnormalizes the two.tffiles (alignment-only) so thefmt -checkgate passes.Verification
Every job was run locally against the real tools before opening this PR — all green: shellcheck (exit 0 with the config), cfn-lint 1.52.1 (exit 0),
terraform fmt -check/validate(both dirs), tflint 0.61.0 (both dirs).Follow-ups to build on this: extend shell coverage (lower severity, drop disables as scripts are cleaned), and add behavioral smoke tests with stubbed
psql/pgcopydbto catch runtime bugs that static analysis can't (e.g. unbound-variable-under-set -u).