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

[BUG] changed-files-diff-sha prints thousands of lines and takes two minutes to run #855

Closed
3 tasks done
RohanJoshi06 opened this issue Dec 13, 2022 · 10 comments · Fixed by #857
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@RohanJoshi06
Copy link

RohanJoshi06 commented Dec 13, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

Only one json file was changed, yet changed-files-diff-sha went haywire. All screenshots on the bug is contained in this gist:

https://gist.github.com/RohanJoshi06/c875cad897c4e2a4b902fc3672d26309

There is also an error at the very end of the step (after the thousand+ lines): Unable to locate a common ancestor between main and TEST-JOB-DELETION with: 0284bb48a7c777e7bcf8d39b20792d86b5d0ba57...e27095d2e7f2d9a00b599e74be281099d2d4a847

A screenshot of that is also attached in the gist.

To Reproduce

Any change to the repository caused this.

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

The expected behavior is that it provides the changed files without taking so long and printing so many lines for a simple change.

Relevant log output

Log output is again shown in this gist: 

https://gist.github.com/RohanJoshi06/c875cad897c4e2a4b902fc3672d26309

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@RohanJoshi06 RohanJoshi06 added the bug Something isn't working label Dec 13, 2022
@github-actions
Copy link
Contributor

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.

@jackton1
Copy link
Member

jackton1 commented Dec 13, 2022

@RohanJoshi06 Can you provide the actual log output instead of pictures?

To help diagnose the issue, can you also provide more information on what you did i.e How you set up your workflow?

@skalinets
Copy link

