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

Ability to dynamically ignore files at runtime. #3404

Closed
bobjackman opened this issue Jun 3, 2020 · 5 comments · Fixed by #3793
Closed

Ability to dynamically ignore files at runtime. #3404

bobjackman opened this issue Jun 3, 2020 · 5 comments · Fixed by #3793
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@bobjackman
Copy link

A few functions accept an ignore=[] flag to prevent triggers on certain files, but most functions don't. In many cases, these ignores can be achieved with the .tiltignore file, but in some cases, these filenames aren't known until runtime.

We have the ability to dynamically watch files with watch_file(), but there is no counterpart ignore_file() or unwatch_file(). Adding this method would allow run-time ignore rules.

This may even be a potential solution for #1930 and #2602

In my particular case, I'm using local('helm pull ...') and k8s_yaml(helm('path/to/pulled/chart')). To ensure we always have a fresh copy of said chart, I'm also doing a local('rm -rf path/to/pulled/chart') immediately before the pull. If tilt is already running, then that chart is being watched. If I update my tiltfile, it gets re-run, which deletes that directory, which triggers a re-run, which successfully pulls the chart, and the newly created files, in turn, trigger another re-run, which again deletes the dir, ad nauseum.

See tilt-dev/tilt-extensions#19

Since helm() doesn't have an ignore=[] flag, there seems to be no way around this. The ability to dynamically un-watch this directory prior to deleting it would solve the problem.

@jazzdan
Copy link
Contributor

jazzdan commented Jun 3, 2020

Hey @kogi,

Thanks for opening this. I think that makes a lot of sense. This could be pretty easily hacked together by making a Tiltfile function that appends patterns as strings to the in-memory version of the .tiltignore file and letting the engine reload it as if the .tiltignore had changed.

@nicks
Copy link
Member

nicks commented Jul 29, 2020

fwiw, this has bitten me a lot too

@bobjackman
Copy link
Author

Any updates/plans/roadmap for this, yet?

@nicks nicks added the good first issue Good for newcomers label Sep 16, 2020
@nicks
Copy link
Member

nicks commented Sep 16, 2020

not yet! though there are some changes underway to change the internal data model for the ignores, to make it easier to make/debug changes like this

@bobjackman
Copy link
Author

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
3 participants