-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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 updating notification channels in legacy #45302
Alerting: Fix updating notification channels in legacy #45302
Conversation
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available.
@@ -77,6 +78,7 @@ func (s *AlertNotificationService) UpdateAlertNotification(ctx context.Context, | |||
|
|||
model := models.AlertNotification{ | |||
Id: cmd.Id, | |||
OrgId: cmd.OrgId, |
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.
I tried to create a few tests for this but entered the land of diminishing returns so decided to skip. Would rather get the fix in and follow up (if you feel strongly about it) in another PR. If this were unified alerting, I'd have pushed through but given this is legacy I carried on.
As an FYI, this problem is not reproducible in |
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, tested locally 👍
This looks similar to #43678 – are there other bus commands that we might need to double check? |
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available. (cherry picked from commit 8bf2e64)
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available. (cherry picked from commit 8bf2e64)
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available. (cherry picked from commit 8bf2e64) Co-authored-by: gotjosh <josue.abreu@gmail.com>
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available. (cherry picked from commit 8bf2e64) Co-authored-by: gotjosh <josue.abreu@gmail.com>
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available.
grafana#45330) The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available. (cherry picked from commit 8bf2e64) Co-authored-by: gotjosh <josue.abreu@gmail.com>
* [v8.3.x] Sync security changes (grafana#45067) * "Release: Updated versions in package to 8.3.5" * [v8.3.x] Fix for CVE-2022-21702 (#225) Fix for CVE-2022-21702 * Update yarn.lock for 8.3.5 * resolve conflicts (cherry picked from commit bb38cfcba4b4f824060ff385d858c63f50b72d74) * csrf checks for v8.3.5 (#234) * Fix lint * Cherry pick e2e test server changes Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Kevin Minehart <kmineh0151@gmail.com> Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com> * [v8.3.x] Update changelog for 8.3.5 and 7.5.15 (grafana#45078) (grafana#45086) * Update changelog for 8.3.5 and 7.5.15 (grafana#45078) (cherry picked from commit b2a8487) * Remove 8.4.0-beta1 additions * update snapshots server url (grafana#44563) (grafana#44566) * update snapshots server url * update all old references to snapshot.raintank.io (cherry picked from commit 1e89fc1) Co-authored-by: Dan Cech <dcech@grafana.com> * Alerting: Improve Contact Points error handling (grafana#44888) (grafana#45093) * Add 400 and 408 errors handling to display useful error message * Add generic error handling * Improve type guard (cherry picked from commit 1cf4861) * pkg/web: X-Forwarded-For multi-IP handling (grafana#45098) (grafana#45103) It is conventionally common for the X-Forwarded-For header to contain a comma-separated list of IP addresses, with each intermediate proxy adding an additional item as a request passes through it. This change makes the web framework handle this case appropriately, always selecting the first item in the list. (cherry picked from commit 6a2255a) Co-authored-by: sam boyer <sdboyer@grafana.com> * Alerting: remove error banner when Prometheus ruler is not supported (grafana#44571) (cherry picked from commit 3d0cff5) Co-authored-by: Roy C <crosscent@gmail.com> * Rework template docs and add examples (grafana#43178) (grafana#43179) (cherry picked from commit 8206802) Co-authored-by: David Parrott <stomp.box.yo@gmail.com> * Provisioning: Ensure that the default value for orgID is set when provisioning datasources to be deleted (grafana#44244) (grafana#45129) Fixes grafana#44243 Signed-off-by: Maicon Costa <maiconscosta@gmail.com> (cherry picked from commit 8e03541) Co-authored-by: maicon <maiconscosta@gmail.com> * Tempo: Fix visual service graph bug by setting upper bound for failed arc (grafana#45009) (grafana#45155) * Fix visual service graph bug by setting upper bound for failed arc calculation (cherry picked from commit e94b7f4) Co-authored-by: Connor Lindsey <cblindsey3@gmail.com> * Release: Bump version to 8.3.6 (grafana#45168) * "Release: Updated versions in package to 8.3.6" * Update yarn.lock Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com> * Update latest.json (grafana#45171) (grafana#45172) (cherry picked from commit 67423f4) Co-authored-by: Shirley <4163034+fridgepoet@users.noreply.github.com> * Alerting: support ok state in alert migration (grafana#45264) (grafana#45266) (cherry picked from commit c59567a) Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com> * Update geomap.md (grafana#43527) (grafana#45268) (cherry picked from commit d97e74d) Co-authored-by: JJgitGit <JJgitGit@users.noreply.github.com> * make drone (grafana#45318) Signed-off-by: bergquist <carl.bergquist@gmail.com> Co-authored-by: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com> * Build: only specify github-token when needed (grafana#45326) (grafana#45329) (cherry picked from commit 9a7438c) * Alerting: Fix updating notification channels in legacy (grafana#45302) (grafana#45330) The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available. (cherry picked from commit 8bf2e64) Co-authored-by: gotjosh <josue.abreu@gmail.com> * CI: Remove `grafana/drone-grafana-docker` image (grafana#44983) (grafana#45091) * CI: Remove `grafana/drone-grafana-docker` image (grafana#44983) * Remove grafana/drone-grafana-docker image * Rename step * Remove manual gcloud authentication (cherry picked from commit 329b1a1) * Add publish command for main * Fix TAG variable parsing * Remove shouldSave from main builds * Reorder dependencies * Update grabpl version (cherry picked from commit 5543ad8) * Sign drone * [v8.3.x] Bug: Update `upload-cdn` command args (grafana#44979) * CI: Update `GCP_GRAFANA_UPLOAD_KEY` var name (grafana#44303) * Update GCP_KEY var name * Rename GCP_GRAFANA_UPLOAD_KEY for upload-packages * Update grabpl (cherry picked from commit f96a6c1) * Update upload-cdn command args (grafana#44966) (cherry picked from commit 67225d9) * Alerting: do not unescape external AM label values (grafana#45334) (grafana#45393) (cherry picked from commit 651bb77) Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com> * CI: Remove manual `gcloud` authentication (grafana#44986) (grafana#45445) * Remove manual gcloud auth from store-packages * Update grabpl (cherry picked from commit 163b570) * Docs: Remove docs publish GitHub action (grafana#45539) * Update grabpl (grafana#45520) (grafana#45526) (cherry picked from commit af1691d) * CI: Introduce docs pipeline (grafana#45454) (grafana#45670) * bump go version to 1.17.7 (grafana#45772) (grafana#45782) (cherry picked from commit b512a3d) Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com> * DockerHub: Use `grafana(-oss)-image-tags` to push to `grafana(-oss)-dev` DockerHub repo (grafana#45708) (grafana#45711) * Revert back changes - changes are done on grabpl * Sync drone (cherry picked from commit 3db3314) * Middleware: Fix IPv6 host parsing in CSRF check (grafana#45911) (grafana#45983) - Also create tests for this middleware Co-authored-by: Kyle Brandt <kyle@grafana.com> (cherry picked from commit 06ed5ef) Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com> * BarChart: fix single group rendering (grafana#45953) (grafana#45991) (cherry picked from commit 1c4b20b) Co-authored-by: Leon Sorokin <leeoniya@gmail.com> * Histogram: auto-skip x tick labels to avoid overlap (grafana#45996) (grafana#46000) (cherry picked from commit b491d6b) Co-authored-by: Leon Sorokin <leeoniya@gmail.com> * "Release: Updated versions in package to 8.3.7" (grafana#46027) * ReleaseNotes: Updated changelog and release notes for 8.3.7 (grafana#46028) (grafana#46029) (cherry picked from commit 3ea6c8c) Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * Backporting bump version fixes (grafana#46231) * Prometheus: Fix timestamp truncation (grafana#46302) (grafana#46331) (cherry picked from commit db5f480) * Chore: Update go version used in CI to 1.17.8 (grafana#46591) (grafana#46632) (cherry picked from commit 3f58abe) * Geomap: Display legend (grafana#46886) (grafana#47077) * Display legend for fixed colors and field; Hide tooltip on base layer; (cherry picked from commit 118b87e) # Conflicts: # public/app/plugins/panel/geomap/GeomapPanel.tsx # public/app/plugins/panel/geomap/editor/layerEditor.tsx * [v8.3.x] CI: Sync CI changes (grafana#46085) * CI: Introduce `build-frontend-packages` step (grafana#45824) * Split frontend build * Fix command name * Update grabpl (cherry picked from commit 2f6c827) * CI: Add docs pipeline for `main` pipelines (grafana#45740) * Add docs pipeline for main * Extract trigger docs * Change trigger for main (cherry picked from commit ea3e41e) * CI: Add more checks to standalone docs pipeline (grafana#46449) * Add build frontend package step * Reorder dependencies * Add codespell and prettier checks (cherry picked from commit 82b436a) * Update golang (grafana#46458) (cherry picked from commit a29159f) * Fix XSS in runbook URL (#383) * "Release: Updated versions in package to 8.3.8" (#385) * Fix: Choose Lookup params per auth module v8.3.x (#401) * Fix: Choose Lookup params per auth module Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: Prefer pointer to struct in lookup Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: user email for ldap Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: Use only login for lookup in LDAP Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: use user email for ldap Co-authored-by: Karl Persson <kalle.persson@grafana.com> fix remaining test fix nit picks * update lock * fix integration tests * [v8.3.x] Merge 'release-8.3.9` branch (#404) * Fix: Choose Lookup params per auth module Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: Prefer pointer to struct in lookup Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: user email for ldap Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: Use only login for lookup in LDAP Co-authored-by: Karl Persson <kalle.persson@grafana.com> Fix: use user email for ldap Co-authored-by: Karl Persson <kalle.persson@grafana.com> fix remaining test fix nit picks (cherry picked from commit 09ca54d4665583b5648fea5726a19e0b58df4ec0) * fix integration tests (cherry picked from commit 16c3077bb39f41acacbef4b13c65c7c907c54de7) * Release: Bump version to 8.3.9 (#403) * Change bump-version.yml * "Release: Updated versions in package to 8.3.9" Co-authored-by: dsotirakis <dimitrios.sotirakis@grafana.com> * Update yarn.lock Co-authored-by: jguer <joao.guerreiro@grafana.com> Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> * "Release: Updated versions in package to 8.3.10" (#409) * Update grabpl * update grabpl * CI: Update `grabpl` version - remove `--no-pull-enterprise` flag (grafana#47013) * Update grabpl version * Sign drone * Remove --no-pull-enterprise flag * Sign drone * Update grabpl * update drone, cherry-pick some ci updates * update PR pipeline * PMM-10338 fix time_series_query.go Co-authored-by: Dimitris Sotirakis <sotirakis.dim@gmail.com> Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: Kevin Minehart <kmineh0151@gmail.com> Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com> Co-authored-by: Grot (@grafanabot) <43478413+grafanabot@users.noreply.github.com> Co-authored-by: Dan Cech <dcech@grafana.com> Co-authored-by: Konrad Lalik <konrad.lalik@grafana.com> Co-authored-by: sam boyer <sdboyer@grafana.com> Co-authored-by: Roy C <crosscent@gmail.com> Co-authored-by: David Parrott <stomp.box.yo@gmail.com> Co-authored-by: maicon <maiconscosta@gmail.com> Co-authored-by: Connor Lindsey <cblindsey3@gmail.com> Co-authored-by: Shirley Leu <4163034+fridgepoet@users.noreply.github.com> Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com> Co-authored-by: JJgitGit <JJgitGit@users.noreply.github.com> Co-authored-by: Carl Bergquist <carl.bergquist@gmail.com> Co-authored-by: malcolmholmes <42545407+malcolmholmes@users.noreply.github.com> Co-authored-by: gotjosh <josue.abreu@gmail.com> Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com> Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com> Co-authored-by: ying-jeanne <74549700+ying-jeanne@users.noreply.github.com> Co-authored-by: Leon Sorokin <leeoniya@gmail.com> Co-authored-by: Sriram <yesoreyeram@gmail.com> Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com> Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com> Co-authored-by: Adela Almasan <88068998+adela-almasan@users.noreply.github.com> Co-authored-by: George Robinson <george.robinson@grafana.com> Co-authored-by: Jguer <joao.guerreiro@grafana.com> Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available.
I'm surprised this has not been reported before as it affect all contact points if you're reviewing this and have any context on open issues that report this please let me know that we can close them.
Edit: Seems like Github took an important line away from my commit message. This is very similar to #43695 and the contact point validation was first introduced as part of #41062