Skip to content

Commit 6cf8b6d

Browse files
authored
Merge pull request #1 from getredash/master
update
2 parents 121a44e + fbf4dae commit 6cf8b6d

File tree

340 files changed

+18391
-13367
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

340 files changed

+18391
-13367
lines changed

.circleci/Dockerfile.cypress

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM cypress/browsers:chrome67
33
ENV APP /usr/src/app
44
WORKDIR $APP
55

6-
RUN npm install --no-save cypress @percy/cypress > /dev/null
6+
RUN npm install --no-save puppeteer@1.10.0 cypress@^3.1.5 @percy/cypress@^0.2.3 atob@2.1.2 > /dev/null
77

88
COPY cypress $APP/cypress
99
COPY cypress.json $APP/cypress.json

.circleci/config.yml

+21-21
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
environment:
5959
COMPOSE_FILE: .circleci/docker-compose.cypress.yml
6060
COMPOSE_PROJECT_NAME: cypress
61-
PERCY_TOKEN_ENCODED: MWM3OGUzNzk4ZWQ2NTE4YTBhMDAwZDNiNWE1Nzc4ZjEzZjYyMzY1MjE0NjY0NDRiOGE5ODc5ZGYzYTU4ZmE4NQ==
61+
PERCY_TOKEN_ENCODED: ZGRiY2ZmZDQ0OTdjMzM5ZWE0ZGQzNTZiOWNkMDRjOTk4Zjg0ZjMxMWRmMDZiM2RjOTYxNDZhOGExMjI4ZDE3MA==
6262
docker:
6363
- image: circleci/node:8
6464
steps:
@@ -96,9 +96,7 @@ jobs:
9696
- setup_remote_docker
9797
- checkout
9898
- run: .circleci/update_version
99-
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
100-
- run: docker build -t redash/redash:$(.circleci/docker_tag) .
101-
- run: docker push redash/redash:$(.circleci/docker_tag)
99+
- run: .circleci/docker_build
102100
workflows:
103101
version: 2
104102
build:
@@ -109,21 +107,23 @@ workflows:
109107
- frontend-unit-tests
110108
- frontend-e2e-tests
111109
- build-tarball:
112-
requires:
113-
- backend-unit-tests
114-
filters:
115-
tags:
116-
only: /v[0-9]+(\.[0-9\-a-z]+)*/
117-
branches:
118-
only:
119-
- master
120-
- /release\/.*/
110+
requires:
111+
- backend-unit-tests
112+
- frontend-unit-tests
113+
- frontend-e2e-tests
114+
filters:
115+
branches:
116+
only:
117+
- master
118+
- /release\/.*/
121119
- build-docker-image:
122-
requires:
123-
- backend-unit-tests
124-
filters:
125-
branches:
126-
only:
127-
- master
128-
- preview-build
129-
- /release\/.*/
120+
requires:
121+
- backend-unit-tests
122+
- frontend-unit-tests
123+
- frontend-e2e-tests
124+
filters:
125+
branches:
126+
only:
127+
- master
128+
- preview-image
129+
- /release\/.*/

.circleci/docker-compose.cypress.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
REDASH_LOG_LEVEL: "INFO"
2424
REDASH_REDIS_URL: "redis://redis:6379/0"
2525
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
26-
QUEUES: "queries,scheduled_queries,celery"
26+
QUEUES: "queries,scheduled_queries,celery,schemas"
2727
WORKERS_COUNT: 2
2828
cypress:
2929
build:

.circleci/docker_build

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
VERSION=$(jq -r .version package.json)
3+
VERSION_TAG=$VERSION.b$CIRCLE_BUILD_NUM
4+
5+
docker login -u $DOCKER_USER -p $DOCKER_PASS
6+
7+
if [ $CIRCLE_BRANCH = master ] || [ $CIRCLE_BRANCH = preview-image ]
8+
then
9+
docker build -t redash/redash:preview -t redash/preview:$VERSION_TAG .
10+
docker push redash/redash:preview
11+
docker push redash/preview:$VERSION_TAG
12+
else
13+
docker build -t redash/redash:$VERSION_TAG .
14+
docker push redash/redash:$VERSION_TAG
15+
fi
16+
17+
echo "Built: $VERSION_TAG"

.circleci/docker_tag

-10
This file was deleted.

.codeclimate.yml

