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

Remove dependencies on context methods / functions #821

Merged
merged 2 commits into from
Mar 3, 2022

Conversation

gsoltis
Copy link
Contributor

@gsoltis gsoltis commented Mar 3, 2022

Continuing to remove code dependencies on the internal/context package so that we can possibly calculate the values remotely / asynchronously.

  • Move getTargetsFromArguments from context to run, the only place where it is called.
  • prune reuses the work done resolving global dependencies during context creation. This both reduces the dependency on a method on context as well as avoids doing duplicate work.
  • mark context methods private so that we don't accidentally rely on them elsewhere.

@vercel
Copy link

vercel bot commented Mar 3, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/vercel/turbo-site/GF29pFipW88vTP3mpEE196K3iFX9
✅ Preview: https://turbo-site-git-gsoltis-removedepsoncontext.vercel.sh

@gsoltis gsoltis changed the title Gsoltis/remove deps on context Remove dependencies on context methods / functions Mar 3, 2022
@gsoltis gsoltis marked this pull request as ready for review March 3, 2022 19:59
@@ -28,6 +28,7 @@ const GLOBAL_CACHE_KEY = "snozzberries"

// Context of the CLI
type Context struct {
RootPackageInfo *fs.PackageJSON // TODO(gsoltis): should this be included in PackageInfos?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think eventually this will be. Big feature request is the ability to be able to run tasks from root. I wonder if this is as easy as just adding root to to package infos. and then removing the special resolution logic, but keeping the special edge connecting logic?

We also will need inputs:[] or something to restrict what should be hashed, but I'll spec that.

@kodiakhq kodiakhq bot merged commit f947ece into main Mar 3, 2022
@kodiakhq kodiakhq bot deleted the gsoltis/remove_deps_on_context branch March 3, 2022 21:07
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