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

[MM-53432] Improvements #565

Merged
merged 4 commits into from
Nov 15, 2023
Merged

[MM-53432] Improvements #565

merged 4 commits into from
Nov 15, 2023

Conversation

streamer45
Copy link
Collaborator

Summary

Some minor improvements as requested in the parent PR.

server/bot_api.go Outdated Show resolved Hide resolved
server/utils.go Outdated Show resolved Hide resolved
server/utils.go Outdated Show resolved Hide resolved
@@ -302,6 +303,9 @@ func (s *jobService) RunJob(jobType job.Type, callID, postID, jobID, authToken s
transcriberConfig.PostID = postID
transcriberConfig.TranscriptionID = jobID
transcriberConfig.AuthToken = authToken
if val := os.Getenv("MM_CALLS_TRANSCRIBER_NUM_THREADS"); val != "" {
transcriberConfig.NumThreads, _ = strconv.Atoi(val)
Copy link
Member

Choose a reason for hiding this comment

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

Should we be handling the error with a default, or assume it's correct (because its an admin-controlled env variable)? (Just curious about that kind of thing system-wide, @jupenur )

Copy link
Member

Choose a reason for hiding this comment

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

calls-transcriber implements validation and errors on a zero value. In general we should strive to validate all inputs regardless of the level of trust assumed just to avoid mistakes resulting from bad assumptions, and to make a habit of it. That said, there'd be no direct security impact here even if there was no validation.

0/5 on whether we'd want to add some extra error handling here, too, just to make the admin UX better.

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 is really there to help me test and/or for very advanced use cases at the moment. Until we surface this through proper config I am okay with keeping it this way as the ultimate validation is done on the other side and when zero (error case) a default is used.

name: "special chars",
input: "somefile*with??special/\\chars.mp4",
expected: "somefile_with__special__chars.mp4",
},
Copy link
Member

Choose a reason for hiding this comment

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

Should we test the too-long case also?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, added on the specific function, thanks 👍

@codecov-commenter
Copy link

Codecov Report

Attention: 54 lines in your changes are missing coverage. Please review.

Comparison is base (b3cdc87) 5.68% compared to head (dc15541) 5.75%.

Files Patch % Lines
server/utils.go 15.90% 37 Missing ⚠️
server/bot_api.go 0.00% 14 Missing ⚠️
server/job_service.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           MM-53432    #565      +/-   ##
===========================================
+ Coverage      5.68%   5.75%   +0.07%     
===========================================
  Files            26      26              
  Lines          5011    5071      +60     
===========================================
+ Hits            285     292       +7     
- Misses         4703    4756      +53     
  Partials         23      23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@streamer45 streamer45 added 3: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core committer 3: Security Review labels Nov 15, 2023
@streamer45 streamer45 merged commit e310ebb into MM-53432 Nov 15, 2023
5 of 6 checks passed
@streamer45 streamer45 deleted the MM-53432-improvements branch November 15, 2023 22:08
streamer45 added a commit that referenced this pull request Nov 29, 2023
* handleBotGetProfileForSession

* handleBotPostTranscriptions

* Refactor job api, part I

* Updates

* Job status updates

* Couple transcribing job with recording

* Update offloader

* Updates

* Remove event

* Bump Go version

* Add some docs

* Add e2e test for call transcriptions

* Use leaner API request context

* Verify transcription content

* Bump calls-common

* Fix error message

* Rename param

* Init transcriber runner only if enabled

* Allow status failure report even after job has ended

* Add public.JobInfo

* Bump public module

* Update recorder and transcriber deps

* Update recording ended banner text

* Add processing message

* Update job info types

* Fix transcription file access issues

* Cache current date to avoid refetching

* Update comment

* [MM-53432] Improvements (#565)

* Add Dismiss button to recording job post-processing message

* Implement more human friendly filename for recordings and transcriptions

* Support setting transcriber threads

* Improvements

* Include transcription post ID in metadata

* Add config option to select model size (#566)

* Update transcribing job max duration

* Update strings

* Update deps

* Fix e2e imports

* Use underscore to replace spaces in filenames
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3: Reviews Complete All reviewers have approved the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants