Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
34 changes: 13 additions & 21 deletions .devcontainer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,22 @@ run-all: run-agent-ci run-managed-ci run-qan-ci run-vmproxy-ci ## Run all go ser
run: run-all ## Aliased to "run-all"
echo "run is aliased to run-all"

ui-setup: ## Install UI dependencies
UI_INSTALL_STAMP := ui/node_modules/.install.stamp
UI_DEPS := ui/package.json ui/yarn.lock $(wildcard ui/apps/*/package.json) $(wildcard ui/packages/*/package.json)

ui-setup: $(UI_INSTALL_STAMP) ## Install UI dependencies (skips yarn install if deps are unchanged)

$(UI_INSTALL_STAMP): $(UI_DEPS)
cd ui && yarn install
@mkdir -p ui/node_modules && touch $@

run-ui: ui-setup setup-livereload ## Start vite dev server for UI with HMR
run-ui: ui-setup setup-livereload ## Start vite dev server for UI with HMR, QAN webpack watch and dashboard JSON sync
mv /srv/grafana/plugins/pmm-compat-app /srv/grafana/plugins/pmm-compat-app.bak; \
ln -sfn $(CURDIR)/ui/apps/pmm-compat/dist /srv/grafana/plugins/pmm-compat-app; \
rm -rf /srv/grafana/plugins/pmm-app/dist; \
ln -sfn $(CURDIR)/ui/apps/pmm-app/dist /srv/grafana/plugins/pmm-app/dist; \
supervisorctl restart grafana; \
trap 'rm -f /srv/grafana/plugins/pmm-compat-app; mv /srv/grafana/plugins/pmm-compat-app.bak /srv/grafana/plugins/pmm-compat-app; supervisorctl restart grafana' EXIT; \
trap 'rm -f /srv/grafana/plugins/pmm-compat-app; mv /srv/grafana/plugins/pmm-compat-app.bak /srv/grafana/plugins/pmm-compat-app; rm -f /srv/grafana/plugins/pmm-app/dist; supervisorctl restart grafana' EXIT; \
cd ui && yarn dev

build-ui: ui-setup ## Build UI and deploy to system dirs
Expand All @@ -78,20 +86,9 @@ build-ui: ui-setup ## Build UI and deploy to system dirs
rm -rf /usr/share/percona-dashboards/panels/pmm-compat-app /srv/grafana/plugins/pmm-compat-app
cp -r ui/apps/pmm-compat/dist /usr/share/percona-dashboards/panels/pmm-compat-app
cp -r ui/apps/pmm-compat/dist /srv/grafana/plugins/pmm-compat-app
supervisorctl restart grafana

run-qan-ui: setup-qan-ui setup-livereload ## Runs QAN UI with webpack livereload
rm -rf /srv/grafana/plugins/pmm-app/dist
ln -sfn $(CURDIR)/dashboards/pmm-app/dist/ /srv/grafana/plugins/pmm-app/dist;
cd dashboards/pmm-app && yarn dev

build-qan-ui: setup-qan-ui ## Build QAN UI and deploy
cd dashboards/pmm-app && yarn build
rm -rf /srv/grafana/plugins/pmm-app/dist
cp -r dashboards/pmm-app/dist /srv/grafana/plugins/pmm-app/dist

setup-qan-ui: ## Installs QAN UI dependencies
cd dashboards/pmm-app && yarn install
cp -r ui/apps/pmm-app/dist /srv/grafana/plugins/pmm-app/dist
supervisorctl restart grafana

setup-livereload: ## Add livereload scripts to grafana index file
grep -q "35729/livereload.js" /usr/share/grafana/public/views/index.html || \
Expand All @@ -109,11 +106,6 @@ grafana-be-build:
cp ./bin/linux/amd64/grafana /usr/sbin/grafana && \
supervisorctl restart grafana

reload-dashboards:
rm -r /usr/share/percona-dashboards/panels/pmm-app/dist/dashboards
cp -r /root/go/src/github.com/percona/pmm/dashboards/dashboards /usr/share/percona-dashboards/panels/pmm-app/dist/dashboards
supervisorctl restart grafana

