Skip to content

cz check range sometimes failed in GitLab CI #593

Open
@SsuperL

Description

@SsuperL

Description

Runcz check --range origin/master..HEAD to check commits in CI occasionally fails.
And it worked after I retried the job.But sometimes it didn't work after retrying multiple times.
I couldn't find out the reason ,

Steps to reproduce

lint:
retry: 1
script:
- cz version
- cz check --rev-range origin/master..HEAD

Current behavior

cz check --rev-range origin/master..HEAD failed. Outputs attached below:

  fatal: ambiguous argument 'master..HEAD': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'

Desired behavior

cz check --rev-range can run successfully in gitlab CI.

Screenshots

image

Environment

commitizen version: 2.34.0
python version: 3.7.5
operating system: Linux

Activity

Lee-W

Lee-W commented on Sep 22, 2022

@Lee-W
Member

Is it possible that the git repo doesn't setup remote 🤔

SsuperL

SsuperL commented on Sep 23, 2022

@SsuperL
Author

I run command git remote -v in the CI , and it shows that the remote has been setup.

SsuperL

SsuperL commented on Sep 23, 2022

@SsuperL
Author

image

Lee-W

Lee-W commented on Sep 23, 2022

@Lee-W
Member

Hmmm... As I'm not able to reproduce it, I don't have any clue on how we could fix it. But we can keep it open till you or someone encounter this issue again with more detail

SsuperL

SsuperL commented on Sep 25, 2022

@SsuperL
Author

Actually,this issue has come up again.

SsuperL

SsuperL commented on Sep 26, 2022

@SsuperL
Author

image
And when I merged the branch into master,it said that there is no commit found range origin/master..HEAD.

Lee-W

Lee-W commented on Sep 26, 2022

@Lee-W
Member

Do you mean after merging back to the master branch? If that's the case, your HEAD will on on master so the result seem to be expected.

SsuperL

SsuperL commented on Sep 27, 2022

@SsuperL
Author

Do you mean after merging back to the master branch? If that's the case, your HEAD will on on master so the result seem to be expected.

yes. Or can it skip check when there's no commit rather than make the job failed?

image

Lee-W

Lee-W commented on Oct 3, 2022

@Lee-W
Member

@SsuperL Please try cz --no-raise 3 check --rev-range master... it's output the message with a zero return code

https://commitizen-tools.github.io/commitizen/bump/#easy-way

SsuperL

SsuperL commented on Oct 9, 2022

@SsuperL
Author

cz --no-raise 3 check --rev-range master..

I'll try it.Thank you!

Lujeni

Lujeni commented on Oct 19, 2022

@Lujeni

@SsuperL did you try to git fetch before your command ? its seems GitLab CI dont fetch every branch

SsuperL

SsuperL commented on Oct 24, 2022

@SsuperL
Author

@SsuperL did you try to git fetch before your command ? its seems GitLab CI dont fetch every branch
No, but it only appeared on some machines. And the command git branch -r shows branch origin/master exists.

SsuperL

SsuperL commented on Nov 29, 2022

@SsuperL
Author

image

Lee-W

Lee-W commented on Nov 29, 2022

@Lee-W
Member

do you have remote origin and branch master?

17 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      cz check range sometimes failed in GitLab CI · Issue #593 · commitizen-tools/commitizen