Skip to content

Commit

Permalink
Add bug report issue templates
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymVlasov committed Sep 10, 2021
1 parent 6ba800b commit 1d38174
Show file tree
Hide file tree
Showing 4 changed files with 204 additions and 11 deletions.
81 changes: 81 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
name: Local installation bug report
about: Create a bug report
labels:
- kind/bug
- area/docker
---

<!--
Thank you for helping to improve pre-commit-terraform!
Please be sure to search for open issues before raising a new one. We use issues
for bug reports and feature requests. Please note, this template is for bugs
report, not feature requests.
-->

### Describe the bug

<!--
Please let us know what behavior you expected and how terraform-docs diverged
from that behavior.
-->


### How can we reproduce it?

<!--
Help us to reproduce your bug as succinctly and precisely as possible. Any and
all steps or script that triggers the issue are highly appreciated!
Do you have long logs to share? Please use collapsible sections, that can be created via:
<details><summary>SECTION_NAME</summary>
```bash
YOUR_LOG_HERE
```
</details>
-->


### Environment information

* OS:

<!-- I.e.:
OS: Windows 10
OS: Win10 with Ubuntu 20.04 on WSL2
OS: MacOS
OS: Ubuntu 20.04
-->

* `docker info`:

<details><summary><code>command output</summary>

```bash
INSERT_OUTPUT_HERE
```

</details>

* 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`:

<details><summary>file content</summary>

```bash
INSERT_FILE_CONTENT_HERE
```

</details>
106 changes: 106 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_local_install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
name: Docker bug report
about: Create a bug report
labels:
- kind/bug
- area/local_installation
---

<!--
Thank you for helping to improve pre-commit-terraform!
Please be sure to search for open issues before raising a new one. We use issues
for bug reports and feature requests. Please note, this template is for bugs
report, not feature requests.
-->

### Describe the bug

<!--
Please let us know what behavior you expected and how terraform-docs diverged
from that behavior.
-->


### How can we reproduce it?

<!--
Help us to reproduce your bug as succinctly and precisely as possible. Any and
all steps or script that triggers the issue are highly appreciated!
Do you have long logs to share? Please use collapsible sections, that can be created via:
<details><summary>SECTION_NAME</summary>
```bash
YOUR_LOG_HERE
```
</details>
-->


### Environment information

* OS:
<!-- I.e.:
OS: Windows 10
OS: Win10 with Ubuntu 20.04 on WSL2
OS: MacOS
OS: Ubuntu 20.04
-->

* `uname -a` and/or `systeminfo | Select-String "^OS"` output:

```bash
INSERT_OUTPUT_HERE
```

<!-- I.e.:
```bash
PS C:\Users\vm> systeminfo | Select-String "^OS"
OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.19043 N/A Build 19043
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
OS Build Type: Multiprocessor Free
$ uname -a
Linux DESKTOP-C7315EF 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
```
-->

* Tools availability and versions:

<!-- For check all needed version run next script:
$0 << EOF
pre-commit --version 2>/dev/null || echo "pre-commit SKIPPED"
terraform --version | head -n 1 2>/dev/null || echo "terraform SKIPPED"
python --version 2>/dev/null || echo "python SKIPPED"
python3 --version 2>/dev/null || echo "python3 SKIPPED"
echo -n "checkov " && checkov --version 2>/dev/null || echo "checkov SKIPPED"
terraform-docs --version 2>/dev/null || echo "terraform-docs SKIPPED"
terragrunt --version 2>/dev/null || echo "terragrunt SKIPPED"
echo -n "terrascan " && terrascan version 2>/dev/null || echo "terrascan SKIPPED"
tflint --version 2>/dev/null || echo "tflint SKIPPED"
echo -n "tfsec " && tfsec --version 2>/dev/null || echo "tfsec SKIPPED"
EOF
-->

```bash
INSERT_TOOLS_VERSIONS_HERE
```


* `.pre-commit-config.yaml`:

<details><summary>file content</summary>

```bash
INSERT_FILE_CONTENT_HERE
```

</details>
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1d38174

Please sign in to comment.