boa-dev / criterion-compare-action

⚡️📊 Compare the performance of Rust project branches
ISC License
63 stars 26 forks source link

git checkout error #51

Closed somehowchris closed 2 years ago

somehowchris commented 2 years ago

just wanna let you know, just ran into an error during a git checkout

/usr/bin/git checkout master
error: pathspec 'master' did not match any file(s) known to git
Error: The process '/usr/bin/git' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.0/dist/index.js:1:19002)
    at ExecState.CheckComplete (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.0/dist/index.js:1:18562)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.0/dist/index.js:1:17403)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:390:28)
    at Pipe.<anonymous> (node:net:687:12)
Error: Unhanded error:
Error: The process '/usr/bin/git' failed with exit code 1

https://github.com/felipenoris/hyper-reverse-proxy/runs/6054295355?check_suite_focus=true

Razican commented 2 years ago

This might happen if the branch selected in branchName doesn't exist in the repo. In your case, it doesn't seem the case, but the latest error seems different (related to some apt installation. Could you try to fix that and see if it keeps happening? Also, you seem to be using a different fork.

somehowchris commented 2 years ago

Yeh, yes I forked your repo and tried to debug some stuff.

Reverted back and ran it again https://github.com/felipenoris/hyper-reverse-proxy/runs/6248634792?check_suite_focus=true

Mathieu-Lala commented 2 years ago

Same error here https://github.com/viridIT/vSMTP/runs/6447408013?check_suite_focus=true

Can it comes from the checkout action ?

Razican commented 2 years ago

Interesting. We do a git checkout {branch_name} here: https://github.com/boa-dev/criterion-compare-action/blob/main/main.js#L49-L52

And this is giving the following error:

/usr/bin/git checkout develop
error: pathspec 'develop' did not match any file(s) known to git
Error: The process '/usr/bin/git' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.1/dist/index.js:1:22607)
    at ExecState.CheckComplete (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.1/dist/index.js:1:22167)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.1/dist/index.js:1:21008)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:390:28)
    at Pipe.<anonymous> (node:net:687:12)

Which is very odd, because the develop branch, in this case at least, exists in the remote. It would be interesting to see what the git remote configuration is in that case.

IWANABETHATGUY commented 2 years ago

Same error here.

lcmgh commented 2 years ago

Facing similar issue with my main branch that definetely exists

/usr/bin/git checkout main
error: pathspec 'main' did not match any file(s) known to git
Error: The process '/usr/bin/git' failed with exit code 1

Workflow

on: [pull_request]
name: benchmark pull requests
jobs:
  runBenchmark:
    name: run benchmark
    runs-on: org-self-hosted
    steps:
      - uses: actions/checkout@master
      - uses: webfactory/ssh-agent@v0.5.4
        with:
            ssh-private-key: ${{ secrets.GIT_DEPENDENCIES }}
      - uses: boa-dev/criterion-compare-action@6fdd4e866a4d4539e126afc158249a7631cc842e
        with:
          benchName: "my_benchmark"
          # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against
          branchName: ${{ github.base_ref }}
          # Optional. Default is `${{ github.token }}`.
          token: ${{ secrets.GITHUB_TOKEN }}

Edit: Changing checkout to actions/checkout@v2 did not help.

rdaum commented 2 years ago

I'm having the same issue:

/usr/bin/git checkout master
error: pathspec 'master' did not match any file(s) known to git
Error: The process '/usr/bin/git' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.0.0/dist/index.js:1:19002)

From config with

      - uses: boa-dev/criterion-compare-action@v3.0.0
...
          # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against
          branchName: ${{ github.base_ref }}
          # Optional. Default is `${{ github.token }}`.
          token: ${{ secrets.GITHUB_TOKEN }}

master exists in our repo...

Razican commented 2 years ago

I'm having the same issue:


/usr/bin/git checkout master

error: pathspec 'master' did not match any file(s) known to git

Error: The process '/usr/bin/git' failed with exit code 1

    at ExecState._setResult (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.0.0/dist/index.js:1:19002)

From config with


      - uses: boa-dev/criterion-compare-action@v3.0.0

...

          # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against

          branchName: ${{ github.base_ref }}

          # Optional. Default is `${{ github.token }}`.

          token: ${{ secrets.GITHUB_TOKEN }}

master exists in our repo...

I see you're using the 3.0.0 version. Could you update it to the latest one?

rdaum commented 2 years ago

I tried 3.2.3. Same problem.

    Finished bench [optimized] target(s) in 1.56s
/usr/bin/git checkout master
error: pathspec 'master' did not match any file(s) known to git
Error: The process '/usr/bin/git' failed with exit code 1

Note that 3.0.0 is still what's shown in the README.md

ggordonhall commented 2 years ago

This should be fixable by fetching before checking out the base branch:

  await exec.exec("git", ["fetch"]);

  await exec.exec("git", [
    "checkout",
    core.getInput("branchName") || github.base_ref,
  ]);
  core.debug("Checked out to base branch");
Razican commented 2 years ago

I have uploaded a new branch with this proposed fix. You can check it by using boa-dev/criterion-compare-action@cleanup_fixes.

Could you check it and let me know if this fixes your issue?

rdaum commented 2 years ago

Doesn't seem fixed

Running with v3.2.4:

on: [pull_request]
name: Benchmark Pull Requests
jobs:
  runBenchmark:
    name: run benchmarks
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: boa-dev/criterion-compare-action@v3.2.4
        with:
          # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against
          branchName: ${{ github.base_ref }}
          # Optional. Default is `${{ github.token }}`.
          token: ${{ secrets.GITHUB_TOKEN }}

gives:

error: Unrecognized option: 'save-baseline'
error: bench failed
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101
    at ExecState._setResult (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.4/dist/index.js:1:24691)
    at ExecState.CheckComplete (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.4/dist/index.js:1:24251)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/boa-dev/criterion-compare-action/v3.2.4/dist/index.js:1:23092)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

I also tried boa-dev/criterion-compare-action@cleanup_fixes:

Unable to resolve actionboa-dev/criterion-compare-action@cleanup_fixes, unable to find versioncleanup_fixes``

rdaum commented 2 years ago

I'm sorry, what I just reported is a different problem. On my end (save-baseline).