Add pre-commit workflow with 3 Git hooks - #6273
Conversation
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@jbampton there seem to be a lot of irrelevant changes in this PR. Maybe line \n vs. \r? Are all of these necessary? |
|
Changing milestone to 4.18.0 as this targeted for main |
|
Hey @DaanHoogland best practice is to use only one type of line ending in a project. From the prettier site: "When people collaborate on a project from different operating systems, it becomes easy to end up with mixed line endings in a shared git repository. It is also possible for Windows users to accidentally change line endings in a previously committed file from LF to CRLF. Doing so produces a large git diff and thus makes the line-by-line history for a file (git blame) harder to explore." |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. LL-JID 246 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian Build Failed (tid-69) |
|
Trillian test result (tid-74)
|
| cluster.node.IP=127.0.0.1 | ||
| cluster.servlet.port=9090 |
There was a problem hiding this comment.
are these carriage returns intentionally left in?
| cluster.node.IP=127.0.0.1 | |
| cluster.servlet.port=9090 | |
| cluster.node.IP=127.0.0.1 | |
| cluster.servlet.port=9090 |
There was a problem hiding this comment.
I found an issue thread here pre-commit/pre-commit-hooks#196
which talks about the 50/50 rule and how to fix the line endings locally.
So that file had mostly Windows style carriage returns so did not get fixed at first.
Now I have just targeted Java and Python files for this initial first run clean up.
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report
@@ Coverage Diff @@
## main #6273 +/- ##
=========================================
Coverage 11.59% 11.59%
Complexity 7560 7560
=========================================
Files 2494 2494
Lines 247109 247109
Branches 38619 38619
=========================================
Hits 28646 28646
Misses 214719 214719
Partials 3744 3744
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
@blueorangutan test centos7 vmware-67u3 |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests |
|
Trillian test result (tid-5591)
|
errors addressed in #7001 |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5209 |
|
Kudos, SonarCloud Quality Gate passed! |
|
@blueorangutan test matrix |
|
@DaanHoogland a Trillian-Jenkins matrix job (centos7 mgmt + xenserver71, rocky8 mgmt + vmware67u3, centos7 mgmt + kvmcentos7) has been kicked to run smoke tests |
|
Trillian test result (tid-5776)
|
|
Trillian test result (tid-5777)
|
|
Trillian test result (tid-5778)
|
|
@blueorangutan package |
|
@rohityadavcloud a Jenkins job has been kicked to build packages. It will be bundled with SystemVM template(s). I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5223 |
|
Slightly concerned on changes outside of the commit/hook that I couldn't fully test/review, but LGTM. |








Use pre-commit to autofix the mixed line endings
"Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks."
https://pre-commit.com/
Description
This PR adds
pre-commitas a GitHub Action. There are many Git hooks you can add but I just added 3 for easy review and I can expand on this framework in other PRs going forwards.Apache Airflow has an amazing
pre-commitframework almost seen as best practice.https://github.com/apache/airflow/blob/main/.pre-commit-config.yaml
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?