we seem to have the same issue. Our setup is the following:

     - name: 'Verify Changed Files'
       id: verify-changed-files
       uses: tj-actions/changed-file
       with:
         fetch_depth: 2
         files: |
           app.py
           ./some_folder/**
           cdk*.json

and it produces thousands (for 20 minutes and counting) of lines like

Fetching 2940 commits...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching 2942 commits...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching 2944 commits...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching 2946 commits...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching 2948 commits...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching 2950 commits...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
Fetching 2952 commits...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0   

@jackton1
Copy link
Member

@skalinets @RohanJoshi06 This issue should be resolved.

@ngdah
Copy link

ngdah commented Dec 14, 2022

i could still see the issue in v34: 2mins run, but this time with less output and different error:

/usr/bin/git rev-parse --show-toplevel
/home/runner/work/go-backend/go-backend
/usr/bin/git diff --diff-filter=D --name-only 040c6731a9acbe50de6dd781d85efe2cf72c7148...b743e9f6f6c3c0b31f41d3b50dd8f4ff396e5587
fatal: 040c6731a9acbe50de6dd781d85efe2cf72c7148...b743e9f6f6c3c0b31f41d3b50dd8f4ff396e5587: no merge base
Error: The process '/usr/bin/git' failed with exit code 128

/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:592
                error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
^
Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:592:1)
    at ExecState.CheckComplete (/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:575:1)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:469:1)
    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)

this is the env:

env:
    GH_REPO: <redacted>
    PR_NUMBER: 6766
    IMPRINT_DIR: .
    GITHUB_SERVER_URL: https://github.com
    GITHUB_REPOSITORY: <redacted>
    GITHUB_REF: refs/pull/6766/merge
    GITHUB_BASE_REF: main
    GITHUB_HEAD_REF: PC-3659
    GITHUB_WORKSPACE: /home/runner/work/go-backend/go-backend
    GITHUB_EVENT_HEAD_REPO_FORK: false
    GITHUB_EVENT_PULL_REQUEST_BASE_SHA: 040c6731a9acbe50de6dd781d85efe2cf72c7148
    GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: 5035106f6d5675925d12d49f667debc6bb936122
    GITHUB_EVENT_PULL_REQUEST_COMMITS: 22
    GITHUB_EVENT_BEFORE: 797a2f35ae48d5974c32c1a409da64115ed9db51
    GITHUB_EVENT_FORCED: 
    GITHUB_REFNAME: 6766/merge
    INPUT_SHA: b743e9f6f6c3c0b31f41d3b50dd8f4ff396e5587
    INPUT_BASE_SHA: 
    INPUT_SINCE: 
    INPUT_UNTIL: 
    INPUT_PATH: .
    INPUT_FETCH_DEPTH: 50
    INPUT_MAX_FETCH_DEPTH: 6000
    INPUT_SINCE_LAST_REMOTE_COMMIT: false

output from changed-files-diff-sha:

Fetching remote refs...
  Fetching 0 commits...
  Fetching 50 commits...
  Fetching 100 commits...
  Fetching 150 commits...
  Fetching 200 commits...
  Fetching 250 commits...
  Fetching 300 commits...
  Fetching 350 commits...
  Fetching 400 commits...
  Fetching 450 commits...
  Fetching 500 commits...
  Fetching 550 commits...
  Fetching 600 commits...
  Fetching 650 commits...
  Fetching 700 commits...
  Fetching 750 commits...
  Fetching 800 commits...
  Fetching 850 commits...
  Fetching 900 commits...
  Fetching 950 commits...
  Fetching 1000 commits...
  Fetching 1050 commits...
  Fetching 1100 commits...
  Fetching 1150 commits...
  Fetching 1200 commits...
  Fetching 1250 commits...
  Fetching 1300 commits...
  Fetching 1350 commits...
  Fetching 1400 commits...
  Fetching 1450 commits...
  Fetching 1500 commits...
  Fetching 1550 commits...
  Fetching 1600 commits...
  Fetching 1650 commits...
  Fetching 1700 commits...
  Fetching 1750 commits...
  Fetching 1800 commits...
  Fetching 1850 commits...
  Fetching 1900 commits...
  Fetching 1950 commits...
  Fetching 2000 commits...
  Fetching 2050 commits...
  Fetching 2100 commits...
  Fetching 2150 commits...
  Fetching 2200 commits...
  Fetching 2250 commits...
  Fetching 2300 commits...
  Fetching 2350 commits...
  Fetching 2400 commits...
  Fetching 2450 commits...
  Fetching 2500 commits...
  Fetching 2550 commits...
  Fetching 2600 commits...
  Fetching 2650 commits...
  Fetching 2700 commits...
  Fetching 2750 commits...
  Fetching 2800 commits...
  Fetching 2850 commits...
  Fetching 2900 commits...
  Fetching 2950 commits...
  Fetching 3000 commits...
  Fetching 3050 commits...
  Fetching 3100 commits...
  Fetching 3150 commits...
  Fetching 3200 commits...
  Fetching 3250 commits...
  Fetching 3300 commits...
  Fetching 3350 commits...
  Fetching 3400 commits...
  Fetching 3450 commits...
  Fetching 3500 commits...
  Fetching 3550 commits...
  Fetching 3600 commits...
  Fetching 3650 commits...
  Fetching 3700 commits...
  Fetching 3750 commits...
  Fetching 3800 commits...
  Fetching 3850 commits...
  Fetching 3900 commits...
  Fetching 3950 commits...
  Fetching 4000 commits...
  Fetching 4050 commits...
  Fetching 4100 commits...
  Fetching 4150 commits...
  Fetching 4200 commits...
  Fetching 4250 commits...
  Fetching 4300 commits...
  Fetching 4350 commits...
  Fetching 4400 commits...
  Fetching 4450 commits...
  Fetching 4500 commits...
  Fetching 4550 commits...
  Fetching 4600 commits...
  Fetching 4650 commits...
  Fetching 4700 commits...
  Fetching 4750 commits...
  Fetching 4800 commits...
  Fetching 4850 commits...
  Fetching 4900 commits...
  Fetching 4950 commits...
  Fetching 5000 commits...
  Fetching 5050 commits...
  Fetching 5100 commits...
  Fetching 5150 commits...
  Fetching 5200 commits...
  Fetching 5250 commits...
  Fetching 5300 commits...
  Fetching 5350 commits...
  Fetching 5400 commits...
  Fetching 5450 commits...
  Fetching 5500 commits...
  Fetching 5550 commits...
  Fetching 5600 commits...
  Fetching 5650 commits...
  Fetching 5700 commits...
  Fetching 5750 commits...
  Fetching 5800 commits...
  Fetching 5850 commits...
  Fetching 5900 commits...
  Fetching 5950 commits...

@jackton1
Copy link
Member

jackton1 commented Dec 14, 2022

@ngdah Can you provide your workflow setup i.e what was the configuration of the checkout and changed files action?

@ngdah
Copy link

ngdah commented Dec 14, 2022

- name: Checkout code
  uses: actions/checkout@v2

- name: Get only modified files
  id: modified_files
  uses: tj-actions/changed-files@v34
  continue-on-error: true

@jackton1
Copy link
Member

jackton1 commented Dec 14, 2022

@ngdah Can you upgrade to v3

- name: Checkout code
  uses: actions/checkout@v3

@ngdah
Copy link

ngdah commented Dec 14, 2022

bumping the checkout action version from v2 to v3 helps. thanks jackton!

@mverdaguer
Copy link

mverdaguer commented Dec 16, 2022

Hi @jackton1 we are facing the same problem sporadically in our project.

This is how our job steps look:

      - name: Checkout
        uses: actions/checkout@v3

      - name: Get changed files in Shared, Ui and Dashboard
        id: is-affected
        uses: tj-actions/changed-files@v34
        with:
          files: |
            packages/shared/**
            packages/ui/**
            packages/dashboard/**       

And the problem:

Run tj-actions/changed-files@v34
  with:
    files: packages/shared/**
  packages/ui/**
  packages/dashboard/**
  
    separator:  
    include_all_old_new_renamed_files: false
    old_new_separator: ,
    old_new_files_separator:  
    files_separator: 
  
    files_ignore_separator: 
  
    sha: fef7c05056bf[2](https://github.com/***#step:3:2)1260246fc0d64cedea[3](https://github.com/***#step:3:3)e[4](https://github.com/***#step:3:4)a64[5](https://github.com/***#step:3:5)85
    path: .
    quotepath: true
    dir_names: false
    json: false
    fetch_depth: 50
    max_fetch_depth: [6](https://github.com/***#step:3:6)000
    since_last_remote_commit: false
Run # "Calculating the previous and current SHA..."
  # "Calculating the previous and current SHA..."
  bash $GITHUB_ACTION_PATH/diff-sha.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    GITHUB_SERVER_URL: https://github.com
    GITHUB_REPOSITORY: ***
    GITHUB_REF: refs/pull/1355/merge
    GITHUB_BASE_REF: dev
    GITHUB_HEAD_REF: marcv/github-actions-fixes
    GITHUB_WORKSPACE: /home/runner/work/Apps/Apps
    GITHUB_EVENT_HEAD_REPO_FORK: false
    GITHUB_EVENT_PULL_REQUEST_BASE_SHA: [7](https://github.com/***#step:3:7)935140b0c05f5fcc3143bc0a5[8](https://github.com/***#step:3:8)c5d0[9](https://github.com/***#step:3:9)cf4fedae
    GITHUB_EVENT_PULL_REQUEST_HEAD_SHA: 9648e1b449798e913cdc5765376525d2e714ccc1
    GITHUB_EVENT_PULL_REQUEST_COMMITS: 6
    GITHUB_EVENT_BEFORE: 1807dc0a0253aa0346c1d857f9c0d282d3f2841a
    GITHUB_EVENT_FORCED: 
    GITHUB_REFNAME: 1355/merge
    INPUT_SHA: fef7c05056bf2[12](https://github.com/***#step:3:12)60[24](https://github.com/***#step:3:25)6fc0d64cedea3e4a64585
    INPUT_BASE_SHA: 
    INPUT_SINCE: 
    INPUT_UNTIL: 
    INPUT_PATH: .
    INPUT_FETCH_DEPTH: 50
    INPUT_MAX_FETCH_DEPTH: 6000
    INPUT_SINCE_LAST_REMOTE_COMMIT: false
changed-files-diff-sha
  Verifying git version...
  Valid git version found: (2.38.2)
  Running on a pull request event...
  Fetching remote refs...
  Fetching 0 commits...
  Fetching 50 commits...
  Fetching 100 commits...
  Fetching 150 commits...
  Fetching 200 commits...
  Fetching 250 commits...
  Fetching 300 commits...
  Fetching 350 commits...
  Fetching 400 commits...
  Fetching 450 commits...
  Fetching 500 commits...
  Fetching 550 commits...
  Fetching 600 commits...
  Fetching 650 commits...
  Fetching 700 commits...
  Fetching 750 commits...
  Fetching 800 commits...
  Fetching 850 commits...
  Fetching 900 commits...
  Fetching 950 commits...
  Fetching 1000 commits...
  Fetching 1050 commits...
  Fetching 1100 commits...
  Fetching 1150 commits...
  Fetching 1200 commits...
  Fetching 1250 commits...
  Fetching 1300 commits...
  Fetching 1350 commits...
  Fetching [140](https://github.com/***#step:3:142)0 commits...
  Fetching 1450 commits...
  Fetching 1500 commits...
  Fetching 1550 commits...
  Fetching 1600 commits...
  Fetching 1650 commits...
  Fetching 1700 commits...
  Fetching 1750 commits...
  Fetching 1800 commits...
  Fetching 1850 commits...
  Fetching 1900 commits...
  Fetching 1950 commits...
  Fetching 2000 commits...
  Fetching 2050 commits...
  Fetching 2100 commits...
  Fetching 2150 commits...
  Fetching 2200 commits...
  Fetching 2250 commits...
  Fetching 2300 commits...
  Fetching 2350 commits...
  Fetching 2400 commits...
  Fetching 2450 commits...
  Fetching 2500 commits...
  Fetching 2550 commits...
  Fetching 2600 commits...
  Fetching 2650 commits...
  Fetching 2700 commits...
  Fetching 2750 commits...
  Fetching 2800 commits...
  Fetching 2850 commits...
  Fetching 2900 commits...
  Fetching 2950 commits...
  Fetching 3000 commits...
  Fetching 3050 commits...
  Fetching 3100 commits...
  Fetching 3150 commits...
  Fetching 3200 commits...
  Fetching 3250 commits...
  Fetching 3300 commits...
  Fetching 3350 commits...
  Fetching 3400 commits...
  Fetching 3450 commits...
  Fetching 3500 commits...
  Fetching 3550 commits...
  Fetching 3600 commits...
  Fetching 3650 commits...
  Fetching 3700 commits...
  Fetching 3750 commits...
  Fetching 3800 commits...
  Fetching 3850 commits...
  Fetching 3900 commits...
  Fetching 3950 commits...
  Fetching 4000 commits...
  Fetching 4050 commits...
  Fetching 4100 commits...
  Fetching 4150 commits...
  Fetching 4200 commits...
  Fetching 4250 commits...
  Fetching 4300 commits...
  Fetching 4350 commits...
  Fetching 4400 commits...
  Fetching 4450 commits...
  Fetching 4500 commits...
  Fetching 4550 commits...
  Fetching 4600 commits...
  Fetching 4650 commits...
  Fetching 4700 commits...
  Fetching 4750 commits...
  Fetching 4800 commits...
  Fetching 4850 commits...
  Fetching 4900 commits...
  Fetching 4950 commits...
  Fetching 5000 commits...
  Fetching 5050 commits...
  Fetching 5100 commits...
  Fetching 5150 commits...
  Fetching 5200 commits...
  Fetching 5250 commits...
  Fetching 5300 commits...
  Fetching 5350 commits...
  Fetching 5400 commits...
  Fetching 5450 commits...
  Fetching 5500 commits...
  Fetching 5550 commits...
  Fetching 5600 commits...
  Fetching 5650 commits...
  Fetching 5700 commits...
  Fetching 5750 commits...
  Fetching 5800 commits...
  Fetching 5850 commits...
  Fetching 5900 commits...
  Fetching 5950 commits...
Run tj-actions/glob@v16
/usr/bin/git rev-parse --show-toplevel
/home/runner/work/Apps/Apps
/usr/bin/git diff --diff-filter=D --name-only 7935140b0c05f5fcc3[143](https://github.com/***#step:3:145)bc0a58c5d09cf4fedae...fef7c05056bf21260246fc0d64cedea3e4a64585
fatal: 7935140b0c05f5fcc3143bc0a58c5d09cf4fedae...fef7c05056bf21260246fc0d64cedea3e4a64585: no merge base
Error: The process '/usr/bin/git' failed with exit code 128

/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:592
                error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
^
Error: The process '/usr/bin/git' failed with exit code 128
    at ExecState._setResult (/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:592:1)
    at ExecState.CheckComplete (/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:575:1)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/tj-actions/glob/v16/webpack:/glob/node_modules/@actions/exec/lib/toolrunner.js:469:1)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:[106](https://github.com/***#step:3:108)4:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
    

Note that I repladced the urls to our private github for ***

Any suggestions on how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
5 participants