steampipe icon indicating copy to clipboard operation
steampipe copied to clipboard

Provide feedback in interactive mode when loading a workspace with a mod.sp, and loading all files recursively

Open kaidaguerre opened this issue 2 years ago • 1 comments

When running Steampipe, it searches the current folder and the up parent folder tree to find a mod.sp file containing a mod definition. So if you are running Steampipe from within a child folder of a mod folder, it recognises that mod as the current workspace mod.

If a mod.sp is found, a recursive search is executed to find any .sp underneath the mod folder directory. These are parsed and loaded into the workspace. Any .sql files found recursively under the mod directory are converted into query resources in the workspace

Currently no indication is given that this is happening, which can be confusing, particularly if you are inadvertently running in the child folder of a mod.

Add feedback when starting up:

Modfile found at path xxx/xxx/xxx/mod.sp`
Loading .sp and .sql files recursively underneath xxx/xxx/xxx
Found 100 files

kaidaguerre avatar Aug 10 '22 11:08 kaidaguerre

Here is the function where the workspace detemines whether there is a workspace modfile: https://github.com/turbot/steampipe/blob/5193c70395ff52cb8ff8df321c97bf1ecffad140/pkg/workspace/workspace.go#L194

If it finds a modfile, it sets the workspace property modFilePath. This property can be checked to determine whether a modfile was found

kaidaguerre avatar Aug 11 '22 12:08 kaidaguerre

https://github.com/turbot/steampipe/pull/2339#issuecomment-1375326891 Closing but subject to review

pskrbasu avatar Sep 13 '23 07:09 pskrbasu