+29-13
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
1-
engines:
1+
version: "2"
2+
checks:
3+
complex-logic:
4+
enabled: false
5+
file-lines:
6+
enabled: false
7+
method-complexity:
8+
enabled: false
9+
method-count:
10+
enabled: false
11+
method-lines:
12+
config:
13+
threshold: 100
14+
nested-control-flow:
15+
enabled: false
16+
identical-code:
17+
enabled: false
18+
plugins:
219
pep8:
320
enabled: true
421
eslint:
522
enabled: true
6-
channel: "eslint-3"
23+
channel: "eslint-5"
724
config:
825
config: client/.eslintrc.js
926
checks:
1027
import/no-unresolved:
1128
enabled: false
12-
ratings:
13-
paths:
14-
- "redash/**/*.py"
15-
- "client/**/*.js"
16-
exclude_paths:
17-
- tests/**/*.py
18-
- migrations/**/*.py
19-
- old_migrations/**/*.py
20-
- setup/**/*
21-
- bin/**/*
22-
29+
no-multiple-empty-lines: # TODO: Enable
30+
enabled: false
31+
exclude_patterns:
32+
- "tests/**/*.py"
33+
- "migrations/**/*.py"
34+
- "setup/**/*"
35+
- "bin/**/*"
36+
- "**/node_modules/"
37+
- "client/dist/"
38+
- "**/*.pyc"

.dockerignore

+8
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,12 @@ client/dist/
33
node_modules/
44
.tmp/
55
.venv/
6+
venv/
67
.git/
8+
/.codeclimate.yml
9+
/.coverage
10+
/coverage.xml
11+
/.circleci/
12+
/.github/
13+
/netlify.toml
14+
/setup/

.github/PULL_REQUEST_TEMPLATE.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## What type of PR is this? (check all applicable)
2+
<!-- Please leave only what's applicable -->
3+
4+
- [ ] Refactor
5+
- [ ] Feature
6+
- [ ] Bug Fix
7+
- [ ] New Query Runner (Data Source)
8+
- [ ] New Alert Destination
9+
- [ ] Other
10+
11+
## Description
12+
13+
## Related Tickets & Documents
14+
15+
## Mobile & Desktop Screenshots/Recordings (if there are UI changes)

