Closed liZe closed 3 years ago
- The only way I found to get a metabase authetication token is to login with my account and get the session token from the HTTP headers. There’s probably a better way to do this.
I didn't review any of this, but that statement seemed odd. Indeed, it seems the only way to use the REST API is via a session token - https://github.com/metabase/metabase/wiki/Using-the-REST-API. That's kinda odd for these types of services, but not insurmountable. What I suggest is we create a dedicated user with standard username/password credentials and then make those credentials available to this code so that it can generate a session token as needed. Whether this is done via travis or our jenkins, I'd allow those credentials to come from environment variables as that's how most CI systems would expose them to you.
Looks like this needs to be refreshed after some parallel changes to the event documentation.
Looks like this needs to be refreshed after some parallel changes to the event documentation.
I’ve included the latest changes of the wiki page.
@wjt I’ve rebased this branch onto master, it’s ready to be reviewed and merged.
I believe the deployment happens in https://github.com/endlessm/azafea/pull/139, right?
I believe the deployment happens in #139, right?
Yes, in #139.
See https://phabricator.endlessm.com/T30895.
This PR has to be merged after #127.
The documentation for known tables and their fields can be uploaded using: ~
sphinx-build docs/source/ docs/build/html/ -b metabase -D metabase_session=<key> -D metabase_url=<url> -E
~sphinx-build docs/source/ docs/build/html/ -b metabase -D metabase_username=<username> -D metabase_password=<password> -D metabase_url=<url> -E
Environment variables (uppercase) can also be used instead of Sphinx properties.
This code uses Sphinx to gather docstrings from the documentation, translate them from ReST to plain text, and upload them on Metabase. It suffers from many problems that can be solved in other pull requests later if needed.
Transforming ReST to plain text is painful. Docutils doesn’t include a plain text generator, we have to use one provided by Sphinx. Unfortunately, this generator is not a "real" Docutils generator: it’s only designed to work with Sphinx, not with Docutils, and it crashes when it meets Sphinx features in ReST. That’s why we have to manually remove most of the Sphinx-specific notations. Using other solutions (Pandoc?) may give better results with less code.
We don’t have documentation for ping events, activation events, unknown events and unknown tables.
We don’t have documentation for many fields, including IDs, fields shared by many tables, foreign keys…
Getting information from Metabase and uploading documentation is slow (~15 minutes for me on the dev platform through VPN). We have to launch one HTTP request per field, because information provided elsewhere (by routes that give information for many fields) are not enough. We could improve this by launching parallel HTTP requests. Or, maybe we don’t care :smile:.
The only way I found to get a metabase authetication token is to login with my account and get the session token from the HTTP headers. There’s probably a better way to do this.
You can see the result on the dev platform: https://metabase.dev.endlessm-sf.com/browse/2