Skip to content

T1.1 Python 2 Code Migration - #10850

Merged
mmisol merged 12 commits into
DynamoDS:masterfrom
SHKnudsen:T1.1-CodeMigration
Jul 21, 2020
Merged

mmisol merged 12 commits into
DynamoDS:masterfrom
SHKnudsen:T1.1-CodeMigration

Conversation

@SHKnudsen

Copy link
Copy Markdown
Contributor

Purpose

This PR is the first step in adding a Migration Assistant that helps users automatically upgrade their Python code from Python 2 to Python 3. The PR focuses on adding the functionality to Migrate Python 2 code to Python 3 compatible code, using Pythons 2to3 library. It also adds a new VisualDifferenceViewer to show the changes being made by the migration.

This is the biggest of the PRs concerning the Python 3 migration work, the following PRs will be smaller.

image

Declarations

Check these if you believe they are true

  • The codebase is in a better state after this PR
  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • All tests pass using the self-service CI.
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.

Reviewers

@mjkkirschner
@QilongTang
@radumg

FYIs

The VisualDifferenceViewer are using the DiffPlex library. I know the decision on whether or not we want to include this dependency is still pending, but the rest of the code should be fine to review.

The button icons on the VisualDifferenceViewer are also pending final confirmation, we can easily revert back to text if this turns out to be an issue.

SHKnudsen added 4 commits July 3, 2020 08:19
* add ScriptMigrator

* Add visual difference viewer

* Update PythonMigrationViewExtension.cs

* Add tooltip description to migration assistant

* updates

* comment updates

* comment updates
@QilongTang

Copy link
Copy Markdown
Contributor

Thank you @SHKnudsen . This is exciting. @mjkkirschner will log a Jira task for our team to review your work soon

@mjkkirschner

Copy link
Copy Markdown
Member

@mmisol mmisol self-assigned this Jul 10, 2020
@mmisol
mmisol self-requested a review July 10, 2020 22:12
Comment thread src/AssemblySharedInfoGenerator/AssemblySharedInfo.cs Outdated
Comment thread src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml
Comment thread src/Libraries/PythonNodeModels/PythonNode.cs
Comment thread src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs
Comment thread src/PythonMigrationViewExtension/Controls/VisualDifferenceViewer.xaml Outdated
Comment thread src/PythonMigrationViewExtension/GraphPythonDependencies.cs Outdated
Comment thread src/PythonMigrationViewExtension/MigrationAssistant/ScriptMigrator.cs Outdated
Comment thread src/PythonMigrationViewExtension/PythonMigrationViewExtension.cs Outdated
Comment thread test/DynamoCoreTests/PythonMigrationAssistantTests.cs Outdated
Comment thread test/DynamoCoreTests/PythonMigrationAssistantTests.cs
Comment thread src/PythonMigrationViewExtension/packages.config

@mmisol mmisol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just to move things up a little, I commented the things I feel still need addressing. I'll summarize here:

  • Delete third unit test (unless there is something I overlooked, LMK)
  • Add new libraries to license files
  • Fix bug related to unsaved code changes not showing in the migrator

Comment thread test/DynamoCoreTests/PythonMigrationAssistantTests.cs Outdated
Comment thread test/DynamoCoreTests/PythonMigrationAssistantTests.cs
Comment thread src/PythonMigrationViewExtension/packages.config
Comment thread src/Libraries/PythonNodeModelsWpf/ScriptEditorWindow.xaml.cs
@mjkkirschner

mjkkirschner commented Jul 20, 2020 via email

Copy link
Copy Markdown
Member

@SHKnudsen

Copy link
Copy Markdown
Contributor Author

@mmisol addressed the last changes, sorry for the delay! Let me know if there is anything else.

@mmisol

mmisol commented Jul 20, 2020

Copy link
Copy Markdown
Collaborator

Thanks @SHKnudsen . I see the bug is fixed. Could I ask you to place diffplex in the license.rtf file so that it appears in alphabetical order in the about window?
Screen Shot 2020-07-20 at 5 04 14 PM

@SHKnudsen

Copy link
Copy Markdown
Contributor Author

@mmisol order of the licence files are updated

@mmisol mmisol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @SHKnudsen! Looks good to me

@mmisol

mmisol commented Jul 21, 2020

Copy link
Copy Markdown
Collaborator

I couldn't reproduce the test failure locally. I have triggered a manual test run on a different server just in case this is just a flaky failure. If that works I'm merging this.

@mmisol

mmisol commented Jul 21, 2020

Copy link
Copy Markdown
Collaborator

Also got an error here https://master-15.jenkins.autodesk.com/view/DYN/job/DYN-DevCI_Self_Service/709/, although it seems unrelated (PackageDependencyTests). I think we can probably merge but I'll confirm with @QilongTang first.

@mmisol
mmisol merged commit e06234e into DynamoDS:master Jul 21, 2020
@SHKnudsen
SHKnudsen deleted the T1.1-CodeMigration branch July 21, 2020 15:11
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.

6 participants