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

[turborepo] HEAD^ filter on shallow clone stopped working in 1.9.1 #4559

Closed
laat opened this issue Apr 13, 2023 · 5 comments
Closed

[turborepo] HEAD^ filter on shallow clone stopped working in 1.9.1 #4559

laat opened this issue Apr 13, 2023 · 5 comments
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage

Comments

@laat
Copy link
Contributor

laat commented Apr 13, 2023

What version of Turborepo are you using?

1.9.2

What package manager are you using / does the bug impact?

npm

What operating system are you using?

Linux

Describe the Bug

Turbo tries to read a commit before HEAD^ when filtering.

npx turbo@1.9.2 run build --filter "...[HEAD^]" --dry json fails with the message:

Turbo error: failed to resolve packages to run: git error: object not found - no match for id (d9f5424696e8aa64fa7c92b88ee8d96bd529f008); class=Odb (9)

Expected Behavior

It should probably work on a shallow clone

To Reproduce

A repro, with a PR that fails with 1.9.1:

laat/turbo-shallow-repro#2

The Github Action:

name: Node.js CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 2
    - uses: actions/setup-node@v3

    # works
    - run: npx turbo@1.9.0 run build --filter "...[HEAD^]" --dry json
    
    # fails
    - run: npx turbo@1.9.1 run build --filter "...[HEAD^]" --dry json
   
    # fails
    - run: npx turbo@1.9.2 run build --filter "...[HEAD^]" --dry json
      if: always()
@laat laat added area: turborepo kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Apr 13, 2023
@laat laat changed the title [turborepo] HEAD^ filter on shallow clone stopped working [turborepo] HEAD^ filter on shallow clone stopped working in 1.9.1 Apr 13, 2023
@hugo082
Copy link

hugo082 commented Apr 13, 2023

Same issue on --filter="[HEAD~...HEAD]"

ERROR  run failed: failed to resolve packages to run: git error: object not found - no match for id (9914a2c527ce7efe318d4e9f0991997066a096fc); class=Odb (9)
Turbo error: failed to resolve packages to run: git error: object not found - no match for id (9914a2c527ce7efe318d4e9f0991997066a096fc); class=Odb (9)

@Xa3lis
Copy link

Xa3lis commented Apr 13, 2023

Same issue on --filter='[main...HEAD^1]'

But only on one of my CI workflow
The other one is working flawlessly

ERROR  run failed: failed to resolve packages to run: git error: object not found - no match for id (e207f37719a34d8bb172595c541a433200d00c00); class=Odb (9)
Turbo error: failed to resolve packages to run: git error: object not found - no match for id (e207f37719a34d8bb172595c541a433200d00c00); class=Odb (9)

@arantespp
Copy link

arantespp commented Apr 16, 2023

Similar issue when I use git tag: --filter=...[$TAG]

ERROR  run failed: failed to resolve packages to run: git error: object is no commit object; class=Invalid (3)
Turbo error: failed to resolve packages to run: git error: object is no commit object; class=Invalid (3)

@laat
Copy link
Contributor Author

laat commented Apr 17, 2023

solved in 1.9.3

🎉 thanks @NicholasLYang

@tknickman
Copy link
Member

Fixed in #4604

Thanks for the reports!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage
Projects
None yet
Development

No branches or pull requests

5 participants