Commit Graph

6808 Commits

Author SHA1 Message Date
Arik Fraimovich
c612bba19c
Amazon CloudWatch query runners (#4372)
* CloudWatch Metrics query runner

* Add: query runner for CloudWatch Logs Insights

* Add logos

* Update Insights type

* Basic test connection

* Format files
2019-11-27 09:14:28 +02:00
Nicolas Le Manchet
f5a40827aa Remove builtins invalid in Python 3 from Python runner (#4375)
These few builtins were available in Python 2.7 but not anymore
in Python 3, making the runner fail to start.
2019-11-27 09:12:36 +02:00
Gabriel Dutra
5de291a98d
Fix Map spec and Alert Page snapshot flakyness (#4403) 2019-11-26 19:08:18 -03:00
Levko Kravets
c70a48db9c
Table visualization with column named "children" renders +/- buttons (#4394) 2019-11-26 15:47:19 +02:00
Omer Lachish
be56035bd6
don't try to purge jobs which have already been deleted (#4396) 2019-11-25 11:04:00 +02:00
Gabriel Dutra
7c97d8eafa
Add autoscroll to ng-view (#4337) 2019-11-24 14:01:35 -03:00
Gabriel Dutra
0563ecf648
Migrate Home to React (#4379) 2019-11-24 13:59:56 -03:00
Levko Kravets
e72d7a8cca
Table visualization: accept timestamp for date/time columns (#4389) 2019-11-24 11:50:52 +02:00
Levko Kravets
a7a933946b Hide deprecated visualizations from query editor (#4388)
* Hide deprecated visualizations from query editor

* Fix Map tests
2019-11-24 11:05:01 +02:00
uncletimmy3
7cfd362a7a fix typo at unsupportedRedirect.js (#4387) 2019-11-24 10:46:16 +02:00
Arik Fraimovich
4d1b359713
Remove unused npm dependencies (#4380)
* Remove ui-ace.

* Remove ui-sortable.

* Remove angular-base64-upload.

* Remove angular-messages.

* Remove jquery-ui.

* Update package-lock.json.
2019-11-21 12:18:33 +02:00
Levko Kravets
818649bbec
Migrate Chart visualization to React Part 2: Editor (#4139) 2019-11-20 21:57:12 +02:00
Levko Kravets
c6a2725f0a
Migrate Map visualization to React (#4278) 2019-11-20 17:36:59 +02:00
Gabriel Dutra
5cd6913e40
Fix Cypress and Percy flakyness issues (#4365) 2019-11-18 10:37:01 -03:00
Gabriel Dutra
0aebb37317
Remove Chrome Logger and update Cypress and Percy (#4354) 2019-11-14 15:23:00 -03:00
Levko Kravets
aa06b32e17
Add some tests for Choropleth visualization (#4358) 2019-11-14 19:08:51 +02:00
Levko Kravets
b44fa51829 Migrate Funnel visualization to React (#4267)
* Migrate Funnel visualization to React: Editor

* Migrate Funnel visualization to React: Renderer

* Replace Auto sort options with Sort Column + Reverse Order

* Add option for items limit (instead of hard-coded value)

* Add number formatting options

* Replace d3.max with lodash.maxBy; fix bug in prepareData

* Add options for min/max percent values

* Debounce inputs

* Tests

* Refine Renderer: split components, use Ant Table for rendering, fix data handling

* Extract utility function to own file

* Fix tests

* Fix: sometimes after updating options, funnel shows "ghost" rows from previous dataset

* Sort by value column by default
2019-11-14 15:47:17 +02:00
Levko Kravets
1a95904ffd Migrate Choropleth visualization to React (#4313)
* Migrate Choropleth to React: skeleton

* Migrate Choropleth to React: Editor - skeleton

* Choropleth Editor: Bounds tab

* Choropleth Editor: Colors tab

* Choropleth Editor: Format tab

* Choropleth Editor: General tab

* Some refinements

* Migrate Choropleth to React: Renderer

* Refine code

* CR1
2019-11-14 15:42:15 +02:00
Omer Lachish
ef56e4e920
use to set the hash instead of directly manipulating it (#4351)
* use  to set the hash instead of directly manipulating it

* Update Jobs.jsx
2019-11-13 15:36:04 +02:00
shinsuke-nara
d5a3f0de57 CLI command to reencrypt data source options (#4190)
* Script to reencrypt data source options.

* Implement reencrypt sub command under database command.
2019-11-13 15:27:20 +02:00
Arik Fraimovich
cf274d96c8
Fix: number based alerts evaluation isn't working (#4295)
* Fix: correctly evaluate numeric thresholds

* Missing import

* More missing imports

* Alert evaluation: support for booleans
2019-11-13 15:11:21 +02:00
Levko Kravets
c00410768c Migrate Cohort visualization to React (#4270)
* Migrate Cohort to React: Editor

* Extract prepareData and getOptions to own files

* Refine CohortRenderer Angular component (js, less, prepareData) for easier migration

* Migrate Cohort to React: Renderer

* Migrate Cornelius to React: styles

* Migrate Cohort to React: Cornelius library

* Cornelius: add licence info; remove unused style

* Cornelius: use numeral to format numbers; revisit styles

* Cornelius: use moment to format date labels

* Cornelius: use chroma for cell backgrounds; update options; update proptypes; minor fixes

* Tidy up

* Tests
2019-11-13 14:39:08 +02:00
Jakdaw
dda5a9d58f Fix the DB migration so that the correct key is used for encrypting DS credentials. (#4344)
Without this upgrades from at least v5 (and earlier) won't work.
2019-11-11 21:49:05 +02:00
Omer Lachish
a0a32be3dd
Admin status page's current tab does not preserve (#4299)
* handle a console warning about passing in string page options

* preserve selected tab in the location hash
2019-11-11 12:04:32 +02:00
Omer Lachish
e0e94d79ac
Restarting rq-scheduler reschedules all periodics (#4302)
* add some logging to scheduler

* schedule jobs only if they are not already scheduled

* jobs scheduled with an interval over 24 hours were not repeated

* schedule version_check using standard scheduling

* clean up old jobs that are not part of the definition anymore

* add some tests

* add one more test to verify that reschedules are not done when not neccesary

* no need to check for func existence - all jobs have a func to run
2019-11-11 09:54:41 +02:00
Omer Lachish
f19d24287e
auto-refresh data RQ jobs admin page (#4298) 2019-11-11 09:42:05 +02:00
Gabriel Dutra
80878abf7b Migrate Settings Screen to React (#4323)
* Migrate settings-screen to React

* Use black instead of blue color for active item

* Revert "Use black instead of blue color for active item"

This reverts commit 0e4ececa6aba68f6484fefaae8ab85153d177bf8.

* Add selectable=false to the Menu
2019-11-10 09:07:40 +02:00
Gabriel Dutra
6716bb390c
Update TagsList and Sidebar to use Ant components (#4338) 2019-11-07 13:41:15 -03:00
Omer Lachish
a33d11de3a
RQ: periodically clear failed jobs (#4306)
* add some logging to scheduler

* clean failed RQ job data from Redis

* move stale job purging to tasks/general.py

* provide better documentation on why we don't reject keys in FailedJobRegistry at the moment

* pleasing the CodeClimate overlords

* simplified clenaup by deleting both job data and registry entry

* use FailedJobRegistry as source of truth for purging

* remove redundant key deletion

* Update redash/settings/__init__.py

Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
2019-11-07 17:00:53 +02:00
Omer Lachish
6f791a092b
Adjust RQ job priorities (#4301)
* prioritize periodic jobs

* declare default queues in inside worker()

* separate send_email to its own queue
2019-11-06 13:36:27 +02:00
Kyle Krueger
cce6546a62 Feature/last x days parameter (#4333)
* Add last 14, 30, 60, and 90 days to DRP.js

Date Range Parameter (DRP)

* Add last 14, 30, 60, and 60 day params to DRP.jsx

DateRangeParameters (DRP)
2019-11-05 16:15:11 +02:00
Ran Byron
5fd78fdb23 New feature - Alert muting (#4276)
* New feature - Alert muting

* pep8 fix

* Fixed backend api update

* whoops semicolon

* Implemented mute
2019-11-02 14:54:26 +02:00
Gabriel Dutra
74dbb8acf3
Skip favorites dropdown loading state on init (#4318) 2019-10-31 13:28:28 -03:00
Omer Lachish
36638be1dd
optimize work horse initialization by configuration mappers on the worker process (#4314) 2019-10-30 09:53:06 +02:00
Gabriel Dutra
82f488d231
Migrate PermissionsEditor to React (#4266)
Co-Authored-By: Arik Fraimovich <arik@arikfr.com>
2019-10-29 12:42:31 -03:00
Arik Fraimovich
7b3943052e
Move the setup scripts to their own home (#4310) 2019-10-28 21:11:21 +02:00
Arik Fraimovich
96a95b7090
Add V8 to the CHANGELOG. 2019-10-28 13:27:34 +02:00
Omer Lachish
accf0f7ac5
show more workers per page. also allow page size selection (#4300) 2019-10-28 09:51:57 +02:00
Arik Fraimovich
88ae639ee4
CircleCI workflow improvements (#4296)
* CircleCI workflow improvements

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

* Fix YAML syntax error.

* Add separate build Docker image step for master branch
2019-10-27 22:27:34 +02:00
Omer Lachish
ba413c210e use rq_redis_connection instead of redis_connection (#4288) 2019-10-25 14:23:24 +03:00
Levko Kravets
7157244eec Migrate Table visualization to React Part 2: Editor (#4175)
* Migrate table editor to React: skeleton, Grid tab

* Columns tab

* Cleanup

* Columns tab: DnD column sorting

* Columns types should be JSX

* New Columns tab UI/X

* Use Sortable component on Columns tab

* Tests: Grid Settings

* Tests: Columns Settings

* Tests: Editors for Text, Number, Boolean and Date/Time columns

* Tests: Editors for Image and Link columns

* Minor UI fix

* Trigger build

* Debounce inputs
2019-10-24 12:46:46 +03:00
Gabriel Dutra
9f7844640a Introduce inheritance to the Parameter structure (#4049)
* Start draft for new Parameter structure

* Add the rest of the methods

* EnumParameter

* QueryBasedDropdownParameter

* DateParameter

* DateRangeParameter

* Update Parameter usage on code

* Merge dynamicValue into normalizedValue

* Add updateLocals and omit unwanted props

* Allow null NumberParameter and omit parentQueryId

* Rename parameter getValue to getExecutionValue

* Update $$value to normalizedValue + omit on save

* Add a few comments

* Remove ngModel property from Parameter

* Use value directly in DateRangeParameter

* Use simpler separator for DateRange url param

* Add backward compatibility

* Use normalizeValue null value for isEmpty

* Start creating jest tests

* Add more tests

* Normalize null value for multi mode in Enum

* Use saved value for param isEmpty
2019-10-24 12:42:30 +03:00
Nicolas Le Manchet
246eca1121 Migrate the application to Python 3 (#4251)
* Make core app compatible with Python 3

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

* Use Python 3.7 as base docker image

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

* Upgrade some requirements to newest versions

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

* Migrate tests to Python 3

* Build frontend on Python 3

* Make the HMAC sign function compatible with Python 3

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

* Use assertCountEqual instead of assertItemsEqual

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

* Remove redundant encoding header for Python 3 modules

* Remove redundant string encoding in CLI

* Rename list() functions in CLI

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

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

* Replace usage of Exception.message in CLI

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

* Adapt test handlers to Python 3

* Fix test that relied on dict ordering

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

* Support encoding memoryview to JSON

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

* Fix test relying on object address ordering

* Decode bytes returned from Redis

* Stop using e.message for most exceptions

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

* Fix writing XLSX files in Python 3

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

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

* Fix test by comparing strings to strings

* Fix another exception message unavailable in Python 3

* Fix export to CSV in Python 3

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

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

* Fix test_outdated_queries_works_scheduled_queries_tracker (use utcnow)

* Make sure Redis connection uses decoded_responses option

* Remove unused imports.

* Use Redis' decode_responses option

* Remove cases of explicit Redis decoding

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

* Don't add decode_responses to Celery Redis connection URL

* Fix displaying error while connecting to SQLite

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

* Fix another missing exception message

* Handle JSON encoding for datasources returning bytes

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

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

* Fix Python 3 compatibility with RQ

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

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

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

- Fix Flask warning.

* Upgrade dependencies

* Remove useless `iter` added by 2to3

* Fix get_next_path tests (#4280)

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

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

* Fix redirect tests:

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

* Remove explicit dependency for Werkzeug

* Switched pytz and certifi to unbinded versions.

* Switch to new library for getting country from IP

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

* Python 3 RQ modifications (#4281)

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

* avoid loading entire job data for queued jobs

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

* get all active RQ queues

* call get_celery_queues in another place

* merge dicts the Python 3 way

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

* Remove legacy Python flake8 tests
2019-10-24 12:42:13 +03:00
Arik Fraimovich
7ffb97232e
Pin Cypress version (#4284) 2019-10-24 12:22:56 +03:00
Omer Lachish
8b9fa53efe extend the result_ttl of refresh_queries to 600 seconds to allow it to continue running periodically even after longer executions (#4283) 2019-10-24 11:56:07 +03:00
Omer Lachish
43b35b6fb4 Monitor general RQ queues (default, periodic and schemas) (#4256)
* track general RQ queues (default, periodic and schemas)

* get all active RQ queues

* call get_celery_queues in another place
2019-10-23 12:31:32 +03:00
Omer Lachish
f0f85ece42 avoid loading entire job data for queued jobs (#4257) 2019-10-23 11:43:31 +03:00
Omer Lachish
612833404b show current worker job (alongside with minor cosmetic column tweaks) (#4262) 2019-10-23 11:20:15 +03:00
Ran Byron
5d58503623
Minor alert bug fixes (#4274) 2019-10-22 16:58:20 +03:00
Ran Byron
3dfad87266
Extracted alert menu button (#4273) 2019-10-22 13:00:16 +03:00