Skip to content

Commit

Permalink
Update dependencies (#146)
Browse files Browse the repository at this point in the history
* update frontend dependencies

* update frontend dependencies

* update @grafana/ui

* update test setup

* put back @types/testing-library__jest-dom

* revert

* update go version

* npx @grafana/create-plugin@latest update

* use version-support-policy

* exclude grafana-enterprise

* try exclude

* try exclude again

* try exclude again 2

* try exclude again

* try exclude again

* demo step

* skip steps for fast testing

* demo

* demo

* demo

* demo

* demo

* exclude enterprise

* move dependabot.yml back
  • Loading branch information
itsmylife authored Jun 6, 2024
1 parent 2c12121 commit 56292eb
Show file tree
Hide file tree
Showing 9 changed files with 937 additions and 2,821 deletions.
2 changes: 1 addition & 1 deletion .config/.cprc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "4.4.4"
"version": "4.11.4"
}
27 changes: 19 additions & 8 deletions .config/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ ARG grafana_image=grafana-enterprise

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

ARG development=false

ARG GO_VERSION=1.21.6
ARG GO_ARCH=amd64

ENV DEV "${development}"

# Make it as simple as possible to access the grafana instance for development purposes
# Do NOT enable these settings in a public facing / production grafana instance
ENV GF_AUTH_ANONYMOUS_ORG_ROLE "Admin"
Expand All @@ -22,38 +26,45 @@ WORKDIR $GF_PATHS_HOME

USER root


