Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lineage pull request for: skeleton #72

Merged
merged 29 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
60b612d
Enable terraform validate pre-commit hook
dav3r Aug 26, 2021
6a7fbf0
Temporarily use cisagov/setup-env-github-action@improvement/support_t…
dav3r Aug 26, 2021
895a692
Remove lint job step to initialize Terraform directories
dav3r Aug 27, 2021
b51dbb5
Revert "Temporarily use cisagov/setup-env-github-action@improvement/s…
dav3r Aug 27, 2021
1b5cd25
Merge pull request #90 from cisagov/improvement/enable_terraform_vali…
dav3r Sep 13, 2021
65b7140
Merge https://github.com/cisagov/skeleton-generic into lineage/skeleton
Sep 13, 2021
b66988d
Update pre-commit hooks
mcdonnnj Sep 29, 2021
f3000e5
Merge pull request #91 from cisagov/improvement/pre-commit_update
mcdonnnj Oct 19, 2021
b78b832
Update the ansible-lint version for pre-commit
mcdonnnj Oct 1, 2021
a3c5aa7
Add an ansible-lint configuration file
mcdonnnj Oct 1, 2021
14d2edb
Merge pull request #93 from cisagov/improvement/update_ansible-lint_p…
mcdonnnj Oct 19, 2021
24df40a
Add dependabot configuration for Terraform
mcdonnnj Oct 8, 2021
ff73498
Merge pull request #94 from cisagov/improvement/add_dependabot_config…
mcdonnnj Oct 19, 2021
6cf78c0
Use an id when using cisagov/setup-env-github-action
mcdonnnj Sep 30, 2021
1e16136
Use setup-env outputs for Terraform version
mcdonnnj Sep 30, 2021
64b2471
Use setup-env outputs for Packer version
mcdonnnj Oct 1, 2021
0851598
Use setup-env outputs for shfmt version
mcdonnnj Oct 1, 2021
2699e09
Use setup-env outputs for Terraform-docs version
mcdonnnj Oct 1, 2021
8797e11
Store Go version as a step output
mcdonnnj Oct 1, 2021
ee39ac5
Merge pull request #92 from cisagov/improvement/use_action_outputs
mcdonnnj Oct 19, 2021
1bdcd86
Merge https://github.com/cisagov/skeleton-generic into lineage/skeleton
Oct 19, 2021
6a10135
Update ansible-lint configuration
mcdonnnj Oct 28, 2021
4b912fe
Update ansible-lint configuration
mcdonnnj Oct 28, 2021
3f370eb
Update pre-commit hooks
mcdonnnj Nov 17, 2021
115af25
Merge pull request #97 from cisagov/maintenance/update_pre-commit_hooks
mcdonnnj Jan 11, 2022
6e652ec
Merge branch 'develop' into improvement/update_ansible-lint_configura…
mcdonnnj Jan 11, 2022
11eca90
Merge pull request #95 from cisagov/improvement/update_ansible-lint_c…
mcdonnnj Jan 11, 2022
f0e6779
Merge https://github.com/cisagov/skeleton-generic into lineage/skeleton
Jan 11, 2022
2c1342d
Merge branch 'develop' into lineage/skeleton
mcdonnnj Jan 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# See https://ansible-lint.readthedocs.io/en/latest/configuring.html
# for a list of the configuration elements that can exist in this
# file.
enable_list:
# Useful checks that one must opt-into. See here for more details:
# https://ansible-lint.readthedocs.io/en/latest/rules.html
- fcqn-builtins
- no-log-password
- no-same-owner
exclude_paths:
# This exclusion is implicit, unless exclude_paths is defined
- .cache
# Seems wise to ignore this too
- .github
kinds:
# This will force our systemd specific molecule configurations to be treated
# as plain yaml files by ansible-lint. This mirrors the default kind
# configuration in ansible-lint for molecule configurations:
# yaml: "**/molecule/*/{base,molecule}.{yaml,yml}"
- yaml: "**/molecule/*/molecule-{no,with}-systemd.yml"
use_default_rules: true
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "terraform"
directory: "/"
schedule:
interval: "weekly"
42 changes: 21 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,23 @@ jobs:
name: "Lint sources"
runs-on: ubuntu-latest
steps:
- uses: cisagov/setup-env-github-action@develop
- id: setup-env
uses: cisagov/setup-env-github-action@develop
- uses: actions/checkout@v2
- id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.9
# GO_VERSION and GOCACHE are used by the cache task, so the Go
# installation must happen before that.
# We need the Go version and Go cache location for the actions/cache step,
# so the Go installation must happen before that.
- uses: actions/setup-go@v2
with:
go-version: '1.16'
- name: Store installed Go version
id: go-version
run: |
echo "GO_VERSION="\
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')" \
>> $GITHUB_ENV
echo "::set-output name=version::"\
"$(go version | sed 's/^go version go\([0-9.]\+\) .*/\1/')"
- name: Lookup Go cache directory
id: go-cache
run: |
Expand All @@ -65,9 +66,9 @@ jobs:
env:
BASE_CACHE_KEY: "${{ github.job }}-${{ runner.os }}-\
py${{ steps.setup-python.outputs.python-version }}-\
go${{ env.GO_VERSION }}-\
packer${{ env.PACKER_VERSION }}-\
tf${{ env.TERRAFORM_VERSION }}-"
go${{ steps.go-version.outputs.version }}-\
packer${{ steps.setup-env.outputs.packer-version }}-\
tf${{ steps.setup-env.outputs.terraform-version }}-"
with:
# Note that the .terraform directory IS NOT included in the
# cache because if we were caching, then we would need to use
Expand All @@ -89,6 +90,8 @@ jobs:
- name: Setup curl cache
run: mkdir -p ${{ env.CURL_CACHE_DIR }}
- name: Install Packer
env:
PACKER_VERSION: ${{ steps.setup-env.outputs.packer-version }}
run: |
PACKER_ZIP="packer_${PACKER_VERSION}_linux_amd64.zip"
curl --output ${{ env.CURL_CACHE_DIR }}/"${PACKER_ZIP}" \
Expand All @@ -101,20 +104,17 @@ jobs:
sudo ln -s /opt/packer/packer /usr/local/bin/packer
- uses: hashicorp/setup-terraform@v1
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_version: ${{ steps.setup-env.outputs.terraform-version }}
- name: Install shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@${SHFMT_VERSION}
env:
PACKAGE_URL: mvdan.cc/sh/v3/cmd/shfmt
PACKAGE_VERSION: ${{ steps.setup-env.outputs.shfmt-version }}
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
- name: Install Terraform-docs
run: |
go install \
github.com/terraform-docs/terraform-docs@${TERRAFORM_DOCS_VERSION}
- name: Find and initialize Terraform directories
run: |
for path in $(find . -not \( -type d -name ".terraform" -prune \) \
-type f -iname "*.tf" -exec dirname "{}" \; | sort -u); do \
echo "Initializing '$path'..."; \
terraform init -input=false -backend=false "$path"; \
done
env:
PACKAGE_URL: github.com/terraform-docs/terraform-docs
PACKAGE_VERSION: ${{ steps.setup-env.outputs.terraform-docs-version }}
run: go install ${PACKAGE_URL}@${PACKAGE_VERSION}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
43 changes: 13 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
Expand All @@ -32,25 +32,25 @@ repos:

