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

SeeItSayItLabel improvements (#593) #792

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

anonymous2585
Copy link
Contributor

Improved the SeeItSayItLabel:

  • Automatically update the label when the button's speech recognition keyword is changed.
  • Allow users to change the pattern "Say {0}" to whatever we want
  • Pattern can be changed programaticaly, that way all localization tool can change it if needed.
  • If the Unity's official localization package is present in the project, a LocalizedString is used for the pattern, allowing to translate the pattern. For instance, use "Say {0}" in english and "Dire {0}" in french.

Added automated test for the label update when the speech keyword is changed.

Fixes #593

@AMollis
Copy link
Contributor

AMollis commented Jun 24, 2024

Changes looks good to me. I would like a second pair of eyes to review before committing

@ms-RistoRK
Copy link
Contributor

@anonymous2585 the PR LGTM but Could you please update your branch to pickup the latest commits from main and let the pipeline re-run Unity-tests?

@anonymous2585
Copy link
Contributor Author

@ms-RistoRK I have rebased my branch on main

@ms-RistoRK
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ms-RistoRK
Copy link
Contributor

ms-RistoRK commented Jun 25, 2024

@anonymous2585 thank you for your contribution. The changes in this PR are breaking a Unity-test run by the pipelines. The root-cause is that speech recognition is disabled in pipelines. Could you please update your PR so that Unity-test run correctly in pipelines with your changes? Here is a commit with an example on how to disable speech recognition during pipeline unity-tests.

anonymous2585 pushed a commit to anonymous2585/MixedRealityToolkit-Unity that referenced this pull request Jun 26, 2024
anonymous2585 pushed a commit to anonymous2585/MixedRealityToolkit-Unity that referenced this pull request Jun 26, 2024
@anonymous2585
Copy link
Contributor Author

I can't view your first link because it has restriced access.

I'm not sure how to replicate the pipeline configuration on my machine. When I run the powershell script Tooling/run_playmode_tests.ps1, all tests in SeeItSayItLabelEnablerTests fail because I never have the log "Speech recognition is not supported on this machine" (it is supported on my machine).

@AMollis
Copy link
Contributor

AMollis commented Jun 26, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ms-RistoRK
Copy link
Contributor

I can't view your first link because it has restriced access.

I'm not sure how to replicate the pipeline configuration on my machine. When I run the powershell script Tooling/run_playmode_tests.ps1, all tests in SeeItSayItLabelEnablerTests fail because I never have the log "Speech recognition is not supported on this machine" (it is supported on my machine).

Thank you for your reply. I apologize to refer to a commit you couldn't access. The piece of code I wanted to share is this one:
image

@ms-RistoRK
Copy link
Contributor

I'm not sure how to replicate the pipeline configuration on my machine. When I run the powershell script Tooling/run_playmode_tests.ps1, all tests in SeeItSayItLabelEnablerTests fail because I never have the log "Speech recognition is not supported on this machine" (it is supported on my machine).

Hello @anonymous2585, I understand your situation. I would recommend to use the pipelines we have in place in this repo already. One easy way to trigger the execution of the pipelines is by just adding a comment in the PR with following content: '/azp run' for example:
image
Once you add that comment to the PR then the build pipelines are triggered and checks are executed.

As for disabling the SpeechInteractor in your test you can add code similar to this at the beginning of your test:
image
and it will disable the SpeechInteractor. Submit a commit to your PR and run the pipelines as explained above.
Note: The pipelines does run automatically for every new commit in the PR but sometimes they ... mmmmmmhhhh ... lets say: "have glitches" and don't run :P ... you can also check the results of the pipelines execution at the end of the PR as shown next:
image
Click on the pointed "Details" link to access the logs of the execution and reach per-test results.

@anonymous2585
Copy link
Contributor Author

@ms-RistoRK I can see the piece of code from the beginning. What I can't see is the per-test results details of the pipeline on https://dev.azure.com/. Even when I log to my microsoft account, I'm unauthorized.

I don't understand why my new test should disable the speech interactor while the existing tests are ok with it enabled. I copy/pasted the structure of them.

@ms-RistoRK
Copy link
Contributor

I don't understand why my new test should disable the speech interactor while the existing tests are ok with it enabled. I copy/pasted the structure of them.

My bad, I was in another context (XRI3 migration). Whenever you need a detailed result of a failing test please post a comment in your PR requesting the detailed result and we will gladly provide it to you. Unfortunately, we cannot share access to our internal systems to external personnel.

As for your latest run here is the detailed output of the failing test, hope this helps:
image

@anonymous2585
Copy link
Contributor Author

/azp run

Copy link

Commenter does not have sufficient privileges for PR 792 in repo MixedRealityToolkit/MixedRealityToolkit-Unity

anonymous2585 pushed a commit to anonymous2585/MixedRealityToolkit-Unity that referenced this pull request Jul 1, 2024
@anonymous2585
Copy link
Contributor Author

@ms-RistoRK Thank you for the details, it has helped a lot!
During my new test, I change the keyword on the button, this triggers a new KeywordRecognizer to be created at next update, but KeywordRecognizer is unsupported in the pipeline runner, so the exception is expected.

One easy way to trigger the execution of the pipelines is by just adding a comment in the PR with following content: '/azp run'

As you can see, I can't run the pipeline by myself, please start it to see if it's fixed now.

anonymous2585 pushed a commit to anonymous2585/MixedRealityToolkit-Unity that referenced this pull request Jul 11, 2024
@ms-RistoRK
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ms-RistoRK
Copy link
Contributor

ms-RistoRK commented Jul 12, 2024

@anonymous2585 Hello, we had a broken build pipeline after a VM image update. The issue has been fixed and available in main branch. You may want to update your branch to pick that change. Have a great weekend! :)

