@@ -180,11 +180,12 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk, _ .
180
180
181
181
// Scan workspaces
182
182
for _ , workspaceID := range s .conn .Workspaces {
183
- w , err := s .client .GetWorkspace (workspaceID )
183
+ w , err := s .client .GetWorkspace (ctx , workspaceID )
184
184
if err != nil {
185
185
return fmt .Errorf ("error getting workspace %s: %w" , workspaceID , err )
186
186
}
187
187
s .SetProgressOngoing (fmt .Sprintf ("Scanning workspace %s" , workspaceID ), "" )
188
+ ctx .Logger ().V (2 ).Info ("scanning workspace from workspaces given" , "workspace" , workspaceID )
188
189
if err = s .scanWorkspace (ctx , chunksChan , w ); err != nil {
189
190
return fmt .Errorf ("error scanning workspace %s: %w" , workspaceID , err )
190
191
}
@@ -206,10 +207,11 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk, _ .
206
207
207
208
// Scan personal workspaces (from API token)
208
209
if s .conn .Workspaces == nil && s .conn .Collections == nil && s .conn .Environments == nil && s .conn .GetToken () != "" {
209
- workspaces , err := s .client .EnumerateWorkspaces ()
210
+ workspaces , err := s .client .EnumerateWorkspaces (ctx )
210
211
if err != nil {
211
212
return fmt .Errorf ("error enumerating postman workspaces: %w" , err )
212
213
}
214
+ ctx .Logger ().V (2 ).Info ("enumerated workspaces" , "workspaces" , workspaces )
213
215
for _ , workspace := range workspaces {
214
216
s .SetProgressOngoing (fmt .Sprintf ("Scanning workspace %s" , workspace .ID ), "" )
215
217
if err = s .scanWorkspace (ctx , chunksChan , workspace ); err != nil {
@@ -307,7 +309,7 @@ func (s *Source) scanWorkspace(ctx context.Context, chunksChan chan *sources.Chu
307
309
// scanCollection scans a collection and all its items, folders, and requests.
308
310
// locally scoped Metadata is updated as we drill down into the collection.
309
311
func (s * Source ) scanCollection (ctx context.Context , chunksChan chan * sources.Chunk , metadata Metadata , collection Collection ) {
310
- ctx .Logger ().V (2 ).Info ("starting scanning collection" , collection .Info .Name , "uuid " , collection .Info .UID )
312
+ ctx .Logger ().V (2 ).Info ("starting to scan collection" , "collection_name" , collection .Info .Name , "collection_uuid " , collection .Info .UID )
311
313
metadata .CollectionInfo = collection .Info
312
314
metadata .Type = COLLECTION_TYPE
313
315
s .attemptToAddKeyword (collection .Info .Name )
@@ -637,7 +639,7 @@ func (s *Source) scanHTTPResponse(ctx context.Context, chunksChan chan *sources.
637
639
638
640
func (s * Source ) scanVariableData (ctx context.Context , chunksChan chan * sources.Chunk , m Metadata , variableData VariableData ) {
639
641
if len (variableData .KeyValues ) == 0 {
640
- ctx .Logger ().V (2 ).Info ("no variables to scan" , "type" , m .Type , "uuid " , m .FullID )
642
+ ctx .Logger ().V (2 ).Info ("no variables to scan" , "type" , m .Type , "item_uuid " , m .FullID )
641
643
return
642
644
}
643
645
@@ -673,12 +675,14 @@ func (s *Source) scanVariableData(ctx context.Context, chunksChan chan *sources.
673
675
674
676
func (s * Source ) scanData (ctx context.Context , chunksChan chan * sources.Chunk , data string , metadata Metadata ) {
675
677
if data == "" {
678
+ ctx .Logger ().V (3 ).Info ("Data string is empty" , "workspace_id" , metadata .WorkspaceUUID )
676
679
return
677
680
}
678
681
if metadata .FieldType == "" {
679
682
metadata .FieldType = metadata .Type
680
683
}
681
684
685
+ ctx .Logger ().V (3 ).Info ("Generating chunk and passing it to the channel" , "link" , metadata .Link )
682
686
chunksChan <- & sources.Chunk {
683
687
SourceType : s .Type (),
684
688
SourceName : s .name ,
0 commit comments