Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve dev experience with devcontainer and debugger breakpoint support #1127

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Datasource",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/guiyomh/features/mage": {}
},
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"dbaeumer.vscode-eslint"
]
}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"portsAttributes": {
"3000": {
"label": "Grafana",
"onAutoForward": "silent"
}
},

"updateContentCommand": "bash ${containerWorkspaceFolder}/.devcontainer/init.sh"

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
2 changes: 2 additions & 0 deletions .devcontainer/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mage -v build:linux
yarn install
12 changes: 12 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
},
{
"name": "Debug: Frontend",
"request": "launch",
"type": "chrome",
"url": "http://localhost:3000/explore",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "run grafana",
"cwd": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack://grafana-clickhouse-datasource/*": "${workspaceRoot}/src/*"
},
}
]
}
70 changes: 70 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"command": "yarn install",
"label": "frontend: yarn install",
"detail": "install frontend dependencies"
},
{
"type": "shell",
"command": "yarn dev",
"label": "frontend: yarn dev",
"dependsOn": [
"frontend: yarn install"
],
"isBackground": true,
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": ".",
}
}
]
},
{
"type": "shell",
"command": "mage -v build:linux",
"label": "backend: marge build",
"detail": "build clickhouse plugin backend",
},
{
"type": "shell",
"command": "docker compose up",
"label": "run grafana",
"detail": "run test environment",
"dependsOn": [
"frontend: yarn dev"
],
"isBackground": true,
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"location": 2,
"message": 3
}
],
"background": {
"activeOnStart": true,
"beginsPattern": ".",
"endsPattern": ".",
}
}
]
}
]
}
2 changes: 1 addition & 1 deletion tests/fixtures/property-prices.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- example dataset from the ClickHouse documentation:
-- https://clickhouse.com/docs/en/getting-started/example-datasets/uk-price-paid

CREATE TABLE uk_price_paid
CREATE TABLE IF NOT EXISTS uk_price_paid
(
price UInt32,
date Date,
Expand Down