Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cloudeteer/grafana-pdf-report-app
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0493725bdcb1cbdc44bb8f71958b2ea1ff6c1a2c
Choose a base ref
..
head repository: cloudeteer/grafana-pdf-report-app
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3c0bc104346faa6b1dce31a28e4f1cdcd04041f9
Choose a head ref
4 changes: 2 additions & 2 deletions .ci/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ services:
- IGNORE_HTTPS_ERRORS=true

chrome_plain:
image: chromedp/headless-shell:130.0.6683.2
image: chromedp/headless-shell:132.0.6793.2
shm_size: 2G
init: true
network_mode: service:grafana_plain
@@ -125,7 +125,7 @@ services:
- IGNORE_HTTPS_ERRORS=true

chrome_tls:
image: chromedp/headless-shell:130.0.6683.2
image: chromedp/headless-shell:132.0.6793.2
shm_size: 2G
init: true
network_mode: service:grafana_tls
2 changes: 1 addition & 1 deletion .config/.cprc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "5.3.1"
"version": "5.7.2"
}
4 changes: 2 additions & 2 deletions .config/jest-setup.js
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ Object.assign(global, { TextDecoder, TextEncoder });
// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Object.defineProperty(global, 'matchMedia', {
writable: true,
value: jest.fn().mockImplementation((query) => ({
value: (query) => ({
matches: false,
media: query,
onchange: null,
@@ -22,7 +22,7 @@ Object.defineProperty(global, 'matchMedia', {
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
dispatchEvent: jest.fn(),
})),
}),
});

HTMLCanvasElement.prototype.getContext = () => {};
31 changes: 20 additions & 11 deletions .config/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import path from 'path';
import ReplaceInFileWebpackPlugin from 'replace-in-file-webpack-plugin';
import TerserPlugin from 'terser-webpack-plugin';
import { SubresourceIntegrityPlugin } from 'webpack-subresource-integrity';
import { type Configuration, BannerPlugin } from 'webpack';
import LiveReloadPlugin from 'webpack-livereload-plugin';
import VirtualModulesPlugin from 'webpack-virtual-modules';
@@ -96,6 +97,18 @@ const config = async (env): Promise<Configuration> => {

module: {
rules: [
// This must come first in the rules array otherwise it breaks sourcemaps.
{
test: /src\/(?:.*\/)?module\.tsx?$/,
use: [
{
loader: 'imports-loader',
options: {
imports: `side-effects grafana-public-path`,
},
},
],
},
{
exclude: /(node_modules)/,
test: /\.[tj]sx?$/,
@@ -116,17 +129,6 @@ const config = async (env): Promise<Configuration> => {
},
},
},
{
test: /src\/(?:.*\/)?module\.tsx?$/,
use: [
{
loader: 'imports-loader',
options: {
imports: `side-effects grafana-public-path`,
},
},
],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
@@ -160,6 +162,9 @@ const config = async (env): Promise<Configuration> => {
format: {
comments: (_, { type, value }) => type === 'comment2' && value.trim().startsWith('[create-plugin]'),
},
compress: {
drop_console: ['log', 'info'],
},
},
}),
],
@@ -176,6 +181,7 @@ const config = async (env): Promise<Configuration> => {
path: path.resolve(process.cwd(), DIST_DIR),
publicPath: `public/plugins/${pluginJson.id}/`,
uniqueName: pluginJson.id,
crossOriginLoading: 'anonymous',
},