# TODO https://jira.percona.com/browse/PMM-3484, see maincover_test.go
# run-race-cover: install-race ## Run pmm-managed with race detector and collect coverage information.
# go test -coverpkg="github.com/percona/pmm/managed/..." \
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/dev/docs/ @percona/pmm-review-be
/documentation/ @percona/pmm-docs
/ui/ @percona/pmm-review-fe
/ui/apps/pmm-app/ @nailya @percona/pmm-review-fe
/dashboards/ @nailya @percona/pmm-review-fe
/api/ @percona/pmm-review-be
**/go.mod @percona/pmm-review-be
Expand Down
79 changes: 3 additions & 76 deletions .github/workflows/dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,79 +9,6 @@ permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
actions: write

steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install NodeJS
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "22"
cache: "yarn"
cache-dependency-path: dashboards/pmm-app/yarn.lock

- name: Verify plugin.json dashboard paths exist
run: |
missing=$(jq -r '.includes[] | select(.path) | .path' dashboards/pmm-app/src/plugin.json \
| while read -r p; do [ -f "dashboards/$p" ] || echo "$p"; done)
if [ -n "$missing" ]; then
echo "::error::plugin.json references dashboard files that do not exist:"
echo "$missing" | sed 's/^/ - /'
exit 1
fi

- name: Install deps
run: make -C dashboards install

- name: Build Grafana Dashboards
run: make -C dashboards build

- name: Upload the build artefacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: build-dist
path: dashboards/pmm-app/dist/
if-no-files-found: error

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Install NodeJS
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "22"
cache: "yarn"
cache-dependency-path: dashboards/pmm-app/yarn.lock

- name: Install deps
run: make -C dashboards install

- name: Run lint
run: cd dashboards/pmm-app && yarn lint:check

- name: Run unit tests
run: cd dashboards/pmm-app && yarn test:ci

- name: Upload unit test coverage
if: github.event.pull_request.head.repo.full_name == github.repository
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
fail_ci_if_error: true
flags: unittests # optional
name: codecov-umbrella
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

check:
name: Check
runs-on: ubuntu-latest
Expand All @@ -95,7 +22,7 @@ jobs:
id: changed
run: |
git diff --name-only ${{ github.event.pull_request.base.sha }} HEAD \
| grep -E '^dashboards/dashboards/.*\.json$' \
| grep -E '^dashboards/.*\.json$' \
| sort -u > changed_dashboards.txt || true
echo "count=$(wc -l < changed_dashboards.txt | tr -d ' ')" >> $GITHUB_OUTPUT

Expand Down Expand Up @@ -131,7 +58,7 @@ jobs:
fi

workflow_success:
needs: [tests, build]
needs: [check]
name: Slack Notification success
runs-on: ubuntu-latest
env:
Expand All @@ -149,7 +76,7 @@ jobs:

workflow_failure:
if: ${{ failure() }}
needs: [tests, build]
needs: [check]
name: Slack Notification failure
runs-on: ubuntu-latest
env:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- "api-tests/**"
- "dev/docs/**"
- "documentation/**"
- "dashboards/**"
- "managed/**"
- "qan-api2/**"
- "vmproxy/**"
Expand Down Expand Up @@ -38,6 +37,17 @@ jobs:
cache: yarn
cache-dependency-path: ui/yarn.lock

- name: Verify plugin.json dashboard paths exist
working-directory: ${{ github.workspace }}
run: |
missing=$(jq -r '.includes[] | select(.path) | .path' ui/apps/pmm-app/src/plugin.json \
| while read -r p; do [ -f "$p" ] || echo "$p"; done)
if [ -n "$missing" ]; then
echo "::error::plugin.json references dashboard files that do not exist:"
echo "$missing" | sed 's/^/ - /'
exit 1
fi

- name: Check formatting
run: make format-check

