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

fix: prevent loading issues with ipynb files #9850

Merged
merged 4 commits into from
Aug 22, 2024
Merged

Conversation

ashtonG
Copy link
Contributor

@ashtonG ashtonG commented Aug 21, 2024

Ticket

ET-741

Description

This fixes an issue where a parse error occurs when the user selects an ipynb file in the experiment code viewer. The file content updates as an effect of the selected file path changing. Because the effect happens after render, the editor is briefly rendered with the wrong content. To fix this, the file content is now keyed with the path. when the path doesn't match, we assume the content hasn't loaded yet.

Further error handling fixes should be introduced in this pr upstream in hew.

Test Plan

  • visit an experiment page of an experiment that contains an ipynb file in the files, or, with the flat_runs feature flag on, visit a run containing the same
  • click the code tab
  • select an non-ipynb file
  • select an ipynb file
  • no error should appear in the toast or in the console.

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been included for new code which was copied and/or modified from any external code

This fixes an issue where a parse error occurs when the user selects
an ipynb file in the experiment code viewer. The file content updates as
an effect of the selected file path changing. Because the effect happens
after render, the editor is briefly rendered with the wrong content. To
fix this, the file content is now keyed with the path. when the path
doesn't match, we assume the content hasn't loaded yet.

Further error handling fixes should be introduced in this pr upstream in hew.
@cla-bot cla-bot bot added the cla-signed label Aug 21, 2024
Copy link

netlify bot commented Aug 21, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 5afd93b
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66c773d0451c390008a456c9
😎 Deploy Preview https://deploy-preview-9850--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

Attention: Patch coverage is 69.44444% with 11 lines in your changes missing coverage. Please review.

Project coverage is 50.15%. Comparing base (91d0b67) to head (5afd93b).
Report is 38 commits behind head on main.

Files Patch % Lines
...c/pages/ExperimentDetails/ExperimentCodeViewer.tsx 69.44% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9850      +/-   ##
==========================================
- Coverage   54.38%   50.15%   -4.23%     
==========================================
  Files        1261      938     -323     
  Lines      155770   126437   -29333     
  Branches     3540     3543       +3     
==========================================
- Hits        84711    63414   -21297     
+ Misses      70921    62885    -8036     
  Partials      138      138              
Flag Coverage Δ
harness ?
web 53.70% <69.44%> (+<0.01%) ⬆️

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

Files Coverage Δ
...c/pages/ExperimentDetails/ExperimentCodeViewer.tsx 88.60% <69.44%> (+1.89%) ⬆️

... and 323 files with indirect coverage changes

@ashtonG ashtonG marked this pull request as ready for review August 21, 2024 17:56
@ashtonG ashtonG requested a review from a team as a code owner August 21, 2024 17:56
Copy link
Contributor

@EmilyBonar EmilyBonar left a comment

Choose a reason for hiding this comment

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

Confirmed that I don't see the error toast anymore. useAsync is also a cleaner way to load the data, so this gets two birds with one stone

@ashtonG ashtonG merged commit a37e6e7 into main Aug 22, 2024
82 of 95 checks passed
@ashtonG ashtonG deleted the bug/ET-741/ipynb-fixes branch August 22, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants