-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Show recordings for interims #7197
Conversation
Should the same fix be made for the buttons, at https://github.com/ietf-tools/datatracker/blob/main/ietf/templates/meeting/session_buttons_include.html#L139 ? |
@@ -320,7 +320,7 @@ <h3 class="mt-4">Notes and recordings</h3> | |||
</tr> | |||
{% endif %} | |||
{# Recordings #} | |||
{% if meeting.number|add:"0" >= 80 %} | |||
{% if meeting.number|add:"0" >= 80 or "interim" in meeting.number %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{% if meeting.number|add:"0" >= 80 or "interim" in meeting.number %} | |
{% if meeting.type_id == 'ietf' and meeting.number|add:"0" >= 80 or meeting.type_id != 'ietf' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above suggestion is a bit awkward - it requires knowing the precedence of operators as documented at https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#boolean-operators. It might be better to move this into the view code to get away from the |add:"0"
type-coersion-by-hack-trick anyhow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of something like that. In addition to the one mentioned above, the other tests against meeting 60. What's the significance of meetings 60 and 80? I'd like to remove the magic numbers, replacing with a reasonable function name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they aren't magic (though they aren't complete) - they are places where the shape of proceedings and what was captured at meetings fundamentally changes. 60 was when we first started capturing chatlogs (jabber at the time). 80 was a point at where recording tech changed significantly.
That said, we don't have any Documents of type "recording" before ietf-100, so the code being touched here could could (for meetings of type ietf) not show the recordings block at all for meeting numbers < 100.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7197 +/- ##
==========================================
- Coverage 88.78% 88.77% -0.02%
==========================================
Files 296 299 +3
Lines 41320 41355 +35
==========================================
+ Hits 36687 36712 +25
- Misses 4633 4643 +10 ☔ View full report in Codecov by Sentry. |
Looks like it. This really needs a new (or updated) test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is shaping up nicely. It should go a litter further as noted inline.
@@ -881,3 +881,19 @@ def badgeify(blob): | |||
) | |||
|
|||
return text | |||
|
|||
@register.filter | |||
def has_chat_logs(meeting): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this get the same "Return true for interims" treatment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear that these should be filters - why aren't they methods on Meeting instead? (those would be visible to the templates). I think you were on the way to discovering that with the partial removal of the has_notes filter, and the redundant argument passed to the templates in the views later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to make them methods on the meeting if you prefer. I didn't know templates could invoke methods directly :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this get the same "Return true for interims" treatment?
I guess? I changed it in the commit 466a630
#register.filter | ||
#define has_notes(meeting): | ||
return meeting.uses_notes() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks incomplete - if the intent was to remove the filter L899 should also go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and I suspect all of these should just be removed once the functionality is moved to Meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this was just checking in a snapshot before i got on the plane. will move to templates and fix shortly.
5a99e85
to
89449d7
Compare
Rebased, squashed, fixed the tests. This is ready for review now. |
Add methods uses_notes(), has_recordings(), and uses_chat_logs() to the meeting object (with semantically correct tests) and use them consistently throughout. List the recordings if the "meeting numnber" starts with "interim" Fixes: ietf-tools#6543
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good - thank you for getting rid of the kludgy template code! There are a few nits to adjust that I've noted inline but I don't see any big issues.
ietf/meeting/models.py
Outdated
if self.type_id != 'ietf': | ||
return True | ||
num = self.get_number() | ||
return num != None and num >= 108 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally preferable to write the first test as num is not None
return num != None and num >= 80 | ||
|
||
def has_chat_logs(self): | ||
num = self.get_number() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For symmetry with the other has_*
methods, I think it'd be good to make clear how this behaves with non-"ietf"
meetings
ietf/meeting/views.py
Outdated
@@ -1691,7 +1690,7 @@ def api_get_agenda_data (request, num=None): | |||
}, | |||
"categories": filter_organizer.get_filter_categories(), | |||
"isCurrentMeeting": is_current_meeting, | |||
"useNotes": meeting.uses_notes(), | |||
"uses_notes": meeting.uses_notes(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also stay as a camelCase key (usesNotes
) to match the rest of the structure
style: Use "is not None" instead of "!=" For non-IETF meetings assume chat logs exist
@jennifer-richards I believe I addressed all your feedback, PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if I misread the request for keeping the js variables in camelCase.
Also add comment about meeting number field in tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's still one variable name change needed
I think there was still disagreement about |
List the recordings if the "meeting number" starts with "interim"
Fixes: #6543