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

fix: deletion logic for transformed checks #1143

Merged
merged 8 commits into from
Jul 18, 2023

Conversation

@yashmehrotra yashmehrotra force-pushed the fix-deletion-logic-for-transformed-checks branch 2 times, most recently from 8183a8f to ca2ba2b Compare July 12, 2023 10:44
pkg/db/canary.go Outdated Show resolved Hide resolved
@yashmehrotra yashmehrotra force-pushed the fix-deletion-logic-for-transformed-checks branch 2 times, most recently from cb25ffc to f3d067e Compare July 17, 2023 07:27
pkg/db/canary.go Outdated
if !utils.Contains(models.CheckHealthStatuses, status) {
return fmt.Errorf("invalid check health status: %s", status)
}
updates["status"] = status
}
return Gorm.Table("checks").
Copy link
Member

Choose a reason for hiding this comment

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

I think we want to insert a new check rather than update the old checks

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean check_status ?
Ie. Insert new check status and mark the existing check as deleted ?

for _, checkID := range checksToRemove {
strategy := checkIDDeleteStrategyMap[checkID]
var status string
if strategy == "MarkHealthy" {
Copy link
Member

Choose a reason for hiding this comment

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

Can we use Constants ?
I think ignore should be the default strategy - i.e. do not insert or update anything, just mark as deleted.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍🏽

@yashmehrotra yashmehrotra force-pushed the fix-deletion-logic-for-transformed-checks branch from 85d3161 to e46566c Compare July 18, 2023 15:35
@moshloop moshloop merged commit 23a2a70 into master Jul 18, 2023
8 checks passed
@yashmehrotra yashmehrotra deleted the fix-deletion-logic-for-transformed-checks branch July 19, 2023 03:44
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.

2 participants