# Installing supervisor and inotify-tools
RUN if grep -i -q alpine /etc/issue; then \
apk add supervisor inotify-tools git; \
RUN if [ "${development}" = "true" ]; then \
if grep -i -q alpine /etc/issue; then \
apk add supervisor inotify-tools git; \
elif grep -i -q ubuntu /etc/issue; then \
DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y supervisor inotify-tools git && \
rm -rf /var/lib/apt/lists/*; \
else \
echo 'ERROR: Unsupported base image' && /bin/false; \
fi \
fi

COPY supervisord/supervisord.conf /etc/supervisor.d/supervisord.ini
COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf


# Installing Go
RUN curl -O -L https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
RUN if [ "${development}" = "true" ]; then \
curl -O -L https://golang.org/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
rm -rf /usr/local/go && \
tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz && \
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bashrc && \
rm -f go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
rm -f go${GO_VERSION}.linux-${GO_ARCH}.tar.gz; \
fi

# Installing delve for debugging
RUN /usr/local/go/bin/go install github.com/go-delve/delve/cmd/dlv@latest
RUN if [ "${development}" = "true" ]; then \
/usr/local/go/bin/go install github.com/go-delve/delve/cmd/dlv@latest; \
fi

# Installing mage for plugin (re)building
RUN git clone https://github.com/magefile/mage; \
RUN if [ "${development}" = "true" ]; then \
git clone https://github.com/magefile/mage; \
cd mage; \
export PATH=$PATH:/usr/local/go/bin; \
go run bootstrap.go
go run bootstrap.go; \
fi

# Inject livereload script into grafana index.html
RUN sed -i 's|</body>|<script src="http://localhost:35729/livereload.js"></script></body>|g' /usr/share/grafana/public/views/index.html
Expand Down
8 changes: 8 additions & 0 deletions .config/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
#!/bin/sh

if [ "${DEV}" = "false" ]; then
echo "Starting test mode"
exec /run.sh
fi

echo "Starting development mode"

if grep -i -q alpine /etc/issue; then
exec /usr/bin/supervisord -c /etc/supervisord.conf
elif grep -i -q ubuntu /etc/issue; then
Expand All @@ -8,3 +15,4 @@ else
echo 'ERROR: Unsupported base image'
exit 1
fi

3 changes: 3 additions & 0 deletions .config/jest-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/

import '@testing-library/jest-dom';
import { TextEncoder, TextDecoder } from 'util';

Object.assign(global, { TextDecoder, TextEncoder });

// https://jestjs.io/docs/manual-mocks#mocking-methods-which-are-not-implemented-in-jsdom
Object.defineProperty(global, 'matchMedia', {
Expand Down
2 changes: 1 addition & 1 deletion .config/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const config = async (env): Promise<Configuration> => {
loader: 'swc-loader',
options: {
jsc: {
baseUrl: path.resolve(__dirname, 'src'),
baseUrl: path.resolve(process.cwd(), SOURCE_DIR),
target: 'es2015',
loose: false,
parser: {
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
- name: Resolve Grafana E2E versions
id: resolve-versions
uses: grafana/plugin-actions/e2e-version@main
with:
version-resolver-type: version-support-policy

playwright-tests:
needs: resolve-versions
Expand All @@ -31,6 +33,8 @@ jobs:
fail-fast: false
matrix:
GRAFANA_IMAGE: ${{fromJson(needs.resolve-versions.outputs.matrix)}}
exclude:
- GRAFANA_IMAGE: { name: 'grafana-enterprise' }
name: e2e ${{ matrix.GRAFANA_IMAGE.name }}
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/grafana/prometheus-amazon

go 1.21.0
go 1.22.4

require (
github.com/grafana/grafana-aws-sdk v0.25.0
Expand Down
68 changes: 36 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,54 @@
"build": "webpack -c ./.config/webpack/webpack.config.ts --env production",
"dev": "webpack -w -c ./.config/webpack/webpack.config.ts --env development",
"test": "jest --watch --onlyChanged",
"e2e": "yarn playwright test",
"e2e": "playwright test",
"e2e:ui": "yarn playwright test --ui",
"test:ci": "jest --passWithNoTests --maxWorkers 4",
"typecheck": "tsc --noEmit",
"lint": "eslint --cache --ignore-path ./.gitignore --ext .js,.jsx,.ts,.tsx .",
"lint:fix": "yarn run lint --fix",
"server:configured": "GRAFANA_VERSION=11.0.0 GRAFANA_IMAGE=grafana-enterprise docker-compose up -d",
"sign": "npx --yes @grafana/sign-plugin@latest --rootUrls https://github.com/grafana/prometheus-amazon",
"spellcheck": "cspell -c cspell.config.json \"**/*.{ts,tsx,js,go,md,mdx,yml,yaml,json,scss,css}\""
"sign": "npx --yes @grafana/sign-plugin@latest",
"spellcheck": "cspell -c cspell.config.json \"**/*.{ts,tsx,js,go,md,mdx,yml,yaml,json,scss,css}\"",
"server": "docker-compose up --build"
},
"author": "Grafana Labs",
"license": "Apache-2.0",
"devDependencies": {
"@babel/core": "7.21.4",
"@emotion/eslint-plugin": "11.11.0",
"@grafana/e2e": "11.1.0-173675",
"@grafana/e2e-selectors": "11.1.0-173675",
"@grafana/e2e-selectors": "11.1.0-181468",
"@grafana/eslint-config": "7.0.0",
"@grafana/plugin-e2e": "1.1.1",
"@grafana/plugin-e2e": "1.3.2",
"@grafana/tsconfig": "1.3.0-rc1",
"@playwright/test": "1.43.1",
"@swc/core": "1.3.90",
"@swc/helpers": "0.5.8",
"@swc/jest": "0.2.26",
"@testing-library/dom": "9.3.4",
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.1",
"@playwright/test": "1.44.1",
"@swc/core": "1.5.25",
"@swc/helpers": "0.5.11",
"@swc/jest": "0.2.36",
"@testing-library/dom": "10.1.0",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"@types/eslint": "8.56.2",
"@types/eslint": "8.56.10",
"@types/jest": "29.5.12",
"@types/lodash": "4.17.0",
"@types/node": "20.11.19",
"@types/react": "18.2.79",
"@types/react-dom": "18.2.19",
"@types/lodash": "4.17.4",
"@types/node": "20.14.2",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@types/react-router-dom": "5.3.3",
"@types/semver": "7.5.8",
"@types/testing-library__jest-dom": "5.14.9",
"@types/uuid": "9.0.8",
"@types/testing-library__jest-dom": "5.14.9",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"copy-webpack-plugin": "12.0.2",
"cspell": "6.13.3",
"css-loader": "6.10.0",
"css-loader": "7.1.2",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-deprecation": "2.0.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jest": "27.8.0",
"eslint-plugin-jest": "28.5.0",
"eslint-plugin-jsdoc": "48.2.3",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-lodash": "7.4.0",
Expand All @@ -62,17 +65,17 @@
"identity-obj-proxy": "3.0.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"prettier": "3.2.5",
"prettier": "3.3.1",
"react-popper-tooltip": "4.4.2",
"replace-in-file-webpack-plugin": "1.0.6",
"sass": "1.70.0",
"sass-loader": "13.3.2",
"sass": "1.77.4",
"sass-loader": "14.2.1",
"style-loader": "3.3.4",
"swc-loader": "0.2.6",
"testing-library-selector": "0.3.1",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "5.4.4",
"typescript": "5.4.5",
"webpack": "5.91.0",
"webpack-cli": "5.1.4",
"webpack-livereload-plugin": "3.0.2"
Expand All @@ -83,17 +86,18 @@
"dependencies": {
"@emotion/css": "11.11.2",
"@grafana/aws-sdk": "0.3.3",
"@grafana/data": "11.1.0-173675",
"@grafana/experimental": "1.7.10",
"@grafana/prometheus": "11.1.0-173675",
"@grafana/runtime": "11.1.0-173675",
"@grafana/schema": "11.1.0-173675",
"@grafana/ui": "11.1.0-173675",
"@grafana/data": "11.1.0-181468",
"@grafana/experimental": "1.7.11",
"@grafana/prometheus": "11.1.0-181468",
"@grafana/runtime": "11.1.0-181468",
"@grafana/schema": "11.1.0-181468",
"@grafana/ui": "11.1.0-181468",
"lodash": "4.17.21",
"react": "18.2.0",
"react-dom": "18.2.0",
"rxjs": "7.8.1",
"semver": "7.6.0",
"uuid": "9.0.1"
"uuid": "9.0.1",
"tslib": "2.5.3"
}
}
Loading

0 comments on commit 56292eb

Please sign in to comment.