-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement crawl session management with CRUD operations #14
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
53cc9e0
feat: implement crawl session management with CRUD operations
Karim-Agami 8c47410
feat: add crawler worker
YoussefMehany 22952dc
refactor: put type in types folder
YoussefMehany a5cd5e0
feat: add mapper file for crawler and use it
YoussefMehany 5a50754
refactor: remove the crawler worker and move it to crawler repository
YoussefMehany 527edfd
feat: modify the schema according to contracts and smoke test
YoussefMehany File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| DO $$ BEGIN | ||
| IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'CrawlStatus') THEN | ||
| CREATE TYPE "CrawlStatus" AS ENUM ( | ||
| 'UNSPECIFIED', | ||
| 'QUEUED', | ||
| 'RUNNING', | ||
| 'COMPLETED', | ||
| 'FAILED', | ||
| 'ABORTED', | ||
| 'PAUSED', | ||
| 'NEW' | ||
| ); | ||
| END IF; | ||
| END $$; | ||
|
|
||
| DO $$ BEGIN | ||
| IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'CrawlTriggerType') THEN | ||
| CREATE TYPE "CrawlTriggerType" AS ENUM ( | ||
| 'UNSPECIFIED', | ||
| 'MANUAL', | ||
| 'SCHEDULED', | ||
| 'CI_TRIGGER', | ||
| 'WEBHOOK' | ||
| ); | ||
| END IF; | ||
| END $$; | ||
|
|
||
| CREATE TABLE IF NOT EXISTS "crawl_sessions" ( | ||
| "crawl_session_id" UUID NOT NULL, | ||
| "app_version_id" UUID NOT NULL, | ||
| "status" "CrawlStatus" NOT NULL DEFAULT 'NEW', | ||
| "trigger_type" "CrawlTriggerType" NOT NULL, | ||
| "config" JSONB NOT NULL, | ||
| "state_count" INTEGER NOT NULL DEFAULT 0, | ||
| "transition_count" INTEGER NOT NULL DEFAULT 0, | ||
| "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
| "started_at" TIMESTAMP(3), | ||
| "finished_at" TIMESTAMP(3), | ||
| "error" TEXT, | ||
| CONSTRAINT "crawl_sessions_pkey" PRIMARY KEY ("crawl_session_id") | ||
| ); | ||
|
|
||
| ALTER TABLE "crawl_sessions" | ||
| ADD CONSTRAINT "crawl_sessions_app_version_id_fkey" | ||
| FOREIGN KEY ("app_version_id") | ||
| REFERENCES "target_application_versions"("id") | ||
| ON DELETE CASCADE ON UPDATE CASCADE; |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.