.github/support.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Configuration for Support Requests - https://github.com/dessant/support-requests
2+
3+
# Label used to mark issues as support requests
4+
supportLabel: Support Question
5+
6+
# Comment to post on issues marked as support requests, `{issue-author}` is an
7+
# optional placeholder. Set to `false` to disable
8+
supportComment: >
9+
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports
10+
and planned work. However, this issue appears to be a support request.
11+
Please use [our forum](https://discuss.redash.io) to get help.
12+
13+
# Close issues marked as support requests
14+
close: true
15+
16+
# Lock issues marked as support requests
17+
lock: false
18+
19+
# Assign `off-topic` as the reason for locking. Set to `false` to disable
20+
setLockReason: true
21+
22+
# Repository to extend settings from
23+
# _extends: repo

.github/weekly-digest.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Configuration for weekly-digest - https://github.com/apps/weekly-digest
2+
publishDay: mon
3+
canPublishIssues: true
4+
canPublishPullRequests: true
5+
canPublishContributors: true
6+
canPublishStargazers: true
7+
canPublishCommits: true

CONTRIBUTING.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ The following is a set of guidelines for contributing to Redash. These are guide
66

77
## Quick Links:
88

9-
- [Feature Roadmap](https://trello.com/b/b2LUHU7A/redash-roadmap)
109
- [Feature Requests](https://discuss.redash.io/c/feature-requests)
1110
- [Documentation](https://redash.io/help/)
1211
- [Blog](https://blog.redash.io/)
@@ -61,7 +60,7 @@ If you would like to suggest an enhancement or ask for a new feature:
6160

6261
### Documentation
6362

64-
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/website/_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.
63+
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.
6564

6665
## Additional Notes
6766

bin/docker-entrypoint

+12-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -e
33

44
worker() {
55
WORKERS_COUNT=${WORKERS_COUNT:-2}
6-
QUEUES=${QUEUES:-queries,scheduled_queries,celery}
6+
QUEUES=${QUEUES:-queries,scheduled_queries,celery,schemas}
77

88
echo "Starting $WORKERS_COUNT workers for queues: $QUEUES..."
99
exec /usr/local/bin/celery worker --app=redash.worker -c$WORKERS_COUNT -Q$QUEUES -linfo --maxtasksperchild=10 -Ofair
@@ -27,6 +27,10 @@ create_db() {
2727
exec /app/manage.py database create_tables
2828
}
2929

30+
celery_healthcheck() {
31+
exec /usr/local/bin/celery inspect ping --app=redash.worker -d celery@$HOSTNAME
32+
}
33+
3034
help() {
3135
echo "Redash Docker."
3236
echo ""
@@ -36,9 +40,11 @@ help() {
3640
echo "server -- start Redash server (with gunicorn)"
3741
echo "worker -- start Celery worker"
3842
echo "scheduler -- start Celery worker with a beat (scheduler) process"
43+
echo "celery_healthcheck -- runs a Celery healthcheck. Useful for Docker's HEALTHCHECK mechanism."
3944
echo ""
4045
echo "shell -- open shell"
4146
echo "dev_server -- start Flask development server with debugger and auto reload"
47+
echo "debug -- start Flask development server with remote debugger via ptvsd"
4248
echo "create_db -- create database tables"
4349
echo "manage -- CLI to manage redash"
4450
echo "tests -- run tests"
@@ -72,6 +78,11 @@ case "$1" in
7278
export FLASK_DEBUG=1
7379
exec /app/manage.py runserver --debugger --reload -h 0.0.0.0
7480
;;
81+
debug)
82+
export FLASK_DEBUG=1
83+
export REMOTE_DEBUG=1
84+
exec /app/manage.py runserver --debugger --no-reload -h 0.0.0.0
85+
;;
7586
shell)
7687
exec /app/manage.py shell
7788
;;

client/.babelrc

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
2-
"presets": ["env", "react", "stage-2"],
2+
"presets": [
3+
["@babel/preset-env", {
4+
"targets": "> 0.5%, last 2 versions, Firefox ESR, ie 11, not dead",
5+
"useBuiltIns": "usage"
6+
}],
7+
"@babel/preset-react"
8+
],
39
"plugins": [
410
"angularjs-annotate",
5-
"transform-object-assign",
11+
"@babel/plugin-proposal-class-properties",
12+
"@babel/plugin-transform-object-assign",
613
["babel-plugin-transform-builtin-extend", {
714
"globals": ["Error"]
815
}]

client/.eslintrc.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = {
1818
'no-param-reassign': 0,
1919
'no-mixed-operators': 0,
2020
'no-underscore-dangle': 0,
21+
"no-use-before-define": ["error", "nofunc"],
2122
"prefer-destructuring": "off",
2223
"prefer-template": "off",
2324
"no-restricted-properties": "off",
@@ -26,15 +27,24 @@ module.exports = {
2627
"no-lonely-if": "off",
2728
"consistent-return": "off",
2829
"no-control-regex": "off",
30+
'no-multiple-empty-lines': 'warn',
2931
"no-script-url": "off", // some <a> tags should have href="javascript:void(0)"
32+
'operator-linebreak': 'off',
33+
'react/destructuring-assignment': 'off',
3034
"react/jsx-filename-extension": "off",
35+
'react/jsx-one-expression-per-line': 'off',
3136
"react/jsx-uses-react": "error",
3237
"react/jsx-uses-vars": "error",
38+
'react/jsx-wrap-multilines': 'warn',
39+
'react/no-access-state-in-setstate': 'warn',
3340
"react/prefer-stateless-function": "warn",
3441
"react/forbid-prop-types": "warn",
3542
"react/prop-types": "warn",
3643
"jsx-a11y/anchor-is-valid": "off",
3744
"jsx-a11y/click-events-have-key-events": "off",
45+
"jsx-a11y/label-has-associated-control": ["warn", {
46+
"controlComponents": true
47+
}],
3848
"jsx-a11y/label-has-for": "off",
3949
"jsx-a11y/no-static-element-interactions": "off",
4050
"max-len": ['error', 120, 2, {
@@ -43,6 +53,8 @@ module.exports = {
4353
ignoreRegExpLiterals: true,
4454
ignoreStrings: true,
4555
ignoreTemplateLiterals: true,
46-
}]
56+
}],
57+
"no-else-return": ["error", {"allowElseIf": true}],
58+
"object-curly-newline": ["error", {"consistent": true}],
4759
}
4860
};
8.08 KB
Loading
2.57 KB
Loading
Loading
-6.34 KB
Loading

0 commit comments

Comments
 (0)