From f1518cb85743573caacaf5da9f644c175ce96459 Mon Sep 17 00:00:00 2001 From: Michael Derynck Date: Wed, 29 Nov 2023 13:45:49 -0700 Subject: [PATCH] Ensure stack_id and org_id are ints (#3458) # What this PR does When reading plugin provisioning data if the value was > 999999 it was converted to exponential notation by the template which the backend could not understand as an ID. This makes sure it is written as an int. ## Which issue(s) this PR fixes ## Checklist - [x] Unit, integration, and e2e (if applicable) tests updated - [x] Documentation added (or `pr:no public docs` PR label added if not required) - [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not required) --- CHANGELOG.md | 1 + grafana-plugin/src/plugin.json | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0382d3fe4..666ab13127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - User profile UI tweaks ([#3443](https://github.com/grafana/oncall/pull/3443)) +- Ensure stack_id and org_id are ints @mderynck [(#3458](https://github.com/grafana/oncall/pull/3458)) ## v1.3.64 (2023-11-28) diff --git a/grafana-plugin/src/plugin.json b/grafana-plugin/src/plugin.json index 9e6311624e..b492048217 100644 --- a/grafana-plugin/src/plugin.json +++ b/grafana-plugin/src/plugin.json @@ -108,7 +108,7 @@ "headers": [ { "name": "X-Instance-Context", - "content": "{ \"stack_id\": \"{{ .JsonData.stackId }}\", \"org_id\": \"{{ .JsonData.orgId }}\", \"grafana_token\": \"{{ .SecureJsonData.grafanaToken }}\" }" + "content": "{ \"stack_id\": \"{{ printf \"%.0f\" .JsonData.stackId }}\", \"org_id\": \"{{ printf \"%.0f\" .JsonData.orgId }}\", \"grafana_token\": \"{{ .SecureJsonData.grafanaToken }}\" }" }, { "name": "Authorization", @@ -134,7 +134,7 @@ "headers": [ { "name": "X-Instance-Context", - "content": "{ \"stack_id\": \"{{ .JsonData.stackId }}\", \"org_id\": \"{{ .JsonData.orgId }}\" }" + "content": "{ \"stack_id\": \"{{ printf \"%.0f\" .JsonData.stackId }}\", \"org_id\": \"{{ printf \"%.0f\" .JsonData.orgId }}\" }" }, { "name": "Authorization", @@ -149,7 +149,7 @@ "headers": [ { "name": "X-Instance-Context", - "content": "{ \"stack_id\": \"{{ .JsonData.stackId }}\", \"org_id\": \"{{ .JsonData.orgId }}\" }" + "content": "{ \"stack_id\": \"{{ printf \"%.0f\" .JsonData.stackId }}\", \"org_id\": \"{{ printf \"%.0f\" .JsonData.orgId }}\" }" }, { "name": "Authorization", @@ -164,7 +164,7 @@ "headers": [ { "name": "X-Instance-Context", - "content": "{ \"stack_id\": \"{{ .JsonData.stackId }}\", \"org_id\": \"{{ .JsonData.orgId }}\" }" + "content": "{ \"stack_id\": \"{{ printf \"%.0f\" .JsonData.stackId }}\", \"org_id\": \"{{ printf \"%.0f\" .JsonData.orgId }}\" }" }, { "name": "Authorization", @@ -179,7 +179,7 @@ "headers": [ { "name": "X-Instance-Context", - "content": "{ \"stack_id\": \"{{ .JsonData.stackId }}\", \"org_id\": \"{{ .JsonData.orgId }}\" }" + "content": "{ \"stack_id\": \"{{ printf \"%.0f\" .JsonData.stackId }}\", \"org_id\": \"{{ printf \"%.0f\" .JsonData.orgId }}\" }" }, { "name": "Authorization",