* 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
* 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.
* 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
* 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
* 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
* 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
* 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.
* 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
* 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
* 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
* 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
* 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
* 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
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
* 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.