Skip to content

Conversation

@ikreymer
Copy link
Member

@ikreymer ikreymer commented Mar 1, 2023

  • crawlconfig PATCH /{id} can now receive a new JSON config to replace the old one (in addition to scale, schedule, tags)
  • exclusions: add / remove APIs mutate the current crawlconfig, do not result in a new crawlconfig created
  • k8s: crawlconfig json is updated along with scale
  • k8s: stateful set is restarted by updating annotation, instead of changing template
  • crawl object: now has 'config', as well as 'profileid', 'schedule', and 'crawlTimeout' properties to ensure anything that is changeable is stored on the crawl
  • crawlconfig object: remove 'oldId', 'newId', disallow deactivating/deleting while crawl is running

Still do:
This change will require a DB migration, to remove crawlconfig props, and populate new props on the crawl

@ikreymer ikreymer requested a review from tw4l March 2, 2023 01:16
Copy link
Member

@tw4l tw4l left a comment

Choose a reason for hiding this comment

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

Haven't had a chance to test yet, but the code looks good! Left one small comment about a docstring that could be updated

@tw4l tw4l force-pushed the mutable-crawlconfig branch 3 times, most recently from 130195e to 84f8c26 Compare March 3, 2023 02:42
@tw4l
Copy link
Member

tw4l commented Mar 3, 2023

I tested the migration manually by creating some crawls and crawl configs on version 0002 of the database, then upgrading via helm and testing that all looked good after the migration.

@tw4l tw4l force-pushed the mutable-crawlconfig branch from e946aa5 to 1974d70 Compare March 3, 2023 21:52
@tw4l tw4l marked this pull request as ready for review March 3, 2023 21:59
@tw4l
Copy link
Member

tw4l commented Mar 3, 2023

@ikreymer I've now tested migrations from an empty slate and from existing 0002 data and all is looking good in terms of being able to re-run configs after migration and create new configs/crawls. API returns what I'd expect as well.

@tw4l tw4l force-pushed the mutable-crawlconfig branch from 1318b33 to 85fb4e0 Compare March 3, 2023 23:12
@SuaYoo SuaYoo force-pushed the mutable-crawlconfig branch from 61caf2f to 42d64d5 Compare March 7, 2023 01:34
@SuaYoo SuaYoo force-pushed the mutable-crawlconfig branch 2 times, most recently from b02ee68 to 5603d41 Compare March 8, 2023 00:05
ikreymer and others added 12 commits March 7, 2023 19:14
- crawlconfig PATCH /{id} can now receive a new JSON config to replace the old one (in addition to scale, schedule, tags)
- exclusions: add / remove APIs mutate the current crawlconfig, do not result in a new crawlconfig created
- k8s: crawlconfig json is updated along with scale
- k8s: stateful set is restarted by updating annotation, instead of changing template
- crawl object: now has 'config', as well as 'profileid', 'schedule', and 'crawlTimeout' properties to ensure anything that is changeable
is stored on the crawl
- crawlconfig object: remove 'oldId', 'newId', disallow deactivating/deleting while crawl is running
- store each revision separate mongo db collection
- revisions accessible via /crawlconfigs/{cid}/revs
- update 'userid' on each crawlconfig modification, use 'modified' for modification date, 'useridCreated' for initial creation user
- store 'rev' int in crawlconfig and in crawljob
- backwards compatibility: add_crawl_config calls update_crawl_config and returns same id if oldId provided
…tadata (tags, name)

tests: add tests for updating config, revision history api
…ed/removed, unify add/remove exclusions on crawl

remove unused 'completions' field
@SuaYoo SuaYoo force-pushed the mutable-crawlconfig branch from b543d3c to d3178b5 Compare March 8, 2023 03:14
SuaYoo and others added 3 commits March 7, 2023 19:35
- update profiles: update PROFILE_FILENAME in configmap is profileid provided, clear if ""
- return 'settings_changed' and 'metadata_changed' if either crawl settings or metadata changed
- return if neither is true
- update tests to check settigns/metadata changed return values
@ikreymer ikreymer merged commit 544346d into main Mar 8, 2023
@ikreymer ikreymer mentioned this pull request Mar 8, 2023
@Shrinks99 Shrinks99 deleted the mutable-crawlconfig branch March 17, 2023 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants