Skip to content

Fix guest token errors - #163

Merged
bmtcril merged 3 commits into
mainfrom
bmtcril/fix_guest_token_errors
Jul 31, 2025
Merged

Fix guest token errors#163
bmtcril merged 3 commits into
mainfrom
bmtcril/fix_guest_token_errors

Conversation

@bmtcril

@bmtcril bmtcril commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

Adds better error handling and use tutor-contrib-aspects' ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS setting to give more control over in-context metrics when using older versions of tutor-contrib-aspects or pre-Sumac named releases. When this flag is false we do not try to get guest tokens for the in-context dashboards when displaying the embedded Superset dashboards in the LMS Instructor dashboard.

To manually test:

Set up a Tutor Redwood environment

  • Install tutor-contrib-aspects v2.2.0 or above
  • Mount this branch
  • Set ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS = False
  • Rebuild openedx, mfe, aspects, aspects-superset images
  • Tutor init
  • Check that the Superset dashboards load in the Instructor dashboard
  • Check that now Analytics buttons appear in Studio (should be impossible)

Upgrade your tutor install to Sumac, Teak, or nightly

  • Stop your environment
  • pip upgrade Tutor, tutor-mfe, any other plugins
  • Save config
  • do convert-mysql-utf8mb4-charset
  • Rebuild images as above
  • Run the tutor upgrade script --from redwood
  • Start your environment

Test

  • Check that in context metrics still doesn't appear
  • Check that instructor dashboard Superset dashboards load without error

Turn on in-context metrics

  • Stop your environment
  • Set ASPECTS_ENABLE_STUDIO_IN_CONTEXT_METRICS True
  • Save config
  • Rebuild the mfe image
  • Start your environment

Test

  • Confirm in-context metrics show up in studio and work (Analytics button at the top, chart icon on some subsections)
  • Confirm that instructor dashboard Superset dashboards still work
  • Confirm that Superset access still works

Closes: #162

Merge checklist:
Check off if complete or not applicable:

  • Version bumped
  • Documentation updated (not only docstrings)
  • Fixup commits are squashed away
  • Unit tests added/updated
  • Manual testing instructions provided
  • Noted any: Concerns, dependencies, migration issues, deadlines, tickets

@github-actions

github-actions Bot commented Jul 23, 2025

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  platform_plugin_aspects
  __init__.py
  utils.py
  views.py
Project Total  

This report was generated by python-coverage-comment-action

@bmtcril
bmtcril force-pushed the bmtcril/fix_guest_token_errors branch from e212037 to e41fb23 Compare July 23, 2025 20:10
Comment thread platform_plugin_aspects/tests/test_xblock.py Outdated
This top level settings lets us decide which dashboards to include when
asking for Superset guest tokens, which fixes issues in OeX releases
before Sumac and where newer versions of platform-plugin-aspects are
used with older versions of tutor-contrib-aspects.
@bmtcril
bmtcril force-pushed the bmtcril/fix_guest_token_errors branch from e41fb23 to 8b6fd83 Compare July 23, 2025 20:30
Comment thread README.rst Outdated
Previously the error messages sent upstream were eaten, making debugging
very difficult. This ensures the correct messages are logged.
@bmtcril
bmtcril force-pushed the bmtcril/fix_guest_token_errors branch from 4101873 to 4f9d7cf Compare July 30, 2025 14:08
Co-authored-by: Sara Burns <sburns@axim.org>
bmtcril added a commit to openedx/tutor-contrib-aspects that referenced this pull request Jul 30, 2025
settings

Allows platform-plugin-aspects to know whether to include in-context
dashboards in the request for a Superset guest token. See: openedx/platform-plugin-aspects#163
@bmtcril
bmtcril merged commit d1136d1 into main Jul 31, 2025
13 checks passed
@bmtcril
bmtcril deleted the bmtcril/fix_guest_token_errors branch July 31, 2025 14:51
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.

Default settings break pre-Teak embedded dashboards

2 participants