diff --git a/.ci/Dockerfile.cypress b/.ci/Dockerfile.cypress new file mode 100644 index 0000000000..e595fcc1ba --- /dev/null +++ b/.ci/Dockerfile.cypress @@ -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 diff --git a/.circleci/docker-compose.circle.yml b/.ci/compose.ci.yaml similarity index 81% rename from .circleci/docker-compose.circle.yml rename to .ci/compose.ci.yaml index f607e7534a..470aca98aa 100644 --- a/.circleci/docker-compose.circle.yml +++ b/.ci/compose.ci.yaml @@ -1,4 +1,3 @@ -version: '2.2' services: redash: build: ../ @@ -15,9 +14,11 @@ services: REDASH_DATABASE_URL: "postgresql://postgres@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: pgautoupgrade/pgautoupgrade:latest command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF" restart: unless-stopped + environment: + POSTGRES_HOST_AUTH_METHOD: "trust" diff --git a/.circleci/docker-compose.cypress.yml b/.ci/compose.cypress.yaml similarity index 82% rename from .circleci/docker-compose.cypress.yml rename to .ci/compose.cypress.yaml index da57925f11..7f769ab3ef 100644 --- a/.circleci/docker-compose.cypress.yml +++ b/.ci/compose.cypress.yaml @@ -1,15 +1,14 @@ -version: "2.2" x-redash-service: &redash-service build: context: ../ args: - skip_dev_deps: "true" - skip_ds_deps: "true" + install_groups: "main" code_coverage: ${CODE_COVERAGE} x-redash-environment: &redash-environment REDASH_LOG_LEVEL: "INFO" REDASH_REDIS_URL: "redis://redis:6379/0" - REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" + POSTGRES_PASSWORD: "FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb" + REDASH_DATABASE_URL: "postgresql://postgres:FmTKs5vX52ufKR1rd8tn4MoSP7zvCJwb@postgres/postgres" REDASH_RATELIMIT_ENABLED: "false" REDASH_ENFORCE_CSRF: "true" REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF" @@ -44,7 +43,7 @@ services: ipc: host build: context: ../ - dockerfile: .circleci/Dockerfile.cypress + dockerfile: .ci/Dockerfile.cypress depends_on: - server - worker @@ -64,9 +63,11 @@ services: CYPRESS_PROJECT_ID: ${CYPRESS_PROJECT_ID} CYPRESS_RECORD_KEY: ${CYPRESS_RECORD_KEY} redis: - image: redis:3.0-alpine + image: redis:7-alpine restart: unless-stopped postgres: - image: postgres:9.5.6-alpine + image: pgautoupgrade/pgautoupgrade:latest command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF" restart: unless-stopped + environment: + POSTGRES_HOST_AUTH_METHOD: "trust" diff --git a/.ci/docker_build b/.ci/docker_build new file mode 100755 index 0000000000..324c7e996e --- /dev/null +++ b/.ci/docker_build @@ -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}" diff --git a/.circleci/pack b/.ci/pack similarity index 100% rename from .circleci/pack rename to .ci/pack diff --git a/.ci/update_version b/.ci/update_version new file mode 100755 index 0000000000..53b537208c --- /dev/null +++ b/.ci/update_version @@ -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 diff --git a/.circleci/Dockerfile.cypress b/.circleci/Dockerfile.cypress deleted file mode 100644 index 0681a9910f..0000000000 --- a/.circleci/Dockerfile.cypress +++ /dev/null @@ -1,12 +0,0 @@ -FROM cypress/browsers:node14.0.0-chrome84 - -ENV APP /usr/src/app -WORKDIR $APP - -COPY package.json package-lock.json $APP/ -COPY viz-lib $APP/viz-lib -RUN npm ci > /dev/null - -COPY . $APP - -RUN ./node_modules/.bin/cypress verify diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ded3ad6dee..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,177 +0,0 @@ -version: 2.0 - -build-docker-image-job: &build-docker-image-job - docker: - - image: circleci/node:12 - steps: - - setup_remote_docker - - checkout - - run: sudo apt update - - run: sudo apt install python3-pip - - run: sudo pip3 install -r requirements_bundles.txt - - run: .circleci/update_version - - run: npm run bundle - - run: .circleci/docker_build -jobs: - backend-lint: - docker: - - image: circleci/python:3.7.0 - steps: - - checkout - - run: sudo pip install flake8 - - run: ./bin/flake8_tests.sh - backend-unit-tests: - environment: - COMPOSE_FILE: .circleci/docker-compose.circle.yml - COMPOSE_PROJECT_NAME: redash - docker: - - image: circleci/buildpack-deps:xenial - 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 - sleep 10 - - run: - name: Create Test Database - command: docker-compose 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 - - run: - name: Run Tests - command: docker-compose run --name tests redash tests --junitxml=junit.xml --cov-report xml --cov=redash --cov-config .coveragerc tests/ - - run: - name: Copy Test Results - command: | - mkdir -p /tmp/test-results/unit-tests - docker cp tests:/app/coverage.xml ./coverage.xml - docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml - when: always - - store_test_results: - path: /tmp/test-results - - store_artifacts: - path: coverage.xml - frontend-lint: - environment: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 - docker: - - image: circleci/node:12 - steps: - - checkout - - run: mkdir -p /tmp/test-results/eslint - - run: npm ci - - run: npm run lint:ci - - store_test_results: - path: /tmp/test-results - frontend-unit-tests: - environment: - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 - docker: - - image: circleci/node:12 - 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: - name: Run App Tests - command: npm test - - run: - name: Run Visualizations Tests - command: (cd viz-lib && npm test) - - run: npm run lint - frontend-e2e-tests: - environment: - COMPOSE_FILE: .circleci/docker-compose.cypress.yml - COMPOSE_PROJECT_NAME: cypress - PERCY_TOKEN_ENCODED: ZGRiY2ZmZDQ0OTdjMzM5ZWE0ZGQzNTZiOWNkMDRjOTk4Zjg0ZjMxMWRmMDZiM2RjOTYxNDZhOGExMjI4ZDE3MA== - CYPRESS_PROJECT_ID_ENCODED: OTI0Y2th - CYPRESS_RECORD_KEY_ENCODED: YzA1OTIxMTUtYTA1Yy00NzQ2LWEyMDMtZmZjMDgwZGI2ODgx - CYPRESS_INSTALL_BINARY: 0 - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 - docker: - - image: circleci/node:12 - steps: - - setup_remote_docker - - checkout - - run: - name: Enable Code Coverage report for master branch - command: | - if [ "$CIRCLE_BRANCH" = "master" ]; then - echo 'export CODE_COVERAGE=true' >> $BASH_ENV - source $BASH_ENV - fi - - run: - name: Install npm dependencies - command: | - npm ci - - run: - name: Setup Redash server - command: | - npm run cypress build - npm run cypress start -- --skip-db-seed - docker-compose run cypress npm run cypress db-seed - - run: - name: Execute Cypress tests - command: npm run cypress run-ci - - run: - name: "Failure: output container logs to console" - command: | - docker-compose logs - when: on_fail - - run: - name: Copy Code Coverage results - command: | - docker cp cypress:/usr/src/app/coverage ./coverage || true - when: always - - store_artifacts: - path: coverage - build-docker-image: *build-docker-image-job - build-preview-docker-image: *build-docker-image-job -workflows: - version: 2 - build: - jobs: - - backend-lint - - backend-unit-tests: - requires: - - backend-lint - - frontend-lint - - frontend-unit-tests: - requires: - - backend-lint - - frontend-lint - - frontend-e2e-tests: - requires: - - frontend-lint - - build-preview-docker-image: - requires: - - backend-unit-tests - - frontend-unit-tests - - frontend-e2e-tests - filters: - branches: - only: - - master - - hold: - type: approval - requires: - - backend-unit-tests - - frontend-unit-tests - - frontend-e2e-tests - filters: - branches: - only: - - /release\/.*/ - - build-docker-image: - requires: - - hold diff --git a/.circleci/docker_build b/.circleci/docker_build deleted file mode 100755 index e105c584e0..0000000000 --- a/.circleci/docker_build +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -VERSION=$(jq -r .version package.json) -VERSION_TAG=$VERSION.b$CIRCLE_BUILD_NUM - -docker login -u $DOCKER_USER -p $DOCKER_PASS - -if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-image ] -then - docker build --build-arg skip_dev_deps=true -t redash/redash:preview -t redash/preview:$VERSION_TAG . - docker push redash/redash:preview - docker push redash/preview:$VERSION_TAG -else - docker build --build-arg skip_dev_deps=true -t redash/redash:$VERSION_TAG . - docker push redash/redash:$VERSION_TAG -fi - -echo "Built: $VERSION_TAG" \ No newline at end of file diff --git a/.circleci/update_version b/.circleci/update_version deleted file mode 100755 index d397fb23df..0000000000 --- a/.circleci/update_version +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -VERSION=$(jq -r .version package.json) -FULL_VERSION=$VERSION+b$CIRCLE_BUILD_NUM - -sed -ri "s/^__version__ = '([A-Za-z0-9.-]*)'/__version__ = '$FULL_VERSION'/" redash/__init__.py -sed -i "s/dev/$CIRCLE_SHA1/" client/app/version.json diff --git a/.dockerignore b/.dockerignore index 8e3dfae173..b5a2c33ebb 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,5 +1,4 @@ client/.tmp/ -client/dist/ node_modules/ viz-lib/node_modules/ .tmp/ diff --git a/.github/ISSUE_TEMPLATE/---bug_report.md b/.github/ISSUE_TEMPLATE/---bug_report.md index f376d6f1ce..1399ef7791 100644 --- a/.github/ISSUE_TEMPLATE/---bug_report.md +++ b/.github/ISSUE_TEMPLATE/---bug_report.md @@ -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. diff --git a/.github/ISSUE_TEMPLATE/--anything_else.md b/.github/ISSUE_TEMPLATE/--anything_else.md index 9db411b781..d6886cc4ce 100644 --- a/.github/ISSUE_TEMPLATE/--anything_else.md +++ b/.github/ISSUE_TEMPLATE/--anything_else.md @@ -1,17 +1,17 @@ --- name: "\U0001F4A1Anything else" -about: "For help, support, features & ideas - please use https://discuss.redash.io \U0001F46B " +about: "For help, support, features & ideas - please use Discussions \U0001F46B " labels: "Support Question" --- 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 Alternatively, check out these resources below. Thanks! 😁. -- [Forum](https://disucss.redash.io) +- [Discussions](https://github.com/getredash/redash/discussions/) - [Knowledge Base](https://redash.io/help) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a4e1d25210..8b6e58a6f2 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,15 +1,26 @@ -## What type of PR is this? (check all applicable) - +## What type of PR is this? + - [ ] Refactor - [ ] Feature - [ ] Bug Fix -- [ ] New Query Runner (Data Source) +- [ ] New Query Runner (Data Source) - [ ] New Alert Destination - [ ] Other ## Description + + +## How is this tested? + +- [ ] Unit tests (pytest, jest) +- [ ] E2E Tests (Cypress) +- [ ] Manually +- [ ] N/A + + ## Related Tickets & Documents + ## Mobile & Desktop Screenshots/Recordings (if there are UI changes) diff --git a/.github/support.yml b/.github/support.yml deleted file mode 100644 index 164b588b36..0000000000 --- a/.github/support.yml +++ /dev/null @@ -1,23 +0,0 @@ -# Configuration for Support Requests - https://github.com/dessant/support-requests - -# Label used to mark issues as support requests -supportLabel: Support Question - -# Comment to post on issues marked as support requests, `{issue-author}` is an -# optional placeholder. Set to `false` to disable -supportComment: > - :wave: @{issue-author}, we use the issue tracker exclusively for bug reports - and planned work. However, this issue appears to be a support request. - Please use [our forum](https://discuss.redash.io) to get help. - -# Close issues marked as support requests -close: true - -# Lock issues marked as support requests -lock: false - -# Assign `off-topic` as the reason for locking. Set to `false` to disable -setLockReason: true - -# Repository to extend settings from -# _extends: repo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..e8098f5b0e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,175 @@ +name: Tests +on: + push: + branches: + - master + pull_request_target: + branches: + - master +env: + NODE_VERSION: 18 + YARN_VERSION: 1.22.22 +jobs: + backend-lint: + runs-on: ubuntu-22.04 + steps: + - if: github.event.pull_request.mergeable == 'false' + name: Exit if PR is not mergeable + run: exit 1 + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-python@v5 + with: + python-version: '3.8' + - run: sudo pip install black==23.1.0 ruff==0.0.287 + - run: ruff check . + - run: black --check . + + backend-unit-tests: + runs-on: ubuntu-22.04 + needs: backend-lint + env: + COMPOSE_FILE: .ci/compose.ci.yaml + COMPOSE_PROJECT_NAME: redash + COMPOSE_DOCKER_CLI_BUILD: 1 + DOCKER_BUILDKIT: 1 + steps: + - if: github.event.pull_request.mergeable == 'false' + name: Exit if PR is not mergeable + run: exit 1 + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.sha }} + - name: Build Docker Images + run: | + set -x + docker compose build --build-arg install_groups="main,all_ds,dev" --build-arg skip_frontend_build=true + docker compose up -d + sleep 10 + - name: Create Test Database + run: docker compose -p redash run --rm postgres psql -h postgres -U postgres -c "create database tests;" + - name: List Enabled Query Runners + run: docker compose -p redash run --rm redash manage ds list_types + - name: Run Tests + run: docker compose -p redash run --name tests redash tests --junitxml=junit.xml --cov-report=xml --cov=redash --cov-config=.coveragerc tests/ + - name: Copy Test Results + run: | + mkdir -p /tmp/test-results/unit-tests + docker cp tests:/app/coverage.xml ./coverage.xml + docker cp tests:/app/junit.xml /tmp/test-results/unit-tests/results.xml + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + - name: Store Test Results + uses: actions/upload-artifact@v3 + with: + name: test-results + path: /tmp/test-results + - name: Store Coverage Results + uses: actions/upload-artifact@v3 + with: + name: coverage + path: coverage.xml + + frontend-lint: + runs-on: ubuntu-22.04 + steps: + - if: github.event.pull_request.mergeable == 'false' + name: Exit if PR is not mergeable + run: exit 1 + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'yarn' + - name: Install Dependencies + run: | + npm install --global --force yarn@$YARN_VERSION + yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 + - name: Run Lint + run: yarn lint:ci + - name: Store Test Results + uses: actions/upload-artifact@v3 + with: + name: test-results + path: /tmp/test-results + + frontend-unit-tests: + runs-on: ubuntu-22.04 + needs: frontend-lint + steps: + - if: github.event.pull_request.mergeable == 'false' + name: Exit if PR is not mergeable + run: exit 1 + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'yarn' + - name: Install Dependencies + run: | + npm install --global --force yarn@$YARN_VERSION + yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 + - name: Run App Tests + run: yarn test + - name: Run Visualizations Tests + run: cd viz-lib && yarn test + - run: yarn lint + + frontend-e2e-tests: + runs-on: ubuntu-22.04 + needs: frontend-lint + env: + COMPOSE_FILE: .ci/compose.cypress.yaml + 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 }} + steps: + - if: github.event.pull_request.mergeable == 'false' + name: Exit if PR is not mergeable + run: exit 1 + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: ${{ github.event.pull_request.head.sha }} + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'yarn' + - name: Enable Code Coverage Report For Master Branch + if: endsWith(github.ref, '/master') + run: | + echo "CODE_COVERAGE=true" >> "$GITHUB_ENV" + - name: Install Dependencies + run: | + npm install --global --force yarn@$YARN_VERSION + yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 + - name: Setup Redash Server + run: | + set -x + yarn cypress build + yarn cypress start -- --skip-db-seed + docker compose run cypress yarn cypress db-seed + - name: Execute Cypress Tests + run: yarn cypress run-ci + - name: "Failure: output container logs to console" + if: failure() + run: docker compose logs + - name: Copy Code Coverage Results + run: docker cp cypress:/usr/src/app/coverage ./coverage || true + - name: Store Coverage Results + uses: actions/upload-artifact@v3 + with: + name: coverage + path: coverage diff --git a/.github/workflows/periodic-snapshot.yml b/.github/workflows/periodic-snapshot.yml new file mode 100644 index 0000000000..780957a516 --- /dev/null +++ b/.github/workflows/periodic-snapshot.yml @@ -0,0 +1,85 @@ +name: Periodic Snapshot + +on: + schedule: + - cron: '10 0 1 * *' # 10 minutes after midnight on the first of every month + workflow_dispatch: + inputs: + bump: + description: 'Bump the last digit of the version' + required: false + type: boolean + version: + description: 'Specific version to set' + required: false + default: '' + +env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +permissions: + actions: write + contents: write + +jobs: + bump-version-and-tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ssh-key: ${{ secrets.ACTION_PUSH_KEY }} + + - run: | + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' + + # Function to bump the version + bump_version() { + local version="$1" + local IFS=. + read -r major minor patch <<< "$version" + patch=$((patch + 1)) + echo "$major.$minor.$patch-dev" + } + + # Determine the new version tag + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + BUMP_INPUT="${{ github.event.inputs.bump }}" + SPECIFIC_VERSION="${{ github.event.inputs.version }}" + + # Check if both bump and specific version are provided + if [ "$BUMP_INPUT" = "true" ] && [ -n "$SPECIFIC_VERSION" ]; then + echo "::error::Error: Cannot specify both bump and specific version." + exit 1 + fi + + if [ -n "$SPECIFIC_VERSION" ]; then + TAG_NAME="$SPECIFIC_VERSION-dev" + elif [ "$BUMP_INPUT" = "true" ]; then + CURRENT_VERSION=$(grep '"version":' package.json | awk -F\" '{print $4}') + TAG_NAME=$(bump_version "$CURRENT_VERSION") + else + echo "No version bump or specific version provided for manual dispatch." + exit 1 + fi + else + TAG_NAME="$(date +%y.%m).0-dev" + fi + + echo "New version tag: $TAG_NAME" + + # Update version in files + gawk -i inplace -F: -v q=\" -v tag=${TAG_NAME} '/^ "version": / { print $1 FS, q tag q ","; next} { print }' package.json + gawk -i inplace -F= -v q=\" -v tag=${TAG_NAME} '/^__version__ =/ { print $1 FS, q tag q; next} { print }' redash/__init__.py + gawk -i inplace -F= -v q=\" -v tag=${TAG_NAME} '/^version =/ { print $1 FS, q tag q; next} { print }' pyproject.toml + + git add package.json redash/__init__.py pyproject.toml + git commit -m "Snapshot: ${TAG_NAME}" + git tag ${TAG_NAME} + git push --atomic origin master refs/tags/${TAG_NAME} + + # Run the 'preview-image' workflow if run this workflow manually + # For more information, please see the: https://docs.github.com/en/actions/security-guides/automatic-token-authentication + if [ "$BUMP_INPUT" = "true" ] || [ -n "$SPECIFIC_VERSION" ]; then + gh workflow run preview-image.yml --ref $TAG_NAME + fi diff --git a/.github/workflows/preview-image.yml b/.github/workflows/preview-image.yml new file mode 100644 index 0000000000..8ac42b5a6a --- /dev/null +++ b/.github/workflows/preview-image.yml @@ -0,0 +1,94 @@ +name: Preview Image +on: + push: + tags: + - '*-dev' + workflow_dispatch: + +env: + NODE_VERSION: 18 + +jobs: + build-skip-check: + runs-on: ubuntu-22.04 + outputs: + skip: ${{ steps.skip-check.outputs.skip }} + steps: + - name: Skip? + id: skip-check + run: | + if [[ "${{ vars.DOCKER_USER }}" == '' ]]; then + echo 'Docker user is empty. Skipping build+push' + echo skip=true >> "$GITHUB_OUTPUT" + elif [[ "${{ secrets.DOCKER_PASS }}" == '' ]]; then + echo 'Docker password is empty. Skipping build+push' + echo skip=true >> "$GITHUB_OUTPUT" + else + echo 'Docker user and password are set and branch is `master`.' + echo 'Building + pushing `preview` image.' + echo skip=false >> "$GITHUB_OUTPUT" + fi + + build-docker-image: + runs-on: ubuntu-22.04 + needs: + - build-skip-check + if: needs.build-skip-check.outputs.skip == 'false' + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + ref: ${{ github.event.push.after }} + + - uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'yarn' + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ vars.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + + - name: Install Dependencies + run: | + npm install --global --force yarn@1.22.22 + yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 + + - name: Set version + id: version + run: | + set -x + .ci/update_version + VERSION_TAG=$(jq -r .version package.json) + echo "VERSION_TAG=$VERSION_TAG" >> "$GITHUB_OUTPUT" + + # TODO: We can use GitHub Actions's matrix option to reduce the build time. + - name: Build and push preview image to Docker Hub + uses: docker/build-push-action@v4 + with: + push: true + tags: | + redash/redash:preview + redash/preview:${{ steps.version.outputs.VERSION_TAG }} + context: . + build-args: | + test_all_deps=true + cache-from: type=gha,scope=multi-platform + cache-to: type=gha,mode=max,scope=multi-platform + platforms: linux/amd64,linux/arm64 + env: + DOCKER_CONTENT_TRUST: true + + - name: "Failure: output container logs to console" + if: failure() + run: docker compose logs diff --git a/.github/workflows/restyled.yml b/.github/workflows/restyled.yml new file mode 100644 index 0000000000..3482740947 --- /dev/null +++ b/.github/workflows/restyled.yml @@ -0,0 +1,36 @@ +name: Restyled + +on: + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + restyled: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - uses: restyled-io/actions/setup@v4 + - id: restyler + uses: restyled-io/actions/run@v4 + with: + fail-on-differences: true + + - if: | + !cancelled() && + steps.restyler.outputs.success == 'true' && + github.event.pull_request.head.repo.full_name == github.repository + uses: peter-evans/create-pull-request@v6 + with: + base: ${{ steps.restyler.outputs.restyled-base }} + branch: ${{ steps.restyler.outputs.restyled-head }} + title: ${{ steps.restyler.outputs.restyled-title }} + body: ${{ steps.restyler.outputs.restyled-body }} + labels: "restyled" + reviewers: ${{ github.event.pull_request.user.login }} + delete-branch: true diff --git a/.gitignore b/.gitignore index cdf356f632..6d7f3a7a7c 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ client/dist _build .vscode .env +.tool-versions dump.rdb diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000000..c42da845b4 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict = true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..3f430af82b --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..e8e6795c5e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black + language_version: python3 + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: "v0.0.287" + hooks: + - id: ruff diff --git a/.restyled.yaml b/.restyled.yaml index 9a9537ce7a..ddb249dab0 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -38,7 +38,9 @@ request_review: author # # These can be used to tell other automation to avoid our PRs. # -labels: ["Skip CI"] +labels: + - restyled + - "Skip CI" # Labels to ignore # @@ -50,13 +52,16 @@ labels: ["Skip CI"] # Restylers to run, and how restylers: - name: black - image: restyled/restyler-black:v19.10b0 + image: restyled/restyler-black:v24.4.2 include: - redash - tests - migrations/versions - name: prettier - image: restyled/restyler-prettier:v1.19.1-2 + image: restyled/restyler-prettier:v3.3.2-2 + command: + - prettier + - --write include: - client/app/**/*.js - client/app/**/*.jsx diff --git a/.yarn/.gitignore b/.yarn/.gitignore new file mode 100644 index 0000000000..d6b7ef32c8 --- /dev/null +++ b/.yarn/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/tests/extensions/__init__.py b/.yarnrc similarity index 100% rename from tests/extensions/__init__.py rename to .yarnrc diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9c28e6bc6..e090a0f8fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,19 +4,7 @@ Thank you for taking the time to contribute! :tada::+1: The following is a set of guidelines for contributing to Redash. These are guidelines, not rules, please use your best judgement and feel free to propose changes to this document in a pull request. -## Quick Links: - -- [Feature Requests](https://discuss.redash.io/c/feature-requests) -- [Documentation](https://redash.io/help/) -- [Blog](https://blog.redash.io/) -- [Twitter](https://twitter.com/getredash) - ---- -:star: If you already here and love the project, please make sure to press the Star button. :star: - ---- - - +:star: If you're already here and love the project, please make sure to press the Star button. :star: ## Table of Contents [How can I contribute?](#how-can-i-contribute) @@ -32,6 +20,13 @@ The following is a set of guidelines for contributing to Redash. These are guide - [Release Method](#release-method) - [Code of Conduct](#code-of-conduct) +## Quick Links: + +- [User Forum](https://github.com/getredash/redash/discussions) +- [Documentation](https://redash.io/help/) + + +--- ## How can I contribute? ### Reporting Bugs @@ -39,25 +34,54 @@ The following is a set of guidelines for contributing to Redash. These are guide When creating a new bug report, please make sure to: - Search for existing issues first. If you find a previous report of your issue, please update the existing issue with additional information instead of creating a new one. -- If you are not sure if your issue is really a bug or just some configuration/setup problem, please start a discussion in [the support forum](https://discuss.redash.io/c/support) first. Unless you can provide clear steps to reproduce, it's probably better to start with a thread in the forum and later to open an issue. +- If you are not sure if your issue is really a bug or just some configuration/setup problem, please start a [Q&A discussion](https://github.com/getredash/redash/discussions/new?category=q-a) first. Unless you can provide clear steps to reproduce, it's probably better to start with a discussion and later to open an issue. - If you still decide to open an issue, please review the template and guidelines and include as much details as possible. ### Suggesting Enhancements / Feature Requests If you would like to suggest an enhancement or ask for a new feature: -- Please check [the forum](https://discuss.redash.io/c/feature-requests/5) for existing threads about what you want to suggest/ask. If there is, feel free to upvote it to signal interest or add your comments. +- Please check [the Ideas discussions](https://github.com/getredash/redash/discussions/categories/ideas) for existing threads about what you want to suggest/ask. If there is, feel free to upvote it to signal interest or add your comments. - If there is no open thread, you're welcome to start one to have a discussion about what you want to suggest. Try to provide as much details and context as possible and include information about *the problem you want to solve* rather only *your proposed solution*. ### Pull Requests -- **Code contributions are welcomed**. For big changes or significant features, it's usually better to reach out first and discuss what you want to implement and how (we recommend reading: [Pull Request First](https://medium.com/practical-blend/pull-request-first-f6bb667a9b6#.ozlqxvj36)). This to make sure that what you want to implement is aligned with our goals for the project and that no one else is already working on it. -- Include screenshots and animated GIFs in your pull request whenever possible. +**Code contributions are welcomed**. For big changes or significant features, it's usually better to reach out first and discuss what you want to implement and how (we recommend reading: [Pull Request First](https://medium.com/practical-blend/pull-request-first-f6bb667a9b6#.ozlqxvj36)). This is to make sure that what you want to implement is aligned with our goals for the project and that no one else is already working on it. + +#### Criteria for Review / Merging + +When you open your pull request, please follow this repository’s PR template carefully: + +- Indicate the type of change + - If you implement multiple unrelated features, bug fixes, or refactors please split them into individual pull requests. +- Describe the change +- If fixing a bug, please describe the bug or link to an existing github issue / forum discussion +- Include UI screenshots / GIFs whenever possible - Please add [documentation](#documentation) for new features or changes in functionality along with the code. - Please follow existing code style: - Python: we use [Black](https://github.com/psf/black) to auto format the code. - Javascript: we use [Prettier](https://github.com/prettier/prettier) to auto-format the code. - + +#### Initial Review (1 week) + +During this phase, a team member will apply the “Team Review” label if a pull request meets our criteria or a “Needs More Information” label if not. If more information is required, the team member will comment which criteria have not been met. + +If your pull request receives the “Needs More Information” label, please make the requested changes and then remove the label. This resets the 1 week timer for an initial review. + +Stale pull requests that remain untouched in “Needs More Information” for more than 4 weeks will be closed. + +If a team member closes your pull request, you may reopen it after you have made the changes requested during initial review. After you make these changes, remove the “Needs More Information” label. This again resets the timer for another initial review. + +#### Full Review (2 weeks) + +After the “Team Review” label is applied, a member of the core team will review the PR within 2 weeks. + +Reviews will approve, request changes, or ask questions to discuss areas of uncertainty. After you’ve responded, a member of the team will re-review within one week. + +#### Merging (1 week) + +After your pull request has been approved, a member of the core team will merge the pull request within a week. + ### Documentation The project's documentation can be found at [https://redash.io/help/](https://redash.io/help/). The [documentation sources](https://github.com/getredash/website/tree/master/src/pages/kb) are hosted on GitHub. To contribute edits / new pages, you can use GitHub's interface. Click the "Edit on GitHub" link on the documentation page to quickly open the edit interface. diff --git a/Dockerfile b/Dockerfile index a4ede66458..73a1447590 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,14 +12,18 @@ RUN useradd -m -d /frontend redash USER redash WORKDIR /frontend -COPY --chown=redash package.json package-lock.json /frontend/ +COPY --chown=redash package.json yarn.lock .yarnrc /frontend/ COPY --chown=redash viz-lib /frontend/viz-lib +COPY --chown=redash scripts /frontend/scripts # Controls whether to instrument code for coverage information ARG code_coverage ENV BABEL_ENV=${code_coverage:+test} -RUN if [ "x$skip_frontend_build" = "x" ] ; then npm ci --unsafe-perm; fi +# Avoid issues caused by lags in disk and network I/O speeds when working on top of QEMU emulation for multi-platform image building. +RUN yarn config set network-timeout 300000 + +RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn --frozen-lockfile --network-concurrency 1; fi COPY --chown=redash client /frontend/client COPY --chown=redash webpack.config.js /frontend/ @@ -29,11 +33,6 @@ FROM --platform=linux/amd64 python:3.10.13-slim-bullseye EXPOSE 5000 -# Controls whether to install extra dependencies needed for all data sources. -ARG skip_ds_deps -# Controls whether to install dev dependencies. -ARG skip_dev_deps - RUN useradd --create-home redash # Ubuntu packages @@ -68,37 +67,45 @@ RUN apt-get update && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* -ARG databricks_odbc_driver_url=https://databricks.com/wp-content/uploads/2.6.10.1010-2/SimbaSparkODBC-2.6.10.1010-2-Debian-64bit.zip -RUN wget --quiet $databricks_odbc_driver_url -O /tmp/simba_odbc.zip \ + +ARG TARGETPLATFORM +ARG databricks_odbc_driver_url=https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/odbc/2.6.26/SimbaSparkODBC-2.6.26.1045-Debian-64bit.zip +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ + curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \ + && curl https://packages.microsoft.com/config/debian/12/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && apt-get update \ + && ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && curl "$databricks_odbc_driver_url" --location --output /tmp/simba_odbc.zip \ && chmod 600 /tmp/simba_odbc.zip \ - && unzip /tmp/simba_odbc.zip -d /tmp/ \ - && dpkg -i /tmp/SimbaSparkODBC-*/*.deb \ - && echo "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \ + && unzip /tmp/simba_odbc.zip -d /tmp/simba \ + && dpkg -i /tmp/simba/*.deb \ + && printf "[Simba]\nDriver = /opt/simba/spark/lib/64/libsparkodbc_sb64.so" >> /etc/odbcinst.ini \ && rm /tmp/simba_odbc.zip \ - && rm -rf /tmp/SimbaSparkODBC* + && rm -rf /tmp/simba; fi WORKDIR /app -# Disalbe PIP Cache and Version Check -ENV PIP_DISABLE_PIP_VERSION_CHECK=1 -ENV PIP_NO_CACHE_DIR=1 - -# rollback pip version to avoid legacy resolver problem -RUN pip install pip==20.2.4; +ENV POETRY_VERSION=1.8.3 +ENV POETRY_HOME=/etc/poetry +ENV POETRY_VIRTUALENVS_CREATE=false +RUN curl -sSL https://install.python-poetry.org | python3 - -# We first copy only the requirements file, to avoid rebuilding on every file change. -COPY requirements_all_ds.txt ./ -RUN if [ "x$skip_ds_deps" = "x" ] ; then pip install -r requirements_all_ds.txt ; else echo "Skipping pip install -r requirements_all_ds.txt" ; fi +# Avoid crashes, including corrupted cache artifacts, when building multi-platform images with GitHub Actions. +RUN /etc/poetry/bin/poetry cache clear pypi --all -COPY requirements_bundles.txt requirements_dev.txt ./ -RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements_dev.txt ; fi +COPY pyproject.toml poetry.lock ./ -COPY requirements.txt ./ -RUN pip install -r requirements.txt +ARG POETRY_OPTIONS="--no-root --no-interaction --no-ansi" +# for LDAP authentication, install with `ldap3` group +# disabled by default due to GPL license conflict +ARG install_groups="main,all_ds,dev" +RUN /etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS -COPY . /app -COPY --from=frontend-builder /frontend/client/dist /app/client/dist -RUN chown -R redash /app +COPY --chown=redash . /app +COPY --from=frontend-builder --chown=redash /frontend/client/dist /app/client/dist +RUN chown redash /app USER redash ENTRYPOINT ["/app/bin/docker-entrypoint"] diff --git a/LICENSE.borders b/LICENSE.borders new file mode 100644 index 0000000000..f9e6eff226 --- /dev/null +++ b/LICENSE.borders @@ -0,0 +1,3 @@ +The Bahrain map data used in Redash was downloaded from +https://cartographyvectors.com/map/857-bahrain-detailed-boundary in PR #6192. +* Free for personal and commercial purpose with attribution. diff --git a/Makefile b/Makefile index dd826ed9a4..1704cd8305 100644 --- a/Makefile +++ b/Makefile @@ -1,57 +1,80 @@ -.PHONY: compose_build up test_db create_database clean down bundle tests lint backend-unit-tests frontend-unit-tests test build watch start redis-cli bash +.PHONY: compose_build up test_db create_database clean clean-all down tests lint backend-unit-tests frontend-unit-tests test build watch start redis-cli bash -compose_build: - docker-compose build +compose_build: .env + COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build up: - docker-compose up -d --build + docker compose up -d redis postgres --remove-orphans + docker compose exec -u postgres postgres psql postgres --csv \ + -1tqc "SELECT table_name FROM information_schema.tables WHERE table_name = 'organizations'" 2> /dev/null \ + | grep -q "organizations" || make create_database + COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up -d --build --remove-orphans test_db: @for i in `seq 1 5`; do \ - if (docker-compose exec postgres sh -c 'psql -U postgres -c "select 1;"' 2>&1 > /dev/null) then break; \ + if (docker compose exec postgres sh -c 'psql -U postgres -c "select 1;"' 2>&1 > /dev/null) then break; \ else echo "postgres initializing..."; sleep 5; fi \ done - docker-compose exec postgres sh -c 'psql -U postgres -c "drop database if exists tests;" && psql -U postgres -c "create database tests;"' + docker compose exec postgres sh -c 'psql -U postgres -c "drop database if exists tests;" && psql -U postgres -c "create database tests;"' -create_database: - docker-compose run server create_db +create_database: .env + docker compose run server create_db clean: - docker-compose down && docker-compose rm + docker compose down + docker compose --project-name cypress down + docker compose rm --stop --force + docker compose --project-name cypress rm --stop --force + docker image rm --force \ + cypress-server:latest cypress-worker:latest cypress-scheduler:latest \ + redash-server:latest redash-worker:latest redash-scheduler:latest + docker container prune --force + docker image prune --force + docker volume prune --force + +clean-all: clean + docker image rm --force \ + redash/redash:10.1.0.b50633 redis:7-alpine maildev/maildev:latest \ + pgautoupgrade/pgautoupgrade:15-alpine3.8 pgautoupgrade/pgautoupgrade:latest down: - docker-compose down + docker compose down -bundle: - docker-compose run server bin/bundle-extensions +.env: + printf "REDASH_COOKIE_SECRET=`pwgen -1s 32`\nREDASH_SECRET_KEY=`pwgen -1s 32`\n" >> .env + +env: .env + +format: + pre-commit run --all-files tests: - docker-compose run server tests + docker compose run server tests lint: - ./bin/flake8_tests.sh + ruff check . + black --check . --diff backend-unit-tests: up test_db - docker-compose run --rm --name tests server tests + docker compose run --rm --name tests server tests -frontend-unit-tests: bundle - CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 npm ci - npm run bundle - npm test +frontend-unit-tests: + CYPRESS_INSTALL_BINARY=0 PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarn --frozen-lockfile + yarn test -test: lint backend-unit-tests frontend-unit-tests +test: backend-unit-tests frontend-unit-tests lint -build: bundle - npm run build +build: + yarn build -watch: bundle - npm run watch +watch: + yarn watch -start: bundle - npm run start +start: + yarn start redis-cli: - docker-compose run --rm redis redis-cli -h redis + docker compose run --rm redis redis-cli -h redis bash: - docker-compose run --rm server bash + docker compose run --rm server bash diff --git a/README.md b/README.md index a32aeabbd1..01c9ce355f 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,7 @@

