Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate postman folder from request when at collection root #3912

Merged
merged 8 commits into from
Feb 14, 2025

Conversation

casey-tran
Copy link
Contributor

@casey-tran casey-tran commented Feb 13, 2025

Description:

When Postman items (mainly requests) did not have a parent folder and were at the root of a collection, the folder id/name would be the same as the request id/name. This change helps to keep track of the parent folder through the recursive calls and gives the folder ID of the last folder that the call went through.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@casey-tran casey-tran requested a review from joeleonjr February 14, 2025 00:47
@casey-tran casey-tran marked this pull request as ready for review February 14, 2025 00:47
@casey-tran casey-tran requested review from a team as code owners February 14, 2025 00:47
@@ -350,17 +350,23 @@ func (s *Source) scanItem(ctx context.Context, chunksChan chan *sources.Chunk, c
if item.UID != "" {
metadata.FullID = item.UID
metadata.Link = LINK_BASE_URL + FOLDER_TYPE + "/" + metadata.FullID
metadata.FolderID = item.UID
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is to handle the cases where the item that is going to be scanned is a folder itself that contains an auth or script. In that case, we want the FolderID to be of the target instead of the parent.

}

metadata.FolderID = item.UID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per convo, i think a comment here explaining all this parent folder ID business would be helpful

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

@rosecodym rosecodym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great, thanks!

@casey-tran casey-tran merged commit d50cafe into main Feb 14, 2025
13 checks passed
@casey-tran casey-tran deleted the differentiate-postman-folder-id branch February 14, 2025 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants