-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4979 from grafana/dev
v1.9.21
- Loading branch information
Showing
27 changed files
with
13,745 additions
and
13,090 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,18 @@ | ||
name: "Install frontend dependencies" | ||
description: "Setup node + install frontend dependencies" | ||
inputs: | ||
working-directory: | ||
description: "Relative path to oncall/grafana-plugin directory" | ||
required: false | ||
default: "." | ||
name: Install frontend dependencies | ||
description: Setup node/pnpm + install frontend dependencies | ||
runs: | ||
using: "composite" | ||
using: composite | ||
steps: | ||
- name: Determine grafana-plugin directory location | ||
id: grafana-plugin-directory | ||
shell: bash | ||
run: echo "grafana-plugin-directory=${{ inputs.working-directory }}/grafana-plugin" >> $GITHUB_OUTPUT | ||
- name: Determine yarn.lock location | ||
id: yarn-lock-location | ||
shell: bash | ||
# yamllint disable rule:line-length | ||
run: echo "yarn-lock-location=${{ steps.grafana-plugin-directory.outputs.grafana-plugin-directory }}/yarn.lock" >> $GITHUB_OUTPUT | ||
# yamllint enable rule:line-length | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9.1.4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.15.1 | ||
cache: "yarn" | ||
cache-dependency-path: ${{ steps.yarn-lock-location.outputs.yarn-lock-location }} | ||
- name: Use cached frontend dependencies | ||
id: cache-frontend-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ inputs.working-directory }}/grafana-plugin/node_modules | ||
# yamllint disable rule:line-length | ||
key: ${{ runner.os }}-frontend-node-modules-${{ hashFiles(steps.yarn-lock-location.outputs.yarn-lock-location) }} | ||
# yamllint enable rule:line-length | ||
cache: pnpm | ||
cache-dependency-path: grafana-plugin/pnpm-lock.yaml | ||
- name: Install frontend dependencies | ||
if: steps.cache-frontend-dependencies.outputs.cache-hit != 'true' | ||
shell: bash | ||
working-directory: ${{ steps.grafana-plugin-directory.outputs.grafana-plugin-directory }} | ||
run: yarn install --frozen-lockfile --prefer-offline --network-timeout 500000 | ||
working-directory: grafana-plugin | ||
run: pnpm install --frozen-lockfile --prefer-offline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ venv | |
.DS_Store | ||
.env | ||
|
||
yarn.lock | ||
pnpm.lock | ||
node_modules | ||
|
||
test-results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ extends: default | |
|
||
ignore: | | ||
helm/oncall/templates/**/*.yaml | ||
pnpm-lock.yaml | ||
rules: | ||
line-length: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
engine/apps/alerts/migrations/0058_alter_alertgroup_reason_to_skip_escalation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.2.15 on 2024-09-02 13:34 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('alerts', '0057_remove_alertgroup_slack_log_message_db'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='alertgroup', | ||
name='reason_to_skip_escalation', | ||
field=models.IntegerField(choices=[(0, 'account_inactive'), (1, 'is_archived'), (2, 'no_reason'), (3, 'rate_limited'), (4, 'channel_not_specified'), (5, 'restricted_action'), (6, 'invalid_auth')], default=2), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,11 @@ | |
import pytest | ||
from django.urls import reverse | ||
from rest_framework import status | ||
from rest_framework.exceptions import ValidationError | ||
from rest_framework.test import APIClient | ||
|
||
from apps.api.permissions import LegacyAccessControlRole | ||
from apps.grafana_plugin.serializers.sync_data import SyncTeamSerializer | ||
from apps.grafana_plugin.sync_data import SyncData, SyncSettings, SyncUser | ||
from apps.grafana_plugin.tasks.sync_v2 import start_sync_organizations_v2 | ||
|
||
|
@@ -136,3 +138,24 @@ def test_sync_v2_content_encoding( | |
|
||
assert response.status_code == status.HTTP_200_OK | ||
mock_sync.assert_called() | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"test_team, validation_pass", | ||
[ | ||
({"team_id": 1, "name": "Test Team", "email": "", "avatar_url": ""}, True), | ||
({"team_id": 1, "name": "", "email": "", "avatar_url": ""}, False), | ||
({"name": "ABC", "email": "", "avatar_url": ""}, False), | ||
({"team_id": 1, "name": "ABC", "email": "[email protected]", "avatar_url": ""}, True), | ||
({"team_id": 1, "name": "123", "email": "<invalid email>", "avatar_url": ""}, True), | ||
], | ||
) | ||
@pytest.mark.django_db | ||
def test_sync_team_serialization(test_team, validation_pass): | ||
serializer = SyncTeamSerializer(data=test_team) | ||
validation_error = None | ||
try: | ||
serializer.is_valid(raise_exception=True) | ||
except ValidationError as e: | ||
validation_error = e | ||
assert (validation_error is None) == validation_pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.