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

newrelic_workflow issue filter attribute priority accepts invalid value EXACTLY_MATCHES #2358

Open
brendan-intellum opened this issue May 2, 2023 · 1 comment
Labels
enhancement New feature or request group-workflows

Comments

@brendan-intellum
Copy link

Terraform Version

Terraform v1.1.3
on darwin_arm64

Affected Resource(s)

  • newrelic_workflow

Terraform Configuration

resource "newrelic_workflow" "default" {
  name                  = "${local.capitalized_name} Default"
  muting_rules_handling = "DONT_NOTIFY_FULLY_MUTED_ISSUES"

  issues_filter {
    name = "default"
    type = "FILTER"

    predicate {
      attribute = "accumulations.tag.label.Some"
      operator  = "CONTAINS"
      values    = ["${local.some}"]
    }
    predicate {
      attribute = "accumulations.tag.label.Other"
      operator  = "CONTAINS"
      values    = ["${var.other}"]
    }
    predicate {
      attribute = "accumulations.tag.label.Predicate"
      operator  = "CONTAINS"
      values    = ["${var.predicate}"]
    }
    predicate {
      attribute = "accumulations.tag.policyId"
      operator  = "EXACTLY_MATCHES"
      values    = ["redacted", "redacted", "redacted", "redacted", "redacted", "redacted", "redacted"]
    }
    predicate {
      attribute = "priority"
      operator  = "EXACTLY_MATCHES"
      values    = ["CRITICAL"]
    }
  }

  destination {
    channel_id = newrelic_notification_channel.default.id
  }
}

Actual Behavior

When I apply the above a workflow is created. The predicate

    predicate {
      attribute = "priority"
      operator  = "EXACTLY_MATCHES"
      values    = ["CRITICAL"]
    }
  }

is created and can be seen configured as so in the UI. However when I test this workflow I get an error. After some digging I found that EXACTLY_MATCHES is not a valid input for a predicate with the attribute priority. Changing the value to EQUAL works as expected.

Expected Behavior

I dunno, throw an error I guess?

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply
  2. Go to the New Relic UI for the created workflow.
  3. Click "test workflow"
  4. Observe that the test says it does not match any previous issues
  5. Change the priority filter from EXACTLY_MATCHES to EQUAL.
  6. Click "test workflow"
  7. Observe that it works.
@IliaShurygin IliaShurygin added the enhancement New feature or request label May 3, 2023
@IliaShurygin
Copy link
Collaborator

Hi!
Currently, we only (partially) validate names of the matched fields and not operators or values.
That being said, it makes a lot of sense to start validating them, we will add this to our backlog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request group-workflows
Projects
None yet
Development

No branches or pull requests

3 participants