Skip to content

test: define malformed condition parse errors - #27

Closed
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/invalid-condition-parse-errors
Closed

test: define malformed condition parse errors#27
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/invalid-condition-parse-errors

Conversation

@leoromanovsky

Copy link
Copy Markdown
Collaborator

Motivation

Malformed configured condition operands do not have complete canonical coverage, which allows downstream SDKs to disagree between DEFAULT and ERROR outcomes. This was surfaced while reviewing DataDog/dd-trace-py#19390.

Changes

  • Add isolated fixtures for GT with a string operand, ONE_OF with a scalar operand, and IS_NULL with a non-boolean operand.
  • Add catch-all traps so implementations cannot silently skip an invalid condition and continue evaluating the flag.
  • Keep a valid neighboring flag to verify that a malformed flag does not poison the full configuration.
  • Make PARSE_ERROR explicit for malformed condition operands and the existing invalid configured SemVer comparand.
  • Align the invalid-regex fixture with the same ERROR/PARSE_ERROR contract.
  • Document the optional canonical result.errorCode field.

Decisions

  • Treat malformed configured condition operands as per-flag parse errors.
  • Return the caller default with reason: ERROR and errorCode: PARSE_ERROR for the affected flag.
  • Preserve per-flag isolation so valid flags in the same configuration continue evaluating normally.
  • Intentionally change the recently added invalid-regex expectation from DEFAULT to ERROR so it matches system-test expectations and the other configured-condition parse failures.

Validation

  • python3 ci/validate-fixtures.py
  • git diff --check

Copy link
Copy Markdown
Collaborator Author

Superseded by #26, which now contains the combined malformed-flag isolation fixtures.

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.

1 participant