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

Re-enable the retain folder structure toggle in package manager publish workflow and bug fixes #14880

Merged
merged 35 commits into from
Jan 30, 2024

Conversation

zeusongit
Copy link
Contributor

@zeusongit zeusongit commented Jan 23, 2024

Purpose

https://jira.autodesk.com/browse/DYN-6589

The PR addresses multiple issues in the package publishing workflow and re-enables the retain folder structure option when publishing a package using package manager.
The work done in an extension of @dnenov and @mjkkirschner's branches, and includes their contribution as well.

The following use cases were updated:

  • The retain folder structure option is now enabled by default when a user is publishing a new version.

  • The user can view Node Library checkbox when navigating away from the publishing workflow and then returning to it later in the same session. (the assemblies were not loaded correctly)

  • The user can assign newly added files to be node libraries. (the checkbox was missing before)

  • The package version is not updated if publish fails due to any reason.

  • Handled access exception thrown when publishing a new version of a package by disposing temporary load context.

  • Make directory tree view scrollable when previewing package contents

  • Code refactor

  • Handle use case when a user removes some assemblies when publishing a new version and the workflow fails, since it tries to delete the files already loaded.(will track in a separate issue to limit this PRs scope)
    Show a meaningful exception message when trying to update a loaded package (same message is used when adding assemblies):
    Screenshot 2024-01-29 at 6 27 57 PM

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.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB

Release Notes

  • improve package manager publish workflow with retain folder structure option

Reviewers

@DynamoDS/dynamo

dnenov and others added 8 commits December 19, 2023 19:35
- now retains the exact number of files when retaining folder structure
- publish and publish version using retained folders now working better than before
- added two new options to publish package allowing the retain folder structure from the get-go
make treeview scrollable
retain nodelibraries values
refactor publish version code
Copy link

github-actions bot commented Jan 23, 2024

UI Smoke Tests

Test: success. 2 passed, 0 failed.
TestComplete Test Result
Workflow Run: UI Smoke Tests
Check: UI Smoke Tests - net8.0

@zeusongit zeusongit changed the title Amd fix pub Re-enable the retain folder structure toggle in package manager publish workflow Jan 23, 2024
zeusongit and others added 7 commits January 23, 2024 18:09
- added MaxHeight to trigger the scrollbar
- enabled the custombrowsercontrol
- the Tag property of the custombrowsercontrol now controls the visibility of the remove icons as well, allowing to hide them in this page
@dnenov dnenov mentioned this pull request Jan 26, 2024
9 tasks
@zeusongit zeusongit changed the title Re-enable the retain folder structure toggle in package manager publish workflow Re-enable the retain folder structure toggle in package manager publish workflow and bug fixes Jan 26, 2024
@zeusongit zeusongit requested a review from QilongTang January 26, 2024 23:57
@zeusongit zeusongit marked this pull request as ready for review January 27, 2024 01:36
@QilongTang
Copy link
Contributor

QilongTang commented Jan 29, 2024

@zeusongit Please also check if the PR validation contains real failure and address the merge conflicts. Once you address all the comments, we can merge and cherry-pick to RC3.0.3 branch

@aparajit-pratap
Copy link
Contributor

@zeusongit can we add a new test to verify that publishing a new package version works with the new version already loaded into Dynamo?

It may not be possible with the current implementation to have a unit test that can cover the complete version upload, we may need a UI test for that, the issue that user will not be able to upload a new package version with any change in the current version that includes removing assemblies will still not work though.

Yes, I'm aware that the issue of not being able to publish a new version involving removing assemblies from the current version is not fixed yet. I was referring to publishing the new version with the same version installed.

@@ -269,7 +268,6 @@ <h4>Adding package files</h4>
When in doubt, toggle the setting off to allow Dynamo to set up the folder structure.
</p>
</p>
-->
Copy link
Contributor

Choose a reason for hiding this comment

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

The description says it's an advanced setting. Is it still an advanced setting now that it's the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hwahlstrom @QilongTang should we remove the advanced tag?

Copy link
Contributor

Choose a reason for hiding this comment

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

@zeusongit make sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@@ -222,7 +220,7 @@ internal void CopyFilesIntoRetainedPackageDirectory(IEnumerable<IEnumerable<stri
{
// We expect that files are bundled in root folders
// For single files, just get its folder
var commonPath = files.Count() > 1 ? GetLongestCommonPrefix(files.ToArray()) : Path.GetDirectoryName(files.First());
var commonPath = files.Count() > 1 ? GetLongestCommonPrefix(files.ToArray()) : Path.GetDirectoryName(files.FirstOrDefault());
Copy link
Contributor

Choose a reason for hiding this comment

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

files.Any()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

files.Any() won't work here since we need to know if there is only 1 item vs more than 1

Copy link
Contributor

@QilongTang QilongTang left a comment

Choose a reason for hiding this comment

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

LGTM with comments addressed

Copy link
Contributor

@aparajit-pratap aparajit-pratap left a comment

Choose a reason for hiding this comment

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

LGTM once comments are addressed.

One thing about testing - as we don't have unit tests for all package publishing scenarios, I wonder if we can or have already tested them manually.

@zeusongit
Copy link
Contributor Author

LGTM once comments are addressed.

One thing about testing - as we don't have unit tests for all package publishing scenarios, I wonder if we can or have already tested them manually.

Added a test

@@ -192,6 +192,7 @@
<Name>DynamoUtilities</Name>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\Libraries\PackageManagerTests\PackageManagerTests.csproj" />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a test for loading a package and then publishing the same package with a new version.

@zeusongit
Copy link
Contributor Author

@zeusongit zeusongit merged commit 3e64c41 into DynamoDS:master Jan 30, 2024
21 of 22 checks passed
zeusongit added a commit to zeusongit/Dynamo that referenced this pull request Jan 30, 2024
…sh workflow and bug fixes (DynamoDS#14880)

* retain exact number of files
- now retains the exact number of files when retaining folder structure
- publish and publish version using retained folders now working better than before
* publish retain added
- added two new options to publish package allowing the retain folder structure from the get-go
* fix issue with files with same substring in name in same subfolder
* make treeview scrollable
* retain nodelibraries values
* refactor publish version code
* scrollable custombrowsercontrol in preview page
- added MaxHeight to trigger the scrollbar
- enabled the custombrowsercontrol
- the Tag property of the custombrowsercontrol now controls the visibility of the remove icons as well, allowing to hide them in this page
* dispose mlc at publish
* comments
* revert docs change to add retain feature
* test fix
* add test

---------

Co-authored-by: Deyan Nenov <dnenov@archilizer.com>
Co-authored-by: mjk.kirschner <mjk.kirschner@gmail.com>
QilongTang pushed a commit that referenced this pull request Jan 30, 2024
…sh workflow and bug fixes (#14880) (#14910)

* retain exact number of files
- now retains the exact number of files when retaining folder structure
- publish and publish version using retained folders now working better than before
* publish retain added
- added two new options to publish package allowing the retain folder structure from the get-go
* fix issue with files with same substring in name in same subfolder
* make treeview scrollable
* retain nodelibraries values
* refactor publish version code
* scrollable custombrowsercontrol in preview page
- added MaxHeight to trigger the scrollbar
- enabled the custombrowsercontrol
- the Tag property of the custombrowsercontrol now controls the visibility of the remove icons as well, allowing to hide them in this page
* dispose mlc at publish
* comments
* revert docs change to add retain feature
* test fix
* add test

---------

Co-authored-by: Deyan Nenov <dnenov@archilizer.com>
Co-authored-by: mjk.kirschner <mjk.kirschner@gmail.com>
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.

5 participants