tilt-dev / tilt-dev/tilt

Add stopResourcesBeforeRun to local_resource

Open
#6,307 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the Feature You Want

I would like to have a stopResourcesBeforeRun event that would execute a task before the actual resource is trigger to run.

Current Behavior

afaik, there is no built-in event that allow us to do something before the resource runs (unless I use a external script do it everything in the script)

Why Do You Want This?

Let's say you have 2 local_resources, one to build a project and another to run. The run depends on build. The build is watching source files changes that triggers the build. After initial tilt startup, everything works fine. But after you do the first code change in your project, the build resource fails to run because all the output/bin files are locked by the running resource. With a stopResourcesBeforeRun event, I could setup to have it to stop/disable the running task before the build resource runs.

Additional context
The scenario above is simple (1 build , 1 run) but I could have 1 build for 5 runs for example, if my solution has several projects.

This is the gist of it, the naming or how it works needs to be defined.

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

No files or tests are named. Start by tracing how local_resource tasks are triggered and how existing events are defined, then clarify the event's ordering and effect on dependent resources. Done should include an agreed API, behavior for multiple run resources, and tests covering the build-before-run scenario.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.