Skip to content

Commit 5774eb4

Browse files
committed
Merge remote-tracking branch 'origin' into add-llm-scenes-app-example
2 parents 9020fd5 + 706e659 commit 5774eb4

File tree

538 files changed

+84155
-179793
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

538 files changed

+84155
-179793
lines changed

.github/dependabot.yml

+1-33
Original file line numberDiff line numberDiff line change
@@ -72,43 +72,11 @@ updates:
7272
open-pull-requests-limit: 3
7373
reviewers:
7474
- "grafana/plugins-platform-frontend"
75-
76-
- package-ecosystem: "npm"
77-
directory: "/panel-flot"
78-
schedule:
79-
interval: "monthly"
80-
open-pull-requests-limit: 3
81-
reviewers:
82-
- "grafana/plugins-platform-frontend"
8375

8476
- package-ecosystem: "npm"
8577
directory: "/panel-frame-select"
8678
schedule:
8779
interval: "monthly"
8880
open-pull-requests-limit: 3
8981
reviewers:
90-
- "grafana/plugins-platform-frontend"
91-
92-
- package-ecosystem: "npm"
93-
directory: "/panel-plotly"
94-
schedule:
95-
interval: "monthly"
96-
open-pull-requests-limit: 3
97-
reviewers:
98-
- "grafana/plugins-platform-frontend"
99-
100-
- package-ecosystem: "npm"
101-
directory: "/panel-scatterplot"
102-
schedule:
103-
interval: "monthly"
104-
open-pull-requests-limit: 3
105-
reviewers:
106-
- "grafana/plugins-platform-frontend"
107-
108-
- package-ecosystem: "npm"
109-
directory: "/panel-visx"
110-
schedule:
111-
interval: "monthly"
112-
open-pull-requests-limit: 3
113-
reviewers:
114-
- "grafana/plugins-platform-frontend"
82+
- "grafana/plugins-platform-frontend"

.github/workflows/integration-tests.yml

+114-103
Large diffs are not rendered by default.

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
.vscode
22
node_modules
3-
**/cypress/videos
4-
**/cypress/report.json
5-
**/cypress/screenshots/actual/
63
.DS_Store
74
**/test-results/
85
**/playwright-report/

README.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ This repository contains example plugins to showcase different use cases.
1919

