Compare commits

..

7 Commits

Author SHA1 Message Date
Ryan McKinley
9c2ce6255b [v10.0.x] Snapshots: Require delete within same org (backport) (#84764) 2024-03-22 15:08:11 +03:00
tonypowa
253de798f1 Backport for #84476 (#84634)
* alerting docs: slack integration (#84476)

* alerting docs: slack integration

* added links

* removed aliases and formated notes

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* amended links

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* Update docs/sources/alerting/configure-notifications/manage-contact-points/integrations/configure-slack.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* couple of minor corrections

* fixing link

* ran prettier

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
(cherry picked from commit 500840ab77)

* removed note shortcode

* prettier
2024-03-18 10:52:21 +01:00
grafana-delivery-bot[bot]
0a809b1d8f [v10.0.x] Chore: Bump update checker interval to 1 day (#84446)
Chore: Bump update checker interval to 1 day (#84404)

* Bump interval to 1hr

* 2 hours is better than 1

* Bump further to 1 day

(cherry picked from commit 391d14d091)

Co-authored-by: Andreas Christou <andreas.christou@grafana.com>
2024-03-14 13:12:36 +02:00
Andreas Christou
8eff8f7948 [v10.0.x] Chore: Bump docker image versions (#84069)
Chore: Bump docker image versions (#84033)

Bump docker image versions

(cherry picked from commit 0236053f70)

# Conflicts:
#	Dockerfile
2024-03-07 15:55:00 +00:00
grafana-delivery-bot[bot]
2e14114dd2 Release: Bump version to 10.0.13 (#84014)
"Release: Updated versions in package to 10.0.13"

Co-authored-by: grafana-delivery-bot[bot] <132647405+grafana-delivery-bot[bot]@users.noreply.github.com>
2024-03-06 18:50:13 +02:00
Andreas Christou
af37511ee1 [v10.0.x] Changelog: Updated changelog for 10.0.12 (#84012)
Changelog: Updated changelog for 10.0.12 (#84008)

Co-authored-by: grafanabot <bot@grafana.com>
(cherry picked from commit 32480b49aa)

# Conflicts:
#	CHANGELOG.md

Co-authored-by: grafana-delivery-bot[bot] <132647405+grafana-delivery-bot[bot]@users.noreply.github.com>
2024-03-06 09:44:11 -07:00
grafana-delivery-bot[bot]
a62fe83acf [v10.0.x] Configure Grafana docs: fix custom configuration file location (#83995)
Configure Grafana docs: fix custom configuration file location (#83169)

* Configure Grafana docs: fix custom configuration file location

* Replace config file with `custom.ini`

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
(cherry picked from commit ce827f9518)

Co-authored-by: Pepe Cano <825430+ppcano@users.noreply.github.com>
2024-03-06 10:00:54 -06:00
52 changed files with 184 additions and 80 deletions

View File

@@ -1,3 +1,12 @@
<!-- 10.0.12 START -->
# 10.0.12 (2024-03-06)
### Bug fixes
- **Auth:** Fix email verification bypass when using basic authentication. [#83493](https://github.com/grafana/grafana/issues/83493)
<!-- 10.0.12 END -->
<!-- 10.0.11 START -->
# 10.0.11 (2024-01-29)

View File

@@ -1,9 +1,9 @@
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=alpine:3.18.3
ARG JS_IMAGE=node:18-alpine3.18
ARG BASE_IMAGE=alpine:3.19.1
ARG JS_IMAGE=node:18-alpine
ARG JS_PLATFORM=linux/amd64
ARG GO_IMAGE=golang:1.21.8-alpine3.18
ARG GO_IMAGE=golang:1.21.8-alpine
ARG GO_SRC=go-builder
ARG JS_SRC=js-builder

View File

@@ -0,0 +1,92 @@
---
canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/manage-contact-points/integrations/configure-slack/
description: Configure the Slack integration to connect alerts generated by Grafana Alerting
keywords:
- grafana
- alerting
- slack
- integration
labels:
products:
- cloud
- enterprise
- oss
menuTitle: Slack
title: Configure Slack for Alerting
weight: 300
---
## Configure Slack for Alerting
Use the Grafana Alerting - Slack integration to send Slack notifications when your alerts are firing.
There are two ways of integrating Slack into Grafana Alerting.
1. Use a [Slack API token](https://api.slack.com/authentication/token-types)
Enable your app to access the Slack API. If, for example, you are interested in more granular control over permissions, or your project is expected to regularly scale, resulting in new channels being created, this is the best option.
1. Use a [Webhook URL](https://api.slack.com/messaging/webhooks)
Webhooks is the simpler way to post messages into Slack. Slack automatically creates a bot user with all the necessary permissions to post messages to one particular channel of your choice.
{{< admonition type="note" >}}
Grafana Alerting only allows one Slack channel per contact point.
{{< /admonition >}}
## Before you begin
### Slack API Token
If you are using a Slack API Token, complete the following steps.
1. Follow steps 1 and 2 of the [Slack API Quickstart](https://api.slack.com/start/quickstart).
1. Add the [chat:write.public](https://api.slack.com/scopes/chat:write.public) scope to give your app the ability to post in all public channels without joining.
1. In OAuth Tokens for Your Workspace, copy the Bot User OAuth Token.
1. Open your Slack workplace.
1. Right click the channel you want to receive notifications in.
1. Click View channel details.
1. Scroll down and copy the Channel ID.
{{< admonition type="note" >}}
While going through these steps, Slack may prompt you to Reinstall your app in order for the changes to take effect.
{{< /admonition >}}
### Webhook URL
If you are using a Webhook URL, follow steps 1 and 5 in the [Slack API Quickstart](https://api.slack.com/start/quickstart).
{{< admonition type="note" >}}
Make sure you copy the Slack app Webhook URL. You will need this when setting up your contact point integration in Grafana Alerting.
{{< /admonition >}}
## Procedure
To create your Slack integration in Grafana Alerting, complete the following steps.
1. Navigate to **Alerts & IRM** -> **Alerting** -> **Contact points**.
1. Click **+ Add contact point**.
1. Enter a contact point name.
1. From the Integration list, select Slack.
1. If you are using a Slack API token:
- In the **Recipient** field, copy in the channel ID.
- In the **Token** field, copy in the Bot User OAuth Token that starts with “xoxb-”.
1. If you are using a Webhook URL, in the **Webhook** field, copy in your Slack app Webhook URL.
1. Click **Test** to check that your integration works.
1[]. Click **Save contact point**.
## Next steps
To add the contact point and integration you created to your default notification policy, complete the following steps.
1. Navigate to **Alerts & IRM** -> **Alerting** -> **Notification policies**.
1. In the **Default policy**, click the ellipsis icon (…) and then **Edit**,
1. Change the default policy to the contact point you created.
1. Click **Update default policy**.
**Note:**
If you have more than one contact point, add a new notification policy rather than edit the default one, so you can route specific alerts to Slack. For more information, refer to [Notification policies][nested-policy].
{{% docs/reference %}}
[nested-policy]: "/docs/grafana/ -> /docs/grafana/<GRAFANA_VERSION>/alerting/alerting-rules/create-notification-policy/#add-new-nested-policy"
[nested-policy]: "/docs/grafana-cloud/ -> /docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/create-notification-policy/#add-new-nested-policy"
{{% /docs/reference %}}

View File

@@ -23,7 +23,7 @@ After you add custom options, [uncomment](#remove-comments-in-the-ini-files) the
The default settings for a Grafana instance are stored in the `$WORKING_DIR/conf/defaults.ini` file. _Do not_ change this file.
Depending on your OS, your custom configuration file is either the `$WORKING_DIR/conf/defaults.ini` file or the `/usr/local/etc/grafana/grafana.ini` file. The custom configuration file path can be overridden using the `--config` parameter.
Depending on your OS, your custom configuration file is either the `$WORKING_DIR/conf/custom.ini` file or the `/usr/local/etc/grafana/grafana.ini` file. The custom configuration file path can be overridden using the `--config` parameter.
### Linux

View File

@@ -2,5 +2,5 @@
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"version": "10.0.12"
"version": "10.0.13"
}

View File

@@ -3,7 +3,7 @@
"license": "AGPL-3.0-only",
"private": true,
"name": "grafana",
"version": "10.0.12",
"version": "10.0.13",
"repository": "github:grafana/grafana",
"scripts": {
"build": "yarn i18n:compile && NODE_ENV=production webpack --progress --config scripts/webpack/webpack.prod.js",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/data",
"version": "10.0.12",
"version": "10.0.13",
"description": "Grafana Data Library",
"keywords": [
"typescript"
@@ -36,7 +36,7 @@
},
"dependencies": {
"@braintree/sanitize-url": "6.0.2",
"@grafana/schema": "10.0.12",
"@grafana/schema": "10.0.13",
"@types/d3-interpolate": "^3.0.0",
"@types/string-hash": "1.1.1",
"d3-interpolate": "3.0.1",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/e2e-selectors",
"version": "10.0.12",
"version": "10.0.13",
"description": "Grafana End-to-End Test Selectors Library",
"keywords": [
"cli",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/e2e",
"version": "10.0.12",
"version": "10.0.13",
"description": "Grafana End-to-End Test Library",
"keywords": [
"cli",
@@ -63,7 +63,7 @@
"@babel/core": "7.20.5",
"@babel/preset-env": "7.20.2",
"@cypress/webpack-preprocessor": "5.17.0",
"@grafana/e2e-selectors": "10.0.12",
"@grafana/e2e-selectors": "10.0.13",
"@grafana/tsconfig": "^1.2.0-rc1",
"@mochajs/json-file-reporter": "^1.2.0",
"babel-loader": "9.1.2",

View File

@@ -1,7 +1,7 @@
{
"name": "@grafana/eslint-plugin",
"description": "ESLint rules for use within the Grafana repo. Not suitable (or supported) for external use.",
"version": "10.0.12",
"version": "10.0.13",
"main": "./index.cjs",
"author": "Grafana Labs",
"license": "Apache-2.0",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/runtime",
"version": "10.0.12",
"version": "10.0.13",
"description": "Grafana Runtime Library",
"keywords": [
"grafana",
@@ -37,10 +37,10 @@
"postpack": "mv package.json.bak package.json"
},
"dependencies": {
"@grafana/data": "10.0.12",
"@grafana/e2e-selectors": "10.0.12",
"@grafana/data": "10.0.13",
"@grafana/e2e-selectors": "10.0.13",
"@grafana/faro-web-sdk": "1.0.2",
"@grafana/ui": "10.0.12",
"@grafana/ui": "10.0.13",
"@sentry/browser": "6.19.7",
"history": "4.10.1",
"lodash": "4.17.21",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/schema",
"version": "10.0.12",
"version": "10.0.13",
"description": "Grafana Schema Library",
"keywords": [
"typescript"

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
/**

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
limit: number;

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip, common.OptionsWithTextFormatting {
/**

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends common.SingleStatBaseOptions {
displayMode: common.BarGaugeDisplayMode;

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export enum VizDisplayMode {
Candles = 'candles',

View File

@@ -11,7 +11,7 @@
import * as ui from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export enum HorizontalConstraint {
Center = 'center',

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface MetricStat {
/**

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
folderId?: number;

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
selectedSeries: number;

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export type UpdateConfig = {
render: boolean,

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export type BucketAggregation = (DateHistogram | Histogram | Terms | Filters | GeoHashGrid | Nested);

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends common.SingleStatBaseOptions {
showThresholdLabels: boolean;

View File

@@ -11,7 +11,7 @@
import * as ui from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
basemap: ui.MapLayerOptions;

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export type PhlareQueryType = ('metrics' | 'profile' | 'both');

View File

@@ -11,7 +11,7 @@
import * as ui from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
/**
* Controls the color mode of the heatmap

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends common.OptionsWithLegend, common.OptionsWithTooltip {
/**

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
dedupStrategy: common.LogsDedupStrategy;

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export enum QueryEditorMode {
Builder = 'builder',

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
/**

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface ArcOption {
/**

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export type ParcaQueryType = ('metrics' | 'profile' | 'both');

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
/**
* Select the pie chart display style.

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export enum QueryEditorMode {
Builder = 'builder',

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends common.SingleStatBaseOptions {
colorMode: common.BigValueColorMode;

View File

@@ -11,7 +11,7 @@
import * as ui from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones {
/**

View File

@@ -11,7 +11,7 @@
import * as ui from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends ui.OptionsWithLegend, ui.OptionsWithTooltip, ui.OptionsWithTimezones {
/**

View File

@@ -11,7 +11,7 @@
import * as ui from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options {
/**

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface TempoQuery extends common.DataQuery {
filters: Array<TraceqlFilter>;

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export enum TestDataQueryType {
Annotations = 'annotations',

View File

@@ -9,7 +9,7 @@
//
// Run 'make gen-cue' from repository root to regenerate.
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export enum TextMode {
Code = 'code',

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export interface Options extends common.OptionsWithTimezones {
legend: common.VizLegendOptions;

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
/**
* Identical to timeseries... except it does not have timezone settings

View File

@@ -11,7 +11,7 @@
import * as common from '@grafana/schema';
export const pluginVersion = "10.0.12";
export const pluginVersion = "10.0.13";
export enum SeriesMapping {
Auto = 'auto',

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/toolkit",
"version": "10.0.12",
"version": "10.0.13",
"description": "Grafana Toolkit",
"keywords": [
"grafana",

View File

@@ -2,7 +2,7 @@
"author": "Grafana Labs",
"license": "Apache-2.0",
"name": "@grafana/ui",
"version": "10.0.12",
"version": "10.0.13",
"description": "Grafana Components Library",
"keywords": [
"grafana",
@@ -49,10 +49,10 @@
"dependencies": {
"@emotion/css": "11.10.6",
"@emotion/react": "11.10.6",
"@grafana/data": "10.0.12",
"@grafana/e2e-selectors": "10.0.12",
"@grafana/data": "10.0.13",
"@grafana/e2e-selectors": "10.0.13",
"@grafana/faro-web-sdk": "1.0.2",
"@grafana/schema": "10.0.12",
"@grafana/schema": "10.0.13",
"@leeoniya/ufuzzy": "1.0.6",
"@monaco-editor/react": "4.4.6",
"@popperjs/core": "2.11.6",

View File

@@ -349,6 +349,9 @@ func (hs *HTTPServer) DeleteDashboardSnapshot(c *contextmodel.ReqContext) respon
if queryResult == nil {
return response.Error(http.StatusNotFound, "Failed to get dashboard snapshot", nil)
}
if queryResult.OrgID != c.OrgID {
return response.Error(http.StatusUnauthorized, "OrgID mismatch", nil)
}
if queryResult.External {
err := deleteExternalDashboardSnapshot(queryResult.ExternalDeleteURL)

View File

@@ -44,6 +44,7 @@ func TestDashboardSnapshotAPIEndpoint_singleSnapshot(t *testing.T) {
dashSnapSvc.On("DeleteDashboardSnapshot", mock.Anything, mock.AnythingOfType("*dashboardsnapshots.DeleteDashboardSnapshotCommand")).Return(nil).Maybe()
res := &dashboardsnapshots.DashboardSnapshot{
ID: 1,
OrgID: 1,
Key: "12345",
DeleteKey: "54321",
Dashboard: jsonModel,
@@ -103,12 +104,11 @@ func TestDashboardSnapshotAPIEndpoint_singleSnapshot(t *testing.T) {
sc.handlerFunc = hs.DeleteDashboardSnapshotByDeleteKey
sc.fakeReqWithParams("GET", sc.url, map[string]string{"deleteKey": "12345"}).exec()
require.Equal(t, 200, sc.resp.Code)
require.Equal(t, 200, sc.resp.Code, "BODY: "+sc.resp.Body.String())
respJSON, err := simplejson.NewJson(sc.resp.Body.Bytes())
require.NoError(t, err)
assert.True(t, strings.HasPrefix(respJSON.Get("message").MustString(), "Snapshot deleted"))
assert.Equal(t, 1, respJSON.Get("id").MustInt())
assert.Equal(t, http.MethodGet, externalRequest.Method)
assert.Equal(t, ts.URL, fmt.Sprintf("http://%s", externalRequest.Host))
@@ -333,7 +333,7 @@ func TestGetDashboardSnapshotNotFound(t *testing.T) {
sc.handlerFunc = hs.DeleteDashboardSnapshot
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"key": "12345"}).exec()
assert.Equal(t, http.StatusNotFound, sc.resp.Code)
assert.Equal(t, http.StatusNotFound, sc.resp.Code, "BODY: "+sc.resp.Body.String())
}, sqlmock)
loggedInUserScenarioWithRole(t,
@@ -344,7 +344,7 @@ func TestGetDashboardSnapshotNotFound(t *testing.T) {
sc.handlerFunc = hs.DeleteDashboardSnapshotByDeleteKey
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"deleteKey": "12345"}).exec()
assert.Equal(t, http.StatusNotFound, sc.resp.Code)
assert.Equal(t, http.StatusNotFound, sc.resp.Code, "BODY: "+sc.resp.Body.String())
}, sqlmock)
}
@@ -407,7 +407,7 @@ func TestGetDashboardSnapshotFailure(t *testing.T) {
sc.handlerFunc = hs.DeleteDashboardSnapshot
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"key": "12345"}).exec()
assert.Equal(t, http.StatusForbidden, sc.resp.Code)
assert.Equal(t, http.StatusForbidden, sc.resp.Code, "BODY: "+sc.resp.Body.String())
}, sqlmock)
loggedInUserScenarioWithRole(t,
@@ -418,7 +418,7 @@ func TestGetDashboardSnapshotFailure(t *testing.T) {
sc.handlerFunc = hs.DeleteDashboardSnapshotByDeleteKey
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"deleteKey": "12345"}).exec()
assert.Equal(t, http.StatusInternalServerError, sc.resp.Code)
assert.Equal(t, http.StatusInternalServerError, sc.resp.Code, "BODY: "+sc.resp.Body.String())
}, sqlmock)
loggedInUserScenarioWithRole(t,
@@ -429,7 +429,7 @@ func TestGetDashboardSnapshotFailure(t *testing.T) {
sc.handlerFunc = hs.DeleteDashboardSnapshotByDeleteKey
sc.fakeReqWithParams("DELETE", sc.url, map[string]string{"deleteKey": "12345"}).exec()
assert.Equal(t, http.StatusForbidden, sc.resp.Code)
assert.Equal(t, http.StatusForbidden, sc.resp.Code, "BODY: "+sc.resp.Body.String())
}, sqlmock)
}

View File

@@ -60,7 +60,7 @@ func (s *GrafanaService) IsDisabled() bool {
func (s *GrafanaService) Run(ctx context.Context) error {
s.instrumentedCheckForUpdates(ctx)
ticker := time.NewTicker(time.Minute * 10)
ticker := time.NewTicker(time.Hour * 24)
run := true
for run {

View File

@@ -1,6 +1,6 @@
{
"name": "@grafana-plugins/input-datasource",
"version": "10.0.12",
"version": "10.0.13",
"description": "Input Datasource",
"private": true,
"repository": {
@@ -28,8 +28,8 @@
"webpack": "5.76.0"
},
"dependencies": {
"@grafana/data": "10.0.12",
"@grafana/ui": "10.0.12",
"@grafana/data": "10.0.13",
"@grafana/ui": "10.0.13",
"react": "18.2.0",
"tslib": "2.5.0"
}

View File

@@ -2730,9 +2730,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@grafana-plugins/input-datasource@workspace:plugins-bundled/internal/input-datasource"
dependencies:
"@grafana/data": 10.0.12
"@grafana/data": 10.0.13
"@grafana/tsconfig": ^1.2.0-rc1
"@grafana/ui": 10.0.12
"@grafana/ui": 10.0.13
"@types/jest": 26.0.15
"@types/react": 18.0.28
copy-webpack-plugin: 11.0.0
@@ -2768,12 +2768,12 @@ __metadata:
languageName: node
linkType: hard
"@grafana/data@10.0.12, @grafana/data@workspace:*, @grafana/data@workspace:packages/grafana-data":
"@grafana/data@10.0.13, @grafana/data@workspace:*, @grafana/data@workspace:packages/grafana-data":
version: 0.0.0-use.local
resolution: "@grafana/data@workspace:packages/grafana-data"
dependencies:
"@braintree/sanitize-url": 6.0.2
"@grafana/schema": 10.0.12
"@grafana/schema": 10.0.13
"@grafana/tsconfig": ^1.2.0-rc1
"@rollup/plugin-commonjs": 23.0.2
"@rollup/plugin-json": 5.0.1
@@ -2834,7 +2834,7 @@ __metadata:
languageName: unknown
linkType: soft
"@grafana/e2e-selectors@10.0.12, @grafana/e2e-selectors@workspace:*, @grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors":
"@grafana/e2e-selectors@10.0.13, @grafana/e2e-selectors@workspace:*, @grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors":
version: 0.0.0-use.local
resolution: "@grafana/e2e-selectors@workspace:packages/grafana-e2e-selectors"
dependencies:
@@ -2871,7 +2871,7 @@ __metadata:
"@babel/core": 7.20.5
"@babel/preset-env": 7.20.2
"@cypress/webpack-preprocessor": 5.17.0
"@grafana/e2e-selectors": 10.0.12
"@grafana/e2e-selectors": 10.0.13
"@grafana/tsconfig": ^1.2.0-rc1
"@mochajs/json-file-reporter": ^1.2.0
"@rollup/plugin-node-resolve": 15.0.1
@@ -3031,11 +3031,11 @@ __metadata:
version: 0.0.0-use.local
resolution: "@grafana/runtime@workspace:packages/grafana-runtime"
dependencies:
"@grafana/data": 10.0.12
"@grafana/e2e-selectors": 10.0.12
"@grafana/data": 10.0.13
"@grafana/e2e-selectors": 10.0.13
"@grafana/faro-web-sdk": 1.0.2
"@grafana/tsconfig": ^1.2.0-rc1
"@grafana/ui": 10.0.12
"@grafana/ui": 10.0.13
"@rollup/plugin-commonjs": 23.0.2
"@rollup/plugin-node-resolve": 15.0.1
"@sentry/browser": 6.19.7
@@ -3085,7 +3085,7 @@ __metadata:
languageName: node
linkType: hard
"@grafana/schema@10.0.12, @grafana/schema@workspace:*, @grafana/schema@workspace:packages/grafana-schema":
"@grafana/schema@10.0.13, @grafana/schema@workspace:*, @grafana/schema@workspace:packages/grafana-schema":
version: 0.0.0-use.local
resolution: "@grafana/schema@workspace:packages/grafana-schema"
dependencies:
@@ -3128,17 +3128,17 @@ __metadata:
languageName: node
linkType: hard
"@grafana/ui@10.0.12, @grafana/ui@workspace:*, @grafana/ui@workspace:packages/grafana-ui":
"@grafana/ui@10.0.13, @grafana/ui@workspace:*, @grafana/ui@workspace:packages/grafana-ui":
version: 0.0.0-use.local
resolution: "@grafana/ui@workspace:packages/grafana-ui"
dependencies:
"@babel/core": 7.20.5
"@emotion/css": 11.10.6
"@emotion/react": 11.10.6
"@grafana/data": 10.0.12
"@grafana/e2e-selectors": 10.0.12
"@grafana/data": 10.0.13
"@grafana/e2e-selectors": 10.0.13
"@grafana/faro-web-sdk": 1.0.2
"@grafana/schema": 10.0.12
"@grafana/schema": 10.0.13
"@grafana/tsconfig": ^1.2.0-rc1
"@leeoniya/ufuzzy": 1.0.6
"@mdx-js/react": 1.6.22