tilt-dev / tilt-dev/tilt

local that generates yaml causes infinite loop

Open
#1,930 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Description

A Tiltfile like below will cause an infinite loop:

local('gen_file.py > foo.yaml')
k8s_yaml('foo.yaml')

This happens because foo.yaml will always be touched.

There are a few ways to fix this.

A workaround is to do text = local('cat foo.yaml'). This will end up reading the file, but not record a dep.

read_file could take an arg saying it shouldn't record a dependency. This could be dangerous, and cause bugs.

local could take arguments of files it expects to touch, and Tilt could ignore edits to them while the command is running.

Ran into this onboarding a user who used make tilt as the command to generate yaml.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Tiltfile with local('gen_file.py > foo.yaml') followed by k8s_yaml('foo.yaml'), then trace how local and k8s_yaml record file dependencies. The issue lists several possible directions but does not select one; done should mean this workflow no longer loops while dependency tracking remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.