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 constant plandifferences in multi-line expressions #8

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

janakerman-form3
Copy link

@janakerman-form3 janakerman-form3 commented Dec 7, 2021

Relates to inuits#15

  • Fixes by standardising expressions before comparing state + local TF (surpressDifFunc) using promql packages
  • Adds test covering fix
  • Adds failing test showing that expression format changes are not applied
    • I'm not sure that this is the right approach as changes to alert rule formatting in the source TF will result in no plan.
      • Options:
        1. Use StateFunc to normalise API response (i.e remove the blank from the rule expression in the response) when saving to state. The consequences of this will be that a user plan will always show differences if they include blank lines in their expressions. ValidateFunc could be used to enforce that no newlines are present in alerts, but this doesn't feel quite right.
        2. Simply document that modifying the alert formatting will not result in a change.
        3. Investigate why Cortex adds a newline into multi-line alerts.

@janakerman-form3 janakerman-form3 marked this pull request as ready for review December 7, 2021 19:08
@janakerman-form3 janakerman-form3 marked this pull request as draft December 8, 2021 08:43
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