Fix tilt logs -f to respect resource filtering#6735
Open
krishnactive wants to merge 1 commit intotilt-dev:masterfrom
Open
Fix tilt logs -f to respect resource filtering#6735krishnactive wants to merge 1 commit intotilt-dev:masterfrom
krishnactive wants to merge 1 commit intotilt-dev:masterfrom
Conversation
When running 'tilt logs -f <resource>', build event logs from other resources were incorrectly shown in the output. The resource filter check was happening after the build event check, allowing build logs to bypass resource filtering. Solution: Reorder the filter checks in LogFilter.Matches() to apply the resource filter first, before checking for build events. This ensures all logs, including build events, respect the resource filter. Fixes tilt-dev#6663
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When running
tilt logs -f <resource>, build event logs from other resources were incorrectly shown in the output. This included:Root Cause
In
internal/hud/client/log_filter.go, theLogFilter.Matches()function was checking if a log line is a BuildEvent BEFORE checking if it matches the resource filter. This caused all build event logs to bypass the resource filtering.Solution
Reorder the filter checks in
LogFilter.Matches()to apply the resource filter FIRST, before checking for build events. This ensures all logs, including build events, respect the resource filter.Changes
internal/hud/client/log_filter.go(lines 111-121)Testing
The fix has been:
Fixes #6663