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

[FEATURE] Notification action validation #644

Closed
Angie-Zhang opened this issue Jan 5, 2023 · 0 comments
Closed

[FEATURE] Notification action validation #644

Angie-Zhang opened this issue Jan 5, 2023 · 0 comments
Assignees
Labels

Comments

@Angie-Zhang
Copy link
Contributor

Angie-Zhang commented Jan 5, 2023

Clarify Notification action validation conditions and implement it.

Meta Feature
#587

We have 2 levels of notification: policy level and action level.

Policy Level:

"policy": {
     ......
     "error_notification": {
         "destination": {
             "slack": {
                 "url": "https://hooks.slack.com/services/xxx/xxxxxx"
             }
         },
         "message_template": {
             "source": "the index is {{ctx.index}}",
             "lang": "mustache"
         }
    }
  ......
}

Action Level:

{
    ......
        "states": [
            {
                "name": "dead_notification",
                "actions": [
                    {
                        "retry": {
                            "count": 3,
                            "backoff": "exponential",
                            "delay": "1m"
                        },
                        "notification": {
                            "channel": {
                                "id": "NYXbx4UBlNI_fIOWo8Xm"
                            },
                            "message_template": {
                                "source": "the index {{ctx.index}} has been deleted.",
                                "lang": "mustache"
                            }
                        }
                    }
                ],
                "transitions": []
            }
        ],
        ......
    }
}

Error Prevention only validates notification at action level.

Validation Conditions
ISM sending notifications depends on Notification plugin. For each request to notification plugin, it checks the response.
The Notification action errors can only be prevent when configuring notification channels.
Thus ISM Error Prevention does not validate notification action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant