Skip to content
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

Merged
merged 8 commits into from
Aug 7, 2024
Merged

Conversation

richsalz
Copy link
Collaborator

@richsalz richsalz commented Mar 16, 2024

List the recordings if the "meeting number" starts with "interim"

Fixes: #6543

@richsalz
Copy link
Collaborator Author

@@ -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 %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% 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' %}

Copy link
Member

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.

Copy link
Collaborator Author

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.

Copy link
Member

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.

Copy link

codecov bot commented Mar 16, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.

Project coverage is 88.77%. Comparing base (c7f6bde) to head (9c1dd11).
Report is 30 commits behind head on main.

Files Patch % Lines
ietf/meeting/models.py 78.57% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@rjsparks
Copy link
Member

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 ?

Looks like it.

This really needs a new (or updated) test.

Copy link
Member

@rjsparks rjsparks left a 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):
Copy link
Member

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?

Copy link
Member

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.

Copy link
Collaborator Author

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 :)

Copy link
Collaborator Author

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

Comment on lines 897 to 899
#register.filter
#define has_notes(meeting):
return meeting.uses_notes()
Copy link
Member

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.

Copy link
Member

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.

Copy link
Collaborator Author

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.

@richsalz richsalz force-pushed the fix-6543 branch 5 times, most recently from 5a99e85 to 89449d7 Compare July 22, 2024 21:32
@richsalz
Copy link
Collaborator Author

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
Copy link
Member

@jennifer-richards jennifer-richards left a 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.

client/agenda/store.js Show resolved Hide resolved
if self.type_id != 'ietf':
return True
num = self.get_number()
return num != None and num >= 108
Copy link
Member

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()
Copy link
Member

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

@@ -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(),
Copy link
Member

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

@richsalz
Copy link
Collaborator Author

richsalz commented Aug 2, 2024

@jennifer-richards I believe I addressed all your feedback, PTAL.

Copy link
Member

@jennifer-richards jennifer-richards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question inline

ietf/meeting/models.py Show resolved Hide resolved
Copy link
Member

@rjsparks rjsparks left a 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.

client/agenda/store.js Show resolved Hide resolved
ietf/meeting/tests_views.py Outdated Show resolved Hide resolved
Also add comment about meeting number field in tests
Copy link
Member

@jennifer-richards jennifer-richards left a 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

client/agenda/AgendaScheduleList.vue Outdated Show resolved Hide resolved
@jennifer-richards
Copy link
Member

I think there was still disagreement about useNotes vs usesNotes. Easier to push a commit than to point at them, but please review that I'm not mixing up similarly named variables in 4e8ce54

rjsparks
rjsparks previously approved these changes Aug 7, 2024
@TohaAbir

This comment was marked as spam.

@rjsparks rjsparks merged commit 0c8db80 into ietf-tools:main Aug 7, 2024
9 checks passed
@richsalz richsalz deleted the fix-6543 branch August 7, 2024 16:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Youtube link is not shown in Notes and Recordings section of past meeting materials
4 participants