Skip to content

[Feature:Submission] Jupyter warnings outside notebook#12523

Merged
bmcutler merged 3 commits into
Submitty:mainfrom
Fizza-Mukhtar:fix/jupyter-warning-outside-notebook
May 5, 2026
Merged

[Feature:Submission] Jupyter warnings outside notebook#12523
bmcutler merged 3 commits into
Submitty:mainfrom
Fizza-Mukhtar:fix/jupyter-warning-outside-notebook

Conversation

@Fizza-Mukhtar

Copy link
Copy Markdown
Contributor

Why is this Change Important & Necessary?

Previously, warnings for oversized or partially skipped Jupyter notebooks were
injected as markdown cells inside the rendered notebook itself. This was
inconsistent with Submitty's existing UI patterns for displaying messages, and
made the warnings easy to miss or confuse with actual notebook content.

Closes #11928

What is the New Behavior?

  • NotebookUtils::jupyterToSubmittyNotebook() now returns a structured array
    with keys: cells, size_exceeded, skipped_content_count, skipped_output_count
    instead of injecting warning markdown cells directly.
  • MiscController.php unpacks these flags and passes them to the Twig template.
  • Notebook.twig now displays a red alert banner above the notebook when the
    file exceeds 10MB, and a yellow alert banner when any content/outputs were
    skipped — using Submitty's existing alert styles.

No functional change — same warnings are shown, just displayed outside the
notebook in a cleaner, consistent way.

What steps should a reviewer take to reproduce or test the bug or new feature?

  1. Upload a Jupyter notebook (.ipynb) with large image attachments or
    truncated outputs to a gradeable
  2. Open the submission in the grading interface
  3. Before fix: warning appears as a markdown cell inside the notebook body
  4. After fix: warning appears as a colored alert banner above the notebook

To test size exceeded case:

  1. Upload a .ipynb file larger than 10MB
  2. Open in grading interface
  3. Before fix: empty notebook with a markdown error cell
  4. After fix: red alert banner above empty notebook

Automated Testing & Documentation

This is a UI consistency improvement with no functional behavior change.
No documentation update required on submitty.org.

Other information

  • Not a breaking change
  • No migrations required
  • No security concerns
  • jupyterToSubmittyNotebook() return type changed from flat array to
    structured array — only called in one place (MiscController.php) so
    no other files affected

@github-project-automation github-project-automation Bot moved this to Seeking Reviewer in Submitty Development Mar 3, 2026
@Fizza-Mukhtar Fizza-Mukhtar changed the title Move Jupyter warning messages outside rendered notebook [Feature:Submission] Jupyter warnings outside notebook Mar 5, 2026
@Eli-J-Schwartz Eli-J-Schwartz self-assigned this Mar 10, 2026
@codecov

codecov Bot commented Mar 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.67%. Comparing base (dc4b908) to head (d714f32).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #12523   +/-   ##
=========================================
  Coverage     21.67%   21.67%           
+ Complexity     9807     9803    -4     
=========================================
  Files           268      268           
  Lines         36722    36721    -1     
  Branches        490      490           
=========================================
  Hits           7960     7960           
+ Misses        28276    28275    -1     
  Partials        486      486           
Flag Coverage Δ
autograder 21.32% <ø> (ø)
js 2.02% <ø> (ø)
migrator 100.00% <ø> (ø)
php 20.73% <0.00%> (+<0.01%) ⬆️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 91.13% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Fizza-Mukhtar

Copy link
Copy Markdown
Contributor Author

Hi @williamjallen , I've fixed the PHPStan errors. Could you please re-run the CI? Thanks!

@Eli-J-Schwartz Eli-J-Schwartz removed their assignment Mar 24, 2026
@vimla01

vimla01 commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Hey, Please look at the CI failure.

@Fizza-Mukhtar

Copy link
Copy Markdown
Contributor Author

@williamjallen I investigated all the failing Cypress tests — none of them
are related to my changes (NotebookUtils.php, MiscController.php,
Notebook.twig only).

The data-testid="notebook-view" element does not exist anywhere in
the codebase even on main branch, so notebook_section.spec.js was
already broken before my PR.

Could you please confirm these are pre-existing CI failures?

@github-actions github-actions Bot added the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label Apr 14, 2026
@Fizza-Mukhtar

Copy link
Copy Markdown
Contributor Author

not abandoned

@williamjallen williamjallen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work on this! I tested it and it works as described. Code looks great as well.

@github-project-automation github-project-automation Bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Apr 30, 2026
@github-actions github-actions Bot removed the Abandoned PR - Needs New Owner No activity on PR for more than 2 weeks -- seeking new owner to complete label May 1, 2026
@bmcutler
bmcutler merged commit 02a7524 into Submitty:main May 5, 2026
212 of 232 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting Maintainer Review to Done in Submitty Development May 5, 2026
prestoncarman added a commit that referenced this pull request May 21, 2026
* main: (50 commits)
  [Bugfix:Developer] Fix Broken CI (#12851)
  [Bugfix:System] Restore TCLAPP (#12850)
  [Bugfix:Submission] Fix non-VCS repo error (#12608)
  [Feature:Submission] Jupyter warnings outside notebook (#12523)
  [Bugfix:InstructorUI] Removed feature flag for Bulk Late Days (#12826)
  [Bugfix:Forum] Fix stats header rendering (#12698)
  [Bugfix:Autograding] Fix negative number tolerance (#12569)
  [Bugfix:HelpQueue] Always use Abbreviated Names in OH (#12820)
  [Bugfix:Autograding] Fix regrade team detection (#12737)
  [Dependency] Bump Lichen from v23.09.00 to v26.04.01 (#12823)
  [Dependency] Bump RainbowGrades from v25.10.00 to v26.04.01 (#12824)
  [Feature:Developer] Remove misc Java utils and TCLAPP (#12819)
  [Bugfix:TAGrading] Fix 2-panel open-document select (#12577)
  [Dependency] Bump AnalysisToolsTS from v23.10.00 to v26.04.00 (#12822)
  [Bugfix:Developer] Fix bump_repo permissions (#12821)
  [Bugfix:InstructorUI] Change Colors to match in Docker UI table (#12739)
  [Bugfix:Forum] Reduce Page Caching (#12339)
  [Bugfix:System] File lost when running install clean fix (#12158)
  [Bugfix:Submission] No File Rubric submit all user groups (#12812)
  [Dependency] Bump twig/markdown-extra from 3.23.0 to 3.24.0 in /site (#12721)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Red warning for rendering Jupyter with skipped outputs

5 participants