Repository navigation
Update framework 260415 - #10715
Update framework 260415#10715
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughCommand-line/options handling was centralized into a new au::app::AudacityCmdOptions (shared_ptr) and threaded through CommandLineParser, AppFactory, GuiApp, and PluginRegistrationApp. App-level lifecycle and per-context orchestration (au::app::App and large parts of GuiApp/PluginRegistrationApp) were removed or simplified to rely on muse::ui::GuiApplication and BaseApplication startup hooks. CMake stopped injecting compile definitions directly and now generates a configuration header ( Sequence Diagram(s)sequenceDiagram
participant Main as main()
participant CLP as CommandLineParser
participant Options as AudacityCmdOptions
participant Factory as AppFactory
participant App as IApplication (Gui / PluginRegistration)
participant GuiUI as muse::ui::GuiApplication
participant Context as Context (IoC)
participant Scenario as IStartupScenario
Main->>CLP: parse(argc, argv)
CLP-->>Options: populate shared AudacityCmdOptions
Main->>Factory: newApp(Options)
Factory-->>App: construct using Options
alt GUI mode
App->>GuiUI: delegate lifecycle
GuiUI->>Context: makeContextOptions / create context
Context->>Scenario: resolve IStartupScenario
GuiUI->>Scenario: apply Options.startup and run startup scenario
Scenario-->>GuiUI: complete startup / trigger runAfterSplash
else PluginRegistration mode
App->>Context: create context
Context->>Scenario: resolve IRegisterAudioPluginsScenario
App->>Scenario: process plugin registration using Options.audioPluginRegistration
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
13b3ffd to
08f9dba
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 23fd8250-dce9-4244-8b52-7e80bdfa4e53
📥 Commits
Reviewing files that changed from the base of the PR and between 0fdad64 and 13b3ffde8619a8127ba1718b547e2787acb7169d.
📒 Files selected for processing (18)
CMakeLists.txtSetupConfigure.cmakemuse_frameworksrc/app/app_config.h.insrc/app/appfactory.cppsrc/app/appfactory.hsrc/app/cmdoptions.hsrc/app/commandlineparser.cppsrc/app/commandlineparser.hsrc/app/guiapp.cppsrc/app/guiapp.hsrc/app/main.cppsrc/app/pluginregistrationapp.cppsrc/app/pluginregistrationapp.hsrc/appshell/internal/applicationactioncontroller.cppsrc/effects/effects_base/internal/effectsrepositoryhelper.cppsrc/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cppsrc/project/internal/projectactionscontroller.cpp
💤 Files with no reviewable changes (2)
- src/appshell/internal/applicationactioncontroller.cpp
- CMakeLists.txt
08f9dba to
6460342
Compare
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (2)
src/app/pluginregistrationapp.cpp (1)
62-70:⚠️ Potential issue | 🔴 CriticalGuard
scenariobefore calling into it.
resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app")can still return null here.runSelfTest()handles that case, but this path dereferencesscenariounconditionally on Line 68 / Line 70 and turns a missing registration service into a startup crash.Suggested fix
auto scenario = modularity::ioc(ctxId)->resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app"); + if (!scenario) { + LOGE() << "Audio plugin registration scenario not available"; + return 1; + } Ret ret = make_ret(Ret::Code::Ok);src/app/guiapp.cpp (1)
104-106:⚠️ Potential issue | 🟠 MajorDon't bypass
GuiApplication::applyCommandLineOptions().
GuiAppnow derives frommuse::ui::GuiApplication, so the qualified call on Line 106 skips any immediate-base handling that the framework adds there. Call the immediate base override instead.Run this to confirm whether the synced framework defines
GuiApplication::applyCommandLineOptions()separately fromBaseApplication:#!/bin/bash set -euo pipefail echo "== GuiApp declaration ==" fd -i '^guiapp\.h$' | while read -r f; do echo "-- $f --" rg -n -C3 'class\s+GuiApp|applyCommandLineOptions\s*\(' "$f" || true done echo echo "== GuiApplication declarations/definitions ==" fd -i 'guiapplication\.(h|cpp)$' | while read -r f; do echo "-- $f --" rg -n -C3 '\bapplyCommandLineOptions\s*\(' "$f" || true doneIf
GuiApplicationhas its own override, the current qualified call bypasses it.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1b46f23b-6114-44a8-8e41-fc2fa6d5fb69
📥 Commits
Reviewing files that changed from the base of the PR and between 13b3ffde8619a8127ba1718b547e2787acb7169d and 08f9dbab828aec616d5504ff0880921332cf7020.
📒 Files selected for processing (17)
CMakeLists.txtSetupConfigure.cmakemuse_frameworksrc/app/app_config.h.insrc/app/appfactory.cppsrc/app/appfactory.hsrc/app/cmdoptions.hsrc/app/commandlineparser.cppsrc/app/commandlineparser.hsrc/app/guiapp.cppsrc/app/guiapp.hsrc/app/main.cppsrc/app/pluginregistrationapp.cppsrc/app/pluginregistrationapp.hsrc/appshell/internal/applicationactioncontroller.cppsrc/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cppsrc/project/internal/projectactionscontroller.cpp
💤 Files with no reviewable changes (2)
- CMakeLists.txt
- src/appshell/internal/applicationactioncontroller.cpp
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/app/appfactory.cpp (1)
111-185:⚠️ Potential issue | 🔴 CriticalGuard
NyquistEffectsModuleinstantiation to match its conditional include.
NyquistEffectsModuleis only included under#if AU_MODULE_EFFECTS_NYQUIST(lines 56-58) with no stub fallback, but bothnewGuiApp()andnewPluginRegistrationApp()instantiate it unconditionally at lines 148 and 182. WhenAU_MODULE_EFFECTS_NYQUISTis false/undefined, this causes a compile-time error. UnlikeAudioUnitEffectsModule,Lv2EffectsModule, andVstEffectsModulewhich have stub modules, Nyquist lacks a fallback implementation.Minimal fix
- app->addModule(new au::effects::NyquistEffectsModule()); +#if AU_MODULE_EFFECTS_NYQUIST + app->addModule(new au::effects::NyquistEffectsModule()); +#endifApply the same guard to both
newGuiApp()(line 148) andnewPluginRegistrationApp()(line 182).
♻️ Duplicate comments (4)
src/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cpp (1)
57-57:⚠️ Potential issue | 🟠 MajorProvide an Audacity privacy-policy source before switching to the generic accessor.
This now delegates to the framework-level
privacyPolicyUrl()lookup, but the PR still does not add an Audacity-side source for that value. In builds without a customUpdateConfiguration, the preferences dialog can end up with an empty/broken privacy-policy link.SetupConfigure.cmake (1)
164-164:⚠️ Potential issue | 🔴 CriticalPopulate the
AU_*CMake variables before generatingapp_config.h.
#cmakedefineonly emits these macros when the matching CMake variables are set. Thisconfigure_file()still runs without any visible mapping of the real feature toggles into the fiveAU_*names, so the generated header can silently disable cloud/effects branches and compile the wrong module set insrc/app/appfactory.cpp.src/app/commandlineparser.cpp (1)
61-62:⚠️ Potential issue | 🟠 MajorDecode Windows argv before persisting the new string options.
These values still come through
prepareArguments(), which usesQString::fromLocal8Bit(argv[i]). Insrc/app/main.cpp, the UTF-16→UTF-8 normalization happens only afterparse(), so non-ASCII--project-display-name-override/--cloud-project-idinput is already mangled on MSVC builds by the time Lines 125 and 129 store it.Also applies to: 79-129
src/app/pluginregistrationapp.cpp (1)
62-71:⚠️ Potential issue | 🔴 CriticalGuard the resolved registration scenario before dereferencing.
resolve<IRegisterAudioPluginsScenario>on Line 62 can return null if the service isn't registered, butscenario->registerFailedPlugin()andscenario->registerPlugin()are called unconditionally on Lines 68 and 70, resulting in a null-pointer dereference.Proposed fix
auto scenario = modularity::ioc(ctxId)->resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app"); + IF_ASSERT_FAILED(scenario) { + LOGE() << "Audio plugin registration scenario not available"; + return 1; + } Ret ret = make_ret(Ret::Code::Ok);
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: d29722a7-c38e-41e1-ac61-5921408290c0
📥 Commits
Reviewing files that changed from the base of the PR and between 08f9dbab828aec616d5504ff0880921332cf7020 and 64603428e7fa3152a10bdd38d1a8cb21f11d88e4.
📒 Files selected for processing (18)
CMakeLists.txtSetupConfigure.cmakemuse_frameworksrc/app/app_config.h.insrc/app/appfactory.cppsrc/app/appfactory.hsrc/app/cmdoptions.hsrc/app/commandlineparser.cppsrc/app/commandlineparser.hsrc/app/guiapp.cppsrc/app/guiapp.hsrc/app/main.cppsrc/app/pluginregistrationapp.cppsrc/app/pluginregistrationapp.hsrc/appshell/internal/applicationactioncontroller.cppsrc/effects/effects_base/internal/effectsrepositoryhelper.cppsrc/preferences/qml/Audacity/Preferences/updatepreferencesmodel.cppsrc/project/internal/projectactionscontroller.cpp
💤 Files with no reviewable changes (2)
- CMakeLists.txt
- src/appshell/internal/applicationactioncontroller.cpp
6460342 to
927a4cd
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6b33c39d-66db-4df2-9248-7f8b22535700
📥 Commits
Reviewing files that changed from the base of the PR and between 64603428e7fa3152a10bdd38d1a8cb21f11d88e4 and 927a4cdbd08264cf6183fe487ccf22141024fa84.
📒 Files selected for processing (14)
muse_frameworksrc/app/app.cppsrc/app/app.hsrc/app/appfactory.cppsrc/app/appfactory.hsrc/app/cmdoptions.hsrc/app/commandlineparser.cppsrc/app/commandlineparser.hsrc/app/guiapp.cppsrc/app/guiapp.hsrc/app/main.cppsrc/app/pluginregistrationapp.cppsrc/app/pluginregistrationapp.hsrc/appshell/internal/applicationactioncontroller.cpp
💤 Files with no reviewable changes (3)
- src/appshell/internal/applicationactioncontroller.cpp
- src/app/app.h
- src/app/app.cpp
927a4cd to
86344c8
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (3)
src/app/guiapp.cpp (3)
62-72:⚠️ Potential issue | 🟠 MajorClose the splash on startup-abort paths.
If either assertion fails here,
doStartupScenario()returns while the splash created byshowContextSplash()is still live. That leaves the app stuck in the startup-failure path instead of unwinding cleanly.Suggested fix
void GuiApp::doStartupScenario(const muse::modularity::ContextPtr& ctxId) { + auto closeSplash = [this]() { + if (m_splashScreen) { + m_splashScreen->close(); + delete m_splashScreen; + m_splashScreen = nullptr; + } + }; + auto startupScenario = muse::modularity::ioc(ctxId)->resolve<IStartupScenario>("app"); IF_ASSERT_FAILED(startupScenario) { + closeSplash(); return; } @@ const std::shared_ptr<AudacityCmdOptions> options = std::dynamic_pointer_cast<AudacityCmdOptions>(contextData(ctxId).options); IF_ASSERT_FAILED(options) { + closeSplash(); return; }Based on learnings,
IF_ASSERT_FAILED(condition)executes its body only on failure, so these branches currently skip the splash cleanup path.
92-101:⚠️ Potential issue | 🟠 MajorWait for
runOnSplashScreen()to finish before continuing startup.
runOnSplashScreen()is asynchronous, but its returned promise is discarded andrunAfterSplashScreen()is queued immediately. That can close the splash and advance startup while splash-phase work is still running or has already failed.
104-106:⚠️ Potential issue | 🟠 MajorCall the immediate base implementation here, not
BaseApplication.Line 106 explicitly bypasses any
muse::ui::GuiApplication::applyCommandLineOptions()override, so GUI-level option handling in the framework can be skipped. Forward toGuiApplicationinstead.Suggested fix
void GuiApp::applyCommandLineOptions(const std::shared_ptr<muse::CmdOptions>& opt) { - BaseApplication::applyCommandLineOptions(opt); + muse::ui::GuiApplication::applyCommandLineOptions(opt);#!/bin/bash set -euo pipefail echo "== Current call site ==" sed -n '104,110p' src/app/guiapp.cpp echo echo "== GuiApplication declarations/definitions ==" fd -HI 'guiapplication.h' . | while read -r f; do echo "-- $f --" rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true done fd -HI 'guiapplication.cpp' . | while read -r f; do echo "-- $f --" rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true done echo echo "== BaseApplication declarations/definitions ==" fd -HI 'baseapplication.h' . | while read -r f; do echo "-- $f --" rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true done fd -HI 'baseapplication.cpp' . | while read -r f; do echo "-- $f --" rg -n -C3 'applyCommandLineOptions\s*\(' "$f" || true done
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: b4f89a46-a539-4008-b59c-18e477760d8e
📥 Commits
Reviewing files that changed from the base of the PR and between 927a4cdbd08264cf6183fe487ccf22141024fa84 and 86344c838ead493292553ef59415761c309ac2b5.
📒 Files selected for processing (14)
muse_frameworksrc/app/app.cppsrc/app/app.hsrc/app/appfactory.cppsrc/app/appfactory.hsrc/app/cmdoptions.hsrc/app/commandlineparser.cppsrc/app/commandlineparser.hsrc/app/guiapp.cppsrc/app/guiapp.hsrc/app/main.cppsrc/app/pluginregistrationapp.cppsrc/app/pluginregistrationapp.hsrc/appshell/internal/applicationactioncontroller.cpp
💤 Files with no reviewable changes (3)
- src/appshell/internal/applicationactioncontroller.cpp
- src/app/app.h
- src/app/app.cpp
| #cmakedefine AU_BUILD_CLOUD_AUDIOCOM 1 | ||
|
|
||
| #cmakedefine AU_MODULE_EFFECTS_VST 1 | ||
| #cmakedefine AU_MODULE_EFFECTS_NYQUIST 1 | ||
| #cmakedefine AU_MODULE_EFFECTS_LV2 1 | ||
| #cmakedefine AU_MODULE_EFFECTS_AUDIO_UNIT 1 |
There was a problem hiding this comment.
I'm not familiar with #cmakedefine and .in files, but I suppose it'll behave the same, e.g. configuring with -DAU_BUILD_CLOUD_AUDIOCOM=OFF will set the cmake variable and c++ macros off ?
There was a problem hiding this comment.
yes, exactly! We already use the same approach with the framework in muse_framework_config.h.in and au3 's audacity_config.h.in
|
|
||
| Autobot m_autobot; | ||
| AudioPluginRegistration m_audioPluginRegistration; | ||
| std::shared_ptr<AudacityCmdOptions> m_options = std::make_shared<AudacityCmdOptions>(); |
There was a problem hiding this comment.
Could be const ? Or may the code change it somewhere?
| auto scenario = modularity::ioc(ctx)->resolve<muse::audioplugins::IRegisterAudioPluginsScenario>("app"); | ||
| std::shared_ptr<AudacityCmdOptions> options = std::dynamic_pointer_cast<AudacityCmdOptions>(m_appOptions); | ||
| IF_ASSERT_FAILED(options) { | ||
| return 1; |
There was a problem hiding this comment.
An error constant could make the reading a tiny bit faster, e.g. return ERROR or smth
86344c8 to
9a5788c
Compare
|
Tested |
9a5788c to
5b793b4
Compare
Recommended:
QA: