Repository navigation
add traffic inspect command - #225
Conversation
|
Gitar automatically fixes CI failures and addresses comments starting with ⚙️ Options:
🔄 To revert changes, post a comment: * Gitar never force pushes to your branch |
|
Overall LGTM I guess some question around -d defaulting. Probably we should have renamed the default dir For the dir checking, I'd suggest
|
|
@scott-cotton @daniel-de-vera comments addressed |
|
@davixcky, given that this feature is still under partial development, I would target the PR to a feature branch (e.g. |
| This command validates that the specified directory contains valid traffic data | ||
| by checking for the presence of meta files (meta.json, meta.yaml, meta.jsons, or meta.yamls). | ||
| If the directory doesn't contain any of these meta files, it will return an error | ||
| indicating it's not a valid traffic directory. | ||
|
|
||
| When the --wait flag is used, the command will wait for the directory to contain | ||
| valid traffic data if it's initially empty, checking every second until meta files | ||
| are found.`, |
There was a problem hiding this comment.
I think what we are expecting to be an input here is the --output-dir from signadot traffic record, right?
This description and the current implementation in:
cli/internal/command/traffic/inspect.go
Lines 78 to 87 in b13ef3c
seem a bit mixed up. For example, the logic currently accepts a directory as valid if it contains a meta.json file, which IMO, it shouldn’t be the case. Those meta.json files are expected to exist inside each request directory, not at the root.
I'm not suggesting we validate the contents of the discovered files (at least not at this stage), but the current logic feels confusing to me.
There was a problem hiding this comment.
In other words, I would implement the check as:
for _, entry := range entries {
if entry.IsDir() {
continue
}
name := entry.Name()
if name == "meta.jsons" || name == "meta.yamls" {
return true, nil
}
} And change the description to something like:
Inspect traffic data from a directory containing recorded traffic.
This command validates that the specified directory contains traffic data
produced by a signadot traffic record session. If the directory does not
contain valid data, the command returns an error.
When the --wait flag is provided, the command will wait until valid traffic data
becomes available in the specified directory.
|
@daniel-de-vera thanks, also updated the branch target |
* add traffic inspect command (#225) * add traffic inspect command * add support for wait and reword messages * fix pr comments * Skeleton TUI (#226) * skeleton tui * fix escape logs * only update if have too * make sure by default nothing is selected * move between panes and tabs with arrow * fix wrong re-render caused by map * use utility for setting up status * update mock to contain routing key * fix help menu and clear status * center empty states * add viewport for right panel * make sure right pane occupy more width * add basic paginator for left pane * make sure left pane scroll move between pages * make short help aware of context * [TUI] Wiring tui traffic watch (#232) * skeleton tui * fix escape logs * only update if have too * make sure by default nothing is selected * move between panes and tabs with arrow * fix wrong re-render caused by map * use utility for setting up status * update mock to contain routing key * fix help menu and clear status * center empty states * add viewport for right panel * make sure right pane occupy more width * add basic paginator for left pane * make sure left pane scroll move between pages * make short help aware of context * remove model mock files * add lipgloss dependency * add simple watcher and use libconnect type: * replace bufferred channel with non * replace round with ceiling * fix build * load absolute meta, request and response * rename symbol * rename symbol * pass record dir and meta format * fix build * fix yaml support * add tui call from the inspect * add tui flag in record * make sure inspect look for json * remove hardcoded path * rename tui flag to inspect * remove tui cmd * remove models directory and move loader to utils (#234) * use pointers for http.{Request,Response} * make sure width is valid for logs * disable logs temporarily * add basic error handling for filemanager (#236) * add basic error handling for filemanager * make sure error message is displayed * remove sprintf from status render * pass pointer instead of copy on linemessages * make union type for scanner
* add traffic inspect command (#225) * add traffic inspect command * add support for wait and reword messages * fix pr comments * Skeleton TUI (#226) * skeleton tui * fix escape logs * only update if have too * make sure by default nothing is selected * move between panes and tabs with arrow * fix wrong re-render caused by map * use utility for setting up status * update mock to contain routing key * fix help menu and clear status * center empty states * add viewport for right panel * make sure right pane occupy more width * add basic paginator for left pane * make sure left pane scroll move between pages * make short help aware of context * [TUI] Wiring tui traffic watch (#232) * skeleton tui * fix escape logs * only update if have too * make sure by default nothing is selected * move between panes and tabs with arrow * fix wrong re-render caused by map * use utility for setting up status * update mock to contain routing key * fix help menu and clear status * center empty states * add viewport for right panel * make sure right pane occupy more width * add basic paginator for left pane * make sure left pane scroll move between pages * make short help aware of context * remove model mock files * add lipgloss dependency * add simple watcher and use libconnect type: * replace bufferred channel with non * replace round with ceiling * fix build * load absolute meta, request and response * rename symbol * rename symbol * pass record dir and meta format * fix build * fix yaml support * add tui call from the inspect * add tui flag in record * make sure inspect look for json * remove hardcoded path * rename tui flag to inspect * remove tui cmd * remove models directory and move loader to utils (#234) * use pointers for http.{Request,Response} * make sure width is valid for logs * disable logs temporarily * add logs viewer * fix regression and make sure logs render ok
* add traffic inspect command (#225) * add traffic inspect command * add support for wait and reword messages * fix pr comments * Skeleton TUI (#226) * skeleton tui * fix escape logs * only update if have too * make sure by default nothing is selected * move between panes and tabs with arrow * fix wrong re-render caused by map * use utility for setting up status * update mock to contain routing key * fix help menu and clear status * center empty states * add viewport for right panel * make sure right pane occupy more width * add basic paginator for left pane * make sure left pane scroll move between pages * make short help aware of context * [TUI] Wiring tui traffic watch (#232) * skeleton tui * fix escape logs * only update if have too * make sure by default nothing is selected * move between panes and tabs with arrow * fix wrong re-render caused by map * use utility for setting up status * update mock to contain routing key * fix help menu and clear status * center empty states * add viewport for right panel * make sure right pane occupy more width * add basic paginator for left pane * make sure left pane scroll move between pages * make short help aware of context * remove model mock files * add lipgloss dependency * add simple watcher and use libconnect type: * replace bufferred channel with non * replace round with ceiling * fix build * load absolute meta, request and response * rename symbol * rename symbol * pass record dir and meta format * fix build * fix yaml support * add tui call from the inspect * add tui flag in record * make sure inspect look for json * remove hardcoded path * rename tui flag to inspect * remove tui cmd * remove models directory and move loader to utils (#234) * use pointers for http.{Request,Response} * make sure width is valid for logs * disable logs temporarily * add logs viewer * fix regression and make sure logs render ok * stay on logs on incoming * clear logs logic and add some coloring * add cosmetic visual for rendering * make sure render properly * constraint width for requests
No description provided.