datatracker icon indicating copy to clipboard operation
datatracker copied to clipboard

fix: display session lengths and conflicts in sess scheduled emails

Open microamp opened this issue 1 year ago • 1 comments

fixes #7874

In draft currently to get some feedback. Also, to discuss how to write unit tests for email content in general.


The session_info.txt inner template is being loaded in multiple templates.

ietf/secr/templates/meetings/session_schedule_notification.txt
19:{% include "includes/session_info.txt" %}{% endtimezone %}

ietf/secr/templates/sreq/session_approval_notification.txt
15:{% include "includes/session_info.txt" %}

ietf/secr/templates/sreq/session_request_notification.txt
5:{% include "includes/session_info.txt" %}

The following keys were missing for session schedule emails:

  • session_lengths

  • session.outbound_conflicts (nested)

With the change, the context dictionary looks like the following.

{'agenda_note': '',
 'baseurl': 'https://datatracker.ietf.org',
 'group': <Group: Measurement and Analysis for Protocols>,
 'items': [{'duration': '2:00',
            'period': '0930-1130 America/Vancouver',
            'session': <Session: IETF-120: maprg  Wed-1630>,
            'timeslot': <TimeSlot: 120: 07-24 16:30-18:30 Session I, Georgia B>}],
 'login': <Person: Mirja Kühlewind>,
 'meeting': <Meeting: IETF-120>,
 'session': {'adjacent_with_wg': None,
             'attendees': 100,
             'bethere': [],
             'comments': 'Please also deconflict the sconepro BoF',
             'constraint_chair_conflict': 'tcpm iabopen quic taps masque '
                                          'privacypass webtrans moq mimi',
             'constraint_tech_overlap': 'v6ops tsvwg tls secdispatch saag '
                                        'rtgarea panrg opsawg irtfopen intarea '
                                        'iccrg httpbis dnsop dispatch bmwg '
                                        'artarea 6man gendispatch iotops ippm '
                                        'ppm openpgp pearg',
             'num_session': 1,
             'outbound_conflicts': ['Chair conflict: tcpm iabopen quic taps '
                                    'masque privacypass webtrans moq mimi',
                                    'Technology overlap: v6ops tsvwg tls '
                                    'secdispatch saag rtgarea panrg opsawg '
                                    'irtfopen intarea iccrg httpbis dnsop '
                                    'dispatch bmwg artarea 6man gendispatch '
                                    'iotops ippm ppm openpgp pearg'],  # added
             'resources': <QuerySet []>,
             'session_time_relation': None,
             'session_time_relation_display': None,
             'third_session': False,
             'timeranges': [],
             'timeranges_display': []},
 'session_lengths': [datetime.timedelta(seconds=7200)],  # added
 'to_name': 'Mirja Kühlewind'}

microamp avatar Sep 02 '24 21:09 microamp

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.78%. Comparing base (c7f6bde) to head (75a539e). Report is 298 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7887      +/-   ##
==========================================
- Coverage   88.78%   88.78%   -0.01%     
==========================================
  Files         296      304       +8     
  Lines       41320    41452     +132     
==========================================
+ Hits        36687    36802     +115     
- Misses       4633     4650      +17     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Sep 02 '24 23:09 codecov[bot]