Expand Down
9 changes: 4 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Each PMM component has a dedicated guide with architecture, directory structure,
| **qan-api2** (query analytics) | [qan-api2/AGENTS.md](qan-api2/AGENTS.md) | `qan-api2/**` |
| **vmproxy** (VictoriaMetrics proxy) | [vmproxy/AGENTS.md](vmproxy/AGENTS.md) | `vmproxy/**` |
| **UI** (React frontend) | [ui/AGENTS.md](ui/AGENTS.md) | `ui/**` |
| **Dashboards** (Grafana dashboard definitions) | [dashboards/dashboards/AGENTS.md](dashboards/dashboards/AGENTS.md) | `dashboards/dashboards/**` |
| **QAN App** (Grafana plugin & QAN panel) | [dashboards/pmm-app/AGENTS.md](dashboards/pmm-app/AGENTS.md) | `dashboards/pmm-app/**` |
| **Dashboards** (Grafana dashboard definitions) | [dashboards/AGENTS.md](dashboards/AGENTS.md) | `dashboards/**` |
| **QAN App** (Grafana plugin & QAN panel) | [ui/apps/pmm-app/AGENTS.md](ui/apps/pmm-app/AGENTS.md) | `ui/apps/pmm-app/**` |
| **API Tests** (integration tests) | [api-tests/AGENTS.md](api-tests/AGENTS.md) | `api-tests/**` |
| **Build & Packaging** | [build/AGENTS.md](build/AGENTS.md) | `build/**` |

