Skip to content

Commit

Permalink
Merge pull request #4735 from grafana/dev
Browse files Browse the repository at this point in the history
v1.8.8
  • Loading branch information
vstpme authored Jul 25, 2024
2 parents 4d3a307 + 71cdf35 commit a13ab2a
Show file tree
Hide file tree
Showing 15 changed files with 145 additions and 374 deletions.
28 changes: 15 additions & 13 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@ DOCKER_REGISTRY = "localhost:63628/"

load("ext://docker_build_sub", "docker_build_sub")

def get_profiles():
profiles = os.getenv('ONCALL_PROFILES', 'grafana,plugin,backend,tests')
return profiles.split(',')
profiles = get_profiles()

# Tell ops-devenv/Tiltifle where our plugin.json file lives
plugin_file = os.path.abspath("grafana-plugin/src/plugin.json")

def plugin_json():
return plugin_file
if 'plugin' in profiles:
return plugin_file
return 'NOT_A_PLUGIN'


allow_k8s_contexts(["kind-kind"])
Expand Down Expand Up @@ -78,12 +85,13 @@ def load_grafana():
grafana_version = os.getenv("GRAFANA_VERSION", "latest")


k8s_resource(
objects=["grafana-oncall-app-provisioning:configmap"],
new_name="grafana-oncall-app-provisioning-configmap",
resource_deps=["build-ui"],
labels=["Grafana"],
)
if 'plugin' in profiles:
k8s_resource(
objects=["grafana-oncall-app-provisioning:configmap"],
new_name="grafana-oncall-app-provisioning-configmap",
resource_deps=["build-ui"],
labels=["Grafana"],
)

# Use separate grafana helm chart
if not running_under_parent_tiltfile:
Expand All @@ -101,12 +109,6 @@ def load_grafana():
)
# --- GRAFANA END ----


def get_profiles():
profiles = os.getenv('ONCALL_PROFILES', 'grafana,plugin,backend,tests')
return profiles.split(',')
profiles = get_profiles()

if 'grafana' in profiles:
load_grafana()
if 'plugin' in profiles:
Expand Down
2 changes: 1 addition & 1 deletion engine/apps/api/views/alert_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def get_queryset(self, ignore_filtering_by_available_teams=False):
alert_receive_channels_ids = list(alert_receive_channels_qs.values_list("id", flat=True))
queryset = AlertGroup.objects.filter(channel__in=alert_receive_channels_ids)

if settings.ALERT_GROUPS_DISABLE_PREFER_ORDERING_INDEX:
if self.action in ("list", "stats") and settings.ALERT_GROUPS_DISABLE_PREFER_ORDERING_INDEX:
# workaround related to MySQL "ORDER BY LIMIT Query Optimizer Bug"
# read more: https://hackmysql.com/infamous-order-by-limit-query-optimizer-bug/
from django_mysql.models import add_QuerySetMixin
Expand Down
15 changes: 14 additions & 1 deletion grafana-plugin/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const rulesDirPlugin = require('eslint-plugin-rulesdir');
rulesDirPlugin.RULES_DIR = 'tools/eslint-rules';
rulesDirPlugin.RULES_DIR = __dirname + '/tools/eslint-rules';

module.exports = {
extends: ['./.config/.eslintrc'],
Expand All @@ -8,6 +8,19 @@ module.exports = {
'import/internal-regex':
'^assets|^components|^containers|^contexts|^icons|^models|^network|^pages|^services|^state|^utils|^plugin',
},
overrides: [
{
files: ['src/**/*.{ts,tsx}'],
rules: {
'deprecation/deprecation': 'off',
},
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
},
],

rules: {
eqeqeq: 'warn',
'import/order': [
Expand Down
11 changes: 5 additions & 6 deletions grafana-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@
"@swc/core": "^1.3.90",
"@swc/helpers": "^0.5.0",
"@swc/jest": "^0.2.26",
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "14.0.0",
"@testing-library/dom": "latest",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.4.3",
"@types/dompurify": "^2.3.4",
"@types/express": "^4.17.21",
Expand Down Expand Up @@ -107,8 +108,6 @@
"plop": "^2.7.4",
"postcss-loader": "^7.0.1",
"prettier": "^2.8.7",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-test-renderer": "^18.0.2",
"replace-in-file-webpack-plugin": "^1.0.6",
"sass": "1.63.2",
Expand All @@ -121,7 +120,7 @@
"ts-jest": "29.0.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "4.8.4",
"typescript": "5.1",
"webpack": "^5.86.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^5.1.4",
Expand All @@ -143,7 +142,7 @@
"@grafana/runtime": "^10.2.2",
"@grafana/scenes": "^1.28.0",
"@grafana/schema": "^10.2.2",
"@grafana/ui": "^10.2.0",
"@grafana/ui": "10.2.0",
"@lifeomic/attempt": "^3.0.3",
"array-move": "^4.0.0",
"axios": "^1.6.7",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest/matchMedia.ts';
import 'jest/matchMedia';
import React from 'react';

import { fireEvent, render, screen } from '@testing-library/react';
Expand Down
2 changes: 1 addition & 1 deletion grafana-plugin/src/components/Collapse/Collapse.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest/matchMedia.ts';
import 'jest/matchMedia';
import React from 'react';

import { render, fireEvent, screen } from '@testing-library/react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest/matchMedia.ts';
import 'jest/matchMedia';
import React from 'react';

import { render, screen } from '@testing-library/react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'jest/matchMedia.ts';
import 'jest/matchMedia';
import React from 'react';

import { render, screen } from '@testing-library/react';
Expand Down
1 change: 1 addition & 0 deletions grafana-plugin/src/pages/incident/Incident.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ class _IncidentPage extends React.Component<IncidentPageProps, IncidentPageState
};

getPlaceholderReplaceFn = (entity: TimeLineItem) => {
// eslint-disable-next-line react/display-name
return (match: string) => {
switch (match) {
case 'author':
Expand Down
112 changes: 0 additions & 112 deletions grafana-plugin/src/plugin/PluginSetup/PluginSetup.test.tsx

This file was deleted.

Loading

0 comments on commit a13ab2a

Please sign in to comment.