Make add and remove endpoints accept workflow ids in addition to crawl ids#3228
Merged
Make add and remove endpoints accept workflow ids in addition to crawl ids#3228
Conversation
emma-sg
reviewed
Mar 17, 2026
backend/btrixcloud/colls.py
Outdated
Comment on lines
+1462
to
+1464
| for config_id in add_remove.crawlconfigIds: | ||
| for crawl_id in await colls.crawl_ops.get_config_crawl_ids(config_id): | ||
| crawl_ids.add(crawl_id) |
Member
There was a problem hiding this comment.
Any reason for this to only operate on one config id at a time, rather than a list? This could be a single db call rather than one for each workflow
Member
Author
There was a problem hiding this comment.
No good reason, certainly! Good call :)
216ac7c to
72b59c9
Compare
emma-sg
approved these changes
Mar 18, 2026
Member
emma-sg
left a comment
There was a problem hiding this comment.
Left one more note but I think this looks good overall
backend/btrixcloud/colls.py
Outdated
Comment on lines
+1462
to
+1465
| for crawl_id in await colls.crawl_ops.get_config_crawl_ids( | ||
| add_remove.crawlconfigIds | ||
| ): | ||
| crawl_ids.add(crawl_id) |
Member
There was a problem hiding this comment.
Very small nit but I believe this could be reduced to a single update call on the set as well:
Suggested change
| for crawl_id in await colls.crawl_ops.get_config_crawl_ids( | |
| add_remove.crawlconfigIds | |
| ): | |
| crawl_ids.add(crawl_id) | |
| crawl_ids.update(await colls.crawl_ops.get_config_crawl_ids( | |
| add_remove.crawlconfigIds | |
| )) |
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.
Fixes #3225
Modifies the existing collection
/addand/removeendpoints to accept a list of workflow ids in addition to crawl ids, and gracefully handles any overlap between the two.This will allow us to more easily add all of a workflow's crawls to a collection in the frontend.