plugins: [
@@ -225,6 +231,9 @@ const config = async (env): Promise<Configuration> => {
],
},
]),
new SubresourceIntegrityPlugin({
hashFuncNames: ['sha256'],
}),
...(env.development
? [
new LiveReloadPlugin(),
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -48,11 +48,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
uses: github/codeql-action/init@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
@@ -78,6 +78,6 @@ jobs:
"${CODEQL_EXTRACTOR_GO_ROOT}/tools/linux64/go-extractor" ./...
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@f0f3afee809481da311ca3a6ff1ff51d81dbeb24 # v3.26.4
uses: github/codeql-action/analyze@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
with:
category: /language:${{ matrix.language }}
6 changes: 3 additions & 3 deletions .github/workflows/is-compatible.yml
Original file line number Diff line number Diff line change
@@ -5,9 +5,9 @@ jobs:
compatibilitycheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '20'
cache: 'yarn'
@@ -19,4 +19,4 @@ jobs:
run: yarn build

- name: Compatibility check
run: npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data@9.3.2,@grafana/ui@9.3.2,@grafana/runtime@9.3.2
run: npx @grafana/levitate@latest is-compatible --path src/module.ts --target @grafana/data@11.1.3,@grafana/ui@11.1.3,@grafana/runtime@11.1.3
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -16,11 +16,11 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
with:
args: --timeout 5m
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: local modifications for release
run: |
npm version '${{ github.ref_name }}' --no-git-tag-version
@@ -21,7 +21,7 @@ jobs:
mv package.tmp.json package.json
rm -rf tools # Remove tools directory
- uses: grafana/plugin-actions/build-plugin@d381e10ef234721a03e28af8017e290dc225e945 # commit of 2024-07-08
- uses: grafana/plugin-actions/build-plugin@7954f7aa08f1450c1ca49e20be401e4c3f8865f8 # commit of 2024-07-08
with:
policy_token: ${{ secrets.GRAFANA_ACCESS_POLICY_TOKEN }}
go-version: '1.23'
8 changes: 4 additions & 4 deletions .github/workflows/step_build.yml
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Node.js environment
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '20'
cache: 'yarn'
@@ -86,7 +86,7 @@ jobs:
- name: Setup Go environment
if: steps.check-for-backend.outputs.has-backend == 'true'
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: '1.23'

@@ -105,7 +105,7 @@ jobs:
args: build

- name: Upload build artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: build-artifacts
path: dist
10 changes: 5 additions & 5 deletions .github/workflows/step_e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ jobs:
snapshots-folder: remote-chrome

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Download build artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
@@ -33,7 +33,7 @@ jobs:
path: dist

- name: Setup Node.js environment
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: '20'
cache: 'yarn'
@@ -70,14 +70,14 @@ jobs:
# yarn e2e:server:down

- name: Compare PDF report from plain server
uses: nowsprinting/diff-pdf-action@ab8fcdda0b2ea2c9f757df83fd26d0b91358a01e # v1.2.0
uses: nowsprinting/diff-pdf-action@2370f6da4625b181e29e0aedaae32fcaa67064f9 # v1.2.1
with:
file1: default.pdf
file2: .ci/reports/default.pdf
options: --verbose --output-diff=default-diff.pdf

- name: Compare PDF report from TLS server
uses: nowsprinting/diff-pdf-action@ab8fcdda0b2ea2c9f757df83fd26d0b91358a01e # v1.2.0
uses: nowsprinting/diff-pdf-action@2370f6da4625b181e29e0aedaae32fcaa67064f9 # v1.2.1
with:
file1: alternative.pdf
file2: .ci/reports/alternative.pdf
@@ -91,7 +91,7 @@ jobs:

- name: Upload UI Test artifacts
if: failure()
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: ui-test-output-${{ matrix.grafana-version }}
path: |
6 changes: 3 additions & 3 deletions .github/workflows/step_package.yml
Original file line number Diff line number Diff line change
@@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Go environment
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: '1.23'

@@ -61,7 +61,7 @@ jobs:
# shell: bash

- name: Upload plugin artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: plugin-artifacts
path: |
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ module github.com/cloudeteer/grafana-pdf-report-app
go 1.23

require (
github.com/chromedp/cdproto v0.0.0-20241022234722-4d5d5faf59fb
github.com/chromedp/chromedp v0.10.0
github.com/chromedp/cdproto v0.0.0-20241030022559-23c28aebe8cb
github.com/chromedp/chromedp v0.11.1
github.com/grafana/grafana-plugin-sdk-go v0.258.0
github.com/magefile/mage v1.15.0
github.com/sethvargo/go-envconfig v1.1.0
11 changes: 4 additions & 7 deletions go.sum
Original file line number Diff line number Diff line change
@@ -13,12 +13,10 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE=
github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ=
github.com/chromedp/cdproto v0.0.0-20240801214329-3f85d328b335/go.mod h1:GKljq0VrfU4D5yc+2qA6OVr8pmO/MBbPEWqWQ/oqGEs=
github.com/chromedp/cdproto v0.0.0-20241022234722-4d5d5faf59fb h1:noKVm2SsG4v0Yd0lHNtFYc9EUxIVvrr4kJ6hM8wvIYU=
github.com/chromedp/cdproto v0.0.0-20241022234722-4d5d5faf59fb/go.mod h1:4XqMl3iIW08jtieURWL6Tt5924w21pxirC6th662XUM=
github.com/chromedp/chromedp v0.10.0 h1:bRclRYVpMm/UVD76+1HcRW9eV3l58rFfy7AdBvKab1E=
github.com/chromedp/chromedp v0.10.0/go.mod h1:ei/1ncZIqXX1YnAYDkxhD4gzBgavMEUu7JCKvztdomE=
github.com/chromedp/sysutil v1.0.0/go.mod h1:kgWmDdq8fTzXYcKIBqIYvRRTnYb9aNS9moAV0xufSww=
github.com/chromedp/cdproto v0.0.0-20241030022559-23c28aebe8cb h1:yBPpAakATGLWZsVgYRcU9FopbOqzoazzbFaStQ9DCMc=
github.com/chromedp/cdproto v0.0.0-20241030022559-23c28aebe8cb/go.mod h1:4XqMl3iIW08jtieURWL6Tt5924w21pxirC6th662XUM=
github.com/chromedp/chromedp v0.11.1 h1:Spca8egFqUlv+JDW+yIs+ijlHlJDPufgrfXPwtq6NMs=
github.com/chromedp/chromedp v0.11.1/go.mod h1:lr8dFRLKsdTTWb75C/Ttol2vnBKOSnt0BW8R9Xaupi8=
github.com/chromedp/sysutil v1.1.0 h1:PUFNv5EcprjqXZD9nJb9b/c9ibAbxiYo4exNWZyipwM=
github.com/chromedp/sysutil v1.1.0/go.mod h1:WiThHUdltqCNKGc4gaU50XgYjwjYIhKWoHGPTUfWTJ8=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -281,7 +279,6 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo=
golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Loading