yunikorn-core
yunikorn-core copied to clipboard
[YUNIKORN-2098] Change go lint SHA detection
What is this PR for?
In YUNIKORN-285, we previously included git symbolic-ref -q HEAD because Travis CI often encountered a detached head situation. However, now that we have switched to GitHub Actions, we can utilize the checkout@v3 action, which efficiently fetches all Git references.
Consequently, we can remove git symbolic-ref -q HEAD
Instead, we can initially set REV='origin/HEAD'
If git rev-parse fails, we can fall back to REV=HEAD^
Regarding the modification from fetch-depth: 2
to fetch-depth: 0
, I have compared the GitHub Action times before this pull request and with the master. The duration of the git checkout action remained around 2 seconds. Therefore, I believe this change is acceptable, as it does not introduce significant overhead.
I encountered this issue when I manually triggered a GitHub Action in the k8shim fork repository. In contrast, manually triggering GitHub Actions in the core repository does not lead to this issue. This is because, in the core repository, the Golang CI is only executed when submitting a Pull Request.
However, I believe ensuring consistency in the make lint
process between k8shim and core is the correct approach.
Perhaps we could consider aligning k8shim's GolangCI behavior with that of the core? (only triggering during PR) cc @craigcondit @wilfred-s
What type of PR is it?
- [x] - Improvement