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: Add two sets of provisioning actions for rules and notifications #87149
Conversation
Hello @yuri-tceretian!
Please, if the current pull request addresses a bug fix, label it with the |
Hello @yuri-tceretian!
Please, if the current pull request addresses a bug fix, label it with the |
2 similar comments
Hello @yuri-tceretian!
Please, if the current pull request addresses a bug fix, label it with the |
Hello @yuri-tceretian!
Please, if the current pull request addresses a bug fix, label it with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Approved for backport |
This PR must be merged before a backport PR will be created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-87149-to-v10.2.x origin/v10.2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 356a29592be6c5fe5de81138f6a55e03a8cdfac2 When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-87149-to-v10.2.x
# Create the PR body template
PR_BODY=$(gh pr view 87149 --json body --template 'Backport 356a29592be6c5fe5de81138f6a55e03a8cdfac2 from #87149{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.2.x] Alerting: Add two sets of provisioning actions for rules and notifications " --body-file - --label "area/alerting" --label "area/backend" --label "add to changelog" --label "area/auth/rbac" --label "product-approved" --label "backport" --base v10.2.x --milestone 10.2.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-87149-to-v10.2.x
# Create a pull request where the `base` branch is `v10.2.x` and the `compare`/`head` branch is `backport-87149-to-v10.2.x`.
# Remove the local backport branch
git switch main
git branch -D backport-87149-to-v10.2.x |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-87149-to-v10.3.x origin/v10.3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 356a29592be6c5fe5de81138f6a55e03a8cdfac2 When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-87149-to-v10.3.x
# Create the PR body template
PR_BODY=$(gh pr view 87149 --json body --template 'Backport 356a29592be6c5fe5de81138f6a55e03a8cdfac2 from #87149{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.3.x] Alerting: Add two sets of provisioning actions for rules and notifications " --body-file - --label "area/alerting" --label "area/backend" --label "add to changelog" --label "area/auth/rbac" --label "product-approved" --label "backport" --base v10.3.x --milestone 10.3.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-87149-to-v10.3.x
# Create a pull request where the `base` branch is `v10.3.x` and the `compare`/`head` branch is `backport-87149-to-v10.3.x`.
# Remove the local backport branch
git switch main
git branch -D backport-87149-to-v10.3.x |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-87149-to-v10.4.x origin/v10.4.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 356a29592be6c5fe5de81138f6a55e03a8cdfac2 When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-87149-to-v10.4.x
# Create the PR body template
PR_BODY=$(gh pr view 87149 --json body --template 'Backport 356a29592be6c5fe5de81138f6a55e03a8cdfac2 from #87149{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v10.4.x] Alerting: Add two sets of provisioning actions for rules and notifications " --body-file - --label "area/alerting" --label "area/backend" --label "add to changelog" --label "area/auth/rbac" --label "product-approved" --label "backport" --base v10.4.x --milestone 10.4.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-87149-to-v10.4.x
# Create a pull request where the `base` branch is `v10.4.x` and the `compare`/`head` branch is `backport-87149-to-v10.4.x`.
# Remove the local backport branch
git switch main
git branch -D backport-87149-to-v10.4.x |
…d notifications (#87664) Alerting: Add two sets of provisioning actions for rules and notifications (#87149) (cherry picked from commit 356a295) # Conflicts: # pkg/services/accesscontrol/models.go # pkg/services/ngalert/accesscontrol.go # pkg/services/ngalert/api/authorization.go # pkg/services/ngalert/provisioning/accesscontrol.go # pkg/services/ngalert/provisioning/accesscontrol_test.go
…d notifications (#87665) Alerting: Add two sets of provisioning actions for rules and notifications (#87149) (cherry picked from commit 356a295) # Conflicts: # pkg/services/accesscontrol/models.go # pkg/services/ngalert/accesscontrol.go # pkg/services/ngalert/api/authorization.go # pkg/services/ngalert/provisioning/accesscontrol.go # pkg/services/ngalert/provisioning/accesscontrol_test.go
…d notifications (#87666) Alerting: Add two sets of provisioning actions for rules and notifications (#87149) (cherry picked from commit 356a295) # Conflicts: # pkg/services/accesscontrol/models.go # pkg/services/ngalert/accesscontrol.go # pkg/services/ngalert/api/authorization.go # pkg/services/ngalert/provisioning/accesscontrol.go # pkg/services/ngalert/provisioning/accesscontrol_test.go
What is this feature?
This PR adds two new sets of permissions that let administrators create custom roles to grant access to provisioning alert rules and notification configurations separately.
It does not replace already existing permissions.
Why do we need this feature?
To allow Grafana Enterprise users to grant access to rules API but not notifications provisioning APIs
Who is this feature for?
Special notes for your reviewer:
The new actions are not exposed independently. To test, you need to create a new custom role.
Example API Call
Example API Call
and then assign the new role to the user (user Id and role UID need to be replaced with values from responses)
Example API Call
Please check that: