Skip to content

Configuration for new Dashboard functionality#8

Merged
mircealungu merged 5 commits intozeeguu:masterfrom
kloostert:master
Oct 14, 2017
Merged

Configuration for new Dashboard functionality#8
mircealungu merged 5 commits intozeeguu:masterfrom
kloostert:master

Conversation

@kloostert
Copy link
Copy Markdown
Contributor

This should enable the new unit-test-grouping-by-endpoint functionality of the Dashboard to be used in the Zeeguu-API Travis integration.

The dashboard_test.cfg file in this PR does not contain the SUBMIT_RESULTS_URL option, which means that the test results will not be uploaded to the live deployment of the Dashboard.
This way, unwanted Travis test results will not be displayed on the live Dashboard.

If the results should be uploaded to the live Dashboard again, simply adding the following line to the config file will do the trick:
SUBMIT_RESULTS_URL=https://zeeguu.unibe.ch/api/dashboard/submit-test-results

Comment thread dashboard_test.cfg
LOG_DIR=./
N=5
SUBMIT_RESULTS_URL=https://zeeguu.unibe.ch/api/dashboard/submit-test-results

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm happy that this is not hardcoded anymore :)
but how come is it not needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still needed, but for testing purposes, I turned the uploading of unit test results off.
This way, the live deployment of the Dashboard would not receive many Travis test results for the same Zeeguu-API version while I was testing the Travis configuration.
But this can easily be turned back on again by adding the submit-results-url to the config file whenever necessary.

Comment thread setup.py Outdated
@@ -16,6 +16,7 @@
dependency_links=[
"git+https://github.com/mircealungu/zeeguu-core.git#egg=zeeguu",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread setup.py Outdated
@@ -16,6 +16,7 @@
dependency_links=[
"git+https://github.com/mircealungu/zeeguu-core.git#egg=zeeguu",
"git+https://github.com/mircealungu/python-translators.git#egg=python_translators",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread zeeguu_api/app.py Outdated
try:
import dashboard
dashboard.config.from_file('/home/mircea/zee/http/api/dashboard.cfg')
dashboard.config.from_file('/home/travis/build/zeeguu-ecosystem/Zeeguu-API/dashboard_test.cfg')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm. instead of fighting for this string, maybe it's good to use an envvar for the location of the dashboard.cfg? e.g. DASHBOARD_CFG ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this would be better. I can implement this such that the Dashboard will take the envvar value when specified, and otherwise takes the dashboard.config.from_file().

@mircealungu mircealungu merged commit beb36e7 into zeeguu:master Oct 14, 2017
Comment thread zeeguu_api/app.py
try:
import dashboard
dashboard.config.from_file('/home/travis/build/zeeguu-ecosystem/Zeeguu-API/dashboard_test.cfg')
dashboard.config.from_file('/home/mircea/zee/http/api/dashboard.cfg')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kloostert -- this seems to still be hardcoded, and not using the envvar, right ? :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I reverted that line back to what it was before.
But specifying envvar DASHBOARD_CONFIG will override this location string.
Thus, whenever the envvar is specified, it will use that one, else the location string provided in the from_file() call.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coool! but if we use the envvar then i think we should drop completely this hardcoded string... its's security paranoia... but, we are giving away info about the state of our server :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, a note should be added here about the envvar: https://github.com/flask-dashboard/Flask-Monitoring-Dashboard

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, added some info about it in the setup section of the readme (on the dev branch).
The line which configures the dashboard can be set to dashboard.config.from_file(None).
This will take the envvar instead of the location string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants