Skip to content

Ability to dynamically ignore files at runtime. #3404

@bobjackman

Description

@bobjackman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions