Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vercel/turborepo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.12.1
Choose a base ref
...
head repository: vercel/turborepo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.12.2
Choose a head ref
  • 10 commits
  • 96 files changed
  • 7 contributors

Commits on Jan 31, 2024

  1. Examples tests revamp. (#7098)

    The tests for examples have proven to be a point of friction for us.
    This PR aims to fix that.
    
    ### Try it out locally with `turbo test -F "@turborepo-examples-tests*"
    --continue --concurrency=5`
    
    ---
    
    There is a bit of technical debt associated with these tests, I'm told.
    Historically, these tests were used more like integration or end-to-end
    tests to ensure that `turbo` was behaving predictably on example
    monorepos.
    
    Today, we're making the explicit commitment that **these tests no longer
    need to serve that goal**. Instead, they are for **ensuring that the
    examples work correctly against the latest published version of
    `turbo`**. We're making sure that users can trust that `npx
    create-turbo@latest [-e <some-example>]` will work out of the box.
    
    ## Problems to solve
    - [x] **Complexity**
    - It appears that our scripting once handled swapping out package
    managers for every example. We no longer feel the need to test our
    examples in this way. We trust that the rest of our CI has managed these
    complexities way before they make it to end users downloading an
    example.
    - There is also layers of scripting around platforms, git, and
    manipulating the package manager. I'm not totally sure what these were
    for - but they're not useful for our new goals.
    - [x] **Flakiness**
    - I suspect that we're not actually surfacing broken examples in these
    tests. I've received reports from users that our examples didn't work
    out of the box - _while these tests are green_. 🧐 As we peel back the
    technical debt, I believe we will find out if this is indeed the case.
    - I've personally experienced these tests _fail_ at unexpected times,
    _pass_ at unexpected times, and _pass and fail_ by re-running the same
    job multiple times with the same code.
    - Going back to our freshly stated goals, the tests catch problems way
    too late (when they do truly catch problems). The examples can
    potentially go untested against the latest published version of `turbo`
    indefinitely.
    - [x] **Testing the wrong thing**
    - The tests are currently set up to do snapshot testing using Prysk.
    However, we no longer are interested in trying to find drift in logs in
    these tests so we don't need this log capturing layer.
    - This Prysk layer also adds a heavy, third layer of task runner
    management between terminal command and final package.json script
    execution. The other two are `turbo`.
    - [x] **Debuggability**
    - Understanding and debugging the current test setup is **extremely**
    difficult. I have my suspicions that this also goes back to the Prysk
    layer as it makes logs quite hard to read. I've found it also swallows
    logs during the debugging process that would have been useful to see
    earlier.
    - I expect that this issue will fix itself as we address the complexity
    and flakiness concerns above.
    - [x] **Performance**
    - I have a hunch that these tests can just...be faster. This will likely
    be a tailwind of addressing the aforementioned complexity.
      
    ## Non-goals
    - There are a few examples that we don't test due to their own internal
    complexities (namely, Docker). We could choose to test these examples in
    the future but we're preferring to fix what we already have first.
    - We **do not** want to test the examples against `turbo`@`HEAD`.
    
    ## Key changes
    - **No more Prysk!**: My first experiment was to get Prysk out of the
    way to see what was going on more clearly and, well, I kept not using it
    and kept getting closer to my goals.
    - **No more snapshot tests**: Because we're not concerned about drift in
    the examples, we can stop doing snapshot tests. This piggybacks on the
    "No more Prysk" idea.
    - **Way less scripting**: I love Bash just as much as the next
    developer. But, alas, the new codepaths use way less of it. Fewer steps,
    less work, trimming the fat of things we used to do that we no longer
    need to.
    
    ## Results
    - [x] These updates **caught issues in the existing examples**! I'm not
    certain how these issues were being covered up in the previous
    implementation but I've confirmed three important fixes that were being
    hidden. They were caught in CI and I fixed them. Early win!
    - [x] The tests now have significantly less complexity, only doing the
    work that they really need to be doing.
    - [x] From my experimenting, the tests are now deterministic. I can
    quickly reproduce issues on my local machine that I found in CI. I've
    also had success purposefully creating errors and resolving them.
    - [x] They're faster. Locally testing is approximately 90% faster for me
    while CI is about 50% faster. This likely a symptom of being simpler.
    - [x] They're more predictable, more debuggable, and I've included a
    README to ensure continued understanding of these tests in the future.
    
    ## TODO?
    - [ ] We could choose to run these tests on a cron to ensure we're
    keeping up with published sooner. This PR still leaves us open to not
    testing the examples against `latest`. (This is slightly mitigated by
    Dependabot always running on Mondays. We would find out that `latest`
    broke an example then.)
    - [ ] We could also choose to run these tests as a part of the release
    process.
    
    Closes TURBO-2177
    
    ---------
    
    Co-authored-by: Chris Olszewski <[email protected]>
    Co-authored-by: Mehul Kar <[email protected]>
    3 people authored Jan 31, 2024
    Copy the full SHA
    720086b View commit details
  2. release(turborepo): 1.12.1 (#7193)

    Co-authored-by: Turbobot <[email protected]>
    github-actions[bot] and turbobot-temp authored Jan 31, 2024
    Copy the full SHA
    3b368d0 View commit details
  3. feat(lockfile): traverse lockfile in parallel (#7178)

    ### Description
    
    I remembered that the FFI interface was what was stopping me from
    throwing rayon at the lockfile graph traversal. This can be done easily
    since we already require that all lockfile implementations are `Send`
    and they don't mutate the underlying lockfile.
    
    There's a more elegant way to do this and avoid calculating inner
    closures multiple times, but this is a straightforward win.
    
    ### Testing Instructions
    From 
    <img width="317" alt="Screenshot 2024-01-30 at 5 40 42 PM"
    src="https://github.com/vercel/turbo/assets/4131117/a6334c99-7c61-4bf3-8a24-b29999a74511">
    To
    <img width="328" alt="Screenshot 2024-01-30 at 5 40 32 PM"
    src="https://github.com/vercel/turbo/assets/4131117/5c0cd0c4-1818-4468-aaac-ce47b924f385">
    
    
    [serial.json](https://github.com/vercel/turbo/files/14106106/profile.json)
    
    [parallel.json](https://github.com/vercel/turbo/files/14106107/parallel.json)
    
    
    
    Closes TURBO-2197
    chris-olszewski authored Jan 31, 2024
    Copy the full SHA
    7ad704e View commit details
  4. perf: remove duplicate git construction (#7194)

    ### Description
    
    I noticed in the profile that we were calling `SCM::new` multiple times
    which should be avoided since this results in FS.
    
    This PR does 2 things:
    - Passes existing `SCM` instance around to all the places we were
    constructing a new instance
    - Kick of a thread to construct the `SCM` instance as soon as we start
    run, this means it will usually be ready by the time we need it.
    
    ### Testing Instructions
    
    Old profile:
    <img width="2321" alt="Screenshot 2024-01-31 at 9 19 56 AM"
    src="https://github.com/vercel/turbo/assets/4131117/bba04e6b-da2e-4051-9284-27abef6ea094">
    
    
    New profile:
    <img width="2319" alt="Screenshot 2024-01-31 at 9 17 51 AM"
    src="https://github.com/vercel/turbo/assets/4131117/907a67cd-327d-4a80-914d-2f99bec81c60">
    
    Note how we now are able to construct the `SCM` before the package graph
    finishes building meaning it's available for filtering the graph
    immediately.
    
    
    
    Closes TURBO-2206
    chris-olszewski authored Jan 31, 2024
    Copy the full SHA
    43f9e39 View commit details
  5. Make clippy happy (#7195)

    ### Description
    Quick fix for a few clippy errors I was seeing in the repo.
    Zertsov authored Jan 31, 2024
    Copy the full SHA
    01de08b View commit details
  6. fix: keep stdin open for persistent tasks (#7196)

    ### Description
    
    Fixes #7181
    
    Some tools when they are connected to a TTY will take stdin being closed
    as a sign that they should shut down. This PR changes our behavior to
    keep stdin open for persistent tasks to avoid premature shutdowns.
    
    <img width="649" alt="Screenshot 2024-01-31 at 10 13 00 AM"
    src="https://github.com/vercel/turbo/assets/4131117/e7c26b16-2813-428b-9fe3-6eb552d2f102">
    
    
    ### Testing Instructions
    
    Verify that using `vite` no longer immediately exits when invoked using
    a pseudoterminal.
    <img width="377" alt="Screenshot 2024-01-31 at 10 12 29 AM"
    src="https://github.com/vercel/turbo/assets/4131117/8a7f42d3-8a52-489a-9459-b6d711799512">
    
    (`vite` outputs a clear screen sequence resulting in the run prelude
    being erased)
    
    
    Closes TURBO-2208
    chris-olszewski authored Jan 31, 2024
    Copy the full SHA
    363caf8 View commit details
  7. add vc config dir (#7173)

    ### Description
    Add ability to use Vercel's config dir for whatever we need.
    
    Closes TURBO-2193
    Zertsov authored Jan 31, 2024
    Copy the full SHA
    7351651 View commit details
  8. fix(Turborepo): Handle spaces in path names in git status (#7197)

    ### Description
    
     - Don't stop `git status` parsing when encountering a space
    
    ### Testing Instructions
    
     - Added a unit test for `git status` testing
    - Added an integration test for a dry run with an added file with a
    space in the path name
    
    Closes TURBO-2209
    
    ---------
    
    Co-authored-by: Greg Soltis <Greg Soltis>
    Greg Soltis authored Jan 31, 2024
    Copy the full SHA
    14f5207 View commit details
  9. feat: enable vt processing on windows (#7158)

    ### Description
    
    If we're on windows and are attempting to emit colors, help our users by
    setting
    [`ENABLE_VIRTUAL_TERMINAL_PROCESSING`](https://learn.microsoft.com/en-us/windows/console/setconsolemode)
    which allows ANSI color escape sequences to be respected by the Windows
    console. This might already be set to true by some users, but it is not
    enabled by default by Windows.
    
    ### Testing Instructions
    
    Look at the pretty colors on Windows!
    
    ![cmdp](https://github.com/vercel/turbo/assets/4131117/382fa484-03be-4005-9b95-0d4ab7a7aa26)
    
    ![pwsh](https://github.com/vercel/turbo/assets/4131117/08175677-1014-4264-b58f-26c991067ec5)
    (My default powershell colors are horrible and end up making the
    `docs:build` prefix invisible)
    
    ![gitbash](https://github.com/vercel/turbo/assets/4131117/d119347b-7ecd-40e3-9102-c9e3c2e089cc)
    
    
    Closes TURBO-2186
    
    ---------
    
    Co-authored-by: Chris Olszewski <Chris Olszewski>
    Co-authored-by: Mehul Kar <[email protected]>
    chris-olszewski and mehulkar authored Jan 31, 2024
    Copy the full SHA
    cb9be59 View commit details
  10. Copy the full SHA
    f4d6bf7 View commit details
Loading