[![Documentation](https://img.shields.io/badge/docs-redash.io/help-brightgreen.svg)](https://redash.io/help/) -[![Datree](https://s3.amazonaws.com/catalog.static.datree.io/datree-badge-20px.svg)](https://datree.io/?src=badge) -[![Build Status](https://circleci.com/gh/getredash/redash.png?style=shield&circle-token=8a695aa5ec2cbfa89b48c275aea298318016f040)](https://circleci.com/gh/getredash/redash/tree/master) +[![GitHub Build](https://github.com/getredash/redash/actions/workflows/ci.yml/badge.svg)](https://github.com/getredash/redash/actions) Redash is designed to enable anyone, regardless of the level of technical sophistication, to harness the power of data big and small. SQL users leverage Redash to explore, query, visualize, and share data from any data sources. Their work in turn enables anybody in their organization to use the data. Every day, millions of users at thousands of organizations around the world use Redash to develop insights and make data-driven decisions. @@ -32,16 +31,23 @@ Redash features: Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help/data-sources/supported-data-sources). It can also be extended to support more. Below is a list of built-in sources: - Amazon Athena +- Amazon CloudWatch / Insights - Amazon DynamoDB - Amazon Redshift +- ArangoDB - Axibase Time Series Database -- Cassandra +- Apache Cassandra - ClickHouse - CockroachDB +- Couchbase - CSV -- Databricks (Apache Spark) +- Databricks - DB2 by IBM -- Druid +- Dgraph +- Apache Drill +- Apache Druid +- e6data +- Eccenca Corporate Memory - Elasticsearch - Firebolt - Google Analytics @@ -49,33 +55,44 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help - Google Spreadsheets - Graphite - Greenplum -- Hive -- Impala +- Apache Hive +- Apache Impala - InfluxDB -- JIRA +- InfluxDBv2 +- IBM Netezza Performance Server +- JIRA (JQL) - JSON - Apache Kylin - OmniSciDB (Formerly MapD) +- MariaDB - MemSQL - Microsoft Azure Data Warehouse / Synapse - Microsoft Azure SQL Database +- Microsoft Azure Data Explorer / Kusto - Microsoft SQL Server - MongoDB - MySQL - Oracle +- Apache Phoenix +- Apache Pinot - PostgreSQL - Presto - Prometheus - Python - Qubole - Rockset +- RisingWave - Salesforce - ScyllaDB - Shell Scripts - Snowflake +- SPARQL - SQLite - TiDB +- Tinybird - TreasureData +- Trino +- Uptycs - Vertica - Yandex AppMetrrica - Yandex Metrica @@ -83,12 +100,13 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help ## Getting Help * Issues: https://github.com/getredash/redash/issues -* Discussion Forum: https://discuss.redash.io/ +* Discussion Forum: https://github.com/getredash/redash/discussions/ +* Development Discussion: https://discord.gg/tN5MdmfGBp ## Reporting Bugs and Contributing Code * Want to report a bug or request a feature? Please open [an issue](https://github.com/getredash/redash/issues/new). -* Want to help us build **_Redash_**? Fork the project, edit in a [dev environment](https://redash.io/help-onpremise/dev/guide.html) and make a pull request. We need all the help we can get! +* Want to help us build **_Redash_**? Fork the project, edit in a [dev environment](https://github.com/getredash/redash/wiki/Local-development-setup) and make a pull request. We need all the help we can get! ## Security diff --git a/bin/bundle-extensions b/bin/bundle-extensions deleted file mode 100755 index ce0e300854..0000000000 --- a/bin/bundle-extensions +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python3 -"""Copy bundle extension files to the client/app/extension directory""" -import logging -import os -from pathlib import Path -from shutil import copy -from collections import OrderedDict as odict - -import importlib_metadata -import importlib_resources - -# Name of the subdirectory -BUNDLE_DIRECTORY = "bundle" - -logger = logging.getLogger(__name__) - - -# Make a directory for extensions and set it as an environment variable -# to be picked up by webpack. -extensions_relative_path = Path("client", "app", "extensions") -extensions_directory = Path(__file__).parent.parent / extensions_relative_path - -if not extensions_directory.exists(): - extensions_directory.mkdir() -os.environ["EXTENSIONS_DIRECTORY"] = str(extensions_relative_path) - - -def entry_point_module(entry_point): - """Returns the dotted module path for the given entry point""" - return entry_point.pattern.match(entry_point.value).group("module") - - -def load_bundles(): - """"Load bundles as defined in Redash extensions. - - The bundle entry point can be defined as a dotted path to a module - or a callable, but it won't be called but just used as a means - to find the files under its file system path. - - The name of the directory it looks for files in is "bundle". - - So a Python package with an extension bundle could look like this:: - - my_extensions/ - ├── __init__.py - └── wide_footer - ├── __init__.py - └── bundle - ├── extension.js - └── styles.css - - and would then need to register the bundle with an entry point - under the "redash.bundles" group, e.g. in your setup.py:: - - setup( - # ... - entry_points={ - "redash.bundles": [ - "wide_footer = my_extensions.wide_footer", - ] - # ... - }, - # ... - ) - - """ - bundles = odict() - for entry_point in importlib_metadata.entry_points().get("redash.bundles", []): - logger.info('Loading Redash bundle "%s".', entry_point.name) - module = entry_point_module(entry_point) - # Try to get a list of bundle files - try: - bundle_dir = importlib_resources.files(module).joinpath(BUNDLE_DIRECTORY) - except (ImportError, TypeError): - # Module isn't a package, so can't have a subdirectory/-package - logger.error( - 'Redash bundle module "%s" could not be imported: "%s"', - entry_point.name, - module, - ) - continue - if not bundle_dir.is_dir(): - logger.error( - 'Redash bundle directory "%s" could not be found or is not a directory: "%s"', - entry_point.name, - bundle_dir, - ) - continue - bundles[entry_point.name] = list(bundle_dir.rglob("*")) - return bundles - - -bundles = load_bundles().items() -if bundles: - print("Number of extension bundles found: {}".format(len(bundles))) -else: - print("No extension bundles found.") - -for bundle_name, paths in bundles: - # Shortcut in case not paths were found for the bundle - if not paths: - print('No paths found for bundle "{}".'.format(bundle_name)) - continue - - # The destination for the bundle files with the entry point name as the subdirectory - destination = Path(extensions_directory, bundle_name) - if not destination.exists(): - destination.mkdir() - - # Copy the bundle directory from the module to its destination. - print('Copying "{}" bundle to {}:'.format(bundle_name, destination.resolve())) - for src_path in paths: - dest_path = destination / src_path.name - print(" - {} -> {}".format(src_path, dest_path)) - copy(str(src_path), str(dest_path)) diff --git a/bin/docker-entrypoint b/bin/docker-entrypoint index b5d7b0ac17..5e777c10ed 100755 --- a/bin/docker-entrypoint +++ b/bin/docker-entrypoint @@ -22,6 +22,19 @@ worker() { exec supervisord -c worker.conf } +workers_healthcheck() { + WORKERS_COUNT=${WORKERS_COUNT} + echo "Checking active workers count against $WORKERS_COUNT..." + ACTIVE_WORKERS_COUNT=`echo $(rq info --url $REDASH_REDIS_URL -R | grep workers | grep -oP ^[0-9]+)` + if [ "$ACTIVE_WORKERS_COUNT" -lt "$WORKERS_COUNT" ]; then + echo "$ACTIVE_WORKERS_COUNT workers are active, Exiting" + exit 1 + else + echo "$ACTIVE_WORKERS_COUNT workers are active" + exit 0 + fi +} + dev_worker() { echo "Starting dev RQ worker..." @@ -32,7 +45,8 @@ server() { # Recycle gunicorn workers every n-th request. See http://docs.gunicorn.org/en/stable/settings.html#max-requests for more details. MAX_REQUESTS=${MAX_REQUESTS:-1000} MAX_REQUESTS_JITTER=${MAX_REQUESTS_JITTER:-100} - exec /usr/local/bin/gunicorn -b 0.0.0.0:5000 --name redash -w${REDASH_WEB_WORKERS:-4} redash.wsgi:app --max-requests $MAX_REQUESTS --max-requests-jitter $MAX_REQUESTS_JITTER + TIMEOUT=${REDASH_GUNICORN_TIMEOUT:-60} + exec /usr/local/bin/gunicorn -b 0.0.0.0:5000 --name redash -w${REDASH_WEB_WORKERS:-4} redash.wsgi:app --max-requests $MAX_REQUESTS --max-requests-jitter $MAX_REQUESTS_JITTER --timeout $TIMEOUT } create_db() { @@ -75,6 +89,10 @@ case "$1" in shift worker ;; + workers_healthcheck) + shift + workers_healthcheck + ;; server) shift server diff --git a/bin/flake8_tests.sh b/bin/flake8_tests.sh deleted file mode 100755 index 3c27f7fee2..0000000000 --- a/bin/flake8_tests.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -set -o errexit # fail the build if any task fails - -flake8 --version ; pip --version -# stop the build if there are Python syntax errors or undefined names -flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics -# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide -flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics diff --git a/bin/get_changes.py b/bin/get_changes.py index 60091bb772..aad1223837 100644 --- a/bin/get_changes.py +++ b/bin/get_changes.py @@ -1,35 +1,44 @@ #!/bin/env python3 -import sys import re import subprocess +import sys def get_change_log(previous_sha): - args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', 'master...{}'.format(previous_sha)] + args = [ + "git", + "--no-pager", + "log", + "--merges", + "--grep", + "Merge pull request", + '--pretty=format:"%h|%s|%b|%p"', + "master...{}".format(previous_sha), + ] log = subprocess.check_output(args) changes = [] - for line in log.split('\n'): + for line in log.split("\n"): try: - sha, subject, body, parents = line[1:-1].split('|') + sha, subject, body, parents = line[1:-1].split("|") except ValueError: continue try: - pull_request = re.match("Merge pull request #(\d+)", subject).groups()[0] + pull_request = re.match(r"Merge pull request #(\d+)", subject).groups()[0] pull_request = " #{}".format(pull_request) - except Exception as ex: + except Exception: pull_request = "" - author = subprocess.check_output(['git', 'log', '-1', '--pretty=format:"%an"', parents.split(' ')[-1]])[1:-1] + author = subprocess.check_output(["git", "log", "-1", '--pretty=format:"%an"', parents.split(" ")[-1]])[1:-1] changes.append("{}{}: {} ({})".format(sha, pull_request, body.strip(), author)) return changes -if __name__ == '__main__': +if __name__ == "__main__": previous_sha = sys.argv[1] changes = get_change_log(previous_sha) diff --git a/bin/release_manager.py b/bin/release_manager.py index 3d9b21c895..bd2200d523 100644 --- a/bin/release_manager.py +++ b/bin/release_manager.py @@ -1,17 +1,20 @@ #!/usr/bin/env python3 import os -import sys import re import subprocess +import sys +from urllib.parse import urlparse + import requests import simplejson -github_token = os.environ['GITHUB_TOKEN'] -auth = (github_token, 'x-oauth-basic') -repo = 'getredash/redash' +github_token = os.environ["GITHUB_TOKEN"] +auth = (github_token, "x-oauth-basic") +repo = "getredash/redash" + def _github_request(method, path, params=None, headers={}): - if not path.startswith('https://api.github.com'): + if urlparse(path).hostname != "api.github.com": url = "https://api.github.com/{}".format(path) else: url = path @@ -22,15 +25,18 @@ def _github_request(method, path, params=None, headers={}): response = requests.request(method, url, data=params, auth=auth) return response + def exception_from_error(message, response): - return Exception("({}) {}: {}".format(response.status_code, message, response.json().get('message', '?'))) + return Exception("({}) {}: {}".format(response.status_code, message, response.json().get("message", "?"))) + def rc_tag_name(version): return "v{}-rc".format(version) + def get_rc_release(version): tag = rc_tag_name(version) - response = _github_request('get', 'repos/{}/releases/tags/{}'.format(repo, tag)) + response = _github_request("get", "repos/{}/releases/tags/{}".format(repo, tag)) if response.status_code == 404: return None @@ -39,84 +45,101 @@ def get_rc_release(version): raise exception_from_error("Unknown error while looking RC release: ", response) + def create_release(version, commit_sha): tag = rc_tag_name(version) params = { - 'tag_name': tag, - 'name': "{} - RC".format(version), - 'target_commitish': commit_sha, - 'prerelease': True + "tag_name": tag, + "name": "{} - RC".format(version), + "target_commitish": commit_sha, + "prerelease": True, } - response = _github_request('post', 'repos/{}/releases'.format(repo), params) + response = _github_request("post", "repos/{}/releases".format(repo), params) if response.status_code != 201: raise exception_from_error("Failed creating new release", response) return response.json() + def upload_asset(release, filepath): - upload_url = release['upload_url'].replace('{?name,label}', '') - filename = filepath.split('/')[-1] + upload_url = release["upload_url"].replace("{?name,label}", "") + filename = filepath.split("/")[-1] with open(filepath) as file_content: - headers = {'Content-Type': 'application/gzip'} - response = requests.post(upload_url, file_content, params={'name': filename}, headers=headers, auth=auth, verify=False) + headers = {"Content-Type": "application/gzip"} + response = requests.post( + upload_url, file_content, params={"name": filename}, headers=headers, auth=auth, verify=False + ) if response.status_code != 201: # not 200/201/... - raise exception_from_error('Failed uploading asset', response) + raise exception_from_error("Failed uploading asset", response) return response + def remove_previous_builds(release): - for asset in release['assets']: - response = _github_request('delete', asset['url']) + for asset in release["assets"]: + response = _github_request("delete", asset["url"]) if response.status_code != 204: raise exception_from_error("Failed deleting asset", response) + def get_changelog(commit_sha): - latest_release = _github_request('get', 'repos/{}/releases/latest'.format(repo)) + latest_release = _github_request("get", "repos/{}/releases/latest".format(repo)) if latest_release.status_code != 200: - raise exception_from_error('Failed getting latest release', latest_release) + raise exception_from_error("Failed getting latest release", latest_release) latest_release = latest_release.json() - previous_sha = latest_release['target_commitish'] - - args = ['git', '--no-pager', 'log', '--merges', '--grep', 'Merge pull request', '--pretty=format:"%h|%s|%b|%p"', '{}...{}'.format(previous_sha, commit_sha)] + previous_sha = latest_release["target_commitish"] + + args = [ + "git", + "--no-pager", + "log", + "--merges", + "--grep", + "Merge pull request", + '--pretty=format:"%h|%s|%b|%p"', + "{}...{}".format(previous_sha, commit_sha), + ] log = subprocess.check_output(args) - changes = ["Changes since {}:".format(latest_release['name'])] + changes = ["Changes since {}:".format(latest_release["name"])] - for line in log.split('\n'): + for line in log.split("\n"): try: - sha, subject, body, parents = line[1:-1].split('|') + sha, subject, body, parents = line[1:-1].split("|") except ValueError: continue try: - pull_request = re.match("Merge pull request #(\d+)", subject).groups()[0] + pull_request = re.match(r"Merge pull request #(\d+)", subject).groups()[0] pull_request = " #{}".format(pull_request) - except Exception as ex: + except Exception: pull_request = "" - author = subprocess.check_output(['git', 'log', '-1', '--pretty=format:"%an"', parents.split(' ')[-1]])[1:-1] + author = subprocess.check_output(["git", "log", "-1", '--pretty=format:"%an"', parents.split(" ")[-1]])[1:-1] changes.append("{}{}: {} ({})".format(sha, pull_request, body.strip(), author)) return "\n".join(changes) + def update_release_commit_sha(release, commit_sha): params = { - 'target_commitish': commit_sha, + "target_commitish": commit_sha, } - response = _github_request('patch', 'repos/{}/releases/{}'.format(repo, release['id']), params) + response = _github_request("patch", "repos/{}/releases/{}".format(repo, release["id"]), params) if response.status_code != 200: raise exception_from_error("Failed updating commit sha for existing release", response) return response.json() + def update_release(version, build_filepath, commit_sha): try: release = get_rc_release(version) @@ -125,21 +148,22 @@ def update_release(version, build_filepath, commit_sha): else: release = create_release(version, commit_sha) - print("Using release id: {}".format(release['id'])) + print("Using release id: {}".format(release["id"])) remove_previous_builds(release) response = upload_asset(release, build_filepath) changelog = get_changelog(commit_sha) - response = _github_request('patch', release['url'], {'body': changelog}) + response = _github_request("patch", release["url"], {"body": changelog}) if response.status_code != 200: raise exception_from_error("Failed updating release description", response) except Exception as ex: print(ex) -if __name__ == '__main__': + +if __name__ == "__main__": commit_sha = sys.argv[1] version = sys.argv[2] filepath = sys.argv[3] diff --git a/bin/upgrade b/bin/upgrade deleted file mode 100755 index 376866f1ed..0000000000 --- a/bin/upgrade +++ /dev/null @@ -1,242 +0,0 @@ -#!/usr/bin/env python3 -import urllib -import argparse -import os -import subprocess -import sys -from collections import namedtuple -from fnmatch import fnmatch - -import requests - -try: - import semver -except ImportError: - print("Missing required library: semver.") - exit(1) - -REDASH_HOME = os.environ.get('REDASH_HOME', '/opt/redash') -CURRENT_VERSION_PATH = '{}/current'.format(REDASH_HOME) - - -def run(cmd, cwd=None): - if not cwd: - cwd = REDASH_HOME - - return subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=subprocess.STDOUT) - - -def confirm(question): - reply = str(input(question + ' (y/n): ')).lower().strip() - - if reply[0] == 'y': - return True - if reply[0] == 'n': - return False - else: - return confirm("Please use 'y' or 'n'") - - -def version_path(version_name): - return "{}/{}".format(REDASH_HOME, version_name) - -END_CODE = '\033[0m' - - -def colored_string(text, color): - if sys.stdout.isatty(): - return "{}{}{}".format(color, text, END_CODE) - else: - return text - - -def h1(text): - print(colored_string(text, '\033[4m\033[1m')) - - -def green(text): - print(colored_string(text, '\033[92m')) - - -def red(text): - print(colored_string(text, '\033[91m')) - - -class Release(namedtuple('Release', ('version', 'download_url', 'filename', 'description'))): - def v1_or_newer(self): - return semver.compare(self.version, '1.0.0-alpha') >= 0 - - def is_newer(self, version): - return semver.compare(self.version, version) > 0 - - @property - def version_name(self): - return self.filename.replace('.tar.gz', '') - - -def get_latest_release_from_ci(): - response = requests.get('https://circleci.com/api/v1.1/project/github/getredash/redash/latest/artifacts?branch=master') - - if response.status_code != 200: - exit("Failed getting releases (status code: %s)." % response.status_code) - - tarball_asset = filter(lambda asset: asset['url'].endswith('.tar.gz'), response.json())[0] - filename = urllib.unquote(tarball_asset['pretty_path'].split('/')[-1]) - version = filename.replace('redash.', '').replace('.tar.gz', '') - - release = Release(version, tarball_asset['url'], filename, '') - - return release - - -def get_release(channel): - if channel == 'ci': - return get_latest_release_from_ci() - - response = requests.get('https://version.redash.io/api/releases?channel={}'.format(channel)) - release = response.json()[0] - - filename = release['download_url'].split('/')[-1] - release = Release(release['version'], release['download_url'], filename, release['description']) - - return release - - -def link_to_current(version_name): - green("Linking to current version...") - run('ln -nfs {} {}'.format(version_path(version_name), CURRENT_VERSION_PATH)) - - -def restart_services(): - # We're doing this instead of simple 'supervisorctl restart all' because - # otherwise it won't notice that /opt/redash/current pointing at a different - # directory. - green("Restarting...") - try: - run('sudo /etc/init.d/redash_supervisord restart') - except subprocess.CalledProcessError as e: - run('sudo service supervisor restart') - - -def update_requirements(version_name): - green("Installing new Python packages (if needed)...") - new_requirements_file = '{}/requirements.txt'.format(version_path(version_name)) - - install_requirements = False - - try: - run('diff {}/requirements.txt {}'.format(CURRENT_VERSION_PATH, new_requirements_file)) != 0 - except subprocess.CalledProcessError as e: - if e.returncode != 0: - install_requirements = True - - if install_requirements: - run('sudo pip install -r {}'.format(new_requirements_file)) - - -def apply_migrations(release): - green("Running migrations (if needed)...") - if not release.v1_or_newer(): - return apply_migrations_pre_v1(release.version_name) - - run("sudo -u redash bin/run ./manage.py db upgrade", cwd=version_path(release.version_name)) - - -def find_migrations(version_name): - current_migrations = set([f for f in os.listdir("{}/migrations".format(CURRENT_VERSION_PATH)) if fnmatch(f, '*_*.py')]) - new_migrations = sorted([f for f in os.listdir("{}/migrations".format(version_path(version_name))) if fnmatch(f, '*_*.py')]) - - return [m for m in new_migrations if m not in current_migrations] - - -def apply_migrations_pre_v1(version_name): - new_migrations = find_migrations(version_name) - - if new_migrations: - green("New migrations to run: ") - print(', '.join(new_migrations)) - else: - print("No new migrations in this version.") - - if new_migrations and confirm("Apply new migrations? (make sure you have backup)"): - for migration in new_migrations: - print("Applying {}...".format(migration)) - run("sudo sudo -u redash PYTHONPATH=. bin/run python migrations/{}".format(migration), cwd=version_path(version_name)) - - -def download_and_unpack(release): - directory_name = release.version_name - - green("Downloading release tarball...") - run('sudo wget --header="Accept: application/octet-stream" -O {} {}'.format(release.filename, release.download_url)) - green("Unpacking to: {}...".format(directory_name)) - run('sudo mkdir -p {}'.format(directory_name)) - run('sudo tar -C {} -xvf {}'.format(directory_name, release.filename)) - - green("Changing ownership to redash...") - run('sudo chown redash {}'.format(directory_name)) - - green("Linking .env file...") - run('sudo ln -nfs {}/.env {}/.env'.format(REDASH_HOME, version_path(directory_name))) - - -def current_version(): - real_current_path = os.path.realpath(CURRENT_VERSION_PATH).replace('.b', '+b') - return real_current_path.replace(REDASH_HOME + '/', '').replace('redash.', '') - - -def verify_minimum_version(): - green("Current version: " + current_version()) - if semver.compare(current_version(), '0.12.0') < 0: - red("You need to have Redash v0.12.0 or newer to upgrade to post v1.0.0 releases.") - green("To upgrade to v0.12.0, run the upgrade script set to the legacy channel (--channel legacy).") - exit(1) - - -def show_description_and_confirm(description): - if description: - print(description) - - if not confirm("Continue with upgrade?"): - red("Cancelling upgrade.") - exit(1) - - -def verify_newer_version(release): - if not release.is_newer(current_version()): - red("The found release is not newer than your current deployed release ({}).".format(current_version())) - if not confirm("Continue with upgrade?"): - red("Cancelling upgrade.") - exit(1) - - -def deploy_release(channel): - h1("Starting Redash upgrade:") - - release = get_release(channel) - green("Found version: {}".format(release.version)) - - if release.v1_or_newer(): - verify_minimum_version() - - verify_newer_version(release) - show_description_and_confirm(release.description) - - try: - download_and_unpack(release) - update_requirements(release.version_name) - apply_migrations(release) - link_to_current(release.version_name) - restart_services() - green("Done! Enjoy.") - except subprocess.CalledProcessError as e: - red("Failed running: {}".format(e.cmd)) - red("Exit status: {}\nOutput:\n{}".format(e.returncode, e.output)) - - -if __name__ == '__main__': - parser = argparse.ArgumentParser() - parser.add_argument("--channel", help="The channel to get release from (default: stable).", default='stable') - args = parser.parse_args() - - deploy_release(args.channel) diff --git a/client/app/assets/images/db-logos/arangodb.png b/client/app/assets/images/db-logos/arangodb.png new file mode 100644 index 0000000000..1b2defd2d6 Binary files /dev/null and b/client/app/assets/images/db-logos/arangodb.png differ diff --git a/client/app/assets/images/db-logos/databend.png b/client/app/assets/images/db-logos/databend.png new file mode 100644 index 0000000000..dec146f4cb Binary files /dev/null and b/client/app/assets/images/db-logos/databend.png differ diff --git a/client/app/assets/images/db-logos/dynamodb_sql.png b/client/app/assets/images/db-logos/dynamodb_sql.png deleted file mode 100644 index 22d9e6430b..0000000000 Binary files a/client/app/assets/images/db-logos/dynamodb_sql.png and /dev/null differ diff --git a/client/app/assets/images/db-logos/e6data.png b/client/app/assets/images/db-logos/e6data.png new file mode 100644 index 0000000000..af5cf71c4b Binary files /dev/null and b/client/app/assets/images/db-logos/e6data.png differ diff --git a/client/app/assets/images/db-logos/elasticsearch2.png b/client/app/assets/images/db-logos/elasticsearch2.png new file mode 100644 index 0000000000..e7cb9c8345 Binary files /dev/null and b/client/app/assets/images/db-logos/elasticsearch2.png differ diff --git a/client/app/assets/images/db-logos/elasticsearch2_OpenDistroSQLElasticSearch.png b/client/app/assets/images/db-logos/elasticsearch2_OpenDistroSQLElasticSearch.png new file mode 100644 index 0000000000..e7cb9c8345 Binary files /dev/null and b/client/app/assets/images/db-logos/elasticsearch2_OpenDistroSQLElasticSearch.png differ diff --git a/client/app/assets/images/db-logos/elasticsearch2_XPackSQLElasticSearch.png b/client/app/assets/images/db-logos/elasticsearch2_XPackSQLElasticSearch.png new file mode 100644 index 0000000000..e7cb9c8345 Binary files /dev/null and b/client/app/assets/images/db-logos/elasticsearch2_XPackSQLElasticSearch.png differ diff --git a/client/app/assets/images/db-logos/google_analytics4.png b/client/app/assets/images/db-logos/google_analytics4.png new file mode 100644 index 0000000000..eaddd9d569 Binary files /dev/null and b/client/app/assets/images/db-logos/google_analytics4.png differ diff --git a/client/app/assets/images/db-logos/google_search_console.png b/client/app/assets/images/db-logos/google_search_console.png new file mode 100644 index 0000000000..a302ca590f Binary files /dev/null and b/client/app/assets/images/db-logos/google_search_console.png differ diff --git a/client/app/assets/images/db-logos/ignite.png b/client/app/assets/images/db-logos/ignite.png new file mode 100644 index 0000000000..046e381012 Binary files /dev/null and b/client/app/assets/images/db-logos/ignite.png differ diff --git a/client/app/assets/images/db-logos/influxdbv2.png b/client/app/assets/images/db-logos/influxdbv2.png new file mode 100644 index 0000000000..f3846cb199 Binary files /dev/null and b/client/app/assets/images/db-logos/influxdbv2.png differ diff --git a/client/app/assets/images/db-logos/nz.png b/client/app/assets/images/db-logos/nz.png new file mode 100644 index 0000000000..663687470c Binary files /dev/null and b/client/app/assets/images/db-logos/nz.png differ diff --git a/client/app/assets/images/db-logos/pinot.png b/client/app/assets/images/db-logos/pinot.png new file mode 100644 index 0000000000..7527e7b157 Binary files /dev/null and b/client/app/assets/images/db-logos/pinot.png differ diff --git a/client/app/assets/images/db-logos/qubole.png b/client/app/assets/images/db-logos/qubole.png deleted file mode 100644 index dfdc2fa2e2..0000000000 Binary files a/client/app/assets/images/db-logos/qubole.png and /dev/null differ diff --git a/client/app/assets/images/db-logos/risingwave.png b/client/app/assets/images/db-logos/risingwave.png new file mode 100644 index 0000000000..ae4a13f129 Binary files /dev/null and b/client/app/assets/images/db-logos/risingwave.png differ diff --git a/client/app/assets/images/db-logos/tinybird.png b/client/app/assets/images/db-logos/tinybird.png new file mode 100644 index 0000000000..129555e39f Binary files /dev/null and b/client/app/assets/images/db-logos/tinybird.png differ diff --git a/client/app/assets/images/db-logos/yandex_disk.png b/client/app/assets/images/db-logos/yandex_disk.png new file mode 100644 index 0000000000..7b375648df Binary files /dev/null and b/client/app/assets/images/db-logos/yandex_disk.png differ diff --git a/client/app/assets/images/destinations/asana.png b/client/app/assets/images/destinations/asana.png new file mode 100644 index 0000000000..42ea1ab9cc Binary files /dev/null and b/client/app/assets/images/destinations/asana.png differ diff --git a/client/app/assets/images/destinations/datadog.png b/client/app/assets/images/destinations/datadog.png new file mode 100644 index 0000000000..0c1cd4e583 Binary files /dev/null and b/client/app/assets/images/destinations/datadog.png differ diff --git a/client/app/assets/images/destinations/discord.png b/client/app/assets/images/destinations/discord.png new file mode 100644 index 0000000000..0781b84ce1 Binary files /dev/null and b/client/app/assets/images/destinations/discord.png differ diff --git a/client/app/assets/images/destinations/hipchat.png b/client/app/assets/images/destinations/hipchat.png deleted file mode 100644 index 88ac512102..0000000000 Binary files a/client/app/assets/images/destinations/hipchat.png and /dev/null differ diff --git a/client/app/assets/images/destinations/microsoft_teams_webhook.png b/client/app/assets/images/destinations/microsoft_teams_webhook.png new file mode 100644 index 0000000000..8ada5c8c69 Binary files /dev/null and b/client/app/assets/images/destinations/microsoft_teams_webhook.png differ diff --git a/client/app/assets/images/destinations/webex.png b/client/app/assets/images/destinations/webex.png new file mode 100644 index 0000000000..bea8fd1cad Binary files /dev/null and b/client/app/assets/images/destinations/webex.png differ diff --git a/client/app/assets/less/redash/query.less b/client/app/assets/less/redash/query.less index 3dd5daf090..57bccbc8c4 100644 --- a/client/app/assets/less/redash/query.less +++ b/client/app/assets/less/redash/query.less @@ -90,6 +90,23 @@ body.fixed-layout { .embed__vis { display: flex; flex-flow: column; + height: calc(~'100vh - 25px'); + + > .embed-heading { + flex: 0 0 auto; + } + + > .query__vis { + flex: 1 1 auto; + + .chart-visualization-container, .visualization-renderer-wrapper, .visualization-renderer { + height: 100% + } + } + + > .tile__bottom-control { + flex: 0 0 auto; + } width: 100%; } @@ -206,6 +223,7 @@ body.fixed-layout { } .editor__left__schema { + min-height: 120px; flex-grow: 1; display: flex; flex-direction: column; diff --git a/client/app/components/ApplicationArea/ApplicationLayout/VersionInfo.jsx b/client/app/components/ApplicationArea/ApplicationLayout/VersionInfo.jsx index e655e7f9fb..2ed1236e93 100644 --- a/client/app/components/ApplicationArea/ApplicationLayout/VersionInfo.jsx +++ b/client/app/components/ApplicationArea/ApplicationLayout/VersionInfo.jsx @@ -1,6 +1,5 @@ import React from "react"; -import Link from "@/components/Link"; -import { clientConfig, currentUser } from "@/services/auth"; +import { clientConfig } from "@/services/auth"; import frontendVersion from "@/version.json"; export default function VersionInfo() { @@ -10,15 +9,6 @@ export default function VersionInfo() { Version: {clientConfig.version} {frontendVersion !== clientConfig.version && ` (${frontendVersion.substring(0, 8)})`} - {clientConfig.newVersionAvailable && currentUser.hasPermission("super_admin") && ( -
- {/* eslint-disable react/jsx-no-target-blank */} - - Update Available