Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
refactor: Remove announcement service (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwerner authored Feb 16, 2021
1 parent 5552cf0 commit 69fdbe2
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 107 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## 1.0.0 (2021-02-16)

### ⚠ BREAKING CHANGES

* **core:** Default setup now relies primarily on Kubernetes based solutions. The `ansible` playbook as been deprecated from this repo. Please view the [illumidesk/illumidesk-containers](https://github.com/illumidesk/illumidesk-containers) repo for stand-alone container examples that use the `illumidesk` package.

### Features

* Add announcement for pilot environments ([#317](https://github.com/IllumiDesk/illumidesk/issues/317)) ([3c1a9d2](https://github.com/IllumiDesk/illumidesk/commit/3c1a9d264499d9a6340f4438ba98227a03b26b1e))
* Add default values for the LTI 1.1 authenticator ([#369](https://github.com/IllumiDesk/illumidesk/issues/369)) ([5d1be80](https://github.com/IllumiDesk/illumidesk/commit/5d1be80d27340797848d56e62a1c2fb90b58b3f2))
* Add grader header and footer templates ([#305](https://github.com/IllumiDesk/illumidesk/issues/305)) ([f2be08a](https://github.com/IllumiDesk/illumidesk/commit/f2be08abbbd29871c63c5273e0eb1dd5fb34564c))
* Add option to shutdown server upon logout ([#322](https://github.com/IllumiDesk/illumidesk/issues/322)) ([f751c67](https://github.com/IllumiDesk/illumidesk/commit/f751c6757d6589711327e2f01516cece33e8b1a4))
* Fetch course name from context_title if context_label value is empty ([#497](https://github.com/IllumiDesk/illumidesk/issues/497)) ([174a35e](https://github.com/IllumiDesk/illumidesk/commit/174a35e94180b3aec158b1838d6fe1ee6ade691a))
* Improve the grader notebooks dropdown ([#358](https://github.com/IllumiDesk/illumidesk/issues/358)) ([898c159](https://github.com/IllumiDesk/illumidesk/commit/898c15980f75d2ee15042339a5f0765b4840189d))
* Use postgres with nbgrader ([#339](https://github.com/IllumiDesk/illumidesk/issues/339)) ([d45780b](https://github.com/IllumiDesk/illumidesk/commit/d45780b91f224996a471c9b3b52cbb2874a5925f))

## 0.10.0 (2020-09-17)


Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "illumidesk",
"version": "0.10.0",
"version": "1.1.0",
"description": "Teach and learning with web-based notebooks!",
"scripts": {
"release": "standard-version"
Expand Down
36 changes: 0 additions & 36 deletions src/illumidesk/illumidesk/apis/announcement_service.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/illumidesk/illumidesk/authenticators/authenticator.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from typing import Dict

from illumidesk.apis.jupyterhub_api import JupyterHubAPI
from illumidesk.apis.announcement_service import AnnouncementService
from illumidesk.apis.nbgrader_service import NbGraderServiceHelper
from illumidesk.apis.setup_course_service import register_new_service
from illumidesk.apis.setup_course_service import create_assignment_source_dir
Expand Down Expand Up @@ -85,12 +84,6 @@ async def setup_course_hook(
# launch the new (?) grader-notebook as a service
setup_response = await register_new_service(org_name=ORG_NAME, course_id=course_id)

# In case of new courses launched then execute a rolling update with jhub to reload our configuration file
if setup_response is True:
# notify the user the browser needs to be reload (when traefik redirects to a new jhub)
await AnnouncementService.add_announcement('A new service was detected, please reload this page...')
logger.debug('The current jupyterhub instance will be updated by grader setup service...')

return authentication


Expand Down
30 changes: 0 additions & 30 deletions src/illumidesk/tests/illumidesk/apis/test_announcement_service.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from unittest.mock import patch

from illumidesk.apis.jupyterhub_api import JupyterHubAPI
from illumidesk.apis.announcement_service import AnnouncementService
from illumidesk.apis.nbgrader_service import NbGraderServiceHelper


Expand Down Expand Up @@ -239,34 +238,3 @@ async def test_setup_course_hook_initialize_data_dict(
assert expected_data['course_id'] == result['auth_state']['course_id']
assert expected_data['org'] == os.environ.get('ORGANIZATION_NAME')
assert expected_data['domain'] == local_handler.request.host


@pytest.mark.asyncio()
async def test_setup_course_hook_calls_announcement_service_when_is_new_setup(
setup_course_hook_environ,
make_auth_state_dict,
make_http_response,
make_mock_request_handler,
mock_nbhelper,
):
"""
Is the annuncement service called in new setup?
"""
local_authenticator = Authenticator(post_auth_hook=setup_course_hook)
local_handler = make_mock_request_handler(RequestHandler, authenticator=local_authenticator)
local_authentication = make_auth_state_dict()

response_args = {'handler': local_handler.request, 'body': {'is_new_setup': True}}
with patch.object(JupyterHubAPI, 'add_student_to_jupyterhub_group', return_value=None):
with patch.object(
AsyncHTTPClient,
'fetch',
side_effect=[
make_http_response(**response_args),
None,
], # noqa: E231
):
AnnouncementService.add_announcement = AsyncMock(return_value=None)

await setup_course_hook(local_authenticator, local_handler, local_authentication)
assert AnnouncementService.add_announcement.called

0 comments on commit 69fdbe2

Please sign in to comment.