Development, build, and test tooling
Redash uses one development toolchain for its Python services and browser client. Python dependencies use uv, JavaScript packages use pnpm, Docker Compose provides the local services, and automation checks the main quality and test layers in separate jobs. Together, these tools turn source changes into a runnable product and give engineers feedback at the Python, browser, visualization, end-to-end, and visual regression levels.
Dependency and workspace management
The dependency model keeps core runtime packages separate from optional data-source connectors and developer tools. Lock files make the Python and JavaScript environments repeatable across local work, container builds, and CI.
Python dependency groups
The Python project targets Python 3.13. The root pyproject.toml defines the base application dependencies plus groups for all data-source connectors, LDAP support, and development tools; uv.lock records the resolved versions for that environment. uv does not install optional groups by default, so the container selects the groups it needs at build time. A normal image and a test image can share the same dependency model without forcing every optional connector into every use.
References: pyproject.toml• L1-14 pyproject.toml• L94-168 Dockerfile• L100-126 uv.lock• L1-4
JavaScript workspace
The JavaScript project uses pnpm 10.30.3 and supports the Node.js versions declared in the root package. The root package is the browser application, while the visualization package is a workspace dependency for reusable charts; pnpm-lock.yaml fixes the dependency graph for both. Installing the workspace also builds the visualization package through the root postinstall step, so the application and its test tools can consume the expected generated output.
References: package.json• L6-39 package.json• L46-136 package.json• L185-190 pnpm-workspace.yaml• L1-12 viz-lib/package.json• L1-20 pnpm-lock.yaml• L1-20
Build products
Builds turn the source projects into two kinds of output: a Python container image that runs the services and static browser assets that the server can deliver. The browser build includes the visualization package before it bundles the main client.
Backend container image
The root Dockerfile builds the browser assets in a Node stage and then places those assets in a Python 3.13 runtime stage. The final image contains the application and its selected Python dependency groups, then starts through the service entry point. This gives local and automated environments the same basic packaging boundary.
References: Dockerfile• L1-40 Dockerfile• L42-46 Dockerfile• L98-134
Browser application build
The main frontend build first cleans client/dist, builds @redash/viz, and then runs Webpack for the web client application. Webpack produces the application pages, JavaScript and CSS bundles, asset manifest, and copied static assets under client/dist; development mode instead supports a dev server and source-friendly output.
References: package.json• L8-16 webpack.config.js• L33-47 webpack.config.js• L64-146 webpack.config.js• L256-304
Visualization package build
@redash/viz is built as a reusable browser library rather than as a second product application. Its build creates typed declarations and transpiled library files, then can create a UMD bundle in dist; the main application uses the workspace package during its own build. The package supplies the visualization capabilities described in the visualization library page.
References: viz-lib/package.json• L5-20 viz-lib/package.json• L76-79 viz-lib/webpack.config.js• L6-14 viz-lib/webpack.config.js• L57-64
Containerized local execution
The development Compose setup runs the server, worker, scheduler, database, cache, and mail service as one local system. Source code is mounted into the application containers, so Python services can reload while the browser client can run through its separate local development server.
Development service stack
The local stack exposes the server on port 5001 and connects it to PostgreSQL and Redis by service name. The worker and scheduler use development entry points with Python file watching, while MailDev provides a local mail target for flows that send email. make up starts the dependencies, creates the database when needed, and starts the full stack. These roles are part of the service composition described in application runtime.
References: compose.yaml• L1-23 compose.yaml• L24-71 bin/docker-entrypoint• L10-23 bin/docker-entrypoint• L38-50 Makefile• L6-11 Makefile• L20-22
Browser development loop
The Webpack dev server serves the browser application and proxies API, login, OAuth, and related requests to the backend. Its history fallback lets client-side routes resolve to the application page, while optional hot reload shortens the feedback loop for client changes.
References: webpack.config.js• L38-48 webpack.config.js• L265-304
The main local flow connects source changes to the browser and then to the supporting services as shown below.
flowchart LR
Source[Source changes] --> Frontend[Webpack dev server]
Frontend --> Browser[Browser application]
Browser --> Backend[Development server]
Backend --> Data[(PostgreSQL)]
Backend --> Queue[(Redis)]
Queue --> Worker[Development worker and scheduler]
Backend --> Mail[Local mail service]
Quality automation
Quality checks cover Python style and correctness, frontend style, TypeScript contracts, and formatting. Local commands and CI divide these checks by language so a failure points to the relevant part of the change.
Python quality checks
Ruff checks Python lint rules and import order, while Black checks formatting. The pre-commit configuration runs both tools for changed work, and the Makefile exposes the same checks as a repository-wide lint target. CI runs these checks before the backend test job.
References: pyproject.toml• L85-92 pyproject.toml• L170-179 .pre-commit-config.yaml• L1-10 Makefile• L40-51 .github/…/ci.yml• L13-28
Frontend quality checks
Biome checks frontend lint and formatting rules, while TypeScript performs a no-emit type check against the client project. The root test command runs the type check before Jest, which makes type errors fail before behavioral assertions run.
References: package.json• L17-25 client/tsconfig.json• L1-30 .github/…/ci.yml• L78-103 .github/…/ci.yml• L105-129
Continuous integration stages
CI builds and tests the system in distinct backend, frontend, visualization, and browser jobs. Backend jobs use the CI Compose stack with PostgreSQL and Redis; frontend jobs install the frozen pnpm workspace; browser jobs run Playwright flows against the service network. Visual regression runs use the Playwright browser image so local and CI screenshots share the same rendering conditions.
References: .github/…/ci.yml• L30-76 .github/…/ci.yml• L105-130 .github/…/ci.yml• L131-180 .ci/compose.ci.yaml• L1-25 .ci/compose.cypress.yaml• L1-73 package.json• L26-30 client/…/docker.sh• L1-28
Test suites
The test system checks the product at several useful levels. Python tests cover service behavior, frontend unit tests cover browser application behavior, visualization tests cover the reusable rendering package, browser end-to-end tests cover full UI flows against running services, and Playwright compares stable visualization screenshots.
Python test suite
The Python suite runs inside the server image with a dedicated tests database. Its changed coverage checks backend contracts at the API, model, task, security, metrics, and query-runner boundaries. The suite protects the product rules that connect user access, query execution, stored results, background jobs, and external data sources.
The main coverage groups are:
- API resources keep data-source, destination, query-result, ordering, setup, organization access, and dashboard widget rules consistent.
- Query execution and result access enforce data-source access, API-key scope, parameter rules, dropdown-query relationships, caching behavior, and job cancellation.
- Models and tasks preserve query hashes, search and scheduling behavior, result cleanup, worker state, and failure backoff.
- Query runners return a common result shape while handling connector-specific schemas, authentication, pagination, SQL statements, scripts, and remote data. Databricks coverage also protects catalog selection, statement timeouts, query annotations, host normalization, schema discovery, and multi-statement handling.
- Security checks protect CSRF, session settings, form limits, server-side request forgery boundaries, Redis support, and version reporting.
- CLI, migration, authentication, and metric checks protect operational paths as well as request paths.
The test base creates an application context, resets the database for each case, isolates Redis databases for test data and queue data, and provides factories for common Redash records. This keeps tests focused on product contracts while still exercising the service boundary. Widget handler checks cover dashboard placement, text widgets, visualization access, and deletion through the backend HTTP API.
References: tests/__init__.py• L7-19 tests/__init__.py• L59-78 tests/factories.py• L175-217 Makefile• L13-18 Makefile• L43-57 pytest.ini• L1-5 tests/…/test_data_sources.py• L10-18 tests/…/test_query_results.py• L78-219 tests/…/test_widgets.py• L5-81 tests/…/test_queries.py• L32-166 tests/…/test_utils.py• L15-53 tests/…/test_databricks.py• L32-373 tests/test_security.py• L7-59 tests/…/test_ssrf.py• L28-108
Browser unit suite
The application unit suite runs Jest in a browser-like environment with the client test setup and module stubs. The normal test command runs the client type check before Jest, which makes type errors fail before behavioral assertions run. List component coverage also checks that tags, search, sorting, pagination, browser history, and request cancellation stay in sync with URL state.
References: package.json• L21-29 package.json• L138-176 client/tsconfig.json• L9-29 client/…/mocks.js• L1 client/…/ItemsList.test.jsx• L109-185 client/…/ItemsList.test.jsx• L238-402
Visualization test suite
The visualization suite runs independently through the @redash/viz workspace package. Jest uses the package source as its root and shares browser, React, style, and snapshot setup with the visualization components, so chart behavior and editor behavior can be checked without starting the full application.
References: viz-lib/package.json• L19-20 viz-lib/package.json• L105-121 viz-lib/tsconfig.json• L1-24 viz-lib/…/enzyme_setup.js• L1
Browser end-to-end suites
Browser end-to-end suites drive Redash through a real browser against a running service stack. The Playwright path uses ordered setup projects to prepare an instance and then runs ordinary and organization-wide scenarios. Root commands expose the path through e2e and its separate type check.
References: package.json• L28-30 client/…/playwright.config.ts• L5-53 client/…/tsconfig.json• L1-7
Visual regression suite
The visual regression suite uses Playwright to render visualization examples in a running Redash instance and compare each result with a committed screenshot baseline. A seed step creates known queries, visualizations, and dashboards from the sample SQLite data, then the screenshot step checks the rendered dashboards in a fixed desktop browser view. The visual regression testing page covers test setup, fixture data, and screenshot validation in detail.
The root package exposes separate commands for local visual tests and for the Docker-based run. The Docker path is the reference path because the browser image fixes the operating system, fonts, and browser build that affect screenshots.
References: package.json• L26-30 client/…/README.md• L1-20 client/…/README.md• L25-34 client/…/playwright.config.ts• L5-29 client/…/playwright.config.ts• L31-47 client/…/docker.sh• L1-28
OIDC verification flow
The OIDC checks use a local-only identity provider so the test suite can exercise the full protocol without a live external service. The provider supplies discovery metadata, signing keys, authorization codes, tokens, and UserInfo responses for fixed test accounts; the backend test then verifies successful login and rejects bad signatures, expired or mismatched claims, wrong nonces, replayed callbacks, unverified email, disallowed domains, and mismatched UserInfo subjects.
The isolated Python check runs with the normal backend test database and Redis settings. Browser verification is a separate flow because it needs a running Redash instance, a disposable database, OIDC settings, and the local provider. This fixture checks protocol handling only; it does not prove compatibility with a live identity provider.
References: tests/README.oidc.md• L1-54 tests/oidc_provider.py• L1-138 tests/test_authentication.py• L255-355
The test layers meet at the product boundary in the following order.
flowchart TD
Change[Code change] --> Quality[Lint and type checks]
Quality --> Python[Python test suite]
Quality --> App[Browser application Jest suite]
Quality --> Viz[Visualization Jest suite]
Quality --> E2E[Browser end-to-end suites]
Quality --> Visual[Playwright visual regression suite]
E2E --> Services[Containerized server and data services]
Visual --> Services
Change checklist
When these files or sections are changed, remember to consider these:
- Keep pyproject.toml dependency groups and uv.lock aligned when Python runtime or connector dependencies change. Check the Docker
install_groupschoice if the new dependency is optional. - Keep package.json, pnpm-workspace.yaml, pnpm-lock.yaml, and the visualization package scripts aligned when changing frontend, visualization, browser-test, or visual-test dependencies. The root install and root build depend on the workspace package being prepared.
- Keep the root browser test commands aligned with their Playwright configs and TypeScript projects. A new suite or renamed script must preserve its test target, setup order, and type-check scope.
- Preserve the
client/disthandoff between the frontend build stage and the Python image. Changes to asset names, public paths, or generated HTML must remain compatible with backend static delivery. - Keep local Compose service names, ports, and database URLs aligned with Webpack proxy settings, Playwright base URLs, and visual-test base URLs. A change in one boundary can make the browser appear healthy while API or test traffic fails.
- Keep test database setup and the server entry point aligned. Backend tests assume the container test command points at the separate
testsdatabase. - Keep list state storage aligned with URL parameter parsing, browser history, request scheduling, and route changes. Changes to tag encoding or search cancellation must preserve both visible state and the request sent to the server.
- Keep widget API access checks aligned with dashboard and visualization ownership. Text-widget payloads must remain valid when no visualization ID is sent.
- Keep query parameter schemas aligned with the API and task paths. Changes to safe parameter types, range fields, dropdown references, or rendered query text must preserve both direct execution and scheduled refresh behavior.
- Keep access checks aligned across query results, dropdowns, dashboard keys, and organization boundaries. A change in one sharing path can expose a result through another path.
- Keep query-runner contracts aligned with result loading and schema display. Changes to annotations, SQL splitting, pagination, column expansion, or filesystem policy can affect several connectors at once.
- Keep Databricks connection settings aligned with its connector contract. Host normalization, catalog selection, statement timeout rules, annotation behavior, and schema discovery must remain valid for both query execution and metadata loading.
- Keep SQL parser limits aligned between configuration, query formatting, and automatic row-limit behavior. A change can turn a bounded request into a rejected request or allow a large statement to run without its usual limit.
- Keep connector authentication and resource cleanup contracts aligned with the connector tests. Connector changes must preserve credential selection, result typing, schema discovery, and cleanup after errors.
- Keep OIDC discovery, token claims, UserInfo identity, account rules, and local browser settings aligned when authentication changes. Run the isolated OIDC tests and use the documented browser flow when a change crosses the full provider boundary.
- Keep the local OIDC provider limited to test use. Its insecure HTTP mode, fixed accounts, and test credentials must not become deployment defaults.
- Keep visual-test seed data, fixture paths, screenshot names, and rendering controls aligned. A visualization change can require an intentional baseline update rather than a test-only change.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| The lock file does not match the Python or pnpm dependency manifest | Frozen installs fail or different code runs in local work and CI | Update the matching lock file and use frozen installs in CI and containers |
@redash/viz is not built before the main client build | The browser build cannot resolve the expected visualization package output | Keep the root build:viz step and the visualization workspace scripts in the build path |
| A root browser test command does not match its Playwright config or type-check project | The intended suite can be skipped or fail before it reaches the application | Keep e2e, e2e:type-check, and their referenced project files aligned |
| The frontend asset handoff or public path changes without a backend update | The server returns missing HTML, JavaScript, or CSS assets | Check client/dist, generated manifests, and Webpack static paths together |
| PostgreSQL or Redis is not ready when a test stack starts | Database creation, backend tests, or service startup fails | Start the Compose dependencies and use the test database setup before the backend suite |
| Playwright uses a host URL inside its container stack | Browser tests cannot reach the server container | Use the Compose service hostname and the configured browser base URL |
| Source changes are made in a mounted container without the development entry point | Python code does not reload and the running process keeps old behavior | Use dev_server, dev_worker, or dev_scheduler for the local loop |
| The visual-test seed cannot reach the worker or fixture database | Example dashboards are incomplete or screenshot tests fail before rendering | Start Redash with a worker, keep the fixture readable in the container, and seed before screenshots |
| Visual tests run outside the reference Playwright image | Valid rendering differences create false screenshot failures | Use visual-tests:docker for baseline comparison and review the report before updating snapshots |
| A visualization change updates screenshots without a matching example or baseline review | The suite can accept the wrong visual contract or leave stale baselines | Review the affected example and expected image together before accepting snapshots |
| A list URL change drops repeated tags, encodes a tag incorrectly, or leaves a delayed request active | The browser shows different filters than the server request or stale results replace current results | Preserve the list URL and request synchronization checks in ItemsList.test.jsx |
| A widget request bypasses visualization access checks or rejects a text widget without an ID | Users can add unauthorized content or valid dashboard text cannot be saved | Keep the widget handler contract covered by test_widgets.py |
| A Databricks timeout or catalog value violates the connector contract | Query execution can fail or metadata can come from the wrong catalog | Validate connector settings and keep query and schema-discovery paths covered |
| The local OIDC provider, issuer settings, or fixture accounts do not match the authentication test flow | Discovery, callback, or browser login checks fail or no longer exercise the intended identity path | Run pytest tests/test_authentication.py -k OIDC and follow tests/README.oidc.md for the separate browser check |
| The local OIDC fixture is used outside a disposable test setup or with insecure transport enabled in a real deployment | Test credentials and HTTP identity tokens can expose an account or weaken authentication | Keep tests/oidc_provider.py local-only and enable insecure transport only for its local verification flow |
| A query uses undeclared or unsafe parameters on a view-only data source or through a shared key | The request can be rejected too late or unsafe work can be queued | Validate parameters against the query schema before enqueueing and limit view-only execution to safe forms |
| A query key reads an unrelated dropdown query or cached result | A shared query or dashboard can expose data outside its intended scope | Check the parent relationship, organization, and underlying data-source access for each request |
| A scheduled query has invalid parameters or points to a paused data source | Refresh work is skipped or stale work is sent to the queue | Validate saved parameter values and skip paused or detached sources before enqueueing |
| Query metadata accepts unsafe values or a remote data source follows an outside origin | Query text can be altered or data can be sent to an untrusted host | Allow only constrained metadata values and same-origin JSON URLs |
| DuckDB filesystem restrictions can be changed by a query | A data-source query can read or write local files | Keep the disabled filesystem setting locked for the query runner |
| SQL exceeds the configured parser grouping limits | Query formatting returns a client error, or automatic row limiting leaves the original statement unchanged | Keep parser limits configured and preserve the bounded fallback behavior in both API and runner paths |
Key files
| File | Why to read it |
|---|---|
| pyproject.toml | Defines the Python version, dependency groups, and backend quality rules. |
| uv.lock | Records the resolved Python dependency environment used for repeatable installs. |
| package.json | Defines the root frontend workspace commands, build order, quality commands, unit tests, browser end-to-end commands, and visual-test entry points. |
| pnpm-lock.yaml | Records the resolved JavaScript dependency graph for the root application and visualization workspace. |
| pnpm-workspace.yaml | Declares the visualization package as part of the JavaScript workspace. |
| viz-lib/package.json | Describes the visualization package build, type, and test lifecycle. |
Dockerfile | Shows how frontend assets and selected Python dependencies become the shared application image. |
| compose.yaml | Defines the local development services, source mounts, ports, and service connections. |
| webpack.config.js | Explains how the browser application is served, bundled, and connected to the backend in development. |
bin/docker-entrypoint | Maps container commands to the server, worker, scheduler, database, shell, and test roles. |
Makefile | Provides the main local entry points for starting services, running checks, testing, and building. |
| .github/…/ci.yml | Shows the automated quality and test gates and how each test environment is assembled. |
| tests/__init__.py | Defines the shared backend test isolation, application context, and request helpers. |
| tests/factories.py | Provides the shared records and relationships used to express backend behavior in tests. |
| tests/…/test_query_results.py | Shows the API contracts for query execution, result access, sharing keys, parameter safety, and queued jobs. |
| tests/…/test_widgets.py | Shows the dashboard widget API contracts for visualization access, text widgets, and deletion. |
| tests/…/test_queries.py | Shows how query work enters the queue and how result storage and scheduled failures behave. |
| tests/…/test_databricks.py | Shows Databricks connector contracts for connection settings, catalog and timeout handling, schema discovery, query annotations, result typing, and SQL statements. |
| tests/…/test_duckdb.py | Shows schema discovery and the local filesystem boundary for DuckDB queries. |
| tests/…/test_utils.py | Shows common result type detection and query-runner loading behavior. |
| tests/test_authentication.py | Shows the authentication contracts and the full local OIDC verification flow. |
| tests/test_security.py | Shows the session, cookie, and request-size security contracts. |
| tests/…/test_ssrf.py | Shows the network boundary that protects remote data-source requests. |
| client/…/ItemsList.test.jsx | Shows the browser contract for list filters, URL state, history navigation, and stale request cancellation. |
| client/…/playwright.config.ts | Defines the ordered setup and browser projects for Playwright end-to-end flows. |
| client/…/README.md | Explains the visual regression setup, fixture data, baseline workflow, and screenshot report. |
| client/…/playwright.config.ts | Defines the seed and screenshot flow, browser target, and strict screenshot comparison rules. |
| client/…/docker.sh | Runs visual tests in the reference Playwright image and passes local test settings into it. |