apache / gravitino

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.
https://gravitino.apache.org
Apache License 2.0
865 stars 284 forks source link

[FEATURE] Use git hooks to auto apply or check for common issues before commit or push #2175

Open M-Faheem-Khan opened 6 months ago

M-Faheem-Khan commented 6 months ago

Describe the feature

We can utilize git hooks to improve developer experience. Git hooks are scripts that are run at various event in git such as commit & push. We make use of these hooks to automate certain tasks or add checks. We can add auto format before commit, check to make sure our commit message are following guidelines outlined by common conventions, run errorprone or add a security scan. These are few of the many many ways we can use git hooks to our advantage.

Adding git hooks can maintainers not get overwhelmed with notification or failed pipelines and save on cost by not having to rerun runner with each new commit(eco friendly :recycle:).

Motivation

Formatting is annoying, running errorprone as part of pre-push can help us reduce new issues introduced.

Describe the solution

We can use either a tool like precommit or simply add our hooks in .git/hooks/<hook>. How?

Additional context

No response

justinmclean commented 6 months ago

It's a good idea, but it comes with a cost. We are looking into using error-prone - see #1746, and in the last week, I've raised a number of issues related to error problem warnings. We also want to donate the project to the ASF Incubator in the near future, and the ASF has some restrictions on what we can and can not run as we would be using a shared resource from all ASF projects, and we need to ensure we don't take more than our fair share of resources.