Repository: ietf-tools/datatracker

Issue:
Meetecho createRoom API call should include room_id parameter
### Description

In order for the slides notification API to work with interim meetings, need to pass a `room_id` to `createRoom`. Per @alexamirante:

> if we want the slides notification thing to work for interims as well, a change is also needed to how you create rooms in Meetecho
you'd need to also specify the room_id in the json you post to createRoom which has to be equal to the DT session_id
so that when you notify slide decks, the session you put there matches our internal room_id

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:

Resolving patch:
diff --git a/ietf/meeting/helpers.py b/ietf/meeting/helpers.py
--- a/ietf/meeting/helpers.py
+++ b/ietf/meeting/helpers.py
@@ -1099,6 +1099,7 @@ def create_interim_session_conferences(sessions):
             try:
                 confs = meetecho_manager.create(
                     group=session.group,
+                    session_id=session.pk,
                     description=str(session),
                     start_time=ts.utc_start_time(),
                     duration=ts.duration,
diff --git a/ietf/utils/meetecho.py b/ietf/utils/meetecho.py
--- a/ietf/utils/meetecho.py
+++ b/ietf/utils/meetecho.py
@@ -115,6 +115,7 @@ def retrieve_wg_tokens(self, acronyms: Union[str, Sequence[str]]):
     def schedule_meeting(
         self,
         wg_token: str,
+        room_id: int,
         description: str,
         start_time: datetime.datetime,
         duration: datetime.timedelta,
@@ -139,6 +140,7 @@ def schedule_meeting(
           }
 
         :param wg_token: token retrieved via retrieve_wg_tokens()
+        :param room_id: int id to identify the room (will be echoed as room.id) 
         :param description: str describing the meeting
         :param start_time: starting time as a datetime
         :param duration: duration as a timedelta
@@ -151,6 +153,7 @@ def schedule_meeting(
                 "meeting/interim/createRoom",
                 api_token=wg_token,
                 json={
+                    "room_id": room_id,
                     "description": description,
                     "start_time": self._serialize_time(start_time),
                     "duration": self._serialize_duration(duration),
@@ -455,9 +458,10 @@ def fetch(self, group):
         response = self.api.fetch_meetings(self.wg_token(group))
         return Conference.from_api_dict(self, response["rooms"])
 
-    def create(self, group, description, start_time, duration, extrainfo=""):
+    def create(self, group, session_id, description, start_time, duration, extrainfo=""):
         response = self.api.schedule_meeting(
             wg_token=self.wg_token(group),
+            room_id=int(session_id),
             description=description,
             start_time=start_time,
             duration=duration,


Test patch:
diff --git a/ietf/meeting/tests_helpers.py b/ietf/meeting/tests_helpers.py
--- a/ietf/meeting/tests_helpers.py
+++ b/ietf/meeting/tests_helpers.py
@@ -487,7 +487,7 @@ def test_create_interim_session_conferences(self, mock):
         mock.reset_mock()
         mock_conf_mgr.create.return_value = [
             Conference(
-                manager=mock_conf_mgr, id=1, public_id='some-uuid', description='desc',
+                manager=mock_conf_mgr, id=int(sessions[0].pk), public_id='some-uuid', description='desc',
                 start_time=timeslots[0].utc_start_time(), duration=timeslots[0].duration, url='fake-meetecho-url',
                 deletion_token='please-delete-me',
             ),
@@ -498,6 +498,7 @@ def test_create_interim_session_conferences(self, mock):
             mock_conf_mgr.create.call_args[1],
             {
                 'group': sessions[0].group,
+                'session_id': sessions[0].id,
                 'description': str(sessions[0]),
                 'start_time': timeslots[0].utc_start_time(),
                 'duration': timeslots[0].duration,
@@ -512,12 +513,12 @@ def test_create_interim_session_conferences(self, mock):
         mock.reset_mock()
         mock_conf_mgr.create.side_effect = [
             [Conference(
-                manager=mock_conf_mgr, id=1, public_id='some-uuid', description='desc',
+                manager=mock_conf_mgr, id=int(sessions[0].pk), public_id='some-uuid', description='desc',
                 start_time=timeslots[0].utc_start_time(), duration=timeslots[0].duration, url='different-fake-meetecho-url',
                 deletion_token='please-delete-me',
             )],
             [Conference(
-                manager=mock_conf_mgr, id=2, public_id='another-uuid', description='desc',
+                manager=mock_conf_mgr, id=int(sessions[1].pk), public_id='another-uuid', description='desc',
                 start_time=timeslots[1].utc_start_time(), duration=timeslots[1].duration, url='another-fake-meetecho-url',
                 deletion_token='please-delete-me-too',
             )],
@@ -528,16 +529,18 @@ def test_create_interim_session_conferences(self, mock):
             mock_conf_mgr.create.call_args_list,
             [
                 ({
-                    'group': sessions[0].group,
-                    'description': str(sessions[0]),
-                    'start_time': timeslots[0].utc_start_time(),
-                    'duration': timeslots[0].duration,
+                     'group': sessions[0].group,
+                     'session_id': sessions[0].id,
+                     'description': str(sessions[0]),
+                     'start_time': timeslots[0].utc_start_time(),
+                     'duration': timeslots[0].duration,
                  },),
                 ({
-                    'group': sessions[1].group,
-                    'description': str(sessions[1]),
-                    'start_time': timeslots[1].utc_start_time(),
-                    'duration': timeslots[1].duration,
+                     'group': sessions[1].group,
+                     'session_id': sessions[1].id,
+                     'description': str(sessions[1]),
+                     'start_time': timeslots[1].utc_start_time(),
+                     'duration': timeslots[1].duration,
                  },),
             ]
         )
diff --git a/ietf/utils/tests_meetecho.py b/ietf/utils/tests_meetecho.py
--- a/ietf/utils/tests_meetecho.py
+++ b/ietf/utils/tests_meetecho.py
@@ -82,7 +82,7 @@ def test_schedule_meeting(self):
                 'rooms': {
                     '3d55bce0-535e-4ba8-bb8e-734911cf3c32': {
                         'room': {
-                            'id': 18,
+                            'id': 18,  # should match room_id in api.schedule_meeting() below
                             'start_time': '2021-09-14 10:00:00',
                             'duration': 130,
                             'description': 'interim-2021-wgname-01',
@@ -97,6 +97,7 @@ def test_schedule_meeting(self):
         api = MeetechoAPI(API_BASE, CLIENT_ID, CLIENT_SECRET)
         api_response = api.schedule_meeting(
             wg_token='my-token',
+            room_id=18,
             start_time=datetime.datetime(2021, 9, 14, 10, 0, 0, tzinfo=datetime.timezone.utc),
             duration=datetime.timedelta(minutes=130),
             description='interim-2021-wgname-01',
@@ -116,6 +117,7 @@ def test_schedule_meeting(self):
         self.assertEqual(
             request.json(),
             {
+                'room_id': 18,
                 'duration': 130,
                 'start_time': '2021-09-14 10:00:00',
                 'extrainfo': 'message for staff',
@@ -485,7 +487,7 @@ def test_create(self, mock_schedule, _):
             'rooms': {
                 'session-1-uuid': {
                     'room': {
-                        'id': 1,
+                        'id': 1,  # value should match session_id param to cm.create() below 
                         'start_time': datetime.datetime(2022,2,4,1,2,3, tzinfo=datetime.timezone.utc),
                         'duration': datetime.timedelta(minutes=45),
                         'description': 'some-description',
@@ -496,7 +498,7 @@ def test_create(self, mock_schedule, _):
             },
         }
         cm = ConferenceManager(settings.MEETECHO_API_CONFIG)
-        result = cm.create('group', 'desc', 'starttime', 'dur', 'extra')
+        result = cm.create('group', '1', 'desc', 'starttime', 'dur', 'extra')
         self.assertEqual(
             result,
             [Conference(
@@ -515,6 +517,7 @@ def test_create(self, mock_schedule, _):
             kwargs,
             {
                 'wg_token': 'atoken',
+                'room_id': 1,
                 'description': 'desc',
                 'start_time': 'starttime',
                 'duration': 'dur',