Expand Down Expand Up @@ -125,7 +125,7 @@ PMM has three test layers ([`CONTRIBUTING.md`](CONTRIBUTING.md)): unit, API inte
| `.proto` or gRPC/REST definitions | `make gen`, then `make check`; update handlers in `managed/` and UI hooks if user-facing |
| REST behavior end-to-end | `make env-up`, then `make api-test` ([`api-tests/AGENTS.md`](api-tests/AGENTS.md)) |
| UI (`ui/apps/pmm`) | `cd ui && make lint && make test` |
| Grafana dashboard JSON (`dashboards/dashboards/`) | `python3 dashboards/misc/cleanup-dash.py --check-only <file>` (or run cleanup without `--check-only`); CI enforces this in `dashboards.yml` ([`dashboards/dashboards/AGENTS.md`](dashboards/dashboards/AGENTS.md)) |
| Grafana dashboard JSON (`dashboards/`) | `python3 dashboards/misc/cleanup-dash.py --check-only <file>` (or run cleanup without `--check-only`); CI enforces this in `dashboards.yml` ([`dashboards/AGENTS.md`](dashboards/AGENTS.md)) |
| User-visible feature / bugfix | Create or update a Feature Build; link it in the PR ([`CONTRIBUTING.md`](CONTRIBUTING.md#feature-build)) |

---
Expand All @@ -139,7 +139,7 @@ CI runs separate linters per area. `make prepare-pr` covers **Go only** — it d
| Go backend (`managed/`, `agent/`, `admin/`, `qan-api2/`, `vmproxy/`, shared packages) | `make prepare-pr` from repo root (or `make check` after `make gen` for a quicker pass) |
| `.proto` only | `make gen`, then `make check` (`buf lint`, `golangci-lint`, `go-sumtype`) |
| UI (`ui/apps/pmm`, `ui/packages/shared`) | `cd ui && make lint` (ESLint; same as CI `ui.yml`) |
| Grafana dashboard JSON (`dashboards/dashboards/`) | `python3 dashboards/misc/cleanup-dash.py --check-only <file>` before commit (CI `dashboards.yml`; no separate ESLint) |
| Grafana dashboard JSON (`dashboards/`) | `python3 dashboards/misc/cleanup-dash.py --check-only <file>` before commit (CI `dashboards.yml`; no separate ESLint) |
| Grafana plugin / QAN app (`dashboards/pmm-app`) | `cd dashboards/pmm-app && yarn lint:check` (and `yarn typecheck` if TypeScript changed) |
| Before any PR | Run the row(s) that match **every** area you touched; fix errors, not just warnings, unless CI allows them |

Expand Down Expand Up @@ -431,7 +431,6 @@ All long-running daemons expose on `127.0.0.1`:
| `make env-up-rebuild` | Rebuild development container from scratch |
| `make env TARGET=<t>` | Run `make <t>` **inside** the `pmm-server` container as the `pmm` user (bash shell if `TARGET` omitted); use `make env-root` for build/test/lint targets |
| `make env-root TARGET=run-managed-ci` | Rebuild + hot-swap the pmm-managed binary (no image rebuild); see [running and verifying locally](dev/docs/process/running-and-verifying-locally.md). Also `run-agent-ci`, `run-qan-ci`, `run-vmproxy-ci`, `run-all` |
| `make run-ui` | Inside devcontainer: Vite HMR for the main PMM UI |
| `make run-qan-ui` | Inside devcontainer: webpack + livereload for the QAN Grafana plugin |
| `make doc-build-preview` | Preview user docs (`documentation/docs/`) with live reload at http://localhost:8000 |
| `make doc-build` | Build user docs (used in CI); `make doc-build-pdf` for the PDF |
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ Exporters are independent applications, so each of them contains its own README

### UI

The devcontainer ships NodeJS and Yarn out of the box and exposes Vite (`make run-ui`) for the main PMM UI and webpack + livereload (`make run-qan-ui`) for the QAN Grafana plugin. See:
The devcontainer ships NodeJS and Yarn out of the box and `make run-ui` starts all of it: Vite (main PMM UI), webpack + livereload (`pmm-compat` and the QAN Grafana plugin), and a watcher that syncs dashboard JSON changes automatically. See:

- [`ui/README.md`](https://github.com/percona/pmm/tree/main/ui/README.md) — main PMM UI (Vite, React, MUI).
- [`dashboards/CONTRIBUTING.md`](https://github.com/percona/pmm/tree/main/dashboards/CONTRIBUTING.md) — QAN plugin and Grafana dashboards.
- [`ui/apps/pmm-app/CONTRIBUTING.md`](https://github.com/percona/pmm/tree/main/ui/apps/pmm-app/CONTRIBUTING.md) — QAN plugin and Grafana dashboards.

Both docs cover the devcontainer flow and the host-local alternative.

Expand Down
9 changes: 6 additions & 3 deletions build/packages/rpm/server/SPECS/percona-dashboards.spec
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%global commit ad4af6808bcd361284e8eb8cd1f36b1e98e32bce
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%define build_timestamp %(date -u +"%y%m%d%H%M")
%define release 27
%define release 28
%define rpm_release %{release}.%{build_timestamp}.%{shortcommit}%{?dist}

%define clickhouse_datasource_version 4.19.0
Expand Down Expand Up @@ -46,14 +46,14 @@ using VictoriaMetrics datasource.
%build
node -v
npm version
make -C dashboards release
cd ui && yarn install --frozen-lockfile && yarn turbo run build --filter=pmm-app


%install
install -d %{buildroot}%{_datadir}/%{name}/panels/pmm-app

# cp -a ./dashboards/panels %{buildroot}%{_datadir}/%{name}
cp -a ./dashboards/pmm-app/dist %{buildroot}%{_datadir}/%{name}/panels/pmm-app
cp -a ./ui/apps/pmm-app/dist %{buildroot}%{_datadir}/%{name}/panels/pmm-app
unzip -q %{SOURCE1} -d %{buildroot}%{_datadir}/%{name}/panels
unzip -q %{SOURCE2} -d %{buildroot}%{_datadir}/%{name}/panels
echo %{version} > %{buildroot}%{_datadir}/%{name}/VERSION
Expand All @@ -66,6 +66,9 @@ echo %{version} > %{buildroot}%{_datadir}/%{name}/VERSION


%changelog
* Thu Jul 30 2026 Fábio Silva <fabio.dasilva@percona.com> - 3.0.0-28
- PMM-15028 Build pmm-app from ui/apps/pmm-app (moved out of dashboards/)

* Wed Jul 15 2026 Alex Demidoff <alexander.demidoff@percona.com> - 3.0.0-27
- PMM-15099 Bump clickhouse datasource plugin to 4.19.0

Expand Down
30 changes: 1 addition & 29 deletions dashboards/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,8 @@ root = true
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,ts,tsx,py}]
[*.json]
charset = utf-8

# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
indent_size = 4

# Indentation override for all JS, TS under pmm-app directory
[pmm-app/src/**.{js,ts,tsx}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[pmm-app/tests/**.js]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[dashboards/*.json]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[{package.json,docker-compose.yml}]
indent_style = space
indent_size = 2
14 changes: 1 addition & 13 deletions dashboards/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@
.vscode
.DS_Store

# development
.env/
node_modules
docker-compose.*.y*ml

# PMM-specific
dashboards/PMM_Demo.json
PMM_Demo.json
/export-dash.py
/import-dash.py
pmm-app.tar.gz
pmm-app/dist/
pmm-app/coverage/
pmm-app/video/
pmm-app/pr.browsers.json
pmm-app/tests/output/
srv
Loading
Loading