Commit Graph

43 Commits

Author SHA1 Message Date
Gabriel Dutra
f4dcb2918a
Move Cypress to dev dependencies (#3991)
* Test Cypress on package list

* Skip Puppeteer Chromium as well

* Put back missing npm install on netlify.toml

* Netlify: move env vars to build.environment

* Remove cypress:install script

* Update Cypress dockerfile

* Copy package-lock.json to Cypress dockerfile
2020-09-29 09:51:28 +03:00
Gabriel Dutra
c821cab4cb
Generate Code Coverage report for Cypress (#5137) 2020-09-28 21:43:04 -03:00
Gabriel Dutra
d12691dc2a
Databricks Schema Browser: Allow eventlet worker instead of RQ (#5045)
* Add loading button in UI

* Handle databricks schema requests without RQ

* Don't use gevent worker

* Revert "Don't use gevent worker"

This reverts commit 9704c70a941a68c249db73e0450961e608fc0507.

* Use eventlet

* Use first column instead of 'namespace' one

* Revert "Add loading button in UI"

This reverts commit c0e4dfb966714a9f9e23977ab659e64afb5ce255.

* Remove databricks tasks

* Update eventlet

* Add libevent

* Display logs on failure

* Revert "Add libevent"

This reverts commit a00d067cb77b6f4f9919cf47f1d15c34d107a18c.

* Test updating gunicorn

* Don't set eventlet as the default for Redash

Co-authored-by: Arik Fraimovich <arik@arikfr.com>

* Remove fetchDataFromJob usage

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2020-07-15 17:35:59 +03:00
Arik Fraimovich
8907a86e33
Make frontend build in Docker image optional (#4879)
* Add build arg to Dockerfile to control if we should build frontend assets

* Move more env settings into the shared one.

* Use build arg in docker-compose to skip frontend build.

* CirlceCI: Skip building frontend assets in backend tests

* Create dummy template files

* Expand file names manually.

* Add build arg to skip dev dependencies.

* Update Dockerfile

* Reverse logic of skip_dev_deps to what it should be.
2020-05-12 16:46:53 +03:00
Gabriel Dutra
fc246aafc4
Separate visualizations into their own package (#4837)
* Add visualizations project settings

* Move visualizations to redash-visualizations

* Delete shared components

* Remove antd from deps

* Remove p-r-5 from table utils

* Remove visualization deps from package.json

* Rename package and change its version

* Test preinstall script

* Update Dockerfile build for frontend

* Test adding dockerignore

* Update jest tests

* Add step for jest tests

* Include viz-lib on dev commands

* User prettier v1 for now

* Delete unused libs on the app

* Add readme draft (to be finished)

* Add getOptions to Editor

* Add required libraries and finish basic example

* Bump version
2020-05-06 10:49:15 +03:00
koooge
e3fff396cb
chore: Update node8 to 12 (#4845)
Signed-off-by: koooge <koooooge@gmail.com>
2020-04-30 12:19:06 +03:00
Arik Fraimovich
3f6699032f
Add apt update step in build docker image job. 2020-03-24 16:11:49 +02:00
Gabriel Dutra
33131c1354
Trigger CI lint failure on warnings and fix failing frontend unit tests (#4735)
* Trigger lint error on warnings on CI

* Test removing pip3 command from frontend unit

* Test eslint warning

* Revert "Test eslint warning"

This reverts commit 89d407345a3a9e9fa5f32555e50fe526de2b050b.

* Revert "Test removing pip3 command from frontend unit"

This reverts commit 424c9002003b54a62b317350aac6377af3a82ddc.

* Run apt update before installing pip3
2020-03-16 13:27:21 +02:00
Gabriel Dutra
f4b69d4495
Cypress: Separate start command and update to v4.1.0 (#4690) 2020-03-11 16:14:33 -03:00
Levko Kravets
7043951f00
Use npm ci instead of npm install in CI scripts (#4688) 2020-02-26 19:23:32 +02:00
Arik Fraimovich
88ae639ee4
CircleCI workflow improvements (#4296)
* CircleCI workflow improvements

- Don't automatically build the Docker image.
- Make the Python lint step requirement for the follow up steps. When it fails it usually means there is a code error which will prevent the next steps anyway.

* Fix YAML syntax error.

* Add separate build Docker image step for master branch
2019-10-27 22:27:34 +02:00
Nicolas Le Manchet
246eca1121 Migrate the application to Python 3 (#4251)
* Make core app compatible with Python 3

No backward compatibility with Python 2.7 is kept.
This commit mostly contains changes made with 2to3 and manual
tweaking when necessary.

* Use Python 3.7 as base docker image

Since it is not possible to change redash/base:debian to Python 3
without breaking future relases, its Dockerfile is temporarly
copied here.

* Upgrade some requirements to newest versions

Some of the older versions were not compatible with Python 3.

* Migrate tests to Python 3

* Build frontend on Python 3

* Make the HMAC sign function compatible with Python 3

In Python 3, HMAC only works with bytes so the strings and the
float used in the sign function need to be encoded.
Hopefully this is still backward compatible with already generated
signatures.

* Use assertCountEqual instead of assertItemsEqual

The latter is not available in Python 3.
See https://bugs.python.org/issue17866

* Remove redundant encoding header for Python 3 modules

* Remove redundant string encoding in CLI

* Rename list() functions in CLI

These functions shadow the builtin list function which is
problematic since 2to3 adds a fair amount of calls to the builtin
list when it finds dict.keys() and dict.values().

Only the Python function is renamed, from the perspective of the
CLI nothing changes.

* Replace usage of Exception.message in CLI

`message` is not available anymore, instead use the string
representation of the exception.

* Adapt test handlers to Python 3

* Fix test that relied on dict ordering

* Make sure test results are always uploaded (#4215)

* Support encoding memoryview to JSON

psycopg2 returns `buffer` objects in Python 2.7 and `memoryview`
in Python 3. See #3156

* Fix test relying on object address ordering

* Decode bytes returned from Redis

* Stop using e.message for most exceptions

Exception.message is not available in Python 3 anymore, except
for some exceptions defined by third-party libraries.

* Fix writing XLSX files in Python 3

The buffer for the file should be made of bytes and the actual
content written to it strings.

Note: I do not know why the diff is so large as it's only a two
lines change. Probably a white space or file encoding issue.

* Fix test by comparing strings to strings

* Fix another exception message unavailable in Python 3

* Fix export to CSV in Python 3

The UnicodeWriter is not used anymore. In Python 3, the interface
provided by the CSV module only deals with strings, in and out.
The encoding of the output is left to the user, in our case
it is given to Flask via `make_response`.

* (Python 3) Use Redis' decode_responses=True option (#4232)

* Fix test_outdated_queries_works_scheduled_queries_tracker (use utcnow)

* Make sure Redis connection uses decoded_responses option

* Remove unused imports.

* Use Redis' decode_responses option

* Remove cases of explicit Redis decoding

* Rename helper function and make sure it doesn't apply twice.

* Don't add decode_responses to Celery Redis connection URL

* Fix displaying error while connecting to SQLite

The exception message is always a string in Python 3, so no
need to try to decode things.

* Fix another missing exception message

* Handle JSON encoding for datasources returning bytes

SimpleJSON assumes the bytes it receives contain text data, so it
tries to UTF-8 encode them. It is sometimes not true, for instance
the SQLite datasource returns bytes for BLOB types, which typically
do not contain text but truly binary data.

This commit disables SimpleJSON auto encoding of bytes to str and
instead uses the same method as for memoryviews: generating a
hex representation of the data.

* Fix Python 3 compatibility with RQ

* Revert some changes 2to3 tends to do (#4261)

- Revert some changes 2to3 tends to do when it errs on the side of caution regarding dict view objects.

- Also fixed some naming issues with one character variables in list comprehensions.

- Fix Flask warning.

* Upgrade dependencies

* Remove useless `iter` added by 2to3

* Fix get_next_path tests (#4280)

* Removed setting SERVER_NAME in tests setup to avoid a warning.

* Change get_next_path to not return empty string in case of a domain only value.

* Fix redirect tests:

Since version 0.15 of Werkzeug it uses full path for fixing the location header instead of the root path.

* Remove explicit dependency for Werkzeug

* Switched pytz and certifi to unbinded versions.

* Switch to new library for getting country from IP

`python-geoip-geolite2` is not compatible with Python 3, instead
use `maxminddb-geolite2` which is very similar as it includes
the geolite2 database in the package .

* Python 3 RQ modifications (#4281)

* show current worker job (alongside with minor cosmetic column tweaks)

* avoid loading entire job data for queued jobs

* track general RQ queues (default, periodic and schemas)

* get all active RQ queues

* call get_celery_queues in another place

* merge dicts the Python 3 way

* extend the result_ttl of refresh_queries to 600 seconds to allow it to continue running periodically even after longer executions

* Remove legacy Python flake8 tests
2019-10-24 12:42:13 +03:00
Arik Fraimovich
a3e8477410
List enabled Query Runner types during build (#4166)
* Add CLI command to list enabled query runner types
2019-09-22 14:55:21 +03:00
Arik Fraimovich
e8d40bbdac
CHANGELOG for v8.0.0-beta.2 (#4145)
* Stop building tarballs.

* Update version reference.

* CHANGELOG for 8.0.0-beta.2
2019-09-18 11:23:32 +03:00
Jannis Leidel
07c9530984 Decouple extensions from Flask app. (#3569)
* Decouple extensions from Flask app.

This separates the extension registry from the Flask app and also introduces a separate registry for preriodic tasks.

Fix #3466.

* Address review feedback.

* Update redash/extensions.py

Co-Authored-By: jezdez <jannis@leidel.info>

* Minor comment in requirements.

* Refactoring after getting feedback.

* Uncoupled bin/bundle-extensions from Flas app instance.

* Load bundles in bundle script and don’t rely on Flask.

* Upgraded to importlib-metadata 0.9.

* Add missing requirement.

* Fix TypeError.

* Added requirements for bundle_extension script.

* Install bundles requirement file correctly.

* Decouple bundle loading code from Redash.

* Install bundle requirements from requirements.txt.

* Use circleci/node for build-docker-image step, too.
2019-05-26 14:56:02 +03:00
Ran Byron
768bfb3525
Cypress Dashboard Service (#3683) 2019-04-09 08:49:10 +03:00
Arik Fraimovich
fd42091f87 Add Lint step to CircleCI (#3642) 2019-03-26 16:40:26 +02:00
Gabriel Dutra
25910e7655
Move cypress to client folder (#3566) 2019-03-24 11:24:59 -03:00
Arik Fraimovich
15c815fb5e
Remove node_modules before creating tarball (#3603)
* Update pack

* Remove node_modules before packing
2019-03-18 12:16:31 +02:00
Arik Fraimovich
a93741e64b
CircleCI build improvements (#3511)
* Make sure master builds tarball/docker image only when backend and frontend tests pass.

* Build a redash/preview image alongside redash/redash image.

* Fix version variable
2019-02-28 15:23:47 +02:00
Gabriel Dutra
60cd8812a9 Update Percy token (#3492) 2019-02-25 21:22:46 +02:00
Gabriel Dutra
b9644b7456
React version of UserEdit (#3354)
* Update DynamicForm export

* Move UserShow to users folder

* Migrate User profile header and create DynamicForm for basic data

* Update UserShow to use UserProfile prop

* Add API Key input

* Add handler to regenerate API Key button

* Handle user profile save

* Add readOnly prop to DynamicForm and begin disabled user behavior

* Add Change Password Modal

* Remove action buttons for disabled users

* Add send password reset behavior

* Add minLength and password comparison to Password Modal

* Resend Invitation button

* Add Convert User Info

* Fix UserShow test

* Some code updates

* Add enable/disable user button

* Add UserPolicy as an idea

* Remove UserPolicy

* Create Edit Profile spec

* Move User profile screenshot to Edit Profile Spec

* Add tests for saving user and changing password errors

* CC is back :) - Fix trailing spaces

* Add test for succesful password update

* A few improvements from code review

* Remove Toggle User button when seeing your own profile

* Create InputWithCopy

* Fix possible errors when network is off and improve Email not sent alert

* Add default response object for $http possible errors

* Changes in UserEdit
- removed onClick from methods name
- regenerate API Key now uses InputWithCopy
- Password title added

* Update UserEdit render behavior and styling
- Password title changed to h5
- change rendering rules for actions
- Password modal is now closed when password is changed
- change DynamicForm readOnly to the fields and add hideSubmitButton

* Create ChangePasswordDialog and update UserEdit

* Fix possible console error

* Remove password match assertion from spec

* Fix typo
2019-02-14 14:08:30 -02:00
Arik Fraimovich
ff42ec2cc6
Cypress tests: preset the admin API key to a static value (#3358) 2019-01-28 17:54:24 +02:00
Omer Lachish
e23a07af03 Remove missing coverage from pytest terminal output (#3180)
* Remove missing coverage from pytest terminal output

* move coverage reporting to CI
2018-12-12 08:30:46 +02:00
Gabriel Dutra
cfe12c5a5d Add DB Seed to Cypress and setup Percy (#3155)
* Update Cypress element selectors

* Add seed data function to Cypress

* Change Cypress setup to be part of db-seed

* Add DatabaseSource selector to Create Data Source spec

* Add getElement command to Cypress

* Fix eslint issues

* Change Cypress getElement to getByTestId

* Add Percy and test it with the CI

* Change Percy dependency for CI to Cypress' Dockerfile

* Change Percy's execution to the docker container
- add --no-save to avoid errors on Dockerfile.cypress
 - pass PERCY_TOKEN from the CI to docker container

* Fix missed char on CircleCI config file

* Move Percy execution back to host on the CI

* Test adding PERCY_TOKEN to frontend-e2e-tests on CI config

* Undo add PERCY_TOKEN to config.yml

* Add Percy token and .git folder to Cypress

* Remove Percy install from config.yml

* Ignore .git folder again and use Percy env vars instead

* Update PERCY_PULL_REQUEST to be CIRCLE_PR_NUMBER

* Update cypress-server.js to handle other cypress commands
- cypress-server.js -> cypress.js
- new commands added to cypress.js
- CircleCI config updated accordingly
- added a Homepage screenshot

* Remove trailing spaces

* Add Create Query spec

* Disable Cypress videos

* Update run browser to Chrome

* Add missing --browser chrome
2018-12-10 22:29:36 +02:00
Omer Lachish
0973ee8abb Include correct version in production builds (#3163)
* take the first 8 characters for frontend version, not backend version

* run `npm run build` after version has been updated in CI

* `pack` should run last
2018-12-04 22:14:32 +02:00
koooge
c2bd8518a6 Makefile: Add make targets for test (#3032) 2018-11-12 09:06:25 +01:00
Gabriel Dutra
7d601cbbc9 Cypress based E2E tests (#3019) 2018-11-07 14:37:08 +01:00
Arik Fraimovich
27f489de20
Build docker image on master branch. (#3039) 2018-11-04 12:12:13 +02:00
Arik Fraimovich
467ec201da
Add Jest based tests to our stack (#2985)
* Add Jest packages
* Add first test
* Install eslint rules for jest & move deps to dev
* Configure cirlce to run jest
* package.json: Remove dev command
* package.json: clean command
* Don't autoload test files.
* Fix: webpack-dev-server was recompiling all the files on every change
* Update CircleCI step names
2018-10-19 19:04:02 +03:00
Marina Samuel
30283235a4 Fix tarball build failure. (#2963) 2018-10-15 20:05:07 +03:00
Marina Samuel
02e919c39b Closes #2565: Add frontend extension capability. (#2799) 2018-10-14 15:53:39 +03:00
Arik Fraimovich
be7f601d21
Speed up builds by skipping installing requirements_all_ds.txt in CI unit tests (#2928)
* Speed up builds by skipping requirements_all_ds.txt

* Update docker compose file version

* Start services before running commands

* Add boto and Athena dependencies to requirements_dev.txt
2018-10-11 14:12:28 +03:00
cclauss
da6d456f6f CircleCI: Flake8 tests passing on Legacy Python and Python 3 (#2881) 2018-10-05 13:48:01 +03:00
Arik Fraimovich
f2c323a089
Disable integration tests
The integration tests are currently not failing and providing false positives when running them. I'm disabling this until the test suite is more stable.

@jrbenny35 @jezdez
2018-09-28 11:52:14 +03:00
Arik Fraimovich
1997f53f40
Fix CircleCI setup for release branches. (#2859) 2018-09-27 10:36:48 +03:00
Arik Fraimovich
3e4adaba9a Update CircleCI config to use release branches 2018-09-24 11:52:38 +03:00
Benjamin Forehand Jr
5113f4ff33 Add npm install for integration test job. (#2795)
* Add npm install.

* Fix typo.
2018-09-07 09:16:58 +02:00
Benjamin Forehand Jr
151683f9f9 Add npm build step to integration tests. (#2794) 2018-09-06 19:55:08 +02:00
Arik Fraimovich
841642b9fc Fix: build Docker image only in tagged versions 2018-08-31 08:42:50 +03:00
Arik Fraimovich
04c97067ac Forgot to enable Docker 🤦 2018-08-30 21:35:31 +03:00
Arik Fraimovich
41113404c0 Remove deprecated argument from docker login command 2018-08-30 20:46:08 +03:00
Arik Fraimovich
a6d501a394
More improvements to CircleCI configuration (#2777)
* Moved configuration to `.circleci/config.yml` as the documentation for V2 suggests.
* Created a dedicated Docker Compose configuration (in `.circleci/docker-compose.yml`) to remove volumes configuration as this is not supported with CircleCI's Docker executer.
* Fix the Docker image build and tarball packing jobs to work and use correct version.
2018-08-30 20:19:52 +03:00