Add Scrape History #15

Merged
SoXX merged 8 commits from dev/scrape-history into main 2024-10-15 10:46:41 +00:00
Owner
No description provided.
SoXX added 2 commits 2024-10-15 09:24:51 +00:00
- added migration
feat(database): added model
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m4s
4312cbdff5
- added model
- added test for model
SoXX added 2 commits 2024-10-15 10:25:49 +00:00
- added Create
- added Get
- added Update
- added Delete
feat(database): added tests
Some checks failed
Gitea Build Check / Build (pull_request) Failing after 3m0s
a6d95067fe
- added Create
- added Get
- added Update
- added Delete
SoXX requested review from Alphyron 2024-10-15 10:26:05 +00:00
SoXX changed title from WIP: Add Scrape History to Add Scrape History 2024-10-15 10:27:54 +00:00
SoXX added 1 commit 2024-10-15 10:28:58 +00:00
fix(database): migration
Some checks failed
Gitea Build Check / Build (pull_request) Failing after 2m54s
59f404883e
- primary key is now first in position
Alphyron requested changes 2024-10-15 10:32:24 +00:00
Dismissed
@ -0,0 +32,4 @@
return models.ScrapeHistory{}, utils.HandleError(ctx, span, localLogger, &otterError.Database{Reason: otterError.DatabaseIsNotConnected})
}
result := client.WithContext(ctx).Create(&scrapeHistory)
Owner

keine ID validierung / verifizierung?

keine ID validierung / verifizierung?
Alphyron marked this conversation as resolved
@ -0,0 +68,4 @@
return models.ScrapeHistory{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.ScrapeTaskIDIsEmpty})
}
result := client.WithContext(ctx).First(&post, "scrape_task_id = ?", id)
Owner

ID wrong length check is missing

ID wrong length check is missing
Alphyron marked this conversation as resolved
@ -0,0 +107,4 @@
if len(scrapeHistory.ScrapeTaskID) == 0 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.ScrapeTaskIDIsEmpty})
}
Owner

ID wrong length check is missing

ID wrong length check is missing
Alphyron marked this conversation as resolved
@ -0,0 +152,4 @@
if len(id) == 0 {
return utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.ScrapeTaskIDIsEmpty})
}
Owner

ID wrong length check is missing

ID wrong length check is missing
Alphyron marked this conversation as resolved
SoXX added 1 commit 2024-10-15 10:37:05 +00:00
feat(database): validation
Some checks failed
Gitea Build Check / Build (pull_request) Failing after 3m0s
f70879cf8d
- added more validation for IDsi
SoXX added 1 commit 2024-10-15 10:41:09 +00:00
feat(database): tests
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m18s
0f1e6c6aaa
- now the test against 25 char id length
Alphyron requested changes 2024-10-15 10:43:12 +00:00
Dismissed
@ -0,0 +39,4 @@
if len(scrapeHistory.ScrapeTaskID) != 25 {
return models.ScrapeHistory{}, utils.HandleError(ctx, span, localLogger, &otterError.EntityValidationFailed{Reason: otterError.ScrapeTaskIDIsWrongLength})
}
Owner

UserSourceID validation is missing

UserSourceID validation is missing
Alphyron marked this conversation as resolved
SoXX added 1 commit 2024-10-15 10:45:56 +00:00
feat(database): validation
All checks were successful
Gitea Build Check / Build (pull_request) Successful in 3m21s
Gitea Build Check / Build (push) Successful in 3m20s
ef31399ab6
- check for user source
Alphyron approved these changes 2024-10-15 10:46:17 +00:00
SoXX merged commit ef31399ab6 into main 2024-10-15 10:46:41 +00:00
SoXX deleted branch dev/scrape-history 2024-10-15 10:46:41 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Anthrove/otter-space-sdk#15
No description provided.