Skip to content

Commit

Permalink
Merge branch 'main' into feat-2538-refactor-builder-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rajesh-jonnalagadda authored Dec 11, 2024
2 parents 1f28476 + 6fde9f4 commit 3cd3878
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
14 changes: 12 additions & 2 deletions keep-ui/app/(keep)/alerts/alerts-rules-builder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,20 @@ export const AlertsRulesBuilder = ({
// check if the CEL is valid by comparing the parsed query with the original CEL
// remove spaces so that "a && b" is the same as "a&&b"
const celQuery = formatQuery(parsedCELRulesToQuery, "cel");
/*
SHAHAR: this is the old way of checking if the CEL is valid
I think its over complicated so let's just check if the query is "1 == 1" (which is parse error)
I'll leave the old code here for reference
const isValidCEL =
celQuery.replace(/\s+/g, "") === celRules.replace(/\s+/g, "") ||
celRules === "";
*/

// SHAHAR: new way of checking if the CEL is valid
const isValidCEL = celRules == "" || celQuery !== "1 == 1";
setIsValidCEL(isValidCEL);

// close the menu
setShowSuggestions(false);
if (isValidCEL) {
Expand Down Expand Up @@ -495,8 +505,8 @@ export const AlertsRulesBuilder = ({
operators: getOperators(id),
}))
: customFields
? customFields
: [];
? customFields
: [];

const onImportSQL = () => {
setImportSQLOpen(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export default function IncidentAlertMenu({ incidentId, alert }: Props) {
function onRemove() {
if (confirm("Are you sure you want to remove correlation?")) {
api
.delete(`/incidents/${incidentId}/alerts`, {
body: [alert.fingerprint],
})
.delete(`/incidents/${incidentId}/alerts`, [alert.fingerprint])
.then(() => {
toast.success("Alert removed from incident successfully", {
position: "top-right",
Expand Down
3 changes: 1 addition & 2 deletions keep/api/routes/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ def get_providers(
logger.info("Getting installed providers", extra={"tenant_id": tenant_id})
providers = ProvidersService.get_all_providers()
installed_providers = ProvidersService.get_installed_providers(tenant_id)
linked_providers = ProvidersService.get_linked_providers(tenant_id)
if PROVIDER_DISTRIBUTION_ENABLED:
linked_providers = ProvidersService.get_linked_providers(tenant_id)

# generate distribution only if not in read only mode
if READ_ONLY:
for provider in linked_providers + installed_providers:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "keep"
version = "0.31.4"
version = "0.31.6"
description = "Alerting. for developers, by developers."
authors = ["Keep Alerting LTD"]
packages = [{include = "keep"}]
Expand Down

0 comments on commit 3cd3878

Please sign in to comment.