[cuegui] Fix blank Stuck Frame page when default show is missing#2445
Conversation
- StuckFrameControls hardcoded `findShow(os.getenv("SHOW", "pipe"))` during construction, which raised EntityNotFoundException on any deployment without a show named "pipe" (e.g. a fresh setup with no SHOW env var)
- AbstractDockWidget attaches the dock to the main window before its content is built, so the failure left the CueCommander Stuck Frame panel completely blank
- Add `__resolveInitialShow()` helper: use SHOW only when it points to an existing show, otherwise fall back to the first active show, and return None (logging a warning) when no show exists so the panel always renders
- Harden `showChanged()` to ignore empty input and catch lookup failures\
- Add `import opencue.exception`
📝 WalkthroughWalkthrough
ChangesShow Resolution Hardening in StuckFramePlugin
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cuegui/cuegui/plugins/StuckFramePlugin.py`:
- Around line 319-325: The `self.__current_show` variable is not being cleared
when the show input is empty or when the show lookup fails, which allows the
code to continue querying a previously selected show. Add a statement to set
`self.__current_show` to None before the return statement when the show string
is empty (after the `if not show:` check), and also add a statement to set
`self.__current_show` to None in the except block when the
opencue.exception.CueException is caught during the opencue.api.findShow call.
This ensures stale state is cleared whenever an invalid selection path is
encountered.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b184f0fd-2dd2-4a08-9803-b1939602c731
📒 Files selected for processing (1)
cuegui/cuegui/plugins/StuckFramePlugin.py
| show = str(show).strip() | ||
| if not show: | ||
| return | ||
| try: | ||
| self.__current_show = opencue.api.findShow(show) | ||
| except opencue.exception.CueException: | ||
| logger.warning("Unable to find show '%s'.", show) |
There was a problem hiding this comment.
Clear stale show state on invalid selection paths.
On Line 320 (empty input) and Line 324 (lookup failure), self.__current_show is left unchanged. That can keep querying a previously selected show even when the current selection is invalid/empty.
💡 Suggested fix
def showChanged(self, show):
"""Sets current show the one provided."""
show = str(show).strip()
if not show:
+ self.__current_show = None
return
try:
self.__current_show = opencue.api.findShow(show)
except opencue.exception.CueException:
logger.warning("Unable to find show '%s'.", show)
+ self.__current_show = None📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| show = str(show).strip() | |
| if not show: | |
| return | |
| try: | |
| self.__current_show = opencue.api.findShow(show) | |
| except opencue.exception.CueException: | |
| logger.warning("Unable to find show '%s'.", show) | |
| show = str(show).strip() | |
| if not show: | |
| self.__current_show = None | |
| return | |
| try: | |
| self.__current_show = opencue.api.findShow(show) | |
| except opencue.exception.CueException: | |
| logger.warning("Unable to find show '%s'.", show) | |
| self.__current_show = None |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@cuegui/cuegui/plugins/StuckFramePlugin.py` around lines 319 - 325, The
`self.__current_show` variable is not being cleared when the show input is empty
or when the show lookup fails, which allows the code to continue querying a
previously selected show. Add a statement to set `self.__current_show` to None
before the return statement when the show string is empty (after the `if not
show:` check), and also add a statement to set `self.__current_show` to None in
the except block when the opencue.exception.CueException is caught during the
opencue.api.findShow call. This ensures stale state is cleared whenever an
invalid selection path is encountered.
Related Issues
Summarize your change.
findShow(os.getenv("SHOW", "pipe"))during construction, which raised EntityNotFoundException on any deployment without a show named "pipe" (e.g. a fresh setup with no SHOW env var)__resolveInitialShow()helper: use SHOW only when it points to an existing show, otherwise fall back to the first active show, and return None (logging a warning) when no show exists so the panel always rendersshowChanged()to ignore empty input and catch lookup failures\import opencue.exception