Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--all flag broken in CI? #384

Open
tommyalatalo opened this issue Apr 10, 2021 · 9 comments
Open

--all flag broken in CI? #384

tommyalatalo opened this issue Apr 10, 2021 · 9 comments

Comments

@tommyalatalo
Copy link

tommyalatalo commented Apr 10, 2021

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
@tommyalatalo tommyalatalo changed the title --all flag broken? --all flag broken in CI? Apr 10, 2021
@fallion
Copy link
Member

fallion commented Apr 11, 2021

I'll have a look. Thanks for the report :)

@tommyalatalo
Copy link
Author

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

@fallion
Copy link
Member

fallion commented Feb 21, 2022

Hey @tommyalatalo
Sorry about that. Could you provide an example Gitlab workflow? Removing any sensitive data ofc.

@fallion
Copy link
Member

fallion commented Feb 21, 2022

I think it's time to rethink the approach of using go-git and use git instead as some things could be simplified.

@fallion
Copy link
Member

fallion commented Oct 26, 2022

I think this is linked to the issue of shallow clone, which breaks go-git currently.

@vikas027
Copy link

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

@fallion
Copy link
Member

fallion commented Feb 19, 2024

GitHub actions? @vikas027

@vikas027
Copy link

Yes, this was on GitHub actions custom host running containerd runtime

@dekobon
Copy link

dekobon commented Apr 26, 2024

I'm having this problem both on Github actions and my local machine. My local machine has a long history of commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants