commitsar
commitsar copied to clipboard
`--all` flag broken in CI?
I have commitsar running in Gitlab CI, but today for some reason it has stopped working for me.
I am running with the docker executor, so the repo is mounted into the commitsar container, and the check run from inside.
But as seen below, even if explicitly fetching the branch from origin and checking it out, the --all
flag fails, and states it's on the branch refs/heads/goreleaser
.
The error message Some errors were found
is of no help, there really should be better error output.
If I run the same repo and branch manually in CLI with docker run...
, mounted to /src
and with --all
, then it works fine. So how come it doesn't work in this case? I even checked in the CI job, ls -la
outputs the repo contents, so the repo is there.
$ git fetch origin $CI_COMMIT_REF_NAME
From https://<url>
* branch goreleaser -> FETCH_HEAD
* [new branch] goreleaser -> origin/goreleaser
$ git checkout $CI_COMMIT_REF_NAME
Branch 'goreleaser' set up to track remote branch 'goreleaser' from 'origin'.
Switched to a new branch 'goreleaser'
$ commitsar --all
2021/04/10 18:03:16 config file not found, using defaults
• Starting pipeline: commit-pipeline
• Starting analysis of commits on branch refs/heads/goreleaser
Some errors were found
I'll have a look. Thanks for the report :)
It's been almost a year since I reported this, and the error still persists. Has anything been done to check what's going on with this issue?
With git log --oneline
I find a bunch of commits in my CI environment, but running commitsar results in the below. The pipeline is a detached head pipeline on Gitlab.
$ commitsar --all --verbose
2022/02/20 18:58:07 config file not found, using defaults
some errors were found
• Starting pipeline: commit-pipeline
• Starting analysis of commits on branch HEAD
• All pipelines complete
• [commit-pipeline] reference not found
⨯ pipeline: commit-pipeline, error: reference not found
Hey @tommyalatalo Sorry about that. Could you provide an example Gitlab workflow? Removing any sensitive data ofc.
I think it's time to rethink the approach of using go-git and use git instead as some things could be simplified.
I think this is linked to the issue of shallow clone, which breaks go-git currently.
Hey @fallion ,
I am also facing the same issue as @altosys without even using the --all
flag. Not sure what I am missing.
❯ git log --oneline
* be69f73 (HEAD -> main, origin/main, origin/HEAD) docs: updated readme
* 44806dc (tag: [email protected]) chore(release): version [skip ci]
* 7f21e15 feat: updated main.tf
* 19f9e18 (tag: [email protected]) chore(release): version [skip ci]
* dd1df05 fix: fixed main.tf
* 9d7ecbf (tag: [email protected]) chore(release): version [skip ci]
* 867d909 feat: azure module added package.json and terraform file
* cf7e791 (tag: [email protected]) chore(release): version [skip ci]
* 5f81688 feat: aws module added package.json and terraform file
* e03024c feat: initialized lerna
* 17b42bc Initial commit
❯ commitsar -v
2024/02/15 05:42:55 config file not found, using defaults
• Starting pipeline: commit-pipeline
• Starting analysis of commits on branch refs/heads/main
• All pipelines complete
• [commit-pipeline] reference not found
⨯ pipeline: commit-pipeline, error: reference not found
some errors were found
GitHub actions? @vikas027
Yes, this was on GitHub actions custom host running containerd runtime
I'm having this problem both on Github actions and my local machine. My local machine has a long history of commits.