2020
| Example | Description |
2121
| ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
22-
| [panel-flot](examples/panel-flot) | Shows how to use the [Flot](http://www.flotcharts.org) plotting library in a panel plugin. |
2322
| [panel-frame-select](examples/panel-frame-select) | Shows how to update panel options with values from a data query response. |
24-
| [panel-plotly](examples/panel-plotly) | Shows how to use the [Plotly](https://plotly.com/javascript/) graphing library in a panel plugin. |
25-
| [panel-scatterplot](examples/panel-scatterplot) | Shows how to use D3 and SVG to create a scatter plot panel. |
26-
| [panel-visx](examples/panel-visx) | Shows how to use [visx](https://github.com/airbnb/visx) to create a time series graph. |
2723
| [panel-basic](examples/panel-basic) | Shows how to build a panel plugin that uses the time series graph from `@grafana/ui` to read and update the dashboard time range. |
2824
| [panel-datalinks](examples/panel-datalinks) | Shows how to build a panel plugin that uses the datalinks functionality of Grafana. |
2925

@@ -42,11 +38,9 @@ This repository contains example plugins to showcase different use cases.
4238
4339
## Integration tests
4440

45-
Some of the examples in this repository contain integration tests that make use of [`@grafana/e2e`](https://npmjs.com/package/@grafana/e2e) package. These tests can be run individually by navigating to the example plugin and running one of the following commands:
41+
Some of the examples in this repository contain integration tests that make use of [`@grafana/plugin-e2e`](https://npmjs.com/package/@grafana/plugin-e2e) package. These tests can be run individually by navigating to the example plugin and running one of the following commands:
4642

47-
- `npm run e2e` - run integration tests
48-
- `npm run e2e:open` - open cypress ui and run integration tests
49-
- `npm run e2e:update` - run integration tests and update any screenshots
43+
- `npm run e2e` - run Playwright e2e tests
5044

5145
### Testing against latest versions of Grafana
5246

@@ -98,17 +92,17 @@ jobs:
9892
- uses: actions/checkout@v3
9993
- uses: actions/setup-node@v3
10094
with:
101-
node-version: "20"
95+
node-version: '20'
10296
- name: Install dependencies
10397
run: npm install
10498
- name: Build plugin
10599
run: npm run build
106100
- name: Compatibility check
107101
uses: grafana/plugin-actions/is-compatible@v1
108102
with:
109-
module: "./src/module.ts"
110-
comment-pr: "yes"
111-
fail-if-incompatible: "no"
103+
module: './src/module.ts'
104+
comment-pr: 'yes'
105+
fail-if-incompatible: 'no'
112106
```
113107
114108
This runs a compatibility check for the latest release of Grafana plugins API in your project every time a new push or pull request is open. If it finds an error you will see a message indicating you have an incompatibility.

examples/app-basic/.config/.cprc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "3.5.0"
2+
"version": "4.10.4"
33
}

examples/app-basic/.config/Dockerfile

+37-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ ARG grafana_image=grafana-enterprise
33

44
FROM grafana/${grafana_image}:${grafana_version}
55

6+
ARG development=false
7+
8+
9+
ENV DEV "${development}"
10+
611
# Make it as simple as possible to access the grafana instance for development purposes
712
# Do NOT enable these settings in a public facing / production grafana instance
813
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
@@ -11,6 +16,37 @@ ENV GF_AUTH_BASIC_ENABLED "false"
1116
# Set development mode so plugins can be loaded without the need to sign
1217
ENV GF_DEFAULT_APP_MODE "development"
1318

14-
# Inject livereload script into grafana index.html
19+
20+
LABEL maintainer="Grafana Labs <[email protected]>"
21+
22+
ENV GF_PATHS_HOME="/usr/share/grafana"
23+
WORKDIR $GF_PATHS_HOME
24+
1525
USER root
26+
27+
# Installing supervisor and inotify-tools
28+
RUN if [ "${development}" = "true" ]; then \
29+
if grep -i -q alpine /etc/issue; then \
30+
apk add supervisor inotify-tools git; \
31+
elif grep -i -q ubuntu /etc/issue; then \
32+
DEBIAN_FRONTEND=noninteractive && \
33+
apt-get update && \
34+
apt-get install -y supervisor inotify-tools git && \
35+
rm -rf /var/lib/apt/lists/*; \
36+
else \
37+
echo 'ERROR: Unsupported base image' && /bin/false; \
38+
fi \
39+
fi
40+
41+
COPY supervisord/supervisord.conf /etc/supervisor.d/supervisord.ini
42+
COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
43+
44+
45+
46+
# Inject livereload script into grafana index.html
1647
RUN sed -i 's|</body>|<script src="http://localhost:35729/livereload.js"></script></body>|g' /usr/share/grafana/public/views/index.html
48+
49+
50+
COPY entrypoint.sh /entrypoint.sh
51+
RUN chmod +x /entrypoint.sh
52+
ENTRYPOINT ["/entrypoint.sh"]
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
if [ "${DEV}" = "false" ]; then
4+
echo "Starting test mode"
5+
exec /run.sh
6+
fi
7+
8+
echo "Starting development mode"
9+
10+
if grep -i -q alpine /etc/issue; then
11+
exec /usr/bin/supervisord -c /etc/supervisord.conf
12+
elif grep -i -q ubuntu /etc/issue; then
13+
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
14+
else
15+
echo 'ERROR: Unsupported base image'
16+
exit 1
17+
fi
18+

examples/app-basic/.config/jest-setup.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*/
77

88
import '@testing-library/jest-dom';
9+
import { TextEncoder, TextDecoder } from 'util';
10+
11+
Object.assign(global, { TextDecoder, TextEncoder });
912

1013
// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
1114
Object.defineProperty(global, 'matchMedia', {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[supervisord]
2+
nodaemon=true
3+
user=root
4+
5+
[program:grafana]
6+
user=root
7+
directory=/var/lib/grafana
8+
command=/run.sh
9+
stdout_logfile=/dev/fd/1
10+
stdout_logfile_maxbytes=0
11+
redirect_stderr=true
12+
killasgroup=true
13+
stopasgroup=true
14+
autostart=true
15+

examples/app-basic/.config/webpack/webpack.config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import LiveReloadPlugin from 'webpack-livereload-plugin';
1212
import path from 'path';
1313
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
1414
import { Configuration } from 'webpack';
15+
import { GrafanaPluginMetaExtractor } from '@grafana/plugin-meta-extractor';
1516

1617
import { getPackageJson, getPluginJson, hasReadme, getEntries, isWSL } from './utils';
1718
import { SOURCE_DIR, DIST_DIR } from './constants';
@@ -139,6 +140,7 @@ const config = async (env): Promise<Configuration> => {
139140
},
140141

141142
plugins: [
143+
new GrafanaPluginMetaExtractor(),
142144
new CopyWebpackPlugin({
143145
patterns: [
144146
// If src/README.md exists use it; otherwise the root README

0 commit comments

Comments
 (0)