Skip to content

Commit

Permalink
Merge pull request #10 from dunzoit/feature/release-9.0.0
Browse files Browse the repository at this point in the history
Feature/release 9.0.0
  • Loading branch information
masterlittle authored Apr 12, 2023
2 parents a439ab6 + f2a98c7 commit c625099
Show file tree
Hide file tree
Showing 763 changed files with 56,750 additions and 42,572 deletions.
10 changes: 5 additions & 5 deletions .circleci/Dockerfile.cypress
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM cypress/browsers:chrome67
FROM cypress/browsers:node14.17.0-chrome91-ff89

ENV APP /usr/src/app
WORKDIR $APP

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

COPY client/cypress $APP/client/cypress
COPY cypress.json $APP/cypress.json
COPY . $APP

RUN ./node_modules/.bin/cypress verify
77 changes: 55 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ version: 2.0

build-docker-image-job: &build-docker-image-job
docker:
- image: circleci/node:12
- image: circleci/node:14.17
steps:
- setup_remote_docker
- setup_remote_docker:
version: 19.03.13
- 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: sudo npm install --global --force yarn@1.22.10
- run: yarn bundle
- run: .circleci/docker_build
jobs:
backend-lint:
Expand All @@ -27,13 +29,14 @@ jobs:
docker:
- image: circleci/buildpack-deps:xenial
steps:
- setup_remote_docker
- setup_remote_docker:
version: 19.03.13
- checkout
- run:
name: Build Docker Images
command: |
set -x
docker-compose build --build-arg skip_ds_deps=true --build-arg skip_frontend_build=true
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose build --build-arg skip_ds_deps=true --build-arg skip_frontend_build=true
docker-compose up -d
sleep 10
- run:
Expand All @@ -57,57 +60,87 @@ jobs:
- store_artifacts:
path: coverage.xml
frontend-lint:
environment:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
docker:
- image: circleci/node:12
- image: circleci/node:14.17
steps:
- checkout
- run: mkdir -p /tmp/test-results/eslint
- run: npm ci
- run: npm run lint:ci
- run: sudo npm install --global --force yarn@1.22.10
- run: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- run: yarn 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
- image: circleci/node:14.17
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: sudo npm install --global --force yarn@1.22.10
- run: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- run: yarn bundle
- 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: .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
- image: circleci/node:14.17
steps:
- setup_remote_docker
- setup_remote_docker:
version: 19.03.13
- checkout
- run:
name: Install npm dependencies
name: Enable Code Coverage report for master branch
command: |
npm ci
if [ "$CIRCLE_BRANCH" = "master" ]; then
echo 'export CODE_COVERAGE=true' >> $BASH_ENV
source $BASH_ENV
fi
- run: sudo npm install --global --force yarn@1.22.10
- run:
name: Install frontend dependencies
command: yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- 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
yarn cypress build
yarn cypress start -- --skip-db-seed
docker-compose run cypress yarn cypress db-seed
- run:
name: Execute Cypress tests
command: npm run cypress run-ci
command: yarn 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:
Expand Down
3 changes: 2 additions & 1 deletion .circleci/docker-compose.circle.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: '2.2'
services:
redash:
build: ../
Expand All @@ -13,6 +13,7 @@ services:
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
redis:
image: redis:3.0-alpine
restart: unless-stopped
Expand Down
35 changes: 23 additions & 12 deletions .circleci/docker-compose.cypress.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
version: '3'
version: "2.2"
x-redash-service: &redash-service
build:
context: ../
args:
skip_dev_deps: "true"
skip_ds_deps: "true"
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"
REDASH_RATELIMIT_ENABLED: "false"
REDASH_ENFORCE_CSRF: "true"
REDASH_COOKIE_SECRET: "2H9gNG9obnAQ9qnR9BDTQUph6CbXKCzF"
services:
server:
build: ../
<<: *redash-service
command: server
depends_on:
- postgres
- redis
ports:
- "5000:5000"
environment:
<<: *redash-environment
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
REDASH_RATELIMIT_ENABLED: "false"
scheduler:
build: ../
<<: *redash-service
command: scheduler
depends_on:
- server
environment:
REDASH_REDIS_URL: "redis://redis:6379/0"
<<: *redash-environment
worker:
build: ../
<<: *redash-service
command: worker
depends_on:
- server
environment:
<<: *redash-environment
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
cypress:
ipc: host
build:
context: ../
dockerfile: .circleci/Dockerfile.cypress
Expand All @@ -41,6 +51,7 @@ services:
- scheduler
environment:
CYPRESS_baseUrl: "http://server:5000"
CYPRESS_coverage: ${CODE_COVERAGE}
PERCY_TOKEN: ${PERCY_TOKEN}
PERCY_BRANCH: ${CIRCLE_BRANCH}
PERCY_COMMIT: ${CIRCLE_SHA1}
Expand Down
5 changes: 4 additions & 1 deletion .circleci/docker_build
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
VERSION=$(jq -r .version package.json)
VERSION_TAG=$VERSION.b$CIRCLE_BUILD_NUM

export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1

docker login -u $DOCKER_USER -p $DOCKER_PASS

if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-image ]
Expand All @@ -14,4 +17,4 @@ else
docker push redash/redash:$VERSION_TAG
fi

echo "Built: $VERSION_TAG"
echo "Built: $VERSION_TAG"
17 changes: 14 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
## What type of PR is this? (check all applicable)
<!-- Please leave only what's applicable -->
## What type of PR is this?
<!-- Check all that apply, delete what doesn't apply. -->

- [ ] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] New Query Runner (Data Source)
- [ ] New Query Runner (Data Source)
- [ ] New Alert Destination
- [ ] Other

## Description
<!-- In case of adding / modifying a query runner, please specify which version(s) you expect are compatible. -->

## How is this tested?

- [ ] Unit tests (pytest, jest)
- [ ] E2E Tests (Cypress)
- [ ] Manually
- [ ] N/A

<!-- If Manually, please describe. -->

## Related Tickets & Documents
<!-- If applicable, please include a link to your documentation PR against getredash/website -->

## Mobile & Desktop Screenshots/Recordings (if there are UI changes)
50 changes: 50 additions & 0 deletions .github/create_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build custom redash image

on:
push:
tags:
- '*'

jobs:
deploy:
permissions:
contents: 'read'
id-token: 'write'
environment:
name: Prod
url: "app.{{ vars.BASE_DOMAIN }}"
runs-on: ubuntu-latest
env:
IMAGE_NAME: asia-south1-python.pkg.dev/prod-data-platform/redash/redash

steps:
- uses: actions/checkout@v3
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
workload_identity_provider: 'projects/1027534050611/locations/global/workloadIdentityPools/github-pool/providers/github'
service_account: 'prod-data-eng-deployment@prod-data-platform.iam.gserviceaccount.com'
token_format: 'access_token'

- uses: olegtarasov/get-tag@v2.1
id: tag_name

- # Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
platforms: linux/amd64,linux/arm64

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: "${{ vars.IMAGE_NAME }}:${{ steps.tag_name.outputs.tag }}"
cache-from: type=gha
cache-to: type=gha,mode=max
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ venv/
.coveralls.yml
.idea
*.pyc
.nyc_output
coverage
.coverage
coverage.xml
client/dist
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v14.16.1
2 changes: 2 additions & 0 deletions .yarn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Empty file added .yarnrc
Empty file.
Loading

0 comments on commit c625099

Please sign in to comment.