Code review comment for lp:~frankban/juju-quickstart/new-auth-api-endpoint

Revision history for this message
Francesco Banconi (frankban) wrote :

Reviewers: mp+249102_code.launchpad.net,

Message:
Please take a look.

Description:
Add support for new Juju WebSocket API endpoints.

Recent Juju versions introduced a new API endpoint
path. In essence, instead of the usual
"wss://<address>:17070", the new
"wss://<address>:17070/environment/<env-uuid>/api"
is used to connect to the API.
This allows for connecting to a specific environment
in a multi-environment state server scenario.

In this branch the new API endpoint is used if a recent
Juju version is in use, and if it is possible to retrieve
the environment UUID from the jenv file.

Also, when connecting to the GUI server (for creating
the auth token or for deploying bundles), use the new
GUI server API endpoints when possible, i.e. when the
charm is recent enough to support redirecting requests
to the new Juju endpoints.
Note that this feature is assumed to land in the next
juju-gui charm release (see settings.py). If that's
not the case, we'll need to increase the charm revisions
in settings.MINIMUM_REVISIONS_FOR_NEW_API_ENDPOINT
before releasing the new Quickstart.

Tests: `make check`

QA:
- bootstrap quickstart as usual: `devenv/bin/juju-quickstart`;
- check that, if you are using juju devel (1.22beta), quickstart
   properly connect to the new API endpoint;
- run quickstart again to deploy a bundle, e.g.:
   `devenv/bin/juju-quickstart bundle:mediawiki/single`;
- ensure that the deployment request succeeds;
- if possible, do the above with and older version of Juju,
   to ensure backward compatibility.

Done, thank you!

https://code.launchpad.net/~frankban/juju-quickstart/new-auth-api-endpoint/+merge/249102

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/199490043/

Affected files (+443, -91 lines):
   A [revision details]
   M quickstart/app.py
   M quickstart/jujutools.py
   M quickstart/manage.py
   M quickstart/models/charms.py
   M quickstart/models/jenv.py
   M quickstart/settings.py
   M quickstart/tests/helpers.py
   M quickstart/tests/models/test_charms.py
   M quickstart/tests/models/test_jenv.py
   M quickstart/tests/test_app.py
   M quickstart/tests/test_jujutools.py
   M quickstart/tests/test_manage.py

« Back to merge proposal