From 1d381744d5abfbe938b595214d9f28213c7320ed Mon Sep 17 00:00:00 2001 From: MaxymVlasov Date: Sat, 11 Sep 2021 00:55:37 +0300 Subject: [PATCH] Add bug report issue templates --- .github/ISSUE_TEMPLATE/bug_report_docker.md | 81 +++++++++++++ .../bug_report_local_install.md | 106 ++++++++++++++++++ Dockerfile | 22 ++-- README.md | 6 + 4 files changed, 204 insertions(+), 11 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report_docker.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report_local_install.md diff --git a/.github/ISSUE_TEMPLATE/bug_report_docker.md b/.github/ISSUE_TEMPLATE/bug_report_docker.md new file mode 100644 index 000000000..f1cddc738 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_docker.md @@ -0,0 +1,81 @@ +--- +name: Local installation bug report +about: Create a bug report +labels: +- kind/bug +- area/docker +--- + + + +### Describe the bug + + + + +### How can we reproduce it? + + + + +### Environment information + +* OS: + + + +* `docker info`: + +
command output + +```bash +INSERT_OUTPUT_HERE +``` + +
+ +* Docker image tag/git commit: + +* Tools versions. Don't forget to specify right tag in command - + `TAG=latest && docker run --entrypoint cat pre-commit:$TAG /usr/bin/tools_versions_info` + +```bash +INSERT_OUTPUT_HERE +``` + +* `.pre-commit-config.yaml`: + +
file content + +```bash +INSERT_FILE_CONTENT_HERE +``` + +
diff --git a/.github/ISSUE_TEMPLATE/bug_report_local_install.md b/.github/ISSUE_TEMPLATE/bug_report_local_install.md new file mode 100644 index 000000000..f0798db1f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report_local_install.md @@ -0,0 +1,106 @@ +--- +name: Docker bug report +about: Create a bug report +labels: +- kind/bug +- area/local_installation +--- + + + +### Describe the bug + + + + +### How can we reproduce it? + + + + +### Environment information + +* OS: + + +* `uname -a` and/or `systeminfo | Select-String "^OS"` output: + +```bash +INSERT_OUTPUT_HERE +``` + + + +* Tools availability and versions: + + + +```bash +INSERT_TOOLS_VERSIONS_HERE +``` + + +* `.pre-commit-config.yaml`: + +
file content + +```bash +INSERT_FILE_CONTENT_HERE +``` + +
diff --git a/Dockerfile b/Dockerfile index 5fa7552ac..0af14e304 100644 --- a/Dockerfile +++ b/Dockerfile @@ -123,18 +123,18 @@ RUN . /.env && \ ) && chmod +x tfsec \ ; fi -# Checking binaries versions +# Checking binaries versions and write it to debug file RUN . /.env && \ - echo "\n\n" && \ - pre-commit --version && \ - terraform --version | head -n 1 && \ - (if [ "$CHECKOV_VERSION" != "false" ]; then echo -n "checkov " && checkov --version; else echo "checkov SKIPPED" ; fi) && \ - (if [ "$TERRAFORM_DOCS_VERSION" != "false" ]; then ./terraform-docs --version; else echo "terraform-docs SKIPPED"; fi) && \ - (if [ "$TERRAGRUNT_VERSION" != "false" ]; then ./terragrunt --version; else echo "terragrunt SKIPPED" ; fi) && \ - (if [ "$TERRASCAN_VERSION" != "false" ]; then echo -n "terrascan " && ./terrascan version; else echo "terrascan SKIPPED" ; fi) && \ - (if [ "$TFLINT_VERSION" != "false" ]; then ./tflint --version; else echo "tflint SKIPPED" ; fi) && \ - (if [ "$TFSEC_VERSION" != "false" ]; then echo -n "tfsec " && ./tfsec --version; else echo "tfsec SKIPPED" ; fi) && \ - echo "\n\n" + F=tools_versions_info && \ + pre-commit --version >> $F && \ + terraform --version | head -n 1 >> $F && \ + (if [ "$CHECKOV_VERSION" != "false" ]; then echo "checkov $(checkov --version)" >> $F; else echo "checkov SKIPPED" >> $F ; fi) && \ + (if [ "$TERRAFORM_DOCS_VERSION" != "false" ]; then ./terraform-docs --version >> $F; else echo "terraform-docs SKIPPED" >> $F; fi) && \ + (if [ "$TERRAGRUNT_VERSION" != "false" ]; then ./terragrunt --version >> $F; else echo "terragrunt SKIPPED" >> $F ; fi) && \ + (if [ "$TERRASCAN_VERSION" != "false" ]; then echo "terrascan $(./terrascan version)" >> $F; else echo "terrascan SKIPPED" >> $F ; fi) && \ + (if [ "$TFLINT_VERSION" != "false" ]; then ./tflint --version >> $F; else echo "tflint SKIPPED" >> $F ; fi) && \ + (if [ "$TFSEC_VERSION" != "false" ]; then echo "tfsec $(./tfsec --version)" >> $F; else echo "tfsec SKIPPED" >> $F ; fi) && \ + echo "\n\n" && cat $F && echo "\n\n" # based on debian:buster-slim # https://github.com/docker-library/python/blob/master/3.9/buster/slim/Dockerfile diff --git a/README.md b/README.md index aeeb9668c..d62e0ded1 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,12 @@ Docker: docker run -v $(pwd):/lint -w /lint pre-commit run -a ``` +> You be able list tools versions when needed +> +> ```bash +> TAG=latest && docker run --entrypoint cat pre-commit:$TAG /usr/bin/tools_versions_info` +> ``` + ## Available Hooks There are several [pre-commit](https://pre-commit.com/) hooks to keep Terraform configurations (both `*.tf` and `*.tfvars`) and Terragrunt configurations (`*.hcl`) in a good shape: