Skip to content

Commit 9672d44

Browse files
localstack-spiral[bot]spiralhovaesco
authored
LAV-4374: Complete OR ALTER ALERT property resets and preserve tags (#4638)
Update the existing alert row's CONFIG, RUNBOOK and failure threshold during OR ALTER, including omission and accepted NULL/empty reset forms. Share the existing ALTER CONFIG validation with the OR ALTER consumer and reject typed property errors before any target mutation. Retain tags and the existing metadata projections, including empty threshold-filtered SHOW PARAMETERS. Capture 96 new cases serially against Cloud: 89 Standard property/consumer cases and seven Enterprise tag cases. Assert explicit definitions, reset definitions, exact errors and subsequent target state. Reuse the prerequisite CONFIG, RUNBOOK, threshold, ALTER TAG and core OR ALTER regression matrices. Verification: - The initial existing-target all-explicit test exposed retained old properties. - make check passed. - Focused make test-compat replay: 226 passed, including all 96 new cases. - make test-vendored-sqlparser passed. - No existing snapshot or compat test was changed. Co-authored-by: Przemek Denkiewicz <przemyslaw.denkiewicz@localstack.cloud> ## Deviations Cloud renders an explicitly assigned threshold 10, unlike the prerequisite renderer, and omits zero/reset values. Corrected the shared CREATE/UNSET producers' hardcoded default from 10 to 0 and GET_DDL to render every nonzero threshold. This fixes the representation used by OR ALTER without adding a store schema/migration or changing the scheduler's failure-handling algorithm. The new mixed-tag/body snapshot also shows Cloud strips a trailing action comment. Bounded raw CREATE ALERT action extraction at the last significant token instead of the end of the SQL string; retained the actual body text, embedded literals, identifiers and interior SQL unchanged. ## Test matrix CONFIG execution consumer[-absent] x success / metadata and exact executed configuration -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_config_consumer[-absent] CONFIG execution consumer[-existing] x success / metadata and exact executed configuration -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_config_consumer[-existing] CONFIG execution consumer[CONFIG='{"new":true}'-absent] x success / metadata and exact executed configuration -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_config_consumer[CONFIG='{"new":true}'-absent] CONFIG execution consumer[CONFIG='{"new":true}'-existing] x success / metadata and exact executed configuration -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_config_consumer[CONFIG='{"new":true}'-existing] CONFIG execution consumer[CONFIG='{}'-absent] x success / metadata and exact executed configuration -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_config_consumer[CONFIG='{}'-absent] CONFIG execution consumer[CONFIG='{}'-existing] x success / metadata and exact executed configuration -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_config_consumer[CONFIG='{}'-existing] Multiple cross-schema/quoted tags + clause-scoped body x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_multiple_tags OR ALTER properties[all-explicit-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[all-explicit-absent] OR ALTER properties[all-explicit-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[all-explicit-existing] OR ALTER properties[config-array-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-array-absent] OR ALTER properties[config-array-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-array-existing] OR ALTER properties[config-dollar-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-dollar-absent] OR ALTER properties[config-dollar-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-dollar-existing] OR ALTER properties[config-empty-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-empty-absent] OR ALTER properties[config-empty-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-empty-existing] OR ALTER properties[config-empty-object-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-empty-object-absent] OR ALTER properties[config-empty-object-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-empty-object-existing] OR ALTER properties[config-escaped-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-escaped-absent] OR ALTER properties[config-escaped-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-escaped-existing] OR ALTER properties[config-invalid-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-invalid-absent] OR ALTER properties[config-invalid-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-invalid-existing] OR ALTER properties[config-json-null-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-json-null-absent] OR ALTER properties[config-json-null-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-json-null-existing] OR ALTER properties[config-null-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-null-absent] OR ALTER properties[config-null-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-null-existing] OR ALTER properties[config-number-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-number-absent] OR ALTER properties[config-number-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-number-existing] OR ALTER properties[config-tagged-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-tagged-absent] OR ALTER properties[config-tagged-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[config-tagged-existing] OR ALTER properties[depth-config-boolean-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-config-boolean-absent] OR ALTER properties[depth-config-boolean-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-config-boolean-existing] OR ALTER properties[depth-config-negative-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-config-negative-absent] OR ALTER properties[depth-config-negative-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-config-negative-existing] OR ALTER properties[depth-threshold-boolean-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-boolean-absent] OR ALTER properties[depth-threshold-boolean-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-boolean-existing] OR ALTER properties[depth-threshold-minimum-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-minimum-absent] OR ALTER properties[depth-threshold-minimum-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-minimum-existing] OR ALTER properties[depth-threshold-negative-fraction-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-negative-fraction-absent] OR ALTER properties[depth-threshold-negative-fraction-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-negative-fraction-existing] OR ALTER properties[depth-threshold-negative-zero-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-negative-zero-absent] OR ALTER properties[depth-threshold-negative-zero-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-negative-zero-existing] OR ALTER properties[depth-threshold-plus-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-plus-absent] OR ALTER properties[depth-threshold-plus-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-plus-existing] OR ALTER properties[depth-threshold-underflow-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-underflow-absent] OR ALTER properties[depth-threshold-underflow-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[depth-threshold-underflow-existing] OR ALTER properties[omitted-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[omitted-absent] OR ALTER properties[omitted-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[omitted-existing] OR ALTER properties[runbook-backslash-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-backslash-absent] OR ALTER properties[runbook-backslash-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-backslash-existing] OR ALTER properties[runbook-dollar-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-dollar-absent] OR ALTER properties[runbook-dollar-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-dollar-existing] OR ALTER properties[runbook-empty-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-empty-absent] OR ALTER properties[runbook-empty-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-empty-existing] OR ALTER properties[runbook-escaped-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-escaped-absent] OR ALTER properties[runbook-escaped-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-escaped-existing] OR ALTER properties[runbook-maximum-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-maximum-absent] OR ALTER properties[runbook-maximum-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-maximum-existing] OR ALTER properties[runbook-null-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-null-absent] OR ALTER properties[runbook-null-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-null-existing] OR ALTER properties[runbook-number-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-number-absent] OR ALTER properties[runbook-number-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-number-existing] OR ALTER properties[runbook-quoted-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-quoted-absent] OR ALTER properties[runbook-quoted-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-quoted-existing] OR ALTER properties[runbook-tagged-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-tagged-absent] OR ALTER properties[runbook-tagged-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-tagged-existing] OR ALTER properties[runbook-too-long-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-too-long-absent] OR ALTER properties[runbook-too-long-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-too-long-existing] OR ALTER properties[runbook-unicode-maximum-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-unicode-maximum-absent] OR ALTER properties[runbook-unicode-maximum-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-unicode-maximum-existing] OR ALTER properties[runbook-url-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-url-absent] OR ALTER properties[runbook-url-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[runbook-url-existing] OR ALTER properties[threshold-decimal-integer-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-decimal-integer-absent] OR ALTER properties[threshold-decimal-integer-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-decimal-integer-existing] OR ALTER properties[threshold-default-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-default-absent] OR ALTER properties[threshold-default-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-default-existing] OR ALTER properties[threshold-fraction-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-fraction-absent] OR ALTER properties[threshold-fraction-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-fraction-existing] OR ALTER properties[threshold-maximum-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-maximum-absent] OR ALTER properties[threshold-maximum-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-maximum-existing] OR ALTER properties[threshold-negative-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-negative-absent] OR ALTER properties[threshold-negative-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-negative-existing] OR ALTER properties[threshold-null-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-null-absent] OR ALTER properties[threshold-null-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-null-existing] OR ALTER properties[threshold-overflow-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-overflow-absent] OR ALTER properties[threshold-overflow-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-overflow-existing] OR ALTER properties[threshold-string-absent] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-string-absent] OR ALTER properties[threshold-string-existing] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-string-existing] OR ALTER properties[threshold-zero-absent] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-zero-absent] OR ALTER properties[threshold-zero-existing] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_properties[threshold-zero-existing] OR ALTER tags[absent-None] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_tags[absent-None] OR ALTER tags[absent-TAG] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_tags[absent-TAG] OR ALTER tags[absent-WITH TAG] x error / SHOW confirms no target created -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_tags[absent-WITH TAG] OR ALTER tags[existing-None] x success / SHOW, DESCRIBE, GET_DDL and empty threshold parameters -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_tags[existing-None] OR ALTER tags[existing-TAG] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_tags[existing-TAG] OR ALTER tags[existing-WITH TAG] x error / original definition and tags unchanged -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_tags[existing-WITH TAG] CREATE omitted threshold / default omitted from GET_DDL -> tests/queries/test_create_or_alter_alert_properties.py::test_alert_threshold_default_ddl CREATE explicit threshold 10 / GET_DDL renders 10 -> tests/queries/test_create_or_alter_alert_properties.py::test_alert_threshold_default_ddl ALTER explicit threshold 10 / GET_DDL renders 10 -> tests/queries/test_create_or_alter_alert_properties.py::test_alert_threshold_default_ddl ALTER UNSET threshold / default omitted from GET_DDL -> tests/queries/test_create_or_alter_alert_properties.py::test_alert_threshold_default_ddl Quoted tag identifier + cross-schema assignments / preservation -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_multiple_tags Body property-like strings and CTE equality expressions / no property false matches -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_multiple_tags Trailing block comment / Cloud-compatible action readback -> tests/queries/test_create_or_alter_alert_properties.py::test_or_alter_alert_multiple_tags Ordinary CREATE/REPLACE CONFIG omitted, empty object and quoted nested object / metadata and execution regressions -> tests/queries/test_alerts.py::test_create_alert_config CONFIG IF NOT EXISTS, UNSET and recreation / lifecycle regressions -> tests/queries/test_alerts.py::test_create_alert_config_lifecycle ALTER CONFIG explicit assignment / execution consumer regression -> tests/queries/test_alerts.py::test_get_alert_config_returns_set_value ALTER multi-property CONFIG/RUNBOOK assignment / readback regression -> tests/queries/test_alerts.py::test_alter_alert_set_properties RUNBOOK omitted, NULL, empty, quoted, dollar, backslash, ASCII/unicode maximum / ordinary CREATE and REPLACE regressions -> tests/queries/test_alert_runbook.py::test_create_alert_runbook RUNBOOK overlength and numeric / error and target-state regressions -> tests/queries/test_alert_runbook.py::test_create_alert_runbook_failure RUNBOOK lifecycle and GET_DDL replay / multiline and backslash regressions -> tests/queries/test_alert_runbook.py::test_alert_runbook_lifecycle_and_ddl_replay RUNBOOK history consumer / execution regression -> tests/queries/test_alert_runbook.py::test_create_alert_runbook_history Threshold positive assignment and UNSET / GET_DDL regression -> tests/queries/test_alerts.py::test_alter_alert_set_suspend_after_get_ddl Threshold CREATE 3, ALTER 5 and UNSET / empty threshold parameters and GET_DDL regression -> tests/queries/test_alerts.py::test_alert_failure_threshold_visibility Threshold zero CREATE/ALTER x manual condition/action failures / no auto-suspension regression -> tests/queries/test_alerts.py::test_alert_zero_failure_threshold Threshold zero x scheduled condition/action failures / no auto-suspension regression -> tests/queries/test_alerts.py::test_scheduled_alert_zero_failure_threshold Positive threshold x manual condition failure / suspension regression -> tests/queries/test_alerts.py::test_execute_alert_auto_suspends_on_condition_failure Positive threshold x manual action failure / suspension regression -> tests/queries/test_alerts.py::test_execute_alert_auto_suspends_on_action_failure Positive threshold x false condition / failure counter reset regression -> tests/queries/test_alerts.py::test_execute_alert_condition_false_resets_failure_counter ALTER TAG SET/UNSET / exact assignment consumer regression -> tests/queries/test_alerts.py::test_alter_alert_set_unset_tag ALTER TAG lists x suspended/started target / multi-assignment regression -> tests/queries/test_alerts.py::test_alter_alert_tag_lists Core OR ALTER lifecycle, ownership, warehouse/schedule/comment and verbatim body / prerequisite matrix regressions -> tests/queries/test_create_or_alter_alert.py Alert literals / prerequisite lexical-form regressions -> tests/queries/test_alert_literals.py Co-authored-by: spiral <spiral@localhost> Co-authored-by: Przemek Denkiewicz <przemyslaw.denkiewicz@localstack.cloud>
1 parent a472174 commit 9672d44

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

‎src/parser/mod.rs‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6532,10 +6532,24 @@ impl<'a> Parser<'a> {
65326532
comment = Some(self.parse_literal_string()?);
65336533
} else if self.parse_keyword(Keyword::CONFIG) {
65346534
self.expect_token(&Token::Eq)?;
6535-
config = Some(self.parse_literal_string()?);
6535+
config = if self.parse_keyword(Keyword::NULL) {
6536+
None
6537+
} else {
6538+
Some(self.parse_literal_string()?)
6539+
};
65366540
} else if self.parse_keyword(Keyword::SUSPEND_ALERT_AFTER_NUM_FAILURES) {
65376541
self.expect_token(&Token::Eq)?;
6538-
suspend_after_num_failures = Some(self.parse_literal_uint()?);
6542+
suspend_after_num_failures = if self.parse_keyword(Keyword::NULL) {
6543+
None
6544+
} else {
6545+
if or_alter
6546+
&& self.peek_token().token == Token::Minus
6547+
&& matches!(self.peek_nth_token(1).token, Token::Number(number, _) if number.parse::<u64>() == Ok(0))
6548+
{
6549+
self.next_token();
6550+
}
6551+
Some(self.parse_literal_uint()?)
6552+
};
65396553
} else if self.parse_keyword(Keyword::RUNBOOK) {
65406554
self.expect_token(&Token::Eq)?;
65416555
runbook = Some(self.parse_value()?);

0 commit comments

Comments
 (0)