anonymous2585 pushed a commit to anonymous2585/MixedRealityToolkit-Unity that referenced this pull request Jul 16, 2024
anonymous2585 pushed a commit to anonymous2585/MixedRealityToolkit-Unity that referenced this pull request Jul 16, 2024
anonymous2585 pushed a commit to anonymous2585/MixedRealityToolkit-Unity that referenced this pull request Jul 16, 2024
@anonymous2585
Copy link
Contributor Author

@ms-RistoRK Hello, no problem.
I just rebased my branch, you can re-launch the pipeline.

@MaxPalmer-UH
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@david-c-kline
Copy link
Contributor

@anonymous2585, As others have said. Thank you for your contribution. My apologies for not reviewing this sooner.

Wanted to leave a note that I am approving and merging this change. Thanks again!

david-c-kline
david-c-kline previously approved these changes Aug 19, 2024
@david-c-kline david-c-kline enabled auto-merge (squash) August 19, 2024 23:25
@keveleigh
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines +54 to +61
#if UNITY_LOCALIZATION_PRESENT
[SerializeField]
[Tooltip("The LocalizedString that define the label pattern. Use a smart string with one argument that will be replaced by the button's speech recognition keyword (e.g: \"Say '{0}'\").")]
private LocalizedString localizedPattern;
#else
[SerializeField]
[Tooltip("The patern for the see-it say-it label using string.Format()")]
private string pattern = "Say '{0}'";
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have any prefabs with this script on them in an MRTK package? If so, I wonder if this will lead to Unity logs (Saving Prefab to immutable folder is not allowed) around trying to reserialize immutable files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great question @keveleigh! I missed that one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, some prefab use this script ("Action Button", "Action Button Checkbox", "SimpleActionButton" and maybe more).

I use this improvement in my main project for a long time, and never seen this message. In what situation to you think it can happen? User can't save (= reserialize) prefabs that are in a package.

@david-c-kline david-c-kline dismissed their stale review August 20, 2024 18:05

PR needs some small updates.

@david-c-kline
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@anonymous2585
Copy link
Contributor Author

Oh, good catch @david-c-kline! It never caused me errors in my project, but could have. Thank you for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Improvements on SeeItSayItLabelEnabler (translation + auto-update)
6 participants