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

Alerting: Fix export of notification policy to JSON #78021

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

rvillablanca
Copy link
Contributor

@rvillablanca rvillablanca commented Nov 11, 2023

What is this feature?

It exports correctly a Notification Policy in json format, so that it can be provisioned correctly.

Why do we need this feature?

Because currently it is not possible to export the default Notification Policy and then provision it in json file format, this due to the Policy fields are not inlined, unlike the yaml format.

Who is this feature for?

Any Grafana user I guess

Which issue(s) does this PR fix?:

Fixes #78020

Before this PR

The JSON version includes the Policy attribute which is not included in the Yaml version.

Exported Notification Policy - Json

image

Exported Notification Policy - Yaml

image

With this PR

The JSON verion now inlines the fields correctly

image

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

The JSON version of an exported Notification Policy now
inline correctly the policy in the same way the Yaml version
does.
@rvillablanca rvillablanca requested a review from a team as a code owner November 11, 2023 18:47
@rvillablanca rvillablanca requested review from rwwiv, JacobsonMT, yuri-tceretian and grobinson-grafana and removed request for a team November 11, 2023 18:47
@CLAassistant
Copy link

CLAassistant commented Nov 11, 2023

CLA assistant check
All committers have signed the CLA.

@grafana-pr-automation grafana-pr-automation bot added area/backend pr/external This PR is from external contributor labels Nov 11, 2023
@tonypowa tonypowa added the area/alerting Grafana Alerting label Nov 24, 2023
Copy link
Contributor

@yuri-tceretian yuri-tceretian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for fixing!

@yuri-tceretian yuri-tceretian added this to the 10.3.x milestone Nov 30, 2023
@yuri-tceretian yuri-tceretian changed the title Export Notification Policy correctly (#78020) Alerting: Fix export of notification policy to JSON Nov 30, 2023
@yuri-tceretian yuri-tceretian merged commit ab83bc7 into grafana:main Dec 4, 2023
11 checks passed
@rvillablanca rvillablanca deleted the inline-policy-export branch December 6, 2023 15:26
@aangelisc aangelisc modified the milestones: 10.3.x, 10.2.3 Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add to changelog area/alerting Grafana Alerting area/backend no-backport Skip backport of PR pr/external This PR is from external contributor
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Alerting: Unable to import Notification policies from json file.
5 participants