Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 12 additions & 0 deletions .ci/Dockerfile.cypress
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM cypress/browsers:node18.12.0-chrome106-ff106

ENV APP /usr/src/app
WORKDIR $APP

COPY package.json yarn.lock .yarnrc $APP/
COPY viz-lib $APP/viz-lib
RUN npm install yarn@1.22.22 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null

COPY . $APP

RUN ./node_modules/.bin/cypress verify
25 changes: 25 additions & 0 deletions .ci/compose.ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:
redash:
build: ../
command: manage version
depends_on:
- postgres
- redis
ports:
- "5000:5000"
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb"
REDASH_DATABASE_URL: "postgresql://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
redis:
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:18-alpine
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
73 changes: 73 additions & 0 deletions .ci/compose.cypress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
x-redash-service: &redash-service
build:
context: ../
args:
install_groups: "main"
code_coverage: ${CODE_COVERAGE}
x-redash-environment: &redash-environment
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb"
REDASH_DATABASE_URL: "postgresql://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres"
REDASH_RATELIMIT_ENABLED: "false"
REDASH_ENFORCE_CSRF: "true"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
services:
server:
<<: *redash-service
command: server
depends_on:
- postgres
- redis
ports:
- "5000:5000"
environment:
<<: *redash-environment
PYTHONUNBUFFERED: 0
scheduler:
<<: *redash-service
command: scheduler
depends_on:
- server
environment:
<<: *redash-environment
worker:
<<: *redash-service
command: worker
depends_on:
- server
environment:
<<: *redash-environment
PYTHONUNBUFFERED: 0
cypress:
ipc: host
build:
context: ../
dockerfile: .ci/Dockerfile.cypress
depends_on:
- server
- worker
- scheduler
environment:
CYPRESS_baseUrl: "http://server:5000"
CYPRESS_coverage: ${CODE_COVERAGE}
PERCY_TOKEN: ${PERCY_TOKEN}
PERCY_BRANCH: ${CIRCLE_BRANCH}
PERCY_COMMIT: ${CIRCLE_SHA1}
PERCY_PULL_REQUEST: ${CIRCLE_PR_NUMBER}
COMMIT_INFO_BRANCH: ${CIRCLE_BRANCH}
COMMIT_INFO_MESSAGE: ${COMMIT_INFO_MESSAGE}
COMMIT_INFO_AUTHOR: ${CIRCLE_USERNAME}
COMMIT_INFO_SHA: ${CIRCLE_SHA1}
COMMIT_INFO_REMOTE: ${CIRCLE_REPOSITORY_URL}
CYPRESS_PROJECT_ID: ${CYPRESS_PROJECT_ID}
CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY}
redis:
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:18-alpine
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
39 changes: 39 additions & 0 deletions .ci/docker_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# This script only needs to run on the main Redash repo

if [ "${GITHUB_REPOSITORY}" != "getredash/redash" ]; then
echo "Skipping image build for Docker Hub, as this isn't the main Redash repository"
exit 0
fi

if [ "${GITHUB_REF_NAME}" != "master" ] && [ "${GITHUB_REF_NAME}" != "preview-image" ]; then
echo "Skipping image build for Docker Hub, as this isn't the 'master' nor 'preview-image' branch"
exit 0
fi

if [ "x${DOCKER_USER}" = "x" ] || [ "x${DOCKER_PASS}" = "x" ]; then
echo "Skipping image build for Docker Hub, as the login details aren't available"
exit 0
fi

set -e
VERSION=$(jq -r .version package.json)
VERSION_TAG="$VERSION.b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}"

export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1

docker login -u "${DOCKER_USER}" -p "${DOCKER_PASS}"

DOCKERHUB_REPO="redash/redash"
DOCKER_TAGS="-t redash/redash:preview -t redash/preview:${VERSION_TAG}"

# Build the docker container
docker build --build-arg install_groups="main,all_ds,dev" ${DOCKER_TAGS} .

# Push the container to the preview build locations
docker push "${DOCKERHUB_REPO}:preview"
docker push "redash/preview:${VERSION_TAG}"

echo "Built: ${VERSION_TAG}"
9 changes: 9 additions & 0 deletions .ci/pack
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
NAME=redash
VERSION=$(jq -r .version package.json)
FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM
FILENAME=$NAME.$FULL_VERSION.tar.gz

mkdir -p /tmp/artifacts/

tar -zcv -f /tmp/artifacts/$FILENAME --exclude=".git" --exclude="optipng*" --exclude="cypress" --exclude="*.pyc" --exclude="*.pyo" --exclude="venv" *
6 changes: 6 additions & 0 deletions .ci/update_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
VERSION=$(jq -r .version package.json)
FULL_VERSION=${VERSION}+b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}

sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '${FULL_VERSION}'/" redash/__init__.py
sed -i "s/dev/${GITHUB_SHA}/" client/app/version.json
109 changes: 78 additions & 31 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,37 @@ version: 2.0
jobs:
backend-lint:
docker:
- image: circleci/python:3.7.0
- image: cimg/python:3.8
steps:
- checkout
- run: sudo pip install flake8
- run: ./bin/flake8_tests.sh
- run: pip3 install black==23.1.0 ruff==0.0.287
- run: ruff check .
- run: black --check .
backend-unit-tests:
environment:
COMPOSE_FILE: .circleci/docker-compose.circle.yml
COMPOSE_PROJECT_NAME: redash
docker:
- image: circleci/buildpack-deps:xenial
- image: cimg/base:2025.04
steps:
- setup_remote_docker
- checkout
- run:
name: Build Docker Images
command: |
set -x
docker-compose build --build-arg skip_ds_deps=true --build-arg skip_frontend_build=true
docker-compose up -d
docker compose build --build-arg install_groups="main,all_ds,dev" --build-arg skip_frontend_build=true
docker compose up -d
sleep 10
- run:
name: Create Test Database
command: docker-compose run --rm postgres psql -h postgres -U postgres -c "create database tests;"
command: docker compose -p redash run --rm postgres psql -h postgres -U postgres -c "create database tests;"
- run:
name: List Enabled Query Runners
command: docker-compose run --rm redash manage ds list_types
command: docker compose -p redash run --rm redash manage ds list_types
- run:
name: Run Tests
command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/
command: docker compose -p redash run --name tests redash tests --junitxml=junit.xml --cov-report=xml --cov=redash --cov-config=.coveragerc tests/
- run:
name: Copy Test Results
command: |
Expand All @@ -46,56 +47,102 @@ jobs:
path: coverage.xml
frontend-lint:
docker:
- image: cimg/node:12.22.8
- image: cimg/node:18.20
steps:
- checkout
- run: mkdir -p /tmp/test-results/eslint
- run: npm ci
- run: npm run lint:ci
- run: |
npm install --global --force yarn@$1.22.22
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- run: yarn lint:ci
- store_test_results:
path: /tmp/test-results
frontend-unit-tests:
docker:
- image: cimg/node:12.22.8
- image: cimg/node:18.20
steps:
- checkout
- run: sudo apt update
- run: sudo apt install python3-pip
- run: sudo pip3 install -r requirements_bundles.txt
- run: npm ci
- run: npm run bundle
- run: |
npm install --global --force yarn@$1.22.22
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- run:
name: Run App Tests
command: npm test
command: yarn test
- run:
name: Run Visualizations Tests
command: (cd viz-lib && npm test)
- run: npm run lint
command: (cd viz-lib && yarn test)
- run: yarn lint

frontend-e2e-tests:
environment:
COMPOSE_FILE: .ci/compose.cypress.yml
COMPOSE_PROJECT_NAME: cypress
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
# PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
# CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
docker:
- image: cimg/node:18.20
steps:
- run: checkout
- run:
name: Install Dependencies
command: |
npm install --global --force yarn@$1.22.22
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
# - name: Enable Code Coverage Report For Master Branch
# if: endsWith(github.ref, '/master')
# run: |
# echo "CODE_COVERAGE=true" >> "$GITHUB_ENV"
- run:
name: Setup Redash Server
command: |
set -x
yarn cypress build
yarn cypress start -- --skip-db-seed
docker compose run cypress yarn cypress db-seed
- run:
name: Execute Cypress Tests
command: yarn cypress run-ci
# - name: "Failure: output container logs to console"
# if: failure()
# run: docker compose logs
- run:
name: Copy Code Coverage Results
command: docker cp cypress:/usr/src/app/coverage ./coverage || true
# - name: Store Coverage Results
# uses: actions/upload-artifact@v4
# with:
# name: coverage
# path: coverage
build-docker-image:
docker:
- image: cimg/node:12.22.8
- image: cimg/node:18.20
steps:
- setup_remote_docker
- checkout
- run: echo "export MOZILLA_VERSION=master" >> $BASH_ENV
- run: sudo apt update
- run: sudo apt install python3-pip
- run: sudo pip3 install -r requirements_bundles.txt
- run: |
npm install --global --force yarn@$1.22.22
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- run: .circleci/update_version
- run: npm run bundle
# Bundle extensions:
# - run: npm run bundle
- run: .circleci/docker_build
build-docker-image-tag:
docker:
- image: cimg/node:12.22.8
- image: cimg/node:18.20
steps:
- setup_remote_docker
- checkout
- run: echo "export MOZILLA_VERSION=$CIRCLE_TAG" >> $BASH_ENV
- run: sudo apt update
- run: sudo apt install python3-pip
- run: sudo pip3 install -r requirements_bundles.txt
- run: |
npm install --global --force yarn@$1.22.22
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- run: .circleci/update_version
- run: npm run bundle
# Bundle extensions:
# - run: npm run bundle
- run: .circleci/docker_build
# Create alias from tag to "latest":
- run: docker tag $DOCKERHUB_REPO:$CIRCLE_TAG $DOCKERHUB_REPO:latest
Expand Down
9 changes: 7 additions & 2 deletions .circleci/docker-compose.circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ services:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
# POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
# REDASH_DATABASE_URL: "postgresql://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
redis:
image: redis:3.0-alpine
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:9.5.6-alpine
image: postgres:18-alpine
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
client/.tmp/
client/dist/
node_modules/
viz-lib/node_modules/
.tmp/
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/---bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ about: Report reproducible software issues so we can improve

We use GitHub only for bug reports 🐛

Anything else should be posted to https://discuss.redash.io 👫
Anything else should be a discussion: https://github.com/getredash/redash/discussions/ 👫

🚨For support, help & questions use https://discuss.redash.io/c/support
💡For feature requests & ideas use https://discuss.redash.io/c/feature-requests
🚨For support, help & questions use https://github.com/getredash/redash/discussions/categories/q-a
💡For feature requests & ideas use https://github.com/getredash/redash/discussions/categories/ideas

**Found a security vulnerability?** Please email security@redash.io to report any security vulnerabilities. We will acknowledge receipt of your vulnerability and strive to send you regular updates about our progress. If you're curious about the status of your disclosure please feel free to email us again. If you want to encrypt your disclosure email, you can use this PGP key.

Expand Down
Loading
Loading