Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.

Refactor mimic_tts to not load config when importing #2888

Conversation

forslund
Copy link
Collaborator

Description

Hitting the entire configuration fetching routine with call to the backend is not polite to do when just importing the file. This moves the config lookup out of the global scope and into special functions for finding the mimic binary and looking up the data path for the subscriber voices.

How to test

Ensure that the unittests still work and that the good old Alan Pope voice can be heard :)

Contributor license agreement signed?

CLA [ Yes ]

@forslund forslund added the Type: Refactoring and other improvements Improvement of code and documentation that does not alter functionality. label Apr 28, 2021
@devops-mycroft devops-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Apr 28, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #2888 (f3246b4) into dev (b712b0e) will increase coverage by 0.02%.
The diff coverage is 76.92%.

❗ Current head f3246b4 differs from pull request most recent head 5e965d4. Consider uploading reports for the commit 5e965d4 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2888      +/-   ##
==========================================
+ Coverage   52.59%   52.62%   +0.02%     
==========================================
  Files         123      123              
  Lines       10989    10997       +8     
==========================================
+ Hits         5780     5787       +7     
- Misses       5209     5210       +1     
Impacted Files Coverage Δ
mycroft/tts/mimic_tts.py 82.07% <76.92%> (+0.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b712b0e...5e965d4. Read the comment docs.

mycroft/tts/mimic_tts.py Outdated Show resolved Hide resolved
@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

Hitting the entire configuration fetching routine with call to the
backend is not polite to do when just importing the file. This moves the
config lookup out of the global scope and into special functions for
finding the mimic binary and looking up the data path for the subscriber
voices.
Default config will generally always have a mimic block but in
combination with newer Mycroft variants a more defensive approach is
probably good
@forslund forslund force-pushed the refactor/mimic_tts-dont-load-config-on-import branch from 5e965d4 to d884da5 Compare April 28, 2021 20:33
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results).
Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

1 similar comment
@devops-mycroft
Copy link

Voight Kampff Integration Test Failed (Results).
Mycroft logs are also available: skills.log, audio.log, voice.log, bus.log, enclosure.log

@devops-mycroft
Copy link

Voight Kampff Integration Test Succeeded (Results)

@krisgesling krisgesling added Merge after next release For large changes that look good, but we want to keep in Dev a little longer Status: Accepted PR has been reviewed and accepted. There must be some reason why it isn't being merged. labels May 11, 2021
Copy link
Contributor

@krisgesling krisgesling left a comment

Choose a reason for hiding this comment

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

Looks great, thanks Ake!

JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request May 13, 2021
this commit should be dropped in next rebase/sync with mycroft-core
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request May 14, 2021
- backport MycroftAI#2888
- dont load remote config unless needed
- identity file handling tweaks
- dont auto create xdg paths (this was triggering some race conditions that killed the whole process when multiple places attempted to create the folder at same time, a simple string definition should not be creating directories)
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request May 14, 2021
adds XDG support
JarbasAl added a commit to HelloChatterbox/HolmesIV that referenced this pull request May 14, 2021
adds XDG support

Co-authored-by: jarbasal <[email protected]>
@krisgesling krisgesling merged commit 891784a into MycroftAI:dev May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) Merge after next release For large changes that look good, but we want to keep in Dev a little longer Status: Accepted PR has been reviewed and accepted. There must be some reason why it isn't being merged. Type: Refactoring and other improvements Improvement of code and documentation that does not alter functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants