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

switching to an affected strategy #5215

Merged
merged 27 commits into from
Apr 2, 2023

Conversation

ZackDeRose
Copy link
Contributor

What It Does:

  • Switches from using only the cache to not rerun tasks to using nx affected in addition to the cache
    • package scripts have been updated accordingly
    • pr workflow updated to set the --base option for nx affected to the PR's target branch
    • ci workflow updated to set the --base option for nx affected to the commit before the triggering push
    • ci-v3 workflow updated to set the --base option for nx affected to the commit before the triggering push

@nx-cloud
Copy link

nx-cloud bot commented Apr 1, 2023

@vercel
Copy link

vercel bot commented Apr 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
query ⬜️ Ignored (Inspect) Apr 1, 2023 11:43am

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 1, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 529bc0a:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-svelte-basic Configuration
@tanstack/query-example-vue-basic Configuration

.github/workflows/ci-v3.yml Outdated Show resolved Hide resolved
@TkDodo
Copy link
Collaborator

TkDodo commented Apr 1, 2023

I don't think the forwarding of --base works?

> query@ test:lib /home/runner/work/query/query
> nx affected --target=test:lib --parallel=5


 >  NX   Affected criteria defaulted to --base=main --head=HEAD

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

Co-authored-by: Dominik Dorfmeister <[email protected]>
@ZackDeRose
Copy link
Contributor Author

I don't think the forwarding of --base works?

> query@ test:lib /home/runner/work/query/query
> nx affected --target=test:lib --parallel=5


 >  NX   Affected criteria defaulted to --base=main --head=HEAD

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

Yes, something went wrong! lol

pnpm should forward the option - I believe this is actually me not getting the github context stuff correct. Let me see...

@ZackDeRose
Copy link
Contributor Author

Alright - got the fix now. For the ci workflow, we'll want to make sure to test it.

(The issues with the PR workflow were due to this PR coming in from a fork. After checking out with default options, we were in a detatched head state, so Nx was unable to find the main branch in the linked list of commits, so affected command failed. With pushes to main/alpha/etc., this should be a non-issue since we'll always be inside this repo, never a fork. All the same, don't wanna bring things down!)

@TkDodo TkDodo merged commit 55bdf77 into TanStack:main Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants