feat(cli): implement watch command with fsnotify and --json streaming#34
Open
abhinav-1504 wants to merge 3 commits into
Open
feat(cli): implement watch command with fsnotify and --json streaming#34abhinav-1504 wants to merge 3 commits into
abhinav-1504 wants to merge 3 commits into
Conversation
|
First PR — welcome aboard! A few things to expect:
If you get stuck, reply here or jump to Discussions. We want this PR to land. |
Signed-off-by: Abhinav Singh Chauhan <abhinavsinghc48@gmail.com>
cb0255c to
e1381b5
Compare
Author
|
Hello @btwshivam, |
Author
|
Hi @btwshivam, just following up on this PR. All CI checks are passing now and the latest changes have been pushed. Could you please take another look when possible? Thanks. |
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.
What
Implements
optiqor watch [chart]— re-analyzes a Helm chart orvalues file whenever a YAML file changes.
Why
Fixes #15
How
internal/watch/watch.go— core watch loop using fsnotify; 200msdebounce to absorb editor save storms; ANSI screen clear between
runs when stdout is a TTY;
--jsonstreams newline-delimited JSONevents (start/update/error); SIGINT/SIGTERM → clean exit (code 0)
cmd/optiqor/main.go— wired newWatchCmd() to call watch.Run();added --json flag; honours --no-color and NO_COLOR
cross-platform compatibility
Testing
go test ./internal/... ./pkg/... -timeout 30s— 10/10 PASSgo build ./...— cleanoptiqor watch ./cmd/optiqor/demo/values.yaml→ full report, waitsoptiqor watch ... --json→ valid JSON streamedNote:
TestGoldenincmd/optiqorfails on Windows only due topath separator differences (
\vs/) — pre-existing issue unrelatedto this PR. CI runs on Ubuntu where it passes.
Checklist