-
Notifications
You must be signed in to change notification settings - Fork 358
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see above comment
Hi there @eyarz, Go is required because of how pre-commit works. It uses the repo we're pointing at in the .pre-commit-hooks.yaml file to pull the source at a specific |
🤔 interesting. So I have some follow-up questions:
BTW, we have a docker image: https://hub.docker.com/r/datree/datree |
I could switch this to run from the Docker image instead, then Go isn't required to be installed on the user's sytem, only Docker or an equivalent OCI runtime. I also noticed https://hub.docker.com/r/datree/datree isn't tagging versions - I think we can use |
Hi @kevholmes, Can we integrate it into the pre-commit hook? Also, we have specific build flags such as cli version - that is auto increment on every deployment. Seems to me that this way users with pre-commit hooks will not know what version they are using. That will make it very hard for us to debug errors. |
Staging branch is deprecated and will soon be deleted. |
I will see if we can use this install script somehow. If that fails the docker container is our best bet. I have used a number of other checks that rely on containers like hadolint (written in Haskell) and they work nicely for end-users who likely do not have ghci installed. |
I think it would be good to include the pre-commit hooks seeded into the repo as part of this commit? This way, a code contributor can skip the |
I just added two other options. One uses a The other option uses your Dockerhub image (or attempted to). I ran into an issue with the existing dockerhub image - which appears a bit out of date - so I updated the Dockerfile to give you a much smaller image for end-users to run than what was already there. The size is down from ~430mb to ~20 mb for the image. |
This reverts commit 997a979.
From my perspective the best way to do this is to utilize the Thoughts @eyarz? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a few other pre-commit methods for the team to review.
@kevholmes, I agree. "latest" is a good practice as an image tag, so I will also open an issue to fix that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevholmes gave you some minor comments, once fixed we can merge.
I got one question, when we will add documentation for the pre-commit hooks usage, do you know what is considered the best practice for the value in the rev key assuming we always want to use the latest version?
@MentalBrake In regards to best practices for |
@kevholmes I meant the rev option in the
looks to me like we can use git tags for the rev value from their docs: https://pre-commit.com/#using-the-latest-version-for-a-repository |
This resolves #217
Below is a sample config file for projects that would like to use this pre-commit hook in their own repo:
This essentially runs
datree test --only-k8s-files file1.yml file2.yaml
The files passed into the command are those detected by pre-commit as staged in git.