# Text file hooks
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.28.1
rev: v0.30.0
hooks:
- id: markdownlint
args:
- --config=.mdl_config.yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.3.2
rev: v2.5.1
hooks:
- id: prettier
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.2
rev: v1.26.3
hooks:
- id: yamllint
args:
- --strict

# pre-commit hooks
- repo: https://github.com/pre-commit/pre-commit
rev: v2.14.0
rev: v2.16.0
hooks:
- id: validate_manifest

Expand All @@ -76,7 +76,7 @@ repos:

# Python hooks
- repo: https://github.com/PyCQA/bandit
rev: 1.7.0
rev: 1.7.1
hooks:
- id: bandit
name: bandit (tests tree)
Expand All @@ -91,7 +91,7 @@ repos:
name: bandit (everything else)
exclude: tests
- repo: https://github.com/psf/black
rev: 21.7b0
rev: 21.12b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
Expand All @@ -101,48 +101,31 @@ repos:
additional_dependencies:
- flake8-docstrings
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
rev: v0.931
hooks:
- id: mypy
- repo: https://github.com/asottile/pyupgrade
rev: v2.23.3
rev: v2.31.0
hooks:
- id: pyupgrade

# Ansible hooks
- repo: https://github.com/ansible-community/ansible-lint
# This is intentionally being held back because of issues in v5 per
# https://github.com/cisagov/skeleton-ansible-role/issues/69
rev: v4.3.7
rev: v5.3.2
hooks:
- id: ansible-lint
# files: molecule/default/playbook.yml

# Terraform hooks
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.50.0
rev: v1.62.3
hooks:
- id: terraform_fmt
# There are ongoing issues with how this command works. This issue
# documents the core issue:
# https://github.com/hashicorp/terraform/issues/21408
# We have seen issues primarily with proxy providers and Terraform code
# that uses remote state. The PR
# https://github.com/hashicorp/terraform/pull/24887
# has been approved and is part of the 0.13 release to resolve the issue
# with remote states.
# The PR
# https://github.com/hashicorp/terraform/pull/24896
# is a proprosed fix to deal with `terraform validate` with proxy
# providers (among other configurations).
# We have decided to disable the terraform_validate hook until the issues
# above have been resolved, which we hope will be with the release of
# Terraform 0.13.
# - id: terraform_validate
- id: terraform_validate

# Docker hooks
- repo: https://github.com/IamTheFij/docker-pre-commit
Expand Down