Compare commits

..

403 Commits

Author SHA1 Message Date
Eric Radman
2b4b1cf7e3 Snapshot: 23.12.0-dev (#6638)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-06 09:51:57 +00:00
dependabot[bot]
9b29f26217 Bump cryptography from 41.0.4 to 41.0.6 (#6630)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.4 to 41.0.6.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.4...41.0.6)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-29 00:39:58 +00:00
Eric Radman
392b930f2d Revert "Switch from numeral to numbro (#6344)" (#6595)
This reverts commit f8934b8312.

Using a format string of '0' does not round to the nearest integer in Numbro
https://github.com/BenjaminVanRyseghem/numbro/issues/745

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-11-25 14:36:08 +00:00
anushae6
9df6f80bb7 update readme to add e6data (#6620) 2023-11-24 05:11:37 -06:00
dependabot[bot]
f7b47c0436 Bump werkzeug from 2.3.6 to 2.3.8 (#6616)
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 2.3.6 to 2.3.8.
- [Release notes](https://github.com/pallets/werkzeug/releases)
- [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/werkzeug/compare/2.3.6...2.3.8)

---
updated-dependencies:
- dependency-name: werkzeug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-22 21:39:39 -05:00
anushae6
09addaadc3 add e6data query runner with test cases (#6604)
* add e6data query runner with test cases

* added more test cases
2023-11-22 20:59:21 -05:00
Vladislav Denisov
a07b8a6bd3 Yandex.Disk Query runner (#6598)
* Snapshot: 23.11.0-dev

* dataframe_to_result function moved outside python query runner

* added yandex disk query runner

* moved file_extension check

* skip unsupported extensions in schema

* removed unused variable

* added support for xlsx with multiple sheets

* moved pandas-converters to utils file

* added tests

* fixed backend tests

* fixed pandas to redash type conversion

* added more tests

* added tests for pandas

* added tests for pandas converter and yandex disk

* added tests for read_file and multiple sheets

* pandas: do not load if lib is not installed

* added test for yaml read

* fixed test for yaml read

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-11-21 21:16:29 -05:00
Genki Sugawara
8bfc57430d chore: Fix ci.yml typo: ghq -> gha (#6601) 2023-11-15 21:57:50 +09:00
Luka Lovosevic
a8c6dd0043 Update rockset.py - replace default API server URL (#6592)
Replaced default API server URL with new URL in USW2 region
2023-11-14 01:01:52 +09:00
Peter Lee
2d879510e4 add fork dashboard function (#6588)
* add fork dashboard function

* add test

* fix

---------

Co-authored-by: guyu <guyu@fordeal.com>
2023-11-11 20:56:47 +00:00
Luka Lovosevic
13e61fc3a0 Update rockset.py with support for multi-VI (#6584)
* Update rockset.py with support for multi-VI

Rockset introduced compute-compute separation which allows multiple Virtual Instances (VIs) to query data independently. This a commit introduces support for executing queries on specific VIs from Redash.

Changes include:
- added new configuration element (not required): Virtual Instance ID
- if this VI ID is configured, Redash will use that specific VI to execute the query
- if it's not specified, Redash will execute the query on the main/default VI (same behaviour as before)

* Update rockset.py

Removed comment from the query method to pass lint test

* Update rockset.py - for linting

Added more formatting to pass the black lint test

* Update rockset.py - linting update

* Update rockset.py - updated lint
2023-11-10 22:38:47 +09:00
Masayuki Takahashi
de1958e995 Bump snowflake-connector-python 3.4.0 for fixing 'Error detecting the version of libcrypto' (#6581)
* Bump snowflake-connector-python 3.4.0 for fixing 'Error detecting the
version of libcrypto'

* Update poetry.lock and remove .python-version
2023-11-07 20:09:52 -05:00
Masayuki Takahashi
198b422eaf Display catalog information on the schema pane when connecting to Trino (#6578) 2023-11-06 20:58:12 -05:00
Eric Radman
63cef6632e Snapshot: 23.11.0-dev (#6571) 2023-11-01 10:38:23 -04:00
myonlylonely
2611dcc0f1 Bump protobuf from 3.18.3 to 3.20.2 (#6568) 2023-10-31 15:52:41 +00:00
Dominik Sigmund
55193fbf66 Changed asc_url to entity_id (#6202)
Respect the User Setting instead of a hardcoded  value

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-31 11:23:00 +00:00
Eric Radman
8b8dd4f68c Revert "Render counter widgets using relative font size" (#6566) 2023-10-31 10:27:09 +10:00
Guido Petri
ae77e72821 fix falsey comparison to determine whether a dashboard is archived. closes #6560 (#6561) 2023-10-30 01:06:04 +10:00
Guido Petri
39e4ea155c Support multi column results with using mongo query runner (#6558)
* Support multi column results with using mongo query runner

* format

Signed-off-by: del-zhenwu <lizhenxiang@pjlab.org.cn>

* Update test_mongodb.py

update unit test case: nested dict for mongodb runner

* Update test_mongodb.py

* fix formatting

---------

Signed-off-by: del-zhenwu <lizhenxiang@pjlab.org.cn>
Co-authored-by: del-zhenwu <dele.zhenwu@gmail.com>
Co-authored-by: del-zhenwu <lizhenxiang@pjlab.org.cn>
2023-10-28 21:13:17 -04:00
dependabot[bot]
a5b01bf8ee Bump browserify-sign from 4.0.4 to 4.2.2 (#6557)
Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.0.4 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](https://github.com/crypto-browserify/browserify-sign/compare/v4.0.4...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-27 19:20:36 -04:00
Justin Clift
5516b427d8 Remove pygridgain so Trino data source shows up (#6546)
This also updates the python tzlocal dependency to the 4.x series,
as seems to be required for Trino to work.
2023-10-23 18:34:55 -04:00
deecay
de84c40868 Better Heatmap annotation color (#6543) 2023-10-23 03:25:27 +00:00
Kieran Molloy
39766a2d97 Reset redis pipeline at end of enqueue_query (#6540) 2023-10-20 22:12:55 -05:00
Eric Radman
593b6ae6ed Specify counter widgets font size in pt (#6537)
- prevent scrollbars from appearing
- start with a base font size of 12pt for more even scaling

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-19 02:35:58 +00:00
Adriano Pereira Junior
8bb1767c69 Add new conn options in MySQL (#6538) 2023-10-19 01:11:11 +00:00
Ken Michalak
7b03e60f9d add pagination and base_url to JSON query_runner (#6499) 2023-10-18 08:08:37 -05:00
dependabot[bot]
ac9f24a781 Bump urllib3 from 1.26.17 to 1.26.18 (#6534)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.17 to 1.26.18.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.17...1.26.18)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 20:15:04 -05:00
Justin Clift
54c4a4249a Revert arm64 docker image building in CI (for now) (#6532)
This PR reverts PRs #6525 and #6531, due to problems building
the arm64 images with GitHub Actions
2023-10-17 20:21:30 -04:00
dependabot[bot]
36dd3e9609 Bump @babel/traverse from 7.22.8 to 7.23.2 (#6530)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.8 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-17 14:35:35 +00:00
Genki Sugawara
69d1e03e60 Update yarn network-timeout: 30s(default) -> 600s (#6531) 2023-10-17 11:46:37 +00:00
dependabot[bot]
a2c0c488eb Bump @babel/traverse from 7.22.8 to 7.23.2 in /viz-lib (#6529)
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.8 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 03:45:29 +00:00
fukatani
ddbe0f6ce5 Display bigquery subfield of record as schema. (#6522)
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-16 23:04:41 -04:00
Vladislav Denisov
42108089ed Metrica: retry query if quota exceeded (#6459)
* metrica: added retries

* updated poetry.lock

* use poetry v1.6.1

* added simple test

* convert unittest to pytest

* add 429 test

* fix 429 status code response?

---------

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-16 21:53:21 -05:00
Genki Sugawara
d4ade51fba Add linux/arm64 to docker image platforms (#6525)
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-16 12:58:19 +00:00
Genki Sugawara
84d1693419 Update Debian image in Dockerfile (#6524) 2023-10-16 08:51:38 +00:00
Genki Sugawara
12f1050000 chore: Remove "Datree" badge from README (#6526) 2023-10-16 17:38:14 +10:00
Eric Radman
6b981972f0 Allow Query.options to be None (#6519)
* Allow Query.options to be None

Query.options may not have a value on a database created by 10.1.0

* Ensure counter widget is not compressed in query preview tabs

Also bump minimum counter font size to 14
2023-10-16 11:07:30 +10:00
Leandro Lomónaco
eafe30d52c Bigger textarea for query description (#6518) 2023-10-13 15:00:48 +10:00
Ben Best
abbd4d3146 Create sqlalchemy_searchable expressions (#6491)
The required sql expressions for sqlalchemy_searchable are only created
on the sqlalchemy pre_create hook. When upgrading from a previous redash
version no CREATE statements may be run, so these expressions are never
created.

Add a migration to manually execute the sql_expressions DDL from
sqlalchemy_searchable.
2023-10-12 17:43:20 +00:00
Eric Radman
1d350853bd Commit version update and tag together (#6513)
Also update to checkout v4
2023-10-09 14:37:16 -04:00
Eric Radman
3edf7790fc Snapshot: 23.10.0-dev (#6512) 2023-10-09 09:55:48 -04:00
Masayuki Takahashi
011f9ef311 Add column type to a query result of InfluxDB (#6505)
* Add column type to a query result of InfluxDB

* Remove an unused import

* Migrate to pytest

* Rename test names to descriptive

---------

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-10-08 14:39:51 +00:00
Guido Petri
138339a8a4 convert docker-compose to docker compose (#6504) 2023-10-08 12:06:48 +10:00
Guido Petri
0f175b7a5b build and push image only on master branch (#6507) 2023-10-08 10:55:15 +10:00
Guido Petri
0c2dc4e025 fix dockerhub image building (#6503) 2023-10-07 02:22:55 +00:00
Vladislav Denisov
a19b17b844 Fixed embedded queries (#6497)
* refactored users models

* added tests
2023-10-04 15:12:17 +10:00
dependabot[bot]
09ec299e65 Bump urllib3 from 1.26.16 to 1.26.17 (#6495)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.16 to 1.26.17.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/1.26.16...1.26.17)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 17:24:11 +10:00
dependabot[bot]
9461bf6479 Bump debug from 3.2.6 to 3.2.7 in /viz-lib (#6493)
Bumps [debug](https://github.com/debug-js/debug) from 3.2.6 to 3.2.7.
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](https://github.com/debug-js/debug/compare/3.2.6...3.2.7)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 03:08:58 +00:00
dependabot[bot]
1ae4e20d70 Bump debug from 3.2.6 to 3.2.7 (#6494)
Bumps [debug](https://github.com/debug-js/debug) from 3.2.6 to 3.2.7.
- [Release notes](https://github.com/debug-js/debug/releases)
- [Commits](https://github.com/debug-js/debug/compare/3.2.6...3.2.7)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-03 02:05:37 +00:00
Eric Radman
3d32c55531 Avoid updating query result for archived queries (#6488) 2023-09-29 13:46:02 +10:00
Genki Sugawara
4a36abc628 Add Datadog alert destination (#6476)
* Add Datadog alert destination

* Fix Datadog Event API response code: 200 -> 202

* Add datadog alert dest test

* Sort test_destinations.py imports

* Fix test_datadog_notify_calls_requests_post

* Fix datadog alert dest: Add aggregation_key
2023-09-27 20:22:00 -04:00
George Spake
3ebf163c29 Update gevent to 23.9.1 to address CVE (#6487)
update greenlet to 2.0.2 - 
Because redash depends on gevent (23.9.1) which depends on greenlet (>=2.0.0), greenlet is required.
So, because redash depends on greenlet (1.1.3), version solving failed.
2023-09-27 18:56:24 +00:00
dependabot[bot]
c3c54f6ca2 Bump cryptography from 41.0.3 to 41.0.4 (#6474)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.3 to 41.0.4.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.3...41.0.4)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-22 08:50:49 +10:00
Justin Clift
b13772c464 Update poetry.lock after PR 6469 (#6473)
Without this, poetry is complaining about a mismatch
2023-09-22 01:57:12 +10:00
Vladislav Denisov
74b0f8bb58 bump gpsread == 5.11.2 (#6469) 2023-09-20 19:42:40 -05:00
Justin Clift
953ed8431b Revert PR 6448 (SQLAlchemy-Utils update) for now (#6466) 2023-09-20 20:51:38 +10:00
Vladislav Denisov
0ca72d27e6 bump ldap3 = 2.9.1 (#6463) 2023-09-20 15:29:17 +10:00
Justin Clift
650ec90df3 Add kerberos development headers to Redash image (#6454)
Without these headers, compiling pymssql on arm64 fails:

  gcc -pthread -shared build/temp.linux-aarch64-cpython-38/src/pymssql/_mssql.o -L/usr/local/lib -lsybdb -lgssapi_krb5 -lkrb5 -lssl -lcrypto -o build/lib.linux-aarch64-cpython-38/pymssql/_mssql.cpython-38-aarch64-linux-gnu.so
  /usr/bin/ld: cannot find -lgssapi_krb5
  /usr/bin/ld: cannot find -lkrb5
  collect2: error: ld returned 1 exit status
2023-09-14 21:54:13 +10:00
Eric Radman
b84587931f Add ruff to Python dev dependencies (#6450) 2023-09-13 08:47:45 +10:00
Eric Radman
ff85a36f50 Avoid file locking issue when running CLI test (#6449)
__file__ will resolve to tests/test_cli.py, which is already opened by Python.
When tests are run on a network file system the test runner may deadlock while
waiting for an advisory lock to be released on this file.
2023-09-12 18:44:24 -04:00
Eric Radman
6d91c64dae Update SQLAlchemy-Utils to 0.36.5 (#6448)
This makes the Python unit tests compatible with Python 3.10
2023-09-12 13:32:58 +00:00
Eric Radman
ca36130e76 Update package.lock for updated python versions (#6446)
Output of `poetry update requires-python`
2023-09-12 02:53:00 +00:00
Guido Petri
0993f68fa0 Poetry conversion followup (#6440)
* change author and add maintainers

* remove bin/upgrade

* update project author/maintainers

* comment on how to get added/removed from the mailing list
2023-09-11 22:25:54 -04:00
Daniel Stevenson
f109af9f30 Check all Trino catalogs if no catalog configured (#5860)
* Check all Trino catalogs if no catalog configured

- If catalog is not set, query 'SHOW CATALOGS' to get catalogs
- For each catalog, discover schema, table, columns
- If catalog has a `.`, then quote the catalog name
- New table name returned includes catalog name
- If catalog is set, same result as before

* Use self._handle_run_query_error(error)

* Fix lint problem & format w/ black

* Fix condition so catalog_prefixes are [""] when catalog is set

* Fix for loop / Remove default values for catalog & schema

* Add untested tests for Trino's get_schema

* Black formatting

* Add test_get_schema_catalog_set test & fix tests

* Parameterize the side_effect fn thoroughly

* Get catalogs (not catalog_prefixes) bc confusing

* Trino._get_catalogs added for testability
2023-09-11 21:16:07 -04:00
Eric Radman
b4e4a5a928 Accept Python 3.8-3.10 (#6445)
For running a development environment on Ubuntu 22
2023-09-11 15:26:31 -04:00
Will Lachance
ca900769c2 Replace flake8/isort with ruff (#6441)
There's a few advantages of using ruff over these tools:

* It's way faster
* It's easier to configure
* It includes support for a bunch of other linters (for example bugbear)
  right out of the box, which catches some things and makes our code
  more consistent.

Ruff works great with black, which I'd recommend we continue using.

Fixed a few minor issues that the new linter combo picked up.
2023-09-11 06:41:08 -04:00
Guido Petri
c97afeb327 Convert project to poetry (#6423)
* poetry init

* add all dependencies

* update pyproject.toml

* add poetry.lock

* remove requirements txt fixer

* add ldap3 group and make all groups optional

* remove requirements files

* convert dockerfile to use poetry instead of pip

* fix ldap 3 dependency group typo

* update ldap3 inline error

* update cypress to install only main poetry group

* convert test_all_deps

* update redis/rq

* don't create virtualenv

* add -dev suffix and make version snapshot work

* fix typo in snapshot commit message

* remove importlib-resources
2023-09-08 23:57:26 +00:00
Leandro Lomónaco
b1f738fc96 Excel and CSV Query Runner fix (#6439) 2023-09-08 18:07:06 -04:00
Eric Radman
6f6d203ca9 Remove importlib-resources from requirements (#6431)
This is not required for Python >= 3.8 since the goal of this project is
to back port functionality.  Also the version specified is not
compatible with later versions of Python.

https://pypi.org/project/importlib-resources/
2023-09-07 13:28:30 -04:00
Tomoki Sekiyama
36482f6717 Move from oauth2client to google-auth / support ADC (#6422)
oauth2client was deprecated in 2017 and is no longer maintained.
This rewrites the service credentials code and replaces it with google-auth.

It also makes the JSON key file optional for the data source and use the
application's default credentials (ADC) if the JSON key file is omitted.
This enables support for a variety of GCP authentication methods, including
the gcloud CLI, GCE metadata servers, and GKE or AWS Workload Identity.

Note that the bigquery_gce functionality is covered by ADC, but is retained
for compatibility reasons.

Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-07 23:50:18 +10:00
Eric Radman
3fee9f6cef Update pymssql and rapidjson (#6428)
Updates to these libraries are required for local development setup on Ubuntu 22 (python 3.10)
2023-09-06 18:58:06 -04:00
Vlad Gramuzov
cb4af6dd57 Add Tinybird query runner (#5616)
"

Co-authored-by: Thomas Rausch <thomas@thrau.at>
2023-09-06 12:59:08 +00:00
Avey777
7f42bf1b65 Add feature: Hide filter components on shared pages (#6115)
* Hide-filter-components-on-shared-pages

* Restyled by prettier

* Fix typo

---------

Co-authored-by: Jengro Woo <Jengro777@outlook.com>
Co-authored-by: Restyled.io <commits@restyled.io>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-09-06 22:51:48 +10:00
Justin Clift
41495ba940 Update rq related dependencies, to hopefully alleviate issue 6424 (#6426) 2023-09-06 18:37:49 +10:00
Wataru Kurashima
9b18e1805c ci: use docker/build-push-action (#6425) 2023-09-06 17:52:38 +10:00
Anirudh Bagri
c2e7df098d Add webex as destination (#5574)
* Add webex as destination

* import from destinations explicitly

* make format

* remove unattributed image

* make webex bot token required

* don't use magic string

* add metadata kwarg

* simplify link creation

* simplify alert description

* simplify alert subject

* split attachments template into method

* DRY message posting

* use api endpoint method

* add missing param to post_message

* static method

* static method attachments template

* log exception if send fails

* simplify destination handling

* transparent image / right size webex logo

* remove unused organization param

* rename api endpoint and make it a property

* add test

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-05 00:26:21 +00:00
Omer Lachish
f1d5ac0d58 Convert unexpected parameter validation errors to InvalidParameterError (#4084)
* convert unexpected validation errors to InvalidParameterError

* get rid of local except blocks - any failure to validate is caught in _valid()

* avoid bare exception

* don't assign exception if we're not going to use it

* preferentially raise querydetachedfromdatasource error if it is present

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-04 21:08:41 +00:00
Justin Clift
710dd8c51b Generate docker hub preview image (#6420)
This needs the appropriate Docker Hub login credentials set in our GitHub settings before it will work properly.

  * DOCKER_USER environment variable
  * DOCKER_PASS secret
2023-09-04 04:30:24 +10:00
Justin Clift
2a2c90a014 Add pkg-config to the Docker image (#6419)
Without pkg-config the MySQL client install doesn't always work
2023-09-03 07:10:54 +00:00
Eric Radman
ab71bded7d Automatically tag release candidates (#6416)
Format similar to Ubuntu: YY.MM.N

Discussion:

  https://github.com/getredash/redash/discussions/6411

1. Updates version in:

  package.json
  redash/__init__.py

2. Sets version tag
2023-09-02 01:10:41 +00:00
kaiba
7b722a1067 Fix typo from ElasticSearch to Elasticsearch (#6349) 2023-09-01 22:11:47 +10:00
Justin Clift
c70d397c72 Fix Cypress not running in forked repos (#6413) 2023-09-01 21:31:56 +10:00
Tsuneo Yoshioka
abe70ab3ca Use multi_byte_search_enabled option for My Queries search and Favorite List search (#5761)
* Use multi_byte_search_enabled option for My Queries search and Favorite List search

* make format

* add search by user tests

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-31 21:43:18 -05:00
Omer Lachish
fcbe726eb2 Expire schemas after 7 days (#5112)
* expire schemas after 7 days

* expire schemas 7 days after the last refresh_schemas scheduled time

* format files

* add expire schema test

* patch schema away

* return nothing on schema get

* fix redis key name

* finally run tests locally and fix tests

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: konnectr <1konnectrl@gmail.com>
Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-09-01 01:20:45 +00:00
ufedor
528807f336 Add 'click' functionality for Chart visualization (#5662)
Co-authored-by: Jesse <jwhitehouse@airpost.net>
Co-authored-by: Justin Clift <justin@postgresql.org>
Reviewed-by: Eric Radman <eradman@starfishstorage.com>
2023-08-31 12:42:13 -04:00
yutopp
28db934698 Google Spreadsheet Data Source: support to find a worksheet by title (#5334)
* Support to find a worksheet by the title for google_spreadsheets

* Add tests for parse_query

* Fix types

* Add tests when finding a worksheet by a title is failed

* Proxy by a wrapper instead of using spreadsheet directly. Do not use gspread in tests

* Add tests. Fix format of quoted strings for titles

* Fix an error format

* Add a newline

* Fix formatting

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-31 16:28:12 +10:00
Eric Chang
182d84226b New alert destination: Asana (#5753)
* Add Asana alert destination

* change icon

* fix format

* add except in log

* fix flake8

* add metadata kwarg to notify

* update asana image

* make pat and project id required

* rename asana destination icon

* reuse Alert

* extract api base url to property method

* use required options

* add asana destination test

* make format

* define metadata

* fix test

* remove json.dumps from asana test

---------

Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-31 04:12:21 +00:00
Michael Parque
5b110b61f0 [client] Fix local dev QueryEditor crash when using a data source with "custom" syntax (#5271)
* [client] add friendly console log on '<' syntax error

Issue: when a javascript file is served with invalid contents, sometimes
it means that a fallback html file was returned from server instead.
This can be hard to determine because the stack trace is not helpful and
the `filename` information was previously lost from the global error
handler.

Added a specific error for this case to produce a friendlier error
message on the console.

* Add ace define override for custom mode

* Apply prettier changes

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-30 21:22:49 -04:00
David
d8b10a0f16 Update snowflake application name (#6403)
* SGA-9999 update header

* SGA-9999 update header
2023-08-30 20:34:06 -04:00
dependabot[bot]
972a49bb9d Bump restrictedpython from 6.1 to 6.2 (#6407)
Bumps [restrictedpython](https://github.com/zopefoundation/RestrictedPython) from 6.1 to 6.2.
- [Changelog](https://github.com/zopefoundation/RestrictedPython/blob/6.2/CHANGES.rst)
- [Commits](https://github.com/zopefoundation/RestrictedPython/compare/6.1...6.2)

---
updated-dependencies:
- dependency-name: restrictedpython
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-30 19:26:02 -04:00
Peter Dave Hello
45e791b675 Sync nodejs version in .nvmrc with Dockerfile & .github/workflows/ci.yml (#6401)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-29 01:05:10 +00:00
Justin Clift
b73d68f056 Use a fixed older version of databend, due to problem with 0.4.7 (#6402) 2023-08-29 00:18:03 +00:00
ehearty
0258dca82a Enable manipulating parameterized queries with Query Results query runner (#5723)
* feat: pass query parameters to query results queries

* prefixing parameterized queries with param_query_<query_id>

* added tests

* Fix formatting, and also fix accidental paste.

---------

Co-authored-by: Elena Hearty <ehearty@whyhotel.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-24 20:47:27 -04:00
Omer Lachish
2d6f5b091c Base duplicate index on column names (#4600)
* increase duplicate column names based on the original column name and not the number of duplicates detected

* add fetch columns test for base query runner

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-24 04:18:05 +00:00
Omer Lachish
1ef63fc3f4 Cleaner pytest results (#4711)
* silence deprecataion warnings

* add some sugar

* filter warnings to only display once

* remove pytest-sugar

---------

Co-authored-by: Omer Lachish <omer@rauchy.net>
Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
2023-08-23 23:38:25 -04:00
snickerjp
fdd1d29693 Add redash.query_runner.oracle to default_query_runners (#6389) 2023-08-24 13:21:58 +10:00
Ivan Torgashov
e18cd8f248 Passing Request metadata to Alert destinations (#5230) 2023-08-23 23:08:52 -04:00
iwakiriK
5eeeb5c62e Fix: Cannot refresh if a query name contain control characters. (#5602) 2023-08-23 20:12:22 +00:00
Vladislav Denisov
1af49e9ddb added requirements-txt-fixer to pre-commit (#6388) 2023-08-24 05:24:44 +10:00
snickerjp
7eae598546 Replace cx_Oracle with python-oracledb (#6386) 2023-08-23 10:41:48 +00:00
mari
0ad43de229 Fix #4402. Removed token from the required list. (#5354)
* Fix issue #4402. Removed token from the required list.

* Update redash/query_runner/salesforce.py

Co-authored-by: Jay Chung <zhongjiajie955@gmail.com>

* Update redash/query_runner/salesforce.py

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
Co-authored-by: Jay Chung <zhongjiajie955@gmail.com>
2023-08-23 14:24:48 +10:00
htamakos
63140260eb Add useQueryAnnotation option to BigQuery Runner (#5675)
* Add useQueryAnnotation option to BigQuery Runner

* Fix formatting

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-22 21:43:07 -04:00
Vladislav Denisov
caf8097c9d fixed module 'numpy' has no attribute 'bool' (#6371) 2023-08-22 20:58:27 -04:00
pong
4107265feb Sometimes self._profile_image_url is empty string (#5308) 2023-08-23 07:54:10 +10:00
Nobuaki Mochizuki
5d8364437a Fix an issue when using Impala's reserved keywords (#5198) 2023-08-23 07:42:58 +10:00
Justin Clift
fcf847eaaf Fix: query result datetime column type check (#5369) (#6385)
Co-authored-by: kazuki.morozumi <kazuki.m777@gmail.com>
Co-authored-by: kawamataryo <ba068082@gmail.com>
Co-authored-by: Masukawa Takeshi <takeshi.masukawa@lapras.com>
2023-08-22 21:18:19 +00:00
Stephen Darlington
9751678c44 Add Apache ignite Query Runner (#5767) 2023-08-23 03:47:10 +10:00
Peter Chen
f49075bada add ssl_config to redshift iam class (#5465)
Co-authored-by: peterxichen <peterxichen@aol.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-21 13:37:59 +10:00
Jesse
772680bbd2 New cypress test: sorting dashboard list does not crash page. (#5702)
* New cypress test: sorting dashboard list does not crash page.

* Restyled by prettier (#5703)

Co-authored-by: Restyled.io <commits@restyled.io>

---------

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2023-08-20 21:03:47 -05:00
snickerjp
0586b43b75 Add offset for query_runner/oracle.py Error Message. (#6373) 2023-08-20 05:16:35 +10:00
Eric Radman
0f88a23835 Allow the X and Y tick format to be customized using a D3 format string (#6370)
Numbers: https://d3-wiki.readthedocs.io/zh_CN/master/Formatting/
Date/Time: https://d3-wiki.readthedocs.io/zh_CN/master/Time-Formatting/
2023-08-16 12:09:33 -04:00
Evgeny
4a5c9c2630 Scheduled queries should include origin Username (#6368) 2023-08-16 13:20:19 +10:00
Eric Radman
f8934b8312 Switch from numeral to numbro (#6344)
numeraljs is no longer maintained, and incorrectly parses high-precision
floats (such as 1.2e-7) as NaN.
2023-08-15 07:59:18 -04:00
Harry C
d333660473 Fix python query runner crashing the GUI due to missing 'rows' and/or… (#5749)
* Fix python query runner crashing the GUI due to missing 'rows' and/or 'columns' in the JSON returned data.

* Fix typo of previous commit.

* Throw exception when python query runner has invalid result.

* Update test_python.py
---------

Co-authored-by: YuhengChen <yuheng.chen@imaygou.com>
2023-08-07 21:03:12 +05:00
Manik Somayaji
f4a930ddeb Fix: Query results in public dashboard not loading when query ends with semicolon (#6351)
* Fix: Query results in public dashboard not loading when query ends with semicolon

* fix flake8 error for commit 7a50b18d3

---------

Co-authored-by: Alexander Strickner <alexander.strickner@outlook.com>
2023-08-07 04:45:21 +10:00
Konstantin Smirnov
113146e4b8 Add data type info into schemas of Trino tables (#6348)
The current get_schema method of Trino query runner is missing table columns' data types information, so these data types won't be seen in Queries editing GUI. After the modification, these info are back.

Co-authored-by: V <4979571+vnnw@users.noreply.github.com>
2023-08-05 16:07:43 +05:00
Justin Clift
126fe9310f Have make create_database create .env if its missing (#6345) 2023-08-03 16:35:03 +00:00
Konstantin Smirnov
0d1ce4d98c Incomplete URL substring sanitization (#6342)
* Incomplete URL substring sanitization

* fix hostname

* Only match on the exact host name

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-02 21:31:18 +00:00
Justin Clift
acf77f85ff Fix the broken icon loading (#6340) 2023-08-02 15:56:51 +00:00
Justin Clift
71bf65b496 Have make compose_build create .env if its missing (#6339) 2023-08-02 20:42:58 +10:00
dependabot[bot]
204e5c1fb9 Bump cryptography from 41.0.2 to 41.0.3 (#6338)
Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.3.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/41.0.2...41.0.3)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 14:19:27 +10:00
Justin Clift
37fa1ec057 Update make env to not run multiple times (#6336) 2023-08-01 22:05:43 +10:00
snickerjp
f4ee891d68 Do not makedsn for query_runner/oracle.py (#6332)
* Do not makedsn. instead self.configuration["servicename"]
in host == "_donotmakedsn"

* add comment

* mod properties in `host`

* mod properties in `host`

* mod word. in host == "_donotmakedsn" to "_useservicename"

* mod properties in `host`

* fix format
2023-08-01 22:04:45 +10:00
Konstantin Smirnov
196bfece30 Fix warning test query (#6335)
* replace assertDictContainsSubset -> asserLessEqual

* refactor definition set
2023-08-01 18:57:22 +08:00
Peter Lee
1726aef0fc add pg types map (#6333)
* add pg types map

* Update pg.py
2023-08-01 10:49:34 +00:00
Konstantin Smirnov
afc6d878c2 replace hmset -> hset (#6331) 2023-08-01 08:57:09 +00:00
dependabot[bot]
9a7d2cdc02 Bump cryptography from 40.0.2 to 41.0.2 (#6188)
Bumps [cryptography](https://github.com/pyca/cryptography) from 40.0.2 to 41.0.2.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/40.0.2...41.0.2)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-08-01 01:37:26 +00:00
Justin Clift
2b8aa5cb32 Bump snowflake-connector-python to 3.1.0 (#6330) 2023-08-01 00:47:58 +00:00
Justin Clift
39477c73ad Webpack-dev-server seems to require the dev-middleware config (#6329) 2023-08-01 07:12:33 +10:00
Jay Chung
353ea868ff Unused qr should respect env setting (#5337)
* Monitor unused qr respect env setting

* style
2023-07-31 20:16:34 +05:00
Justin Clift
7dfacfc531 Update package.json so yarn watch works again (#6328)
For some unknown reason the `--colors` and `-d` options are no longer recognised by webpack (v4) in our configuration.

This is likely due to some other non-obvious problem in our configuration, as those options should exist (they're documented).

For now though, this gets things working again.
2023-07-31 13:47:05 +00:00
Justin Clift
ad39059558 Fix webpack error in viz-lib (#6324)
The config file format for webpack has changed slightly, so webpack was throwing this error:

  Invalid options object. Less Loader has been initialized using an
  options object that does not match the API schema.

This commit updates the config file format so webpack works again.
2023-07-31 21:12:37 +10:00
Jay Chung
a9a348cd64 Use set in fetch_columns for efficient (#5336)
Change list to set
2023-07-31 18:24:49 +10:00
Justin Clift
4155507695 Use exclude list with flake8 pre-commit check (#6322) 2023-07-31 02:33:00 +00:00
Konstantin Smirnov
f6ba9501da fix flake8 (#6321) 2023-07-30 17:58:15 +00:00
Justin Clift
ae29eb3dfb Bump react-test-renderer to 16.14.0 (#6316) 2023-07-29 12:27:29 +00:00
mattdjones
ea3d825a78 Commit the transaction for MS SQL inserts & Updates (#2538)
As discussed here https://discuss.redash.io/t/insert-or-update-query-does-not-apply-in-sql-server/1233
We have made the change to our local installation, it would be great if we can have this included.
@arikfr
2023-07-29 19:33:09 +10:00
Eric Radman
0d699328b8 Allow RSA key used for JWT to be specified as a file path (#6271)
- auth_jwt_auth_public_certs_url may file:// in addition to http/https
- Log an error if payload does not contain an email address
2023-07-29 19:20:18 +10:00
Bryan Yang
8f71e14887 Fixed python query runner and add unittest for python query runner (#4731)
* add test for python runner

* fixed CustomPrint

* remove print

* Reformatted to pass our backend lint tests

Reformatted using:

  $ make format

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-28 20:40:16 -05:00
Justin Clift
5561b5fc55 Fix the peer dep warning about leaflet in viz-lib (#6315) 2023-07-29 06:52:41 +10:00
Justin Clift
ea4ee7ce9b Remove request from the declared dependencies (#6313) 2023-07-28 05:54:35 +00:00
Justin Clift
b43cb1797e Bump Cypress to 11.2.0 (#6312) 2023-07-28 04:24:28 +00:00
Justin Clift
875973bfcd Bump Cypress to 10.11.0 (#6311) 2023-07-28 12:56:03 +10:00
Shunsuke Ohashi
1b064da901 return project id as str, not bytes (#6303) 2023-07-27 20:29:22 -05:00
Justin Clift
55690db1d8 Bump Cypress to 9.7.0 (#6309)
* Bump Cypress to 9.7.0

* Initial fixes for Cypress 9.7.0

* Restyled by prettier (#6310)

Co-authored-by: Restyled.io <commits@restyled.io>

---------

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2023-07-27 23:40:00 +00:00
Justin Clift
a5a9be352d Bump webpack-build-notifier to 2.3.0 (#6308) 2023-07-28 08:32:02 +10:00
Justin Clift
72db9757f8 Bump @percy/agent to 0.28.7 (#6307) 2023-07-27 20:49:35 +00:00
dependabot[bot]
ffbf0fbe45 Bump minimist from 1.2.0 to 1.2.8 (#6306)
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.0 to 1.2.8.
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.0...v1.2.8)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 19:52:29 +00:00
Justin Clift
d0f5215cd8 Bump eslint-loader to 4.0.2 (#6305) 2023-07-27 19:17:19 +00:00
Justin Clift
6d495bc83d Bump mini-css-extract-plugin to 1.6.2 (#6304) 2023-07-27 18:22:02 +00:00
Justin Clift
e012d25585 Add yarn.lock missing from PR #6300 (#6302) 2023-07-27 14:55:20 +00:00
Justin Clift
7a421cf6d0 Bump plotly.js to 1.58.5 in viz-lib (#6300) 2023-07-27 09:13:26 +10:00
dependabot[bot]
58b505536f Bump json5 from 1.0.1 to 1.0.2 in /viz-lib (#6299)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-26 22:01:44 +00:00
Justin Clift
a7c15b078a Bump babel-plugin-module-resolver to 5.0.0 in viz-lib (#6296) 2023-07-27 07:26:33 +10:00
Justin Clift
03d54d3313 Update Netlify to NodeJS 16.20.1 and Yarn 1.22.19 (#6298)
Also, Netlify doesn't seem to need yarn force installed any more
2023-07-26 20:48:45 +00:00
Justin Clift
fbe2f4d808 Update NodeJS in our CI to 16.20.x (#6297) 2023-07-26 19:35:41 +00:00
Justin Clift
5cd38b14b0 Bump file-loader to 6.2.0 (#6295) 2023-07-26 18:01:42 +00:00
Justin Clift
a8e1077bb7 Some manual dedupes of yarn.lock (#6294)
Yarn seems to miss a lot of deduplication opportunities, regardless of what the docs claim.

This can leave old, insecure versions of some dependencies in use when they shouldn't be.
2023-07-26 16:49:45 +00:00
Justin Clift
f572d88d8e Bump less to 3.13.1 in main repo, and to 4.1.3 in viz-lib (#6293)
Also bumps some of the less related dependencies in the main repo:

  * less-loader to 5.0.0
  * less-plugin-autoprefix to 2.0.0
2023-07-26 15:30:43 +00:00
Justin Clift
ba1b496f51 Bump webpack-cli to 4.10.0 (#6292) 2023-07-26 23:40:49 +10:00
Justin Clift
050b9e8716 Bump babel-loader to 8.3.0 (#6291) 2023-07-26 12:24:27 +00:00
Justin Clift
239f8abf70 Bump Cypress to 7.7.0 (#6289) 2023-07-26 20:33:58 +10:00
Eric Radman
2795e1b7a0 Render counter widgets using relative font size (#6191)
Using `transform` scales contents in in height and width, resulting in text wrapping even if there is horizontal space.
2023-07-26 14:07:16 +10:00
Justin Clift
4a847388fe Bump style-loader to 3.3.3 in viz-lib (#6286) 2023-07-25 13:15:44 +00:00
Justin Clift
2eed83bd7c Bump copy-webpack-plugin to 6.4.1 (#6285) 2023-07-25 12:32:02 +00:00
Justin Clift
34d380d427 Bump babel-plugin-istanbul to 6.1.1 (#6284) 2023-07-25 11:44:40 +00:00
Justin Clift
93a2901f6d Bump @cypress/code-coverage to 3.11.0 (#6283) 2023-07-25 10:22:32 +00:00
Justin Clift
2946713a15 Bump various @babel in /viz-lib to latest 7.x. Mostly 7.22.x (#6282) 2023-07-25 08:58:13 +00:00
Justin Clift
1b8f0ac2e9 Bump @babel/(various) to latest. Mostly 7.22.x (#6281) 2023-07-25 07:29:58 +00:00
dependabot[bot]
0701ee9b28 Bump color-string from 1.5.4 to 1.9.1 (#6280)
Bumps [color-string](https://github.com/Qix-/color-string) from 1.5.4 to 1.9.1.
- [Release notes](https://github.com/Qix-/color-string/releases)
- [Changelog](https://github.com/Qix-/color-string/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Qix-/color-string/compare/1.5.4...1.9.1)

---
updated-dependencies:
- dependency-name: color-string
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-25 06:05:34 +00:00
Justin Clift
ef7e38de49 Bump ts-migrate to 0.1.35 in viz-lib (#6279) 2023-07-25 14:49:59 +10:00
Justin Clift
ff1531bee4 Bump express to 4.18.2 (#6278) 2023-07-25 13:15:28 +10:00
dependabot[bot]
f172f15c7f Bump minimist from 1.2.5 to 1.2.8 in /viz-lib (#6276)
Bumps [minimist](https://github.com/minimistjs/minimist) from 1.2.5 to 1.2.8.
- [Changelog](https://github.com/minimistjs/minimist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/minimistjs/minimist/compare/v1.2.5...v1.2.8)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-25 01:44:48 +00:00
Justin Clift
ae10477e50 Bump request to 2.88.2 in viz-lib (#6275)
Had to hand edit the yarn.lock file (!), because I couldn't get the yarn command to do what I was trying to do.
2023-07-25 11:02:32 +10:00
Justin Clift
0a4d250268 Bump request to 2.88.2 (#6273) 2023-07-25 09:18:05 +10:00
Justin Clift
177f33a460 Bump plotly.js to 1.54.4 in viz-lib (#6272) 2023-07-24 21:48:56 +00:00
Justin Clift
6e4f96405d Bump React to exactly 16.14.0 (#6270)
This gets rid of a peer dependency warning from viz-lib.
2023-07-25 05:24:06 +10:00
Konstantin Smirnov
3446e7e569 update jest viz_lib (#6261) 2023-07-23 20:10:14 +05:00
Konstantin Smirnov
ef06dff433 bump jest to 24.9.0 (#6259) 2023-07-23 12:19:43 +00:00
dependabot[bot]
afa723c435 Bump js-yaml from 3.12.2 to 3.14.0 (#6260)
Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.2 to 3.14.0.
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nodeca/js-yaml/compare/3.12.2...3.14.0)

---
updated-dependencies:
- dependency-name: js-yaml
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 21:19:34 +10:00
dependabot[bot]
4fb78387aa Bump bl from 1.2.2 to 1.2.3 (#6257)
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Changelog](https://github.com/rvagg/bl/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

---
updated-dependencies:
- dependency-name: bl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 21:19:20 +10:00
Justin Clift
f8e9887feb Bump @pmmmwh/react-refresh-webpack-plugin to 0.5.10, react-refresh to 0.14.0 (#6258) 2023-07-23 20:39:59 +10:00
dependabot[bot]
f5c53efb3e Bump ws from 5.2.2 to 5.2.3 (#6252)
Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 20:06:51 +10:00
dependabot[bot]
37fd7f74dd Bump dompurify from 2.0.7 to 2.0.17 (#6256)
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.0.7 to 2.0.17.
- [Release notes](https://github.com/cure53/DOMPurify/releases)
- [Commits](https://github.com/cure53/DOMPurify/compare/2.0.7...2.0.17)

---
updated-dependencies:
- dependency-name: dompurify
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 19:26:12 +10:00
dependabot[bot]
3bddbcb025 Bump hosted-git-info from 2.7.1 to 2.8.9 (#6255)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.9)

---
updated-dependencies:
- dependency-name: hosted-git-info
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 19:24:05 +10:00
Justin Clift
f1477c825e Bump webpack-dev-server from 3.11.0 to 4.15.1 (#6254) 2023-07-23 19:14:53 +10:00
dependabot[bot]
416e6cb864 Bump ssri from 6.0.1 to 6.0.2 (#6247)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

---
updated-dependencies:
- dependency-name: ssri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:45:05 +10:00
dependabot[bot]
d4c69beef9 Bump path-parse from 1.0.6 to 1.0.7 (#6253)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:42:41 +10:00
Justin Clift
868453077a Bump css-loader from 0.28.7 to 1.0.1 (#6251) 2023-07-23 18:27:39 +10:00
dependabot[bot]
8973772548 Bump ansi-regex from 3.0.0 to 3.0.1 in /viz-lib (#6244)
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:25:47 +10:00
dependabot[bot]
e2c824e1d5 Bump ini from 1.3.5 to 1.3.8 (#6250)
Bumps [ini](https://github.com/npm/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/npm/ini/releases)
- [Changelog](https://github.com/npm/ini/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/ini/compare/v1.3.5...v1.3.8)

---
updated-dependencies:
- dependency-name: ini
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:23:10 +10:00
dependabot[bot]
ed0075d495 Bump acorn from 5.7.3 to 5.7.4 (#6248)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

---
updated-dependencies:
- dependency-name: acorn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:22:23 +10:00
dependabot[bot]
de1e6ba018 Bump y18n from 4.0.0 to 4.0.3 (#6249)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/compare/v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 18:19:47 +10:00
dependabot[bot]
2d6928469a Bump dns-packet from 1.3.1 to 1.3.4 (#6246)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 1.3.1 to 1.3.4.
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v1.3.1...v1.3.4)

---
updated-dependencies:
- dependency-name: dns-packet
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 17:18:27 +10:00
dependabot[bot]
3370a34b6e Bump ajv from 6.9.2 to 6.12.6 (#6245)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.9.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.9.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 07:00:39 +00:00
dependabot[bot]
5f2aad2009 Bump elliptic from 6.4.1 to 6.5.4 (#6243)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.4.1 to 6.5.4.
- [Commits](https://github.com/indutny/elliptic/compare/v6.4.1...v6.5.4)

---
updated-dependencies:
- dependency-name: elliptic
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 06:44:20 +00:00
dependabot[bot]
58fc8f4aee Bump minimatch from 3.0.4 to 3.1.2 (#6242)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 06:37:47 +00:00
dependabot[bot]
a32c0dfb58 Bump lodash from 4.17.19 to 4.17.21 in /viz-lib (#5496)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 05:50:26 +00:00
dependabot[bot]
34c20afdd8 Bump decode-uri-component from 0.2.0 to 0.2.2 (#6241)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 05:05:11 +00:00
Justin Clift
7871e80abf Bump webpack to 4.46.0, webpack-bundle-analyzer to 4.9.0 (#6240)
This should help unblock some Dependabot updates
2023-07-23 04:25:08 +00:00
dependabot[bot]
00eab75127 Bump mixin-deep from 1.3.1 to 1.3.2 (#6239)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

---
updated-dependencies:
- dependency-name: mixin-deep
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 03:35:41 +00:00
dependabot[bot]
f3a768edb8 Bump eventsource from 1.0.7 to 1.1.2 (#6238)
Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.0.7 to 1.1.2.
- [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md)
- [Commits](https://github.com/EventSource/eventsource/compare/v1.0.7...v1.1.2)

---
updated-dependencies:
- dependency-name: eventsource
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 12:50:37 +10:00
dependabot[bot]
518fb33c7e Bump handlebars from 4.1.0 to 4.7.7 (#6237)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.0 to 4.7.7.
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.0...v4.7.7)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 12:02:25 +10:00
dependabot[bot]
9829a0957a Bump loader-utils from 1.4.0 to 1.4.2 in /viz-lib (#6236)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 01:22:37 +00:00
dependabot[bot]
4113bb532c Bump url-parse from 1.4.7 to 1.5.10 (#6235)
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.10.
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-23 00:09:26 +00:00
Justin Clift
416126abd3 Bump webpack-cli to ^3.3.12 (#6234) 2023-07-22 23:25:51 +00:00
dependabot[bot]
02c8f71710 Bump loader-utils from 1.2.3 to 1.4.2 (#6233)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.2.3 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.2.3...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-22 22:42:32 +00:00
Justin Clift
7248be14bb Bump html-webpack-plugin to ^4.5.2 (#6232)
In theory (!), this should fix a dependabot warning.
2023-07-23 07:59:16 +10:00
Justin Clift
448bb99b7e Update webpack related deps in viz-lib (#6230) 2023-07-23 06:30:56 +10:00
Tadayuki Onishi
f2e31a602e [enhancement] Add a CLI command in order to create organization (#5869)
* Add a cli command in order to create organization

* Update redash/cli/organization.py

Co-authored-by: Jun <junnplus@gmail.com>


* add test

---------

Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: Jun <junnplus@gmail.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
2023-07-22 19:20:17 +05:00
Fernando Salcido
79ef3e4eb0 Handle error when data_source is None (#4936)
* add try except for data_source

* add try except for data_source

* fix errir handle

* add test for no data source

* changed error handle

* fix format

* fix test

---------

Co-authored-by: Konstantin Smirnov <46676677+konnectr@users.noreply.github.com>
Co-authored-by: konnectr <1konnectrl@gmail.com>
2023-07-22 19:17:49 +05:00
Konstantin Smirnov
b30622e531 delete password in the log (#6228) 2023-07-22 19:16:41 +10:00
Jannis Leidel
d2322c9904 Store start datetime in redash:status hash again. (#4894)
Fix #4893.

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-22 19:15:05 +10:00
Konstantin Smirnov
bac15db21f bump PyYaml to 6.0.1 (#6227) 2023-07-21 21:23:01 +00:00
Tejas Agrawal
b284dfe40d improvement: MongoDB - JSON syntax error sent back to Client (#6068) 2023-07-21 13:18:37 +00:00
Justin Clift
81da13b461 Add "make format" command (#6225) 2023-07-21 12:43:37 +00:00
Vitaly Vakhteev
7f4ade5f1f Feature/Add Discord Alert Destination (#6106)
* Add discord webhook

* Fix icon

* Boto3 dependency

* Add unit test for Discord webhook

* Add suggestions

* Apply suggestions from code review

Co-authored-by: Jun <junnplus@gmail.com>

* Misunderstood suggestion )

* Add suggestions

* Apply suggestions from code review

Co-authored-by: Jun <junnplus@gmail.com>

* Fix test

* Fix variables in strings

* Fix formatting using our pre-commit hook

---------

Co-authored-by: Jun <junnplus@gmail.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-21 12:14:42 +00:00
Peter Lee
8376e41684 Fix worker error in macOS (#6224)
* Update worker.py
* fix
---------

Co-authored-by: rajat goyal <gyl.rajat@gmail.com>
2023-07-21 21:10:19 +10:00
Naka Masato
c8eb445ce9 Remove hipchat (#5486)
* Remove hipchat
* Remove hipchat logo

---------

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-21 09:23:15 +00:00
Justin Clift
e4302d9163 Bump ua-parser to 0.18.0 (#6221) 2023-07-21 13:29:51 +05:00
Peter Lee
be306e9284 fix pubic dashboard not update result #6203 (#6214) 2023-07-21 12:32:59 +05:00
ImhotepW
91eee2b49e Refactor permissions (#5600)
* Updated admin permission definition location

* Updated admin permission definition location for create_org and init_db

* format

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Oleksandr <oleksandr_vasylenko4@epam.com>
Co-authored-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 07:18:28 +00:00
Konstantin Smirnov
bee833a6c1 update werkzeug==2.3.6 (#6219) 2023-07-21 15:35:41 +09:00
ChengDaqi2023
37f008cccb update ua-parser 0.8.0 to 0.15.0 (#6199) 2023-07-21 16:27:47 +10:00
Jun
77a2c24d47 fix test warning (#6217)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 14:52:46 +09:00
Jun
05c9b35e42 bump sentry to 1.28.1 (#6212)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 11:54:16 +09:00
Jun
f41eab7054 use CryptContext.hash instead of CryptContext.encrypt (#6211)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 11:51:00 +09:00
Jun
cd0bbc2621 Use 'urllib.parse.quote' instead 'werkzeug.urls.url_quote' (#6209)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 10:52:29 +09:00
Jun
20dbb461e9 Use assertEqual instead of assertEquals (#6210)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 10:52:18 +09:00
Jun
0dd8614d5d bump pysaml2 to 7.3.1 (#6208)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 10:52:09 +09:00
dependabot[bot]
281b552346 Bump urllib3 from 1.25.11 to 1.26.5 (#6136)
Dependabot couldn't find the original pull request head commit, b868bb5edd4a3fc036ed40754f099f37541a2814.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-21 09:33:07 +09:00
Jun
3e8222de17 upgrade boto3 and botocore (#6207)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-21 08:56:30 +09:00
Justin Clift
4869a652c0 Bump Cypress to 6.0.1 (#6205)
* Bump Cypress to 6.0.1

Unfortunately, due to a change in how Cypress treats elements with opacity 0, we need to disable two of the front end tests.

Hopefully someday, someone with better knowledge of JS and Cypress is able to fix these. :)
2023-07-21 02:08:15 +10:00
vvsd
0c223b6af7 update httplib2 0.14.0 to 0.19.0 (#5865)
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-21 01:06:19 +10:00
Justin Clift
ff6377b6e2 Bump SQLAlchemy-Searchable to 1.2.0 (#6173)
* Drop pyparsing, update SQLAlchemy-Searchable to 1.2.0

* fix make_searchable (#6180)

* fix test

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Spencer Weeks <Spince@users.noreply.github.com>
Co-authored-by: Ye Sijun <junnplus@gmail.com>
2023-07-20 23:27:58 +09:00
dependabot[bot]
f3ba10ff32 Bump sqlparse from 0.3.0 to 0.4.4 (#6049)
* Bump sqlparse from 0.3.0 to 0.4.4

Bumps [sqlparse](https://github.com/andialbrecht/sqlparse) from 0.3.0 to 0.4.4.
- [Changelog](https://github.com/andialbrecht/sqlparse/blob/master/CHANGELOG)
- [Commits](https://github.com/andialbrecht/sqlparse/compare/0.3.0...0.4.4)

---
updated-dependencies:
- dependency-name: sqlparse
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* use str instead of text_type

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ye Sijun <junnplus@gmail.com>
2023-07-20 10:39:26 +09:00
Justin Clift
9736bc76f7 Bump Cypress to 5.6.0 (#6198) 2023-07-19 10:18:19 +00:00
Justin Clift
87adad9afc Update our dev and CI docker to use NodeJS 16.20.1 (#6178) 2023-07-19 08:59:42 +00:00
Justin Clift
a63d7d9ad8 Add (dev focused) Discord link to the README (#6197) 2023-07-19 07:13:56 +00:00
dependabot[bot]
d3f118a74b Bump path-parse from 1.0.6 to 1.0.7 in /viz-lib (#5562)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 15:56:39 +10:00
dependabot[bot]
17a03628e4 Bump y18n from 4.0.0 to 4.0.3 in /viz-lib (#5554)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/compare/v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 15:56:21 +10:00
dependabot[bot]
255f2221c6 Bump hosted-git-info from 2.8.8 to 2.8.9 in /viz-lib (#5497)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 15:54:59 +10:00
Justin Clift
698498d896 Update README to point at wiki based dev guide (#6196) 2023-07-19 05:11:12 +00:00
dependabot[bot]
4092d418f6 Bump tmpl from 1.0.4 to 1.0.5 in /viz-lib (#5597)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 14:04:54 +09:00
Jun
af243be0b3 bump copy-webpack-plugin to 5.1.2 (#6195)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-19 14:03:48 +09:00
dependabot[bot]
897e3dbd3b Bump ws from 5.2.2 to 5.2.3 in /viz-lib (#5553)
Bumps [ws](https://github.com/websockets/ws) from 5.2.2 to 5.2.3.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/5.2.2...5.2.3)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-19 13:59:44 +09:00
dependabot[bot]
cbe3093a5d Bump word-wrap from 1.2.3 to 1.2.4 (#6194)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 14:59:31 +10:00
dependabot[bot]
f5fd10bb6c Bump word-wrap from 1.2.3 to 1.2.4 in /viz-lib (#6193)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 13:16:08 +09:00
Peter Lee
a6447b46be Add Bahrain to Map Visualization #5839 (#6192) 2023-07-19 03:47:16 +00:00
Justin Clift
7567a8a76a Update yarn.lock for axios 0.27.2 version bump (#6190)
Looks like I missed adding this file with one of the recent axios version bumps.
2023-07-18 08:17:34 +00:00
Jun
6237d54347 Bump cryptography to 40.0.2 (#6187)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-18 10:26:18 +09:00
Eric Radman
0bdd3bd826 Add support for a default alert template (#5996)
- Escape all variables by default since Mustache only has a syntax for raw values
- Generate a generic HTML result table to allow an alert template to display any query
- Optionally allow alert template to be defined to be set using REDASH_ALERTS_DEFAULT_MAIL_BODY_TEMPLATE
- Formatting updated by black
2023-07-18 06:51:42 +10:00
Eric Radman
1e33eee479 Ensure the email dev server is reachable on port 1080 and 1025 (#6186)
Also set Redash to use local maildev when docker-compose is used to
start a development server.

Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-18 06:05:42 +10:00
Justin Clift
f51b5ad1bb Switch to automatically upgraded PostgreSQL 15 (#6185)
The pgautoupgrade repo on Docker Hub now has stable version tags, so lets use the PostgreSQL 15.x series.
2023-07-17 18:25:29 +00:00
Peter Lee
1ab9036325 change default allow custom chart to true (#6184) 2023-07-17 16:05:40 +00:00
Oluwafemi Sule
c8516d38a7 Give query case sensitive treatment in query hash (#4254)
Generating the query hash from the query text with no lowercasing of the query text
allows case-sensitive parameter values in the dashboard to have different cache entries.

Fixes #2137
2023-07-17 12:40:00 +10:00
Vinod Pandey
095ac2ecf0 Added query runner for Google Analytics Data API (GA4) and Google Search Console API (#5868)
* quick and dirty GA4 integration to support limited queries

request pattern:
{
   "propertyId": 123456789,
   "dateRanges": [{ "startDate": "yesterday", "endDate": "yesterday" }],
   "dimensions": [{ "name": "date" }],
   "metrics": [{ "name": "activeUsers" }]
}

* Update Dockerfile

* Update requirements_bundles.txt

related issue: 
https://github.com/getredash/redash/pull/5851
https://stackoverflow.com/questions/73929564/entrypoints-object-has-no-attribute-get-digital-ocean

* updated integration code to support all usecases for runReport endpoint (does not have support for runPivotReport yet)

* added google search console as query runner

* removed info logger

* removed files that were causing merge conflicts

* fixed failing testcases and pre-commit formatting changes

* added testcases

* fixed linting errors in test files

* code optimization
2023-07-16 19:45:14 -05:00
shinsuke-nara
02d128e7ae Embed view becomes flex. (#4422)
Co-authored-by: Shinsuke Nara <shinsuke.nara@muraoka-design.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-16 15:15:03 +10:00
Will Lachance
d5b821e30a Fix persisting datasource selection choice (#6181)
* Fix persisting datasource selection choice

Closes getredash/redash#5646.

We were already storing this in localStorage, however we weren't
accounting for the fact that it was stored as a string, rather than
an integer.

* Restyled by prettier (#6182)

Co-authored-by: Restyled.io <commits@restyled.io>

---------

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2023-07-15 12:56:39 -05:00
Justin Clift
05526b557e Update /viz-lib axios to 0.27.2, and its axios-auth-refresh to 3.3.6 (#6177) 2023-07-13 15:36:25 +00:00
dependabot[bot]
60531a739d Bump axios from 0.21.1 to 0.27.2 (#5652)
* Bump axios from 0.21.1 to 0.21.2

Bumps [axios](https://github.com/axios/axios) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump axios to 0.27.2, and axios-auth-refresh to 3.3.6

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-13 01:50:06 +10:00
dependabot[bot]
1b3215f79f Bump async from 2.6.2 to 2.6.4 (#5779)
Bumps [async](https://github.com/caolan/async) from 2.6.2 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.2...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:21:44 +00:00
dependabot[bot]
39f4530562 Bump axios from 0.19.2 to 0.21.2 in /viz-lib (#5610)
Bumps [axios](https://github.com/axios/axios) from 0.19.2 to 0.21.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.19.2...v0.21.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 08:12:03 +09:00
dependabot[bot]
6dd6a4c28b Bump cached-path-relative from 1.0.2 to 1.1.0 (#5699)
Bumps [cached-path-relative](https://github.com/ashaffer/cached-path-relative) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/ashaffer/cached-path-relative/releases)
- [Commits](https://github.com/ashaffer/cached-path-relative/commits)

---
updated-dependencies:
- dependency-name: cached-path-relative
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 08:11:29 +09:00
dependabot[bot]
fc39e36771 Bump ajv from 6.12.0 to 6.12.6 in /viz-lib (#5778)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.12.0 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.12.0...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 08:09:40 +09:00
dependabot[bot]
3e3cca4023 Bump moment from 2.24.0 to 2.29.4 in /viz-lib (#5786)
Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 07:32:31 +09:00
dependabot[bot]
c707cccfbf Bump moment from 2.24.0 to 2.29.4 (#5787)
Bumps [moment](https://github.com/moment/moment) from 2.24.0 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.24.0...2.29.4)

---
updated-dependencies:
- dependency-name: moment
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-12 07:31:02 +09:00
Flavio Altinier Maximiano da Silva
32b3e56c97 Make the database reencrypt script safer (#5878)
* Reencrypt Database Safely

* Try with only one statement

* remove success logging

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-11 23:55:47 +09:00
dependabot[bot]
9d5754793f Bump terser from 4.8.0 to 4.8.1 (#5833)
Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/terser/terser/releases)
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v4.8.0...v4.8.1)

---
updated-dependencies:
- dependency-name: terser
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:03:46 +09:00
dependabot[bot]
d1e533264d Bump minimatch from 3.0.4 to 3.1.2 in /viz-lib (#5856)
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:03:25 +09:00
dependabot[bot]
591b607dd5 Bump decode-uri-component from 0.2.0 to 0.2.2 in /viz-lib (#5871)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:03:10 +09:00
dependabot[bot]
ad6b12c5ad Bump shell-quote from 1.7.2 to 1.8.1 in /viz-lib (#6175)
Bumps [shell-quote](https://github.com/ljharb/shell-quote) from 1.7.2 to 1.8.1.
- [Changelog](https://github.com/ljharb/shell-quote/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/shell-quote/compare/v1.7.2...v1.8.1)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 23:02:19 +09:00
Jun
a1a00c6819 upgrade flask limiter (#6174)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-11 21:34:13 +09:00
Jun
9b2f635692 format code by black and isort (#6167)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-11 19:13:54 +10:00
Justin Clift
7f40837d3f Add a make target to generate .env file for development (#6172) 2023-07-11 06:33:25 +00:00
dependabot[bot]
a944658265 Bump semver from 5.7.1 to 5.7.2 in /viz-lib (#6170)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 14:44:28 +09:00
dependabot[bot]
a7681a688e Bump semver from 5.6.0 to 5.7.2 (#6171)
Bumps [semver](https://github.com/npm/node-semver) from 5.6.0 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.6.0...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-11 14:44:17 +09:00
Jun
1b97d9ce04 add codecov action (#6168)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-11 15:33:07 +10:00
Justin Clift
b4801dd2b8 Update SQLAlchemy to highest 1.3.x release (#6169)
Moving to SQLAlchemy 1.4 / 2.0 seems like it'll be a substantial project:

  * https://docs.sqlalchemy.org/en/14/changelog/migration_14.html
  * https://docs.sqlalchemy.org/en/14/changelog/migration_20.html
2023-07-11 14:56:11 +10:00
dependabot[bot]
c922521dbd Bump restrictedpython from 5.0 to 6.1 (#6166)
Bumps [restrictedpython](https://github.com/zopefoundation/RestrictedPython) from 5.0 to 6.1.
- [Changelog](https://github.com/zopefoundation/RestrictedPython/blob/6.1/CHANGES.rst)
- [Commits](https://github.com/zopefoundation/RestrictedPython/compare/5.0...6.1)

---
updated-dependencies:
- dependency-name: restrictedpython
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-10 22:30:22 +00:00
Justin Clift
89e7669ec1 Update pysaml to last version of 6.5.x series for bettter error handling (#6165)
Co-authored-by: Timothy Der <timothy.der@gotinder.com>
2023-07-10 21:03:48 +00:00
Justin Clift
99be51ebc5 Move to Redis 7 for our development and CI docker compose (#6164) 2023-07-11 05:43:15 +10:00
Juan José Fuchs
29c21db813 fix #5811: passing server,port to MS ODBC driver (#5812)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 05:17:18 +10:00
Kirill Lyubchenko
e639a789e7 Updated vertica-python to 1.1.1 (#5807)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 05:16:32 +10:00
645775992
bc9460b04c update passlib 1.7.1 to 1.7.3 (#5855)
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 04:45:47 +10:00
dependabot[bot]
11c50567c3 Bump protobuf from 3.17.3 to 3.18.3 (#5829)
Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.17.3 to 3.18.3.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.17.3...v3.18.3)

---
updated-dependencies:
- dependency-name: protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-11 04:42:58 +10:00
Justin Clift
90cd27fa25 Use automatic upgrading PostgreSQL 15 docker image (#6162)
Also adds the POSTGRES_HOST_AUTH_METHOD environment variable to the CI docker compose files. Modern PostgreSQL docker images need it, at least as they're used by our CI.
2023-07-10 16:17:09 +00:00
Justin Clift
26010f793e Update watchdog to version 3.0.0, to workaround reported error (#6161)
https://github.com/getredash/redash/discussions/6131#discussioncomment-6399367
2023-07-10 19:42:14 +10:00
Jun
a45a95af68 Updated rq-scheduler to 0.10.0 (#6160)
Co-authored-by: Ardiea <mas48@mit.edu>
2023-07-10 19:11:28 +10:00
Jun
24fe1dd121 add pre-commit (#6156)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-10 17:21:03 +09:00
Jun
5af8764c10 upgrade dev deps (#6158)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-10 17:46:41 +10:00
Jun
5b3e47dc0f update ci badge (#6157)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-10 09:30:52 +08:00
wuqingfeng234
c775eedec1 change the version of greenlet and gevent to fit python10 (#5849)
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-09 12:12:37 +10:00
Jun
537d153986 CI: add test_all_deps on docker build (#6152)
* add test_all_deps on docker build

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* upgrade pip version

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-08 12:00:36 +09:00
Beniamin
afef3dc6d4 allow ssl connections for impala runner (#5850)
There is no possibility to use ssl connections for impala runner.
Based on response here: https://discuss.redash.io/t/ssl-for-impala-use-ssl-true-issues-being-added-to-connect/3741/3 adding a ssl parameter in connector config should solve this issue.
2023-07-08 12:47:30 +10:00
Jesse
cdd4849f96 Install python dependencies one-by-one. Don't exit on failures. (#5788)
Cat code taken from https://stackoverflow.com/a/54053100
2023-07-08 12:02:49 +10:00
Jun
6b13d0ad96 fixed importlib-resources==5.13.0 (#6155)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-08 07:52:49 +09:00
Jun
73f49cbf0c upgrade flask (#6138)
* upgrade flask

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* fix test

Signed-off-by: Ye Sijun <junnplus@gmail.com>

* override value_proc for click.prompt

Signed-off-by: Ye Sijun <junnplus@gmail.com>

---------

Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-07-08 06:05:27 +09:00
dependabot[bot]
d92fc98b13 Bump lodash from 4.17.20 to 4.17.21 (#5688)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

---
updated-dependencies:
- dependency-name: lodash
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Justin Clift <justin@postgresql.org>
2023-07-07 13:18:04 +00:00
Frank
350ddd0483 fix: catch exception tips (#5047) 2023-07-07 22:17:01 +10:00
dependabot[bot]
4d0ce10d97 Bump tmpl from 1.0.4 to 1.0.5 (#5653)
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 21:26:18 +10:00
dependabot[bot]
a34deb25d6 Bump tar from 4.4.8 to 4.4.19 (#5651)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.8 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.8...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 20:10:56 +10:00
dependabot[bot]
79b01406fc Bump shell-quote from 1.7.2 to 1.7.3 (#5780)
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 19:31:11 +10:00
dependabot[bot]
2881599aa3 Bump pyjwt from 1.7.1 to 2.4.0 (#5759)
Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 1.7.1 to 2.4.0.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jpadilla/pyjwt/compare/1.7.1...2.4.0)

---
updated-dependencies:
- dependency-name: pyjwt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jun <junnplus@gmail.com>
2023-07-07 07:10:31 +00:00
dependabot[bot]
0f3452f00f Bump qs from 6.5.2 to 6.5.3 in /viz-lib (#5873)
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-07 15:08:27 +09:00
drewmcmahon
e8621dba1a chore: inherit BaseSQLQueryRunner in Snowflake query runner (#6064) 2023-07-07 13:49:48 +10:00
Gabriel Dutra
d6432482bf Wait for query change to propagate on pivot spec (#6142) 2023-07-07 13:02:43 +10:00
Guido Petri
b9bdfe83cc update widget_spec.js test to pass on 380 or 381 vizheight (#6149) 2023-07-07 11:28:41 +10:00
Pavel Shuvalov
66da3bb7cd Add explicit permission checker to postgres schema fetcher (#5911) 2023-07-06 18:02:35 +10:00
Gabriel Dutra
a1e27ae1ed Upgrade viz-lib webpack to v5 (#6141) 2023-07-05 21:47:01 -03:00
Peter Lee
bbd0a21831 feat: add query result expired ttl (#6123)
* feat: add query result expired ttl

* update code
2023-07-03 19:49:53 +08:00
Ran Benita
ee601ec206 Fix FEATURE_POLICY to initialize from REDASH_FEATURE_POLICY envvar, not REDASH_REFERRER_POLICY (#5822)
Problem: setting the `REDASH_REFERRER_POLICY` environment variable also sets the feature policy in addition to the referrer policy. Conversely, there is no way to set the feature policy on its own.

It looks like a copy/paste error from the line above.

Solution: change the feature policy to be set by a `REDASH_FEATURE_POLICY` environment variable.
2023-07-01 14:53:47 +10:00
Justin Clift
241dcfacd9 Update to latest in yarn 1.22.x series (#6140) 2023-06-30 18:50:22 +00:00
Justin Clift
112b9ed1ba Use precompiled psycopg2-binary package instead of psycopg2 (#6137) 2023-06-30 22:24:16 +10:00
Mukesh
24b6ef7ae7 Pymongo version upgrade changes (#5970)
* Pymongo version upgrade changes
* Get count logic has been changed to get using count_documents method
2023-06-30 20:39:04 +10:00
dependabot[bot]
4c3fd833df Bump jinja2 from 2.10.3 to 2.11.3 (#5431)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.10.3 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.10.3...2.11.3)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-30 18:01:26 +10:00
Justin Clift
c2c7f44d5c Update Python dependencies to eliminate version conflicts (#6122)
* Remove DynamoDB as a data source for now, due to dependency incompatibilities
* Remove Firebolt as a data source for now, due to dependency incompatibilities
* Remove pymapd / pyomnisci / heavyai, due to dependency incompatibilities
* Remove pycrypto, upgrade cryptography
* Remove pyarrow (for now), which we no longer need
* Require an (older) version of black, to avoid test failures with more recent click library
* Upgrade gevent to 21.12.0
* Upgrade greenlet to 1.1.2
* Upgrade httpli2 to 0.18.1
* Upgrade requests to 2.31.0
* Upgrade snowflake-connector-python to 3.0.4
* Upgrade urllib3 to 1.25.11

Note, the warning message caused by the older versions of gevent and greenlet was:

    RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 40 from C header, got 144 from PyObject
2023-06-30 16:15:12 +10:00
Will Lachance
46f67fd44b Upgrade Python version to 3.8 (#6130)
* Upgrade Python version to 3.8 (with ci too)

3.7 is now end-of-life: this is a minimal change to get us on a supported version.
2023-06-29 04:26:28 +10:00
Peter Lee
675838619e Try fixing cypress in a more correct way (#6117) 2023-06-27 02:46:10 +10:00
Justin Clift
b33bd1b02e ci: Attempt to fix restyled.io test (#6116)
We're now getting an error with exit code 127, so this commit adds the suggested solution of telling Restyled the exact command needed to run:

    https://github.com/restyled-io/restyled.io/wiki/Common-Errors:-Prettier#prettier-with-tailwindcss-executable-file-not-found-in-path
2023-06-26 05:29:04 +10:00
Peter Lee
28e63e3d76 fix pivot table style error (#6112) 2023-06-25 22:10:49 +10:00
Peter Lee
4d11c94be0 dependencies: pystache==0.6.0 (#6091)
fix Python3.9 can't install pystache problem
2023-06-24 15:35:45 +10:00
Jun
f3892e00a5 ci: migrate to github workflow ci (#6008)
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-06-24 14:25:07 +10:00
Will Lachance
f45bd27e68 Update Simba ODBC driver (#6110) 2023-06-23 08:23:51 -07:00
dependabot[bot]
bc909a13a3 Bump redis from 3.5.0 to 4.4.4 (#6050)
Bumps [redis](https://github.com/redis/redis-py) from 3.5.0 to 4.4.4.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/redis/redis-py/compare/3.5.0...v4.4.4)

---
updated-dependencies:
- dependency-name: redis
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-26 11:35:40 +08:00
Will Lachance
962f13eed0 Update Debian version for Node image (#6038)
`14.17` used stretch, which was ancient and seems to no longer support
updates. Let's try updating to bullseye, which should be around for
a while.
2023-05-17 07:01:15 -07:00
Will Lachance
e8071dcb12 Pin boto3 dependencies in dev requirements as well (#6037)
* Pin boto3 dependencies in dev requirements as well

Testing to see if this fixes CI, where it appears a more recent (too
recent) version of boto3 is being installed.

* Add circle step to list installed packages

This takes almost no time, and helps debug dependency issues (a
longer-term fix might be to switch to pip-compile).
2023-05-17 07:00:42 -07:00
dependabot[bot]
3444f2b06c Bump pyyaml from 5.1.2 to 5.4 (#5442)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.1.2 to 5.4.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.1.2...5.4)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-30 08:33:18 -07:00
Arik Fraimovich
c46d66afec Bump pysaml2 to 6.5.0 (#6013) 2023-04-28 10:35:30 -07:00
須藤大輔 (SUDO Daisuke)
64c24b77f9 fix comparison operator (#5945) 2023-04-20 09:13:20 -07:00
myonlylonely
ad7d30f91d Bump mysqlclient from 1.3.14 to 2.1.1, memsql from 3.0.0 to 3.2.0, fixing MySQL multi statement support (#5957) 2023-04-05 06:59:36 -07:00
Shubham Jain
5b9fd40dc7 Add liveness check for workers (#5886)
* Add liveness check script for workers

closes #5885

* delete extra script

* Rename worker_healthcheck -> workers_healthcheck

---------

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2023-03-27 13:11:18 -07:00
Jeremy
0b86c76552 Fix/databend params (#5937)
* fix: databend params

* add databend logo

* fix log

* fix log

* Update redash/query_runner/databend.py

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

---------

Co-authored-by: Arik Fraimovich <arik@arikfr.com>
2023-03-27 13:08:53 -07:00
David Choi
35b2430ff9 Fix group not found message. (#5935) 2023-03-24 14:55:34 -07:00
Arik Fraimovich
65d0eb72f5 Update development workflow for Apple Silicon, Node version, default port, and maildev image (#5932)
* Update ngines definition to allow for newer versions of Node.

With Node version 19 I stumbled into some issues so for now bumped it to v16, until we get to updating the libraries we use.

* docker-compose.yml updates:

1. Switch to newer maildev docker image.
2. Update local port to 5001 as 5000 seems to be used by a system process now.

* Update pymssql and pyarrow. Also commented out ibm-db until we have a way to not install it only on ARM.
2023-03-24 14:36:58 -07:00
Jeremy
8487876e7f feat: New support databend for redash (#5902)
* feat: New support databend for redash

* fix
2023-03-21 08:21:56 -07:00
Genki Sugawara
c08ef9b502 Add "set -e" to docker_build (#5896) 2023-03-20 07:40:16 -07:00
Arik Fraimovich
28b0a2379d Remove extensions mechanism (#5895)
* Remove extensions mechanism.

* Missing change.
2023-03-20 07:39:21 -07:00
Zach Liu
0dfe726ec8 see https://discuss.redash.io/t/redash-datasource-connection-test-fails/9989 (#5898) 2023-03-20 07:38:45 -07:00
Arik Fraimovich
a1e3369ba3 Update references from Discourse to Discussions. (#5916) 2023-03-18 08:03:20 -07:00
Peter Lee
7ec443c800 fix word spell (#5859)
Co-authored-by: guyu <guyu@fordeal.com>
2023-02-17 06:36:25 -08:00
Izumu KUSUNOKI
d6dbc64cfe bug fix SAML_LOGIN_ENABLED setting logic (#5784) 2023-02-17 06:24:49 -08:00
tsbkw
82361e7054 fix: Support importlib_metadata v5.0.0 (#5840)
* fix: Support importlib_metadata v5.0.0

importlib_metadata removed compatibility shims for deprecated entry point interfaces.
see: https://github.com/python/importlib_metadata/blob/main/CHANGES.rst#v500

Filter result of entry_points function by group parameter.
see: https://importlib-metadata.readthedocs.io/en/latest/api.html#importlib_metadata.entry_points

* fix: Enable to run in older python version

In circleci frontend-unit-tests, old node image is used and python 3.5 is used.
Support both old version and latest version by checking ijmportlib_metadata version
2023-02-16 13:47:56 +11:00
Dmitriy
5cf13afafe Improve visibility of error message during schema retrieval (#5879)
* handle query execution error in one place. increase ability to debug issues with schema retrieval

* split message and details for error reporting

Co-authored-by: Dmitriy Apollonin <dmitriy.apollonin@aspireiq.com>
2023-01-05 14:12:16 +02:00
kevinchiang
328099137d Microsoft Teams Webhook alert destination (#5691)
* Microsoft Teams Webhook alert destination

* Text formatting and new image for Microsoft Teams Webhook

* Comment on how to build frontend

* Add title to clarify webhook URL

* Make the message into a configurable template.
2022-10-06 23:45:03 -07:00
Xiang Fu
a863c8c08c Adding Apache Pinot Query Runner (#5798)
* Adding Apache Pinot integration

* address comments
2022-10-06 23:40:00 -07:00
Ikko Ashimine
71458e5697 Fix typo in users.py (#5818)
seperated -> separated
2022-09-23 23:01:31 -07:00
trigremm
75cb59f4be Databricks ODBC Driver: follow redirects (#5814)
Use curl --location
2022-08-24 09:26:09 -05:00
luc-x41
2935844e88 README: add MariaDB to supported data sources (#5808) 2022-08-24 08:51:22 -05:00
Jesse
4186f8303e New ElasticSearch Query Runner (#5794)
- A runner supporting the newest versions of ES,
  aggregation, nested aggregations and nested fields.
- A runner for the SQL OpenDistro flavor
- A runner for the SQL X-Pack flavor

Co-authored-by: Nicolas Le Manchet <nicolas@lemanchet.fr>
Co-authored-by: wwl717195673 <717195673@qq.com>
2022-07-20 07:47:44 -05:00
Aniket Kulkarni
0712abb359 README: update list of supported data sources (#5790)
Co-authored-by: Jesse Whitehouse <jesse@whitehouse.dev>
2022-07-15 14:29:28 -05:00
Jesse
9abc4f5f1e Clickhouse: Multi-statements support (#5792)
ClickHouse query runner splits query into several and execute each query in turn. The result of the last execution is returned. Implementation uses ClickHouse sessions in the HTTP protocol. `session_id` is generated for the first query and then it is used with the subsequent queries (together with the `session_check` parameter).

If query runner gets a success response with empty body from ClickHouse (for example, in case of temporary table creation request) query runner returns empty response.

authored-by: Liubov Ulitina <ulitinalm@vl.ru>
2022-07-12 12:27:20 -05:00
Aniket Kulkarni
f0a390b11a New Query Runner: Netezza Performance Server (#5771)
Co-authored-by: Jesse <jwhitehouse@airpost.net>
2022-07-08 13:10:49 -05:00
Jacek Jabłoński
3624f8f2be Feature: allow configuration / increase of gunicorn timeout (#5783) 2022-07-06 16:00:56 -05:00
Jesse
65f7b6c5af Sort Python safe built-ins (#5781)
Co-authored-by: Jiajie Zhong <zhongjiajie955@hotmail.com>
Co-authored-by: Jiajie Zhong <zhongjiajie955@gmail.com>
2022-07-06 08:16:36 -05:00
Bryan Yang
412c82940a New Query Runner: Arango query runner (#5124)
Co-authored-by: Hugo Gresse <hugo.gresse@gmail.com>
2022-07-06 06:53:31 -05:00
Arik Fraimovich
e2bad61e5b Add unarchive button to dashboard (#4697)
Co-authored-by: Jesse Whitehouse <jesse@whitehouse.dev>
2022-07-03 13:13:59 -05:00
Adam Zwakenberg
173cbdb2d6 Added clear button for query-based parameter inputs (#5710) 2022-07-03 13:04:09 -05:00
Jiajie Zhong
fc37c1ecfc Remove unused params in query result GET handler (#5346) 2022-07-02 23:09:24 -05:00
Jiajie Zhong
c4bfd4f3e1 mysql: add more configuration options (#5280) 2022-07-02 23:00:56 -05:00
Leandro Lorenzini
bdd1244604 Fix: mongodb schema refresh failed when user had insufficient permissions (#5734)
Co-authored-by: ban-lee-seng <banleesengpaints.marketing@gmail.com>
2022-07-02 14:02:49 -05:00
Greg Stein
6806ebd244 Use correct names for Apache projects (#5776)
Apache's trademark policy says to use the full name for these products on their first mention, on a page.
2022-07-02 13:02:38 -05:00
Jesse
b2cc42e383 Disable auto limit for mssql query runner (#5777) 2022-07-02 11:13:00 -05:00
Ian
cabe33394b [Fix] Broken image included in emails (#5719) 2022-06-01 11:15:18 -05:00
Gabriel A. Devenyi
46ea3b1f0b Fix hard-coding of amd64 platform, make ARM build work. (#5687)
* Fix hard-coding of amd64 platform and make amd64 package installation conditional
* Cleanup Dockerfile for best practices
* Enable BuildKit for docker building
2022-04-28 11:20:13 -05:00
Jesse
e6ebef1e5a Update contributor guidelines and clarify PR review process (#5714) 2022-03-10 12:00:26 -06:00
adamzwakk
b713f6b240 Update Dockerfile CHOWN into COPY (#5660)
Its more efficient to chown while COPY for large stacks of files as per https://github.com/docker/for-linux/issues/388
2022-03-02 09:34:52 -06:00
Jesse
5de85543a5 List pages: move sidebar to the left (#5698)
This change took place in steps:

1. Change order of content and sidebar.

Sidebar appears first, then content.

2. Fix padding

* Before: content was jutted against the sidebar. The sidebar was double-
padded from the edge of the content area.

After: Content has 15px pad against the sidebar. Sidebar has the same pad
as the page title.

3. Don't pad the content on small screens.

Otherwise the content appears off-center and doesn't use all of the
available space.

4. Allow Create buttons to have varying width

This makes the Query, Dashboard, and Alert list pages share the same style
2022-02-09 10:04:54 -06:00
Bruno Agutoli
175a4da49b Fix: Dashboard List page crashes when sorting by name (#5645)
Closes #5119
2022-02-09 08:57:25 -06:00
Jesse
49fe29579a Move user profile image url into the users.details field (#5697)
Makes the details field a JSONB field per pg doc recommendations.

Update model.all() method to work properly now that profile_image_url
is not an independent field.

Closes #4469
2022-02-02 14:03:02 -06:00
Steven Hao
4164a42aab Multi-filters: show all results by default (#5676) 2022-02-02 07:13:40 -06:00
Jesse
6797f32ea6 Snowflake: add option to lowercase column names (#5657)
Ported from app.redash.io codebase.

* Add option to lowercase column names
* Black the file
2022-02-01 11:09:42 -06:00
JyothiGandi
ea07e7e19b Fix: Test Connection button disabled after save (#5666)
Closes #5455
2022-02-01 09:48:07 -06:00
anshulhiran
26ac8ab1cd Firebolt Query Runner: now uses firebold-sdk python package (#5689)
* Added firebolt-sdk in place of firebolt-sqlalchemy
* fixed connection issue
* fixed connection issue
* final commit
* Moved firebolt-sdk's imports to try block

Co-authored-by: rajeshSigmoid <rajeshk@sigmoidanalytics.com>
2022-02-01 08:42:39 -06:00
Jesse
12c4750684 Fix: don't accept password login requests if password auth is disabled (#5693) 2022-01-28 08:52:31 -06:00
Jesse
2b5d1c03c1 JSON query runner: optionally skip certificate verification (#5690)
Add verify option to json datasource runner to allow query developers the option of skipping certificate verification


Co-authored-by: Kevin Chiang <kchiang@tesla.com>
Co-authored-by: kevinchiang <kevinchiang@outlook.com>
2022-01-21 15:43:42 -06:00
Tin C
f77f1b5ca1 Fix: auto limit breaks for Oracle queries (#5181)
Moves auto limit primitives to the base SQL query runner
2022-01-20 12:03:04 -06:00
Vladislav Denisov
e28e4227bf Python query runner: add function that transforms pandas dataframe to result format (#5629) 2022-01-19 13:53:27 -06:00
be30c9
4fddff104a SAML auth: allow custom service provider settings from environment variable (#5621) 2022-01-19 12:36:49 -06:00
Steven Hao
8ef9a1d398 Fix: make plotly charts have unbounded hoverlabel name length (#5661) 2022-01-19 12:17:27 -06:00
Robin Zheng
965db26cab Fix"Unable to locate package msodbcsql17"on M1 (#5638)
If you run the docker-compose on a Mac with the new M1 chip, you will get the "Unable to locate package msodbcsql17" error. Because there are currently no msodbcsql17 packages for arm64 architecture. The solution was to change the base image in the Dockerfile to change the installation to the older AMD architecture. 

FROM --platform=linux/amd64 python:3.7-slim-buster
2021-12-16 00:50:13 -08:00
Katsuya Shimabukuro
64586500a7 Improve BigQuery schema fetching when environment contains 50+ datasets (#5667) 2021-12-14 22:05:52 -06:00
Jesse
df472eb1d4 Update CircleCI configs and move advocate to main requirements file (#5658)
Ported from the 10.0.x branch
2021-11-26 18:15:10 -06:00
Jesse
7487550ad7 Update changelog to incorporate security fixes and #5632 & #5606 (#5654)
* Update changelog to incorporate security fixes and #5632 & #5606

* Added reference to sqlite fix
2021-11-23 15:24:31 -08:00
Jesse
61bbb5aa7a Merge pull request from GHSA-fcpv-hgq6-87h7 2021-11-23 14:58:20 -08:00
Jesse
ce60d20c4e Merge pull request from GHSA-g8xr-f424-h2rv 2021-11-23 14:57:24 -08:00
Jesse
da696ff7f8 Merge pull request from GHSA-vhc7-w7r8-8m34
* WIP: break the flask_oauthlib behavior

* Refactor google-oauth to use cryptographic state.

* Clean up comments

* Fix: tests didn't pass because of the scope issues.

Moved outside the create_blueprint method because this does not depend
on the Authlib object.

* Apply Arik's fixes. Tests pass.
2021-11-23 14:22:02 -08:00
Katsuya Shimabukuro
ed654a7b78 Speed up BigQuery schema fetching (#5632)
New method improves schema fetching by as much as 98% on larger schemas
2021-11-18 09:00:48 -06:00
rajeshmauryasde
3d032b69e5 Update Readme to reflect Firebolt data source (#5649) 2021-11-17 08:58:57 -06:00
Dan Goldin
86514207a3 Fix TypeScript warning: integet -> integer typo (#5637) 2021-11-15 15:43:51 -06:00
Dan Goldin
2e67227f1b Typo(#5636) 2021-10-28 14:55:48 -05:00
Jesse
86b2c4d06e Bump master to 11.0.0-dev (#5631) 2021-10-21 15:27:55 -05:00
Jesse
3c248acf21 Fix: pagination is broken on the dashboard list page (#5612)
* Fix: pagination is broken on the dashboard list page (#5516)
* Add test that reproduces issue #5466
* Fix: Duplicate dashboard rows were returned by Dashboard.all() (#5466)
* Update changelog for V10
* Update changelog for #5516
2021-10-21 11:25:30 -05:00
Aratrik Pal
39ca71c356 Fixes issue #5622 (#5623) 2021-10-18 20:26:10 +03:00
rajeshSigmoid
143d22db04 Add support for Firebolt Database (#5606) 2021-10-14 12:57:12 -05:00
zoomdot
7cac149cef Fix: Specify the protobuf version (#5608)
protobuf package with a dependency of google-api-python-client released a new version (3.18.0) on September 16, 2021. Since then, the Docker build is failing, and it is presumed that there is a conflict with other DataSource packages that use protobuf. (phoenixdb, pydgraph)
2021-10-01 16:22:44 -05:00
Tucker Leavitt
a0a28b09b4 Guard against empty totalProcessedBytes in BigQuery responses (#5592)
* Guard against empty totalProcessedBytes in BigQuery responses

This field will be empty on query responses for tables with
row level access controls enabled.

* Fix whitespace

* Update redash/query_runner/big_query.py

Co-authored-by: Jesse <jwhitehouse@airpost.net>
2021-09-24 22:12:04 +03:00
Jesse
e9bcc3c924 Fix: Edit Source button disappeared for users without CanEdit perms (#5568) 2021-08-30 10:43:00 +03:00
Levko Kravets
380345bb08 Pin python3 image version (#5570) 2021-08-18 11:04:46 -07:00
Kyunghwan Ko
0f41f25720 Fix: log message for bad auth token was malformed (#5557) 2021-08-10 11:31:26 -05:00
Levko Kravets
7445080d1a Use Yarn instead of NPM (#5541) 2021-08-02 13:16:33 +03:00
deecay
b9cb8191f5 Excel & CSV query runner (#2478)
* Excel query runner

* Param handling for read_excel

* CSV query runner

* Fix wrong module name

* Use yaml as query language

* Use yaml as query language for CSV

* Added icon and required modules

* Local address filtering

* Fix syntax error
2021-07-27 13:27:09 -07:00
Omer Lachish
ff7c5e8367 remove redundant fields from slack alert destination (#5514) 2021-06-15 17:41:36 +03:00
397 changed files with 41460 additions and 49163 deletions

12
.ci/Dockerfile.cypress Normal file
View File

@@ -0,0 +1,12 @@
FROM cypress/browsers:node16.18.0-chrome90-ff88
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.19 -g && yarn --frozen-lockfile --network-concurrency 1 > /dev/null
COPY . $APP
RUN ./node_modules/.bin/cypress verify

View File

@@ -12,12 +12,15 @@ services:
PYTHONUNBUFFERED: 0
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_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:15-alpine3.8
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"

View File

@@ -3,13 +3,13 @@ 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 +44,7 @@ services:
ipc: host
build:
context: ../
dockerfile: .circleci/Dockerfile.cypress
dockerfile: .ci/Dockerfile.cypress
depends_on:
- server
- worker
@@ -64,9 +64,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:15-alpine3.8
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"

39
.ci/docker_build Executable file
View File

@@ -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}"

6
.ci/update_version Executable file
View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

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

View File

@@ -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)

View File

@@ -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)

23
.github/support.yml vendored
View File

@@ -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

238
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,238 @@
name: Tests
on:
push:
branches:
- master
pull_request:
env:
NODE_VERSION: 16.20.1
jobs:
backend-lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-python@v4
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/docker-compose.ci.yml
COMPOSE_PROJECT_NAME: redash
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- 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:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@1.22.19
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:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@1.22.19
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/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
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
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@1.22.19
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
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"
elif [[ "${{ github.ref_name }}" != 'master' ]]; then
echo 'Ref name is not `master`. 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:
- backend-unit-tests
- frontend-unit-tests
- frontend-e2e-tests
- build-skip-check
if: needs.build-skip-check.outputs.skip == 'false'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install Dependencies
run: |
npm install --global --force yarn@1.22.19
yarn cache clean && yarn --frozen-lockfile --network-concurrency 1
- name: Set up QEMU
timeout-minutes: 1
uses: docker/setup-qemu-action@v2.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ vars.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Bump version
id: version
run: |
set -x
.ci/update_version
VERSION=$(jq -r .version package.json)
VERSION_TAG="${VERSION}.b${GITHUB_RUN_ID}.${GITHUB_RUN_NUMBER}"
echo "VERSION_TAG=$VERSION_TAG" >> "$GITHUB_OUTPUT"
- 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
cache-to: type=gha,mode=max
platforms: linux/amd64
env:
DOCKER_CONTENT_TRUST: true
- name: "Failure: output container logs to console"
if: failure()
run: docker compose logs

26
.github/workflows/periodic-snapshot.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Periodic Snapshot
# 10 minutes after midnight on the first of every month
on:
schedule:
- cron: "10 0 1 * *"
permissions:
contents: write
jobs:
bump-version-and-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
date="$(date +%y.%m).0-dev"
gawk -i inplace -F: -v q=\" -v tag=$date '/^ "version": / { print $1 FS, q tag q ","; next} { print }' package.json
gawk -i inplace -F= -v q=\" -v tag=$date '/^__version__ =/ { print $1 FS, q tag q; next} { print }' redash/__init__.py
gawk -i inplace -F= -v q=\" -v tag=$date '/^version =/ { print $1 FS, q tag q; next} { print }' pyproject.toml
git config user.name github-actions
git config user.email github-actions@github.com
git add package.json redash/__init__.py pyproject.toml
git commit -m "Snapshot: ${date}"
git tag $date
git push --atomic origin master refs/tags/$date

1
.nvmrc Normal file
View File

@@ -0,0 +1 @@
v16.20.1

10
.pre-commit-config.yaml Normal file
View File

@@ -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

View File

@@ -57,6 +57,9 @@ restylers:
- migrations/versions
- name: prettier
image: restyled/restyler-prettier:v1.19.1-2
command:
- prettier
- --write
include:
- client/app/**/*.js
- client/app/**/*.jsx

2
.yarn/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -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 repositorys 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 youve 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.

View File

@@ -1,4 +1,6 @@
FROM node:12 as frontend-builder
FROM node:16.20.1-bookworm as frontend-builder
RUN npm install --global --force yarn@1.22.19
# Controls whether to build the frontend assets
ARG skip_frontend_build
@@ -10,93 +12,90 @@ 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
# 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
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/
RUN if [ "x$skip_frontend_build" = "x" ] ; then npm run build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi
RUN if [ "x$skip_frontend_build" = "x" ] ; then yarn build; else mkdir -p /frontend/client/dist && touch /frontend/client/dist/multi_org.html && touch /frontend/client/dist/index.html; fi
FROM python:3.7-slim-buster
FROM python:3.8-slim-bookworm
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
RUN apt-get update && \
apt-get install -y \
curl \
gnupg \
build-essential \
pwgen \
libffi-dev \
sudo \
git-core \
wget \
# Postgres client
libpq-dev \
# ODBC support:
g++ unixodbc-dev \
# for SAML
xmlsec1 \
# Additional packages required for data sources:
libssl-dev \
default-libmysqlclient-dev \
freetds-dev \
libsasl2-dev \
unzip \
libsasl2-modules-gssapi-mit && \
# MSSQL ODBC Driver:
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list && \
apt-get update && \
ACCEPT_EULA=Y apt-get install -y msodbcsql17 && \
apt-get install -y --no-install-recommends \
pkg-config \
curl \
gnupg \
build-essential \
pwgen \
libffi-dev \
sudo \
git-core \
# Kerberos, needed for MS SQL Python driver to compile on arm64
libkrb5-dev \
# Postgres client
libpq-dev \
# ODBC support:
g++ unixodbc-dev \
# for SAML
xmlsec1 \
# Additional packages required for data sources:
libssl-dev \
default-libmysqlclient-dev \
freetds-dev \
libsasl2-dev \
unzip \
libsasl2-modules-gssapi-mit && \
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 msodbcsql17 \
&& 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
ENV POETRY_VERSION=1.6.1
ENV POETRY_HOME=/etc/poetry
ENV POETRY_VIRTUALENVS_CREATE=false
RUN curl -sSL https://install.python-poetry.org | python3 -
# rollback pip version to avoid legacy resolver problem
RUN pip install pip==20.2.4;
COPY pyproject.toml poetry.lock ./
# 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
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 requirements_bundles.txt requirements_dev.txt ./
RUN if [ "x$skip_dev_deps" = "x" ] ; then pip install -r requirements_dev.txt ; fi
COPY requirements.txt ./
RUN pip install -r requirements.txt
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"]

3
LICENSE.borders Normal file
View File

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

View File

@@ -1,57 +1,62 @@
.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 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
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up -d --build
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 rm
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

View File

@@ -3,8 +3,7 @@
</p>
[![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,37 +31,52 @@ 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
- Exasol
- Microsoft Excel
- Firebolt
- Databend
- Google Analytics
- Google BigQuery
- Google Spreadsheets
- Graphite
- Greenplum
- Hive
- Impala
- Apache Hive
- Apache Impala
- InfluxDB
- JIRA
- 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
@@ -73,9 +87,13 @@ Redash supports more than 35 SQL and NoSQL [data sources](https://redash.io/help
- ScyllaDB
- Shell Scripts
- Snowflake
- SPARQL
- SQLite
- TiDB
- Tinybird
- TreasureData
- Trino
- Uptycs
- Vertica
- Yandex AppMetrrica
- Yandex Metrica
@@ -83,12 +101,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

View File

@@ -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))

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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']
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)]
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]

View File

@@ -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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -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;

View File

@@ -17,6 +17,13 @@ export default function ApplicationArea() {
useEffect(() => {
function globalErrorHandler(event) {
event.preventDefault();
if (event.message === "Uncaught SyntaxError: Unexpected token '<'") {
// if we see a javascript error on unexpected token where the unexpected token is '<', this usually means that a fallback html file (like index.html)
// was served as content of script rather than the expected script, give a friendlier message in the console on what could be going on
console.error(
`[Uncaught SyntaxError: Unexpected token '<'] usually means that a fallback html file was returned from server rather than the expected script. Check that the server is properly serving the file ${event.filename}.`
);
}
setUnhandledError(event.error);
}

View File

@@ -1,4 +1,4 @@
import { size, filter, forEach, extend } from "lodash";
import { size, filter, forEach, extend, isEmpty } from "lodash";
import React from "react";
import PropTypes from "prop-types";
import { SortableContainer, SortableElement, DragHandle } from "@redash/viz/lib/components/sortable";
@@ -43,13 +43,23 @@ export default class Parameters extends React.Component {
appendSortableToParent: true,
};
toCamelCase = str => {
if (isEmpty(str)) {
return "";
}
return str.replace(/\s+/g, "").toLowerCase();
};
constructor(props) {
super(props);
const { parameters } = props;
const { parameters, disableUrlUpdate } = props;
this.state = { parameters };
if (!props.disableUrlUpdate) {
if (!disableUrlUpdate) {
updateUrl(parameters);
}
const hideRegex = /hide_filter=([^&]+)/g;
const matches = window.location.search.matchAll(hideRegex);
this.hideValues = Array.from(matches, match => match[1]);
}
componentDidUpdate = prevProps => {
@@ -122,7 +132,13 @@ export default class Parameters extends React.Component {
};
renderParameter(param, index) {
if (this.hideValues.some(value => this.toCamelCase(value) === this.toCamelCase(param.name))) {
return null;
}
const { editable } = this.props;
if (param.hidden) {
return null;
}
return (
<div key={param.name} className="di-block" data-test={`ParameterName-${param.name}`}>
<div className="parameter-heading">
@@ -138,6 +154,7 @@ export default class Parameters extends React.Component {
</PlainButton>
)}
</div>
<ParameterValueInput
type={param.type}
value={param.normalizedValue}
@@ -154,7 +171,6 @@ export default class Parameters extends React.Component {
const { parameters } = this.state;
const { sortable, appendSortableToParent } = this.props;
const dirtyParamCount = size(filter(parameters, "hasPendingValue"));
return (
<SortableContainer
disabled={!sortable}
@@ -169,17 +185,18 @@ export default class Parameters extends React.Component {
className: "parameter-container",
onKeyDown: dirtyParamCount ? this.handleKeyDown : null,
}}>
{parameters.map((param, index) => (
<SortableElement key={param.name} index={index}>
<div
className="parameter-block"
data-editable={sortable || null}
data-test={`ParameterBlock-${param.name}`}>
{sortable && <DragHandle data-test={`DragHandle-${param.name}`} />}
{this.renderParameter(param, index)}
</div>
</SortableElement>
))}
{parameters &&
parameters.map((param, index) => (
<SortableElement key={param.name} index={index}>
<div
className="parameter-block"
data-editable={sortable || null}
data-test={`ParameterBlock-${param.name}`}>
{sortable && <DragHandle data-test={`DragHandle-${param.name}`} />}
{this.renderParameter(param, index)}
</div>
</SortableElement>
))}
<ParameterApplyButton onClick={this.applyChanges} paramCount={dirtyParamCount} />
</SortableContainer>
);

View File

@@ -36,6 +36,7 @@ function SelectWithVirtualScroll({ options, ...props }: VirtualScrollSelectProps
<AntdSelect<string>
dropdownMatchSelectWidth={dropdownMatchSelectWidth}
options={options}
allowClear={true}
optionFilterProp="label" // as this component expects "options" prop
{...props}
/>

View File

@@ -151,6 +151,7 @@ export default function DynamicForm({
onSubmit,
}) {
const [isSubmitting, setIsSubmitting] = useState(false);
const [isTouched, setIsTouched] = useState(false);
const [showExtraFields, setShowExtraFields] = useState(defaultShowExtraFields);
const [form] = Form.useForm();
const extraFields = filter(fields, { extra: true });
@@ -163,9 +164,8 @@ export default function DynamicForm({
onSubmit(
values,
msg => {
const { setFieldsValue, getFieldsValue } = form;
setIsSubmitting(false);
setFieldsValue(getFieldsValue()); // reset form touched state
setIsTouched(false); // reset form touched state
notification.success(msg);
},
msg => {
@@ -174,7 +174,7 @@ export default function DynamicForm({
}
);
},
[form, fields, onSubmit]
[fields, onSubmit]
);
const handleFinishFailed = useCallback(
@@ -187,6 +187,9 @@ export default function DynamicForm({
return (
<Form
form={form}
onFieldsChange={() => {
setIsTouched(true);
}}
id={id}
className="dynamic-form"
layout="vertical"
@@ -216,7 +219,7 @@ export default function DynamicForm({
{saveText}
</Button>
)}
<DynamicFormActions actions={actions} isFormDirty={form.isFieldsTouched()} />
<DynamicFormActions actions={actions} isFormDirty={isTouched} />
</Form>
);
}

View File

@@ -11,17 +11,17 @@
> .layout-content {
flex: 1 0 auto;
width: 75%;
order: 0;
order: 1;
margin: 0;
padding: 0 0 0 @spacing
}
> .layout-sidebar {
flex: 0 0 auto;
width: 25%;
max-width: 350px;
order: 1;
order: 0;
margin: 0;
padding: 0 0 0 @spacing;
}
@media (max-width: 990px) {
@@ -31,6 +31,7 @@
width: 100%;
order: 1;
margin: 0;
padding: 0;
}
> .layout-sidebar {
@@ -38,7 +39,6 @@
max-width: none;
order: 0;
margin: 0 0 @spacing 0;
padding: 0;
}
}
}

View File

@@ -27,6 +27,10 @@ defineDummySnippets("sql");
defineDummySnippets("json");
defineDummySnippets("yaml");
// without this line, ace will try to load a non-existent mode-custom.js file
// for data sources with syntax = "custom"
ace.define("ace/mode/custom", [], () => {});
function buildTableColumnKeywords(table) {
const keywords = [];
table.columns.forEach(column => {

View File

@@ -15,6 +15,7 @@ import { DashboardTagsControl } from "@/components/tags-control/TagsControl";
import getTags from "@/services/getTags";
import { clientConfig } from "@/services/auth";
import { policy } from "@/services/policy";
import recordEvent from "@/services/recordEvent";
import { durationHumanize } from "@/lib/utils";
import { DashboardStatusEnum } from "../hooks/useDashboard";
@@ -118,6 +119,8 @@ function DashboardMoreOptionsButton({ dashboardConfiguration }) {
managePermissions,
gridDisabled,
isDashboardOwnerOrAdmin,
isDuplicating,
duplicateDashboard,
} = dashboardConfiguration;
const archive = () => {
@@ -141,6 +144,14 @@ function DashboardMoreOptionsButton({ dashboardConfiguration }) {
<Menu.Item className={cx({ hidden: gridDisabled })}>
<PlainButton onClick={() => setEditingLayout(true)}>Edit</PlainButton>
</Menu.Item>
{!isDuplicating && dashboard.canEdit() && (
<Menu.Item>
<PlainButton onClick={duplicateDashboard}>
Fork <i className="fa fa-external-link m-l-5" aria-hidden="true" />
<span className="sr-only">(opens in a new tab)</span>
</PlainButton>
</Menu.Item>
)}
{clientConfig.showPermissionsControl && isDashboardOwnerOrAdmin && (
<Menu.Item>
<PlainButton onClick={managePermissions}>Manage Permissions</PlainButton>
@@ -175,6 +186,7 @@ function DashboardControl({ dashboardConfiguration, headerExtra }) {
fullscreen,
toggleFullscreen,
showShareDashboardDialog,
updateDashboard,
} = dashboardConfiguration;
const showPublishButton = dashboard.is_draft;
const showRefreshButton = true;
@@ -182,8 +194,14 @@ function DashboardControl({ dashboardConfiguration, headerExtra }) {
const canShareDashboard = canEditDashboard && !dashboard.is_draft;
const showShareButton = !clientConfig.disablePublicUrls && (dashboard.publicAccessEnabled || canShareDashboard);
const showMoreOptionsButton = canEditDashboard;
const unarchiveDashboard = () => {
recordEvent("unarchive", "dashboard", dashboard.id);
updateDashboard({ is_archived: false }, false);
};
return (
<div className="dashboard-control">
{dashboard.can_edit && dashboard.is_archived && <Button onClick={unarchiveDashboard}>Unarchive</Button>}
{!dashboard.is_archived && (
<span className="hidden-print">
{showPublishButton && (

View File

@@ -94,12 +94,12 @@ class ShareDashboardDialog extends React.Component {
};
render() {
const { dialog, dashboard } = this.props;
const { dialog, dashboard, hasOnlySafeQueries } = this.props;
const headerContent = this.constructor.headerContent;
return (
<Modal {...dialog.props} title={this.constructor.headerContent} footer={null}>
<Modal {...dialog.props} title={headerContent} footer={null}>
<Form layout="horizontal">
{!this.props.hasOnlySafeQueries && (
{!hasOnlySafeQueries && (
<Form.Item>
<Alert
message="For your security, sharing is currently not supported for dashboards containing queries with text parameters. Consider changing the text parameters in your query to a different type."
@@ -107,6 +107,7 @@ class ShareDashboardDialog extends React.Component {
/>
</Form.Item>
)}
<Form.Item label="Allow public access" {...this.formItemProps}>
<Switch
checked={dashboard.publicAccessEnabled}
@@ -117,9 +118,28 @@ class ShareDashboardDialog extends React.Component {
/>
</Form.Item>
{dashboard.public_url && (
<Form.Item label="Secret address" {...this.formItemProps}>
<InputWithCopy value={dashboard.public_url} data-test="SecretAddress" />
</Form.Item>
<>
<Form.Item>
<Alert
message={
<div>
Custom rule for hiding filter components when sharing links:
<br />
You can hide filter components by appending `&hide_filter={"{{"} component_name{"}}"}` to the
sharing URL.
<br />
Example: http://{"{{"}ip{"}}"}:{"{{"}port{"}}"}/public/dashboards/{"{{"}id{"}}"}
?p_country=ghana&p_site=10&hide_filter=country
</div>
}
type="warning"
/>
</Form.Item>
<Form.Item label="Secret address" {...this.formItemProps}>
<InputWithCopy value={dashboard.public_url} data-test="SecretAddress" />
</Form.Item>
</>
)}
</Form>
</Modal>

View File

@@ -6,11 +6,6 @@ div.tags-list {
-ms-user-select: none; /* IE10+ */
}
.page-dashboard-list .page-header-actions {
width: 25%; /* same as sidebar */
max-width: 350px; /* same as sidebar */
}
/* same rule as for sidebar */
@media (max-width: 990px) {
.page-dashboard-list .page-header-actions {

View File

@@ -15,6 +15,7 @@ import ShareDashboardDialog from "../components/ShareDashboardDialog";
import useFullscreenHandler from "../../../lib/hooks/useFullscreenHandler";
import useRefreshRateHandler from "./useRefreshRateHandler";
import useEditModeHandler from "./useEditModeHandler";
import useDuplicateDashboard from "./useDuplicateDashboard";
import { policy } from "@/services/policy";
export { DashboardStatusEnum } from "./useEditModeHandler";
@@ -53,6 +54,8 @@ function useDashboard(dashboardData) {
[dashboard]
);
const [isDuplicating, duplicateDashboard] = useDuplicateDashboard(dashboard);
const managePermissions = useCallback(() => {
const aclUrl = `api/dashboards/${dashboard.id}/acl`;
PermissionsEditorDialog.showModal({
@@ -243,6 +246,8 @@ function useDashboard(dashboardData) {
showAddTextboxDialog,
showAddWidgetDialog,
managePermissions,
isDuplicating,
duplicateDashboard,
};
}

View File

@@ -0,0 +1,40 @@
import { noop, extend, pick } from "lodash";
import { useCallback, useState } from "react";
import url from "url";
import qs from "query-string";
import { Dashboard } from "@/services/dashboard";
function keepCurrentUrlParams(targetUrl) {
const currentUrlParams = qs.parse(window.location.search);
targetUrl = url.parse(targetUrl);
const targetUrlParams = qs.parse(targetUrl.search);
return url.format(
extend(pick(targetUrl, ["protocol", "auth", "host", "pathname"]), {
search: qs.stringify(extend(currentUrlParams, targetUrlParams)),
})
);
}
export default function useDuplicateDashboard(dashboard) {
const [isDuplicating, setIsDuplicating] = useState(false);
const duplicateDashboard = useCallback(() => {
// To prevent opening the same tab, name must be unique for each browser
const tabName = `duplicatedDashboardTab/${Math.random().toString()}`;
// We should open tab here because this moment is a part of user interaction;
// later browser will block such attempts
const tab = window.open("", tabName);
setIsDuplicating(true);
Dashboard.fork({ id: dashboard.id })
.then(newDashboard => {
tab.location = keepCurrentUrlParams(newDashboard.getUrl());
})
.finally(() => {
setIsDuplicating(false);
});
}, [dashboard.id]);
return [isDuplicating, isDuplicating ? noop : duplicateDashboard];
}

View File

@@ -3,10 +3,6 @@
height: 35px;
}
.page-queries-list .page-header-actions {
width: 25%; /* same as sidebar */
max-width: 350px; /* same as sidebar */
}
/* same rule as for sidebar */
@media (max-width: 990px) {

View File

@@ -134,11 +134,10 @@ function QuerySource(props) {
// choose data source id for new queries
if (dataSourcesLoaded && queryFlags.isNew) {
const firstDataSourceId = dataSources.length > 0 ? dataSources[0].id : null;
const selectedDataSourceId = parseInt(localStorage.getItem("lastSelectedDataSourceId")) || null;
handleDataSourceChange(
chooseDataSourceId(
[query.data_source_id, localStorage.getItem("lastSelectedDataSourceId"), firstDataSourceId],
dataSources
)
chooseDataSourceId([query.data_source_id, selectedDataSourceId, firstDataSourceId], dataSources)
);
}
}, [query.data_source_id, queryFlags.isNew, dataSourcesLoaded, dataSources, handleDataSourceChange]);

View File

@@ -37,9 +37,10 @@
&.active {
overflow: visible;
max-height: unset !important;
.ant-input {
resize: vertical;
max-height: 150px - 15px * 2;
height: 30vh;
}
}
}

View File

@@ -172,6 +172,7 @@ const DashboardService = {
favorites: params => axios.get("api/dashboards/favorites", { params }).then(transformResponse),
favorite: ({ id }) => axios.post(`api/dashboards/${id}/favorite`),
unfavorite: ({ id }) => axios.delete(`api/dashboards/${id}/favorite`),
fork: ({ id }) => axios.post(`api/dashboards/${id}/fork`, { id }).then(transformResponse),
};
_.extend(Dashboard, DashboardService);
@@ -265,3 +266,7 @@ Dashboard.prototype.favorite = function favorite() {
Dashboard.prototype.unfavorite = function unfavorite() {
return Dashboard.unfavorite(this);
};
Dashboard.prototype.getUrl = function getUrl() {
return urlForDashboard(this);
};

View File

@@ -113,6 +113,10 @@ export function fetchDataFromJob(jobId, interval = 1000) {
});
}
export function isDateTime(v) {
return isString(v) && moment(v).isValid() && /^\d{4}-\d{2}-\d{2}T/.test(v);
}
class QueryResult {
constructor(props) {
this.deferred = defer();
@@ -147,7 +151,7 @@ class QueryResult {
let newType = null;
if (isNumber(v)) {
newType = "float";
} else if (isString(v) && v.match(/^\d{4}-\d{2}-\d{2}T/)) {
} else if (isDateTime(v)) {
row[k] = moment.utc(v);
newType = "datetime";
} else if (isString(v) && v.match(/^\d{4}-\d{2}-\d{2}$/)) {
@@ -318,6 +322,9 @@ class QueryResult {
}
return v;
});
if (filter.values.length > 1 && filter.multiple) {
filter.current = filter.values.slice();
}
});
return filters;

View File

@@ -0,0 +1,17 @@
import { isDateTime } from "@/services/query-result";
describe("isDateTime", () => {
it.each([
["2022-01-01T00:00:00", true],
["2022-01-01T00:00:00+09:00", true],
["2021-01-27T00:00:01.733983944+03:00 stderr F {", false],
["2021-01-27Z00:00:00+09:00", false],
["2021-01-27", false],
["foo bar", false],
[2022, false],
[null, false],
["", false],
])("isDateTime('%s'). expected '%s'.", (value, expected) => {
expect(isDateTime(value)).toBe(expected);
});
});

View File

@@ -13,7 +13,7 @@ try {
cypressConfigBaseUrl = cypressConfig.baseUrl;
} catch (e) {}
const baseUrl = process.env.CYPRESS_baseUrl || cypressConfigBaseUrl || "http://localhost:5000";
const baseUrl = process.env.CYPRESS_baseUrl || cypressConfigBaseUrl || "http://localhost:5001";
function seedDatabase(seedValues) {
get(baseUrl + "/login", (_, { headers }) => {
@@ -44,18 +44,18 @@ function seedDatabase(seedValues) {
function buildServer() {
console.log("Building the server...");
execSync("docker-compose -p cypress build", { stdio: "inherit" });
execSync("docker compose -p cypress build", { stdio: "inherit" });
}
function startServer() {
console.log("Starting the server...");
execSync("docker-compose -p cypress up -d", { stdio: "inherit" });
execSync("docker-compose -p cypress run server create_db", { stdio: "inherit" });
execSync("docker compose -p cypress up -d", { stdio: "inherit" });
execSync("docker compose -p cypress run server create_db", { stdio: "inherit" });
}
function stopServer() {
console.log("Stopping the server...");
execSync("docker-compose -p cypress down", { stdio: "inherit" });
execSync("docker compose -p cypress down", { stdio: "inherit" });
}
function runCypressCI() {
@@ -63,10 +63,11 @@ function runCypressCI() {
PERCY_TOKEN_ENCODED,
CYPRESS_PROJECT_ID_ENCODED,
CYPRESS_RECORD_KEY_ENCODED,
CIRCLE_REPOSITORY_URL,
GITHUB_REPOSITORY,
CYPRESS_OPTIONS, // eslint-disable-line no-unused-vars
} = process.env;
if (CIRCLE_REPOSITORY_URL && CIRCLE_REPOSITORY_URL.includes("getredash/redash")) {
if (GITHUB_REPOSITORY === "getredash/redash") {
if (PERCY_TOKEN_ENCODED) {
process.env.PERCY_TOKEN = atob(`${PERCY_TOKEN_ENCODED}`);
}
@@ -76,10 +77,11 @@ function runCypressCI() {
if (CYPRESS_RECORD_KEY_ENCODED) {
process.env.CYPRESS_RECORD_KEY = atob(`${CYPRESS_RECORD_KEY_ENCODED}`);
}
process.env.CYPRESS_OPTIONS = "--record";
}
execSync(
"COMMIT_INFO_MESSAGE=$(git show -s --format=%s) docker-compose run --name cypress cypress ./node_modules/.bin/percy exec -t 300 -- ./node_modules/.bin/cypress run --record",
"COMMIT_INFO_MESSAGE=$(git show -s --format=%s) docker compose run --name cypress cypress ./node_modules/.bin/percy exec -t 300 -- ./node_modules/.bin/cypress run $CYPRESS_OPTIONS",
{ stdio: "inherit" }
);
}
@@ -118,6 +120,6 @@ switch (command) {
stopServer();
break;
default:
console.log("Usage: npm run cypress [build|start|db-seed|open|run|stop]");
console.log("Usage: yarn cypress [build|start|db-seed|open|run|stop]");
break;
}

View File

@@ -0,0 +1,24 @@
describe("Dashboard list sort", () => {
beforeEach(() => {
cy.login();
});
it("creates one dashboard", () => {
cy.visit("/dashboards");
cy.getByTestId("CreateButton").click();
cy.getByTestId("CreateDashboardMenuItem").click();
cy.getByTestId("CreateDashboardDialog").within(() => {
cy.get("input").type("A Foo Bar");
cy.getByTestId("DashboardSaveButton").click();
});
});
describe("Sorting table does not crash page ", () => {
it("sorts", () => {
cy.visit("/dashboards");
cy.contains("Name").click();
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId("ErrorMessage").should("not.exist");
});
});
});

View File

@@ -1,5 +1,4 @@
import { createQueryAndAddWidget, editDashboard } from "../../support/dashboard";
import { dragParam, expectParamOrder } from "../../support/parameters";
import { createQueryAndAddWidget } from "../../support/dashboard";
describe("Dashboard Parameters", () => {
const parameters = [
@@ -59,16 +58,6 @@ describe("Dashboard Parameters", () => {
});
};
const setWidgetParametersToDashboard = parameters => {
cy.wrap(parameters).each(({ name: paramName }, i) => {
cy.getByTestId(`EditParamMappingButton-${paramName}`).click();
cy.getByTestId("NewDashboardParameterOption")
.filter(":visible")
.click();
return saveMappingOptions(i === parameters.length - 1);
});
};
it("supports widget parameters", function() {
// widget parameter mapping is the default for the API
cy.getByTestId(this.widgetTestId).within(() => {
@@ -86,27 +75,6 @@ describe("Dashboard Parameters", () => {
cy.getByTestId("DashboardParameters").should("not.exist");
});
it("supports dashboard parameters", function() {
openMappingOptions(this.widgetTestId);
setWidgetParametersToDashboard(parameters);
cy.getByTestId(this.widgetTestId).within(() => {
cy.getByTestId("ParameterName-param1").should("not.exist");
});
cy.getByTestId("DashboardParameters").within(() => {
cy.getByTestId("ParameterName-param1")
.find("input")
.type("{selectall}DashboardParam");
cy.getByTestId("ParameterApplyButton").click();
});
cy.getByTestId(this.widgetTestId).within(() => {
cy.getByTestId("TableVisualization").should("contain", "DashboardParam");
});
});
it("supports static values for parameters", function() {
openMappingOptions(this.widgetTestId);
cy.getByTestId("EditParamMappingButton-param1").click();
@@ -131,34 +99,4 @@ describe("Dashboard Parameters", () => {
cy.getByTestId("TableVisualization").should("contain", "StaticValue");
});
});
it("reorders parameters", function() {
// Reorder is only available in edit mode
editDashboard();
const [param1, param2] = parameters;
cy.getByTestId("ParameterBlock-param1")
.invoke("width")
.then(paramWidth => {
cy.server();
cy.route("POST", `**/api/dashboards/*`).as("SaveDashboard");
cy.route("POST", `**/api/widgets/*`).as("SaveWidget");
// Asserts widget param order
dragParam(param1.name, paramWidth, 1);
cy.wait("@SaveWidget");
cy.reload();
expectParamOrder([param2.title, param1.title]);
// Asserts dashboard param order
openMappingOptions(this.widgetTestId);
setWidgetParametersToDashboard(parameters);
cy.wait("@SaveWidget");
dragParam(param1.name, paramWidth, 1);
cy.wait("@SaveDashboard");
cy.reload();
expectParamOrder([param2.title, param1.title]);
});
});
});

View File

@@ -141,7 +141,7 @@ describe("Textbox", () => {
})
.should($el => {
const { top, left } = $el.offset();
expect(top).to.eq(162);
expect(top).to.be.oneOf([162, 162.015625]);
expect(left).to.eq(282);
expect($el.width()).to.eq(545);
expect($el.height()).to.eq(185);

View File

@@ -177,7 +177,7 @@ describe("Widget", () => {
cy.visit(this.dashboardUrl);
cy.getByTestId("TableVisualization")
.its("0.offsetHeight")
.should("eq", 381);
.should("be.oneOf", [380, 381]);
cy.percySnapshot("Shows correct height of table visualization");
});
});

View File

@@ -47,7 +47,7 @@ describe("Create Data Source", () => {
cy.getByTestId("User").type("postgres");
cy.getByTestId("Password").type("postgres");
cy.getByTestId("Database Name").type("postgres{enter}");
cy.getByTestId("CreateSourceSaveButton").click();
cy.getByTestId("CreateSourceSaveButton").click({ force: true });
cy.contains("Saved.");
});

View File

@@ -15,7 +15,7 @@ describe("Create Destination", () => {
cy.getByTestId("PreviewItem")
.then($previewItems => Cypress.$.map($previewItems, item => Cypress.$(item).attr("data-test-type")))
.then(availableTypes => expect(availableTypes).not.to.contain.members(this.deprecatedTypes));
.then(availableTypes => expect(availableTypes).not.to.contain.oneOf(this.deprecatedTypes));
cy.getByTestId("CreateSourceDialog").should("contain", "Email");
cy.wait(1000); // eslint-disable-line cypress/no-unnecessary-waiting

View File

@@ -68,19 +68,11 @@ describe("Query Filters", () => {
}
it("filters rows in a Table Visualization", () => {
expectSelectedOptionsToHaveMembers(["a"]);
expectTableToHaveLength(4);
expectFirstColumnToHaveMembers(["a", "a", "a", "a"]);
// Defaults to All Options Selected
cy.getByTestId("FilterName-stage1::multi-filter")
.find(".ant-select-selector")
.click();
cy.contains(".ant-select-item-option-content", "b").click();
cy.getByTestId("FilterName-stage1::multi-filter").click(); // close dropdown
expectSelectedOptionsToHaveMembers(["a", "b"]);
expectTableToHaveLength(7);
expectFirstColumnToHaveMembers(["a", "a", "a", "a", "b", "b", "b"]);
expectSelectedOptionsToHaveMembers(["a", "b", "c"]);
expectTableToHaveLength(11);
expectFirstColumnToHaveMembers(["a", "a", "a", "a", "b", "b", "b", "c", "c", "c", "c"]);
// Clear Option
@@ -92,6 +84,30 @@ describe("Query Filters", () => {
cy.getByTestId("TableVisualization").should("not.exist");
// Single Option selected
cy.getByTestId("FilterName-stage1::multi-filter")
.find(".ant-select-selector")
.click();
cy.contains(".ant-select-item-option-grouped > .ant-select-item-option-content", "a").click();
cy.getByTestId("FilterName-stage1::multi-filter").click(); // close dropdown
expectSelectedOptionsToHaveMembers(["a"]);
expectTableToHaveLength(4);
expectFirstColumnToHaveMembers(["a", "a", "a", "a"]);
// Two Options selected
cy.getByTestId("FilterName-stage1::multi-filter")
.find(".ant-select-selector")
.click();
cy.contains(".ant-select-item-option-content", "b").click();
cy.getByTestId("FilterName-stage1::multi-filter").click(); // close dropdown
expectSelectedOptionsToHaveMembers(["a", "b"]);
expectTableToHaveLength(7);
expectFirstColumnToHaveMembers(["a", "a", "a", "a", "b", "b", "b"]);
// Select All Option
cy.getByTestId("FilterName-stage1::multi-filter")

View File

@@ -1,4 +1,5 @@
import { dragParam } from "../../support/parameters";
import dayjs from "dayjs";
function openAndSearchAntdDropdown(testId, paramOption) {
cy.getByTestId(testId)
@@ -310,7 +311,7 @@ describe("Parameter", () => {
cy.getByTestId("ParameterApplyButton").click();
cy.getByTestId("TableVisualization").should("contain", Cypress.moment(this.now).format("15/MM/YY"));
cy.getByTestId("TableVisualization").should("contain", dayjs(this.now).format("15/MM/YY"));
});
it("allows picking a dynamic date", function() {
@@ -322,7 +323,7 @@ describe("Parameter", () => {
cy.getByTestId("ParameterApplyButton").click();
cy.getByTestId("TableVisualization").should("contain", Cypress.moment(this.now).format("DD/MM/YY"));
cy.getByTestId("TableVisualization").should("contain", dayjs(this.now).format("DD/MM/YY"));
});
it("sets dirty state when edited", () => {
@@ -364,7 +365,7 @@ describe("Parameter", () => {
cy.getByTestId("ParameterApplyButton").click();
cy.getByTestId("TableVisualization").should("contain", Cypress.moment(this.now).format("YYYY-MM-15 HH:mm"));
cy.getByTestId("TableVisualization").should("contain", dayjs(this.now).format("YYYY-MM-15 HH:mm"));
});
it("shows the current datetime after clicking in Now", function() {
@@ -379,7 +380,7 @@ describe("Parameter", () => {
cy.getByTestId("ParameterApplyButton").click();
cy.getByTestId("TableVisualization").should("contain", Cypress.moment(this.now).format("YYYY-MM-DD HH:mm"));
cy.getByTestId("TableVisualization").should("contain", dayjs(this.now).format("YYYY-MM-DD HH:mm"));
});
it("allows picking a dynamic date", function() {
@@ -391,7 +392,7 @@ describe("Parameter", () => {
cy.getByTestId("ParameterApplyButton").click();
cy.getByTestId("TableVisualization").should("contain", Cypress.moment(this.now).format("YYYY-MM-DD HH:mm"));
cy.getByTestId("TableVisualization").should("contain", dayjs(this.now).format("YYYY-MM-DD HH:mm"));
});
it("sets dirty state when edited", () => {
@@ -449,7 +450,7 @@ describe("Parameter", () => {
cy.getByTestId("ParameterApplyButton").click();
const now = Cypress.moment(this.now);
const now = dayjs(this.now);
cy.getByTestId("TableVisualization").should(
"contain",
now.format("YYYY-MM-15") + " - " + now.format("YYYY-MM-20")
@@ -465,7 +466,7 @@ describe("Parameter", () => {
cy.getByTestId("ParameterApplyButton").click();
const lastMonth = Cypress.moment(this.now).subtract(1, "month");
const lastMonth = dayjs(this.now).subtract(1, "month");
cy.getByTestId("TableVisualization").should(
"contain",
lastMonth.startOf("month").format("YYYY-MM-DD") + " - " + lastMonth.endOf("month").format("YYYY-MM-DD")

View File

@@ -99,8 +99,14 @@ describe("Pivot", () => {
.focus()
.type(" UNION ALL {enter}SELECT 'c' AS stage1, 'c5' AS stage2, 55 AS value");
// wait for the query text change to propagate (it's debounced in QuerySource.jsx)
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(200);
cy.getByTestId("SaveButton").click();
cy.getByTestId("ExecuteButton").click();
cy.getByTestId("ExecuteButton")
.should("be.enabled")
.click();
// assert number of rows is 12
cy.getByTestId("PivotTableVisualization").contains(".pvtGrandTotal", "12");

View File

@@ -1,10 +0,0 @@
const percyHealthCheck = require("@percy/cypress/task"); // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved
module.exports = (on, config) => {
if (config.env.coverage) {
require("@cypress/code-coverage/task")(on, config);
}
on("task", percyHealthCheck);
return config;
};

View File

@@ -80,6 +80,10 @@ export function assertAxesAndAddLabels(xaxisLabel, yaxisLabel) {
.clear()
.type(yaxisLabel);
cy.getByTestId("Chart.LeftYAxis.TickFormat")
.clear()
.type("+");
cy.getByTestId("VisualizationEditor.Tabs.General").click();
}

6
codecov.yml Normal file
View File

@@ -0,0 +1,6 @@
comment:
layout: " diff, flags, files"
behavior: default
require_changes: false
require_base: true
require_head: true

22
cypress.config.js Normal file
View File

@@ -0,0 +1,22 @@
const { defineConfig } = require('cypress')
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:5001',
defaultCommandTimeout: 20000,
downloadsFolder: 'client/cypress/downloads',
fixturesFolder: 'client/cypress/fixtures',
requestTimeout: 15000,
screenshotsFolder: 'client/cypress/screenshots',
specPattern: 'client/cypress/integration/',
supportFile: 'client/cypress/support/index.js',
video: true,
videoUploadOnPasses: false,
videosFolder: 'client/cypress/videos',
viewportHeight: 1024,
viewportWidth: 1280,
env: {
coverage: false
}
},
})

View File

@@ -1,18 +0,0 @@
{
"baseUrl": "http://localhost:5000",
"video": true,
"videoUploadOnPasses": false,
"fixturesFolder": "client/cypress/fixtures",
"integrationFolder": "client/cypress/integration",
"pluginsFile": "client/cypress/plugins/index.js",
"screenshotsFolder": "client/cypress/screenshots",
"videosFolder": "client/cypress/videos",
"supportFile": "client/cypress/support/index.js",
"defaultCommandTimeout": 20000,
"requestTimeout": 15000,
"viewportWidth": 1280,
"viewportHeight": 1024,
"env": {
"coverage": false
}
}

View File

@@ -5,7 +5,7 @@ x-redash-service: &redash-service
build:
context: .
args:
skip_frontend_build: "true"
skip_frontend_build: "true" # set to empty string to build
volumes:
- .:/app
env_file:
@@ -17,7 +17,9 @@ x-redash-environment: &redash-environment
REDASH_RATELIMIT_ENABLED: "false"
REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
REDASH_MAIL_SERVER: "email"
REDASH_MAIL_PORT: 1025
REDASH_ENFORCE_CSRF: "true"
REDASH_GUNICORN_TIMEOUT: 60
# Set secret keys in the .env file
services:
server:
@@ -27,7 +29,7 @@ services:
- postgres
- redis
ports:
- "5000:5000"
- "5001:5000"
- "5678:5678"
environment:
<<: *redash-environment
@@ -48,21 +50,22 @@ services:
<<: *redash-environment
PYTHONUNBUFFERED: 0
redis:
image: redis:3-alpine
image: redis:7-alpine
restart: unless-stopped
postgres:
image: postgres:9.5-alpine
image: pgautoupgrade/pgautoupgrade:15-alpine3.8
ports:
- "15432:5432"
# The following turns the DB into less durable, but gains significant performance improvements for the tests run (x3
# improvement on my personal machine). We should consider moving this into a dedicated Docker Compose configuration for
# tests.
ports:
- "15432:5432"
command: "postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF"
restart: unless-stopped
environment:
POSTGRES_HOST_AUTH_METHOD: "trust"
email:
image: djfarrelly/maildev
image: maildev/maildev
ports:
- "1080:80"
- "1080:1080"
- "1025:1025"
restart: unless-stopped

View File

@@ -5,5 +5,5 @@ CLI to manage redash.
from redash.cli import manager
if __name__ == '__main__':
if __name__ == "__main__":
manager()

View File

@@ -0,0 +1,51 @@
"""Make case insensitive hash of query text
Revision ID: 1038c2174f5d
Revises: fd4fc850d7ea
Create Date: 2023-07-16 23:10:12.885949
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table
from redash.utils import gen_query_hash
# revision identifiers, used by Alembic.
revision = '1038c2174f5d'
down_revision = 'fd4fc850d7ea'
branch_labels = None
depends_on = None
def change_query_hash(conn, table, query_text_to):
for record in conn.execute(table.select()):
query_text = query_text_to(record.query)
conn.execute(
table
.update()
.where(table.c.id == record.id)
.values(query_hash=gen_query_hash(query_text)))
def upgrade():
queries = table(
'queries',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('query', sa.Text),
sa.Column('query_hash', sa.String(length=10)))
conn = op.get_bind()
change_query_hash(conn, queries, query_text_to=str)
def downgrade():
queries = table(
'queries',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('query', sa.Text),
sa.Column('query_hash', sa.String(length=10)))
conn = op.get_bind()
change_query_hash(conn, queries, query_text_to=str.lower)

View File

@@ -0,0 +1,25 @@
"""create sqlalchemy_searchable expressions
Revision ID: 7ce5925f832b
Revises: 1038c2174f5d
Create Date: 2023-09-29 16:48:29.517762
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy_searchable import sql_expressions
# revision identifiers, used by Alembic.
revision = '7ce5925f832b'
down_revision = '1038c2174f5d'
branch_labels = None
depends_on = None
def upgrade():
op.execute(sql_expressions)
def downgrade():
pass

View File

@@ -0,0 +1,60 @@
"""Convert user details to jsonb and move user profile image url into details column
Revision ID: fd4fc850d7ea
Revises: 89bc7873a3e0
Create Date: 2022-01-31 15:24:16.507888
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from redash.models import db
# revision identifiers, used by Alembic.
revision = 'fd4fc850d7ea'
down_revision = '89bc7873a3e0'
branch_labels = None
depends_on = None
def upgrade():
connection = op.get_bind()
### commands auto generated by Alembic - please adjust! ###
op.alter_column('users', 'details',
existing_type=postgresql.JSON(astext_type=sa.Text()),
type_=postgresql.JSONB(astext_type=sa.Text()),
existing_nullable=True,
existing_server_default=sa.text("'{}'::jsonb"))
### end Alembic commands ###
update_query = """
update users
set details = details::jsonb || ('{"profile_image_url": "' || profile_image_url || '"}')::jsonb
where 1=1
"""
connection.execute(update_query)
op.drop_column("users", "profile_image_url")
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
connection = op.get_bind()
op.add_column("users", sa.Column("profile_image_url", db.String(320), nullable=True))
update_query = """
update users set
profile_image_url = details->>'profile_image_url',
details = details - 'profile_image_url' ;
"""
connection.execute(update_query)
db.session.commit()
op.alter_column('users', 'details',
existing_type=postgresql.JSONB(astext_type=sa.Text()),
type_=postgresql.JSON(astext_type=sa.Text()),
existing_nullable=True,
existing_server_default=sa.text("'{}'::json"))
# ### end Alembic commands ###

View File

@@ -1,10 +1,14 @@
[build]
base = "client"
publish = "client/dist"
command = "npm ci && npm run build"
# Netlify doesn't seem to install Yarn even though NETLIFY_USE_YARN is set below
# command = "cd ../ && npm i -g yarn@1.22.19 && yarn --frozen-lockfile --force && cd viz-lib && yarn build:babel && cd .. && rm -r ./node_modules/@redash/viz && cp -r ./viz-lib/. ./node_modules/@redash/viz && yarn build && cd ./client"
command = "cd ../ && yarn cache clean && yarn --frozen-lockfile --network-concurrency 1 && yarn build && cd ./client"
[build.environment]
NODE_VERSION = "12.18.4"
NODE_VERSION = "16.20.1"
NETLIFY_USE_YARN = "true"
YARN_VERSION = "1.22.19"
CYPRESS_INSTALL_BINARY = "0"
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = "1"

27751
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,41 +1,41 @@
{
"name": "redash-client",
"version": "10.1.0",
"version": "23.12.0-dev",
"description": "The frontend part of Redash.",
"main": "index.js",
"scripts": {
"start": "npm-run-all --parallel watch:viz webpack-dev-server",
"bundle": "bin/bundle-extensions",
"clean": "rm -rf ./client/dist/",
"build:viz": "(cd viz-lib && npm run build:babel)",
"build": "npm run clean && npm run build:viz && NODE_ENV=production webpack",
"build:old-node-version": "npm run clean && NODE_ENV=production node --max-old-space-size=4096 node_modules/.bin/webpack",
"watch:app": "webpack --watch --progress --colors -d",
"watch:viz": "(cd viz-lib && npm run watch:babel)",
"build:viz": "(cd viz-lib && yarn build:babel)",
"build": "yarn clean && yarn build:viz && NODE_ENV=production webpack",
"build:old-node-version": "yarn clean && NODE_ENV=production node --max-old-space-size=4096 node_modules/.bin/webpack",
"watch:app": "webpack watch --progress",
"watch:viz": "(cd viz-lib && yarn watch:babel)",
"watch": "npm-run-all --parallel watch:*",
"webpack-dev-server": "webpack-dev-server",
"analyze": "npm run clean && BUNDLE_ANALYZER=on webpack",
"analyze:build": "npm run clean && NODE_ENV=production BUNDLE_ANALYZER=on webpack",
"lint": "npm run lint:base -- --ext .js --ext .jsx --ext .ts --ext .tsx ./client",
"lint:fix": "npm run lint:base -- --fix --ext .js --ext .jsx --ext .ts --ext .tsx ./client",
"analyze": "yarn clean && BUNDLE_ANALYZER=on webpack",
"analyze:build": "yarn clean && NODE_ENV=production BUNDLE_ANALYZER=on webpack",
"lint": "yarn lint:base --ext .js --ext .jsx --ext .ts --ext .tsx ./client",
"lint:fix": "yarn lint:base --fix --ext .js --ext .jsx --ext .ts --ext .tsx ./client",
"lint:base": "eslint --config ./client/.eslintrc.js --ignore-path ./client/.eslintignore",
"lint:ci": "npm run lint -- --max-warnings 0 --format junit --output-file /tmp/test-results/eslint/results.xml",
"lint:ci": "yarn lint --max-warnings 0 --format junit --output-file /tmp/test-results/eslint/results.xml",
"prettier": "prettier --write 'client/app/**/*.{js,jsx,ts,tsx}' 'client/cypress/**/*.{js,jsx,ts,tsx}'",
"type-check": "tsc --noEmit --project client/tsconfig.json",
"type-check:watch": "npm run type-check -- --watch",
"type-check:watch": "yarn type-check --watch",
"jest": "TZ=Africa/Khartoum jest",
"test": "run-s type-check jest",
"test:watch": "jest --watch",
"cypress": "node client/cypress/cypress.js",
"postinstall": "(cd viz-lib && npm ci && npm run build:babel)"
"preinstall": "cd viz-lib && yarn link --link-folder ../.yarn",
"postinstall": "(cd viz-lib && yarn --frozen-lockfile && yarn build:babel) && yarn link --link-folder ./.yarn @redash/viz"
},
"repository": {
"type": "git",
"url": "git+https://github.com/getredash/redash.git"
},
"engines": {
"node": "^12.0.0",
"npm": "^6.0.0"
"node": ">14.16.0 <17.0.0",
"yarn": "^1.22.10"
},
"author": "Redash Contributors",
"license": "BSD-2-Clause",
@@ -48,26 +48,25 @@
"@redash/viz": "file:viz-lib",
"ace-builds": "^1.4.12",
"antd": "^4.4.3",
"axios": "^0.21.1",
"axios-auth-refresh": "^3.0.0",
"axios": "0.27.2",
"axios-auth-refresh": "3.3.6",
"bootstrap": "^3.3.7",
"classnames": "^2.2.6",
"d3": "^3.5.17",
"debug": "^3.1.0",
"dompurify": "^2.0.7",
"debug": "^3.2.7",
"dompurify": "^2.0.17",
"font-awesome": "^4.7.0",
"history": "^4.10.1",
"hoist-non-react-statics": "^3.3.0",
"markdown": "0.5.0",
"material-design-iconic-font": "^2.2.0",
"moment": "^2.19.3",
"mousetrap": "^1.6.1",
"mustache": "^2.3.0",
"numeral": "^2.0.6",
"path-to-regexp": "^3.1.0",
"prop-types": "^15.6.1",
"query-string": "^6.9.0",
"react": "^16.14.0",
"react": "16.14.0",
"react-ace": "^9.1.1",
"react-dom": "^16.14.0",
"react-grid-layout": "^0.18.2",
@@ -79,18 +78,18 @@
"use-media": "^1.4.0"
},
"devDependencies": {
"@babel/cli": "^7.10.4",
"@babel/core": "^7.10.4",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-object-assign": "^7.2.0",
"@babel/preset-env": "^7.10.4",
"@babel/preset-env": "^7.22.9",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.10.4",
"@cypress/code-coverage": "^3.8.1",
"@percy/agent": "0.24.3",
"@percy/cypress": "^2.3.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
"@testing-library/cypress": "^7.0.2",
"@babel/preset-typescript": "^7.22.5",
"@cypress/code-coverage": "^3.11.0",
"@percy/agent": "^0.28.7",
"@percy/cypress": "^3.1.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@testing-library/cypress": "^8.0.7",
"@types/classnames": "^2.2.10",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/lodash": "^4.14.157",
@@ -103,19 +102,20 @@
"atob": "^2.1.2",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.1.0",
"babel-loader": "^8.0.5",
"babel-plugin-istanbul": "^6.0.0",
"babel-loader": "^8.3.0",
"babel-plugin-istanbul": "^6.1.1",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"copy-webpack-plugin": "^4.5.3",
"css-loader": "^0.28.7",
"cypress": "^5.3.0",
"copy-webpack-plugin": "^6.4.1",
"css-loader": "^5.2.7",
"cypress": "^11.2.0",
"dayjs": "^1.11.9",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"enzyme-to-json": "^3.3.5",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-config-react-app": "^5.1.0",
"eslint-loader": "^3.0.3",
"eslint-loader": "^4.0.2",
"eslint-plugin-chai-friendly": "^0.5.0",
"eslint-plugin-compat": "^3.3.0",
"eslint-plugin-cypress": "^2.0.1",
@@ -126,35 +126,34 @@
"eslint-plugin-no-only-tests": "^2.4.0",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^1.7.0",
"file-loader": "^2.0.0",
"html-webpack-plugin": "^3.2.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^4.5.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.1.0",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"less-plugin-autoprefix": "^1.5.1",
"lodash": "^4.17.20",
"mini-css-extract-plugin": "^0.4.4",
"less": "^3.13.1",
"less-loader": "^5.0.0",
"less-plugin-autoprefix": "^2.0.0",
"lodash": "^4.17.21",
"mini-css-extract-plugin": "^1.6.2",
"mockdate": "^2.0.2",
"npm-run-all": "^4.1.5",
"prettier": "^1.19.1",
"raw-loader": "^0.5.1",
"react-refresh": "^0.9.0",
"react-test-renderer": "^16.5.2",
"request": "^2.88.0",
"react-refresh": "^0.14.0",
"react-test-renderer": "^16.14.0",
"request-cookies": "^1.1.0",
"style-loader": "^2.0.0",
"typescript": "^4.1.2",
"url-loader": "^1.1.2",
"webpack": "^4.44.2",
"webpack-build-notifier": "^0.1.30",
"webpack-bundle-analyzer": "^2.11.1",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.11.0",
"url-loader": "^4.1.1",
"webpack": "^4.46.0",
"webpack-build-notifier": "^2.3.0",
"webpack-bundle-analyzer": "^4.9.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-manifest-plugin": "^2.0.4"
},
"optionalDependencies": {
"fsevents": "^1.2.9"
"fsevents": "^2.3.2"
},
"jest": {
"rootDir": "./client",

5149
poetry.lock generated Normal file

File diff suppressed because it is too large Load Diff

177
pyproject.toml Normal file
View File

@@ -0,0 +1,177 @@
[project]
requires-python = ">=3.8"
[tool.black]
target-version = ['py38']
line-length = 119
force-exclude = '''
/(
migrations
)/
'''
[tool.poetry]
name = "redash"
version = "23.12.0-dev"
description = "Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data."
authors = ["Arik Fraimovich <arik@redash.io>"]
# to be added to/removed from the mailing list, please reach out to Arik via the above email or Discord
maintainers = [
"Redash maintainers and contributors <maintainers@redash.io>",
]
readme = "README.md"
[tool.poetry.dependencies]
python = ">=3.8,<3.11"
advocate = "1.0.0"
aniso8601 = "8.0.0"
authlib = "0.15.5"
backoff = "2.2.1"
blinker = "1.6.2"
click = "8.1.3"
cryptography = "41.0.6"
disposable-email-domains = ">=0.0.52"
flask = "2.3.2"
flask-limiter = "3.3.1"
flask-login = "0.6.0"
flask-mail = "0.9.1"
flask-migrate = "2.5.2"
flask-restful = "0.3.10"
flask-sqlalchemy = "2.5.1"
flask-talisman = "0.7.0"
flask-wtf = "1.1.1"
funcy = "1.13"
gevent = "23.9.1"
greenlet = "2.0.2"
gunicorn = "20.0.4"
httplib2 = "0.19.0"
itsdangerous = "2.1.2"
jinja2 = "3.1.2"
jsonschema = "3.1.1"
markupsafe = "2.1.1"
maxminddb-geolite2 = "2018.703"
parsedatetime = "2.4"
passlib = "1.7.3"
psycopg2-binary = "2.9.6"
pyjwt = "2.4.0"
pyopenssl = "23.2.0"
pypd = "1.1.0"
pysaml2 = "7.3.1"
pystache = "0.6.0"
python-dateutil = "2.8.0"
python-dotenv = "0.19.2"
pytz = ">=2019.3"
pyyaml = "6.0.1"
redis = "4.6.0"
regex = "2023.8.8"
requests = "2.31.0"
restrictedpython = "6.2"
rq = "1.9.0"
rq-scheduler = "0.11.0"
semver = "2.8.1"
sentry-sdk = "1.28.1"
simplejson = "3.16.0"
sqlalchemy = "1.3.24"
sqlalchemy-searchable = "1.2.0"
sqlalchemy-utils = "0.34.2"
sqlparse = "0.4.4"
sshtunnel = "0.1.5"
statsd = "3.3.0"
supervisor = "4.1.0"
supervisor-checks = "0.8.1"
ua-parser = "0.18.0"
urllib3 = "1.26.18"
user-agents = "2.0"
werkzeug = "2.3.8"
wtforms = "2.2.1"
xlsxwriter = "1.2.2"
tzlocal = "4.3.1"
[tool.poetry.group.all_ds]
optional = true
[tool.poetry.group.all_ds.dependencies]
atsd-client = "3.0.5"
azure-kusto-data = "0.0.35"
boto3 = "1.28.8"
botocore = "1.31.8"
cassandra-driver = "3.21.0"
certifi = ">=2019.9.11"
cmem-cmempy = "21.2.3"
databend-py = "0.4.6"
databend-sqlalchemy = "0.2.4"
google-api-python-client = "1.7.11"
gspread = "5.11.2"
impyla = "0.16.0"
influxdb = "5.2.3"
memsql = "3.2.0"
mysqlclient = "2.1.1"
nzalchemy = "^11.0.2"
nzpy = ">=1.15"
oauth2client = "4.1.3"
openpyxl = "3.0.7"
oracledb = "1.4.0"
pandas = "1.3.4"
phoenixdb = "0.7"
pinotdb = ">=0.4.5"
protobuf = "3.20.2"
pyathena = ">=1.5.0,<=1.11.5"
pydgraph = "2.0.2"
pydruid = "0.5.7"
pyexasol = "0.12.0"
pyhive = "0.6.1"
pyignite = "0.6.1"
pymongo = { version = "4.3.3", extras = ["srv", "tls"] }
pymssql = "2.2.8"
pyodbc = "4.0.28"
python-arango = "6.1.0"
python-rapidjson = "1.1.0"
qds-sdk = ">=1.9.6"
requests-aws-sign = "0.1.5"
sasl = ">=0.1.3"
simple-salesforce = "0.74.3"
snowflake-connector-python = "3.4.0"
td-client = "1.0.0"
thrift = ">=0.8.0"
thrift-sasl = ">=0.1.0"
trino = ">=0.305,<1.0"
vertica-python = "1.1.1"
xlrd = "2.0.1"
e6data-python-connector = "1.1.9"
[tool.poetry.group.ldap3]
optional = true
[tool.poetry.group.ldap3.dependencies]
ldap3 = "2.9.1"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
pytest = "7.4.0"
coverage = "7.2.7"
freezegun = "1.2.1"
jwcrypto = "1.5.0"
mock = "5.0.2"
pre-commit = "3.3.3"
ptpython = "3.0.23"
ptvsd = "4.3.2"
pytest-cov = "4.1.0"
watchdog = "3.0.0"
ruff = "0.0.289"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
exclude = [".git", "viz-lib", "node_modules", "migrations"]
ignore = ["E501"]
select = ["C9", "E", "F", "W", "I001"]
[tool.ruff.mccabe]
max-complexity = 15
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]

View File

@@ -1,2 +1,5 @@
[pytest]
norecursedirs = *.egg .eggs dist build docs .tox
filterwarnings =
once::DeprecationWarning
once::PendingDeprecationWarning

View File

@@ -1,21 +1,20 @@
from __future__ import absolute_import
import logging
import os
import sys
import redis
from flask_mail import Mail
from flask_limiter import Limiter
from flask_limiter.util import get_ipaddr
from flask_limiter.util import get_remote_address
from flask_mail import Mail
from flask_migrate import Migrate
from statsd import StatsClient
from . import settings
from .app import create_app # noqa
from .query_runner import import_query_runners
from .destinations import import_destinations
from redash import settings
from redash.app import create_app # noqa
from redash.destinations import import_destinations
from redash.query_runner import import_query_runners
__version__ = "10.1.0"
__version__ = "23.12.0-dev"
if os.environ.get("REMOTE_DEBUG"):
@@ -48,10 +47,8 @@ redis_connection = redis.from_url(settings.REDIS_URL)
rq_redis_connection = redis.from_url(settings.RQ_REDIS_URL)
mail = Mail()
migrate = Migrate(compare_type=True)
statsd_client = StatsClient(
host=settings.STATSD_HOST, port=settings.STATSD_PORT, prefix=settings.STATSD_PREFIX
)
limiter = Limiter(key_func=get_ipaddr, storage_uri=settings.LIMITER_STORAGE)
statsd_client = StatsClient(host=settings.STATSD_HOST, port=settings.STATSD_PORT, prefix=settings.STATSD_PREFIX)
limiter = Limiter(key_func=get_remote_address, storage_uri=settings.LIMITER_STORAGE)
import_query_runners(settings.QUERY_RUNNERS)
import_destinations(settings.DESTINATIONS)

View File

@@ -1,7 +1,7 @@
from flask import Flask
from werkzeug.middleware.proxy_fix import ProxyFix
from . import settings
from redash import settings
class Redash(Flask):
@@ -25,7 +25,6 @@ class Redash(Flask):
def create_app():
from . import (
authentication,
extensions,
handlers,
limiter,
mail,
@@ -43,7 +42,7 @@ def create_app():
app = Redash()
# Check and update the cached version for use by the client
app.before_first_request(reset_new_version_status)
reset_new_version_status()
security.init_app(app)
request_metrics.init_app(app)
@@ -54,7 +53,6 @@ def create_app():
limiter.init_app(app)
handlers.init_app(app)
configure_webpack(app)
extensions.init_app(app)
users.init_app(app)
tasks.init_app(app)

View File

@@ -5,27 +5,26 @@ import time
from datetime import timedelta
from urllib.parse import urlsplit, urlunsplit
from flask import jsonify, redirect, request, url_for, session
from flask import jsonify, redirect, request, session, url_for
from flask_login import LoginManager, login_user, logout_user, user_logged_in
from sqlalchemy.orm.exc import NoResultFound
from werkzeug.exceptions import Unauthorized
from redash import models, settings
from redash.authentication import jwt_auth
from redash.authentication.org_resolving import current_org
from redash.settings.organization import settings as org_settings
from redash.tasks import record_event
from sqlalchemy.orm.exc import NoResultFound
from werkzeug.exceptions import Unauthorized
login_manager = LoginManager()
logger = logging.getLogger("authentication")
def get_login_url(external=False, next="/"):
if settings.MULTI_ORG and current_org == None:
if settings.MULTI_ORG and current_org == None: # noqa: E711
login_url = "/"
elif settings.MULTI_ORG:
login_url = url_for(
"redash.login", org_slug=current_org.slug, next=next, _external=external
)
login_url = url_for("redash.login", org_slug=current_org.slug, next=next, _external=external)
else:
login_url = url_for("redash.login", next=next, _external=external)
@@ -68,11 +67,7 @@ def request_loader(request):
elif settings.AUTH_TYPE == "api_key":
user = api_key_load_user_from_request(request)
else:
logger.warning(
"Unknown authentication type ({}). Using default (HMAC).".format(
settings.AUTH_TYPE
)
)
logger.warning("Unknown authentication type ({}). Using default (HMAC).".format(settings.AUTH_TYPE))
user = hmac_load_user_from_request(request)
if org_settings["auth_jwt_login_enabled"] and user is None:
@@ -192,6 +187,10 @@ def jwt_token_load_user_from_request(request):
if not payload:
return
if "email" not in payload:
logger.info("No email field in token, refusing to login")
return
try:
user = models.User.get_by_email_and_org(payload["email"], org)
except models.NoResultFound:
@@ -216,12 +215,9 @@ def log_user_logged_in(app, user):
@login_manager.unauthorized_handler
def redirect_to_login():
if request.is_xhr or "/api/" in request.path:
response = jsonify(
{"message": "Couldn't find resource. Please login and try again."}
)
response.status_code = 404
return response
is_xhr = request.headers.get("X-Requested-With") == "XMLHttpRequest"
if is_xhr or "/api/" in request.path:
return {"message": "Couldn't find resource. Please login and try again."}, 404
login_url = get_login_url(next=request.url, external=False)
@@ -231,7 +227,7 @@ def redirect_to_login():
def logout_and_redirect_to_index():
logout_user()
if settings.MULTI_ORG and current_org == None:
if settings.MULTI_ORG and current_org == None: # noqa: E711
index_url = "/"
elif settings.MULTI_ORG:
index_url = url_for("redash.index", org_slug=current_org.slug, _external=False)
@@ -242,14 +238,11 @@ def logout_and_redirect_to_index():
def init_app(app):
from redash.authentication import (
saml_auth,
remote_user_auth,
ldap_auth,
from redash.authentication import ldap_auth, remote_user_auth, saml_auth
from redash.authentication.google_oauth import (
create_google_oauth_blueprint,
)
from redash.authentication.google_oauth import create_google_oauth_blueprint
login_manager.init_app(app)
login_manager.anonymous_user = models.AnonymousUser
login_manager.REMEMBER_COOKIE_DURATION = settings.REMEMBER_COOKIE_DURATION
@@ -262,7 +255,12 @@ def init_app(app):
from redash.security import csrf
# Authlib's flask oauth client requires a Flask app to initialize
for blueprint in [create_google_oauth_blueprint(app), saml_auth.blueprint, remote_user_auth.blueprint, ldap_auth.blueprint, ]:
for blueprint in [
create_google_oauth_blueprint(app),
saml_auth.blueprint,
remote_user_auth.blueprint,
ldap_auth.blueprint,
]:
csrf.exempt(blueprint)
app.register_blueprint(blueprint)

View File

@@ -1,13 +1,12 @@
import logging
from flask import render_template
from itsdangerous import URLSafeTimedSerializer
from redash import settings
from redash.tasks import send_mail
from redash.utils import base_url
# noinspection PyUnresolvedReferences
from itsdangerous import URLSafeTimedSerializer, SignatureExpired, BadSignature
logger = logging.getLogger(__name__)
serializer = URLSafeTimedSerializer(settings.SECRET_KEY)

Some files were not shown because too many files have changed in this diff Show More