-
Notifications
You must be signed in to change notification settings - Fork 635
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
raise notification at startup if installed package targets a different host. #12990
Conversation
refactor where check is fix existing tests
… into customnodefail
Last question, can we perform these checks for case (2) |
yes, I think theres no reason we can't perform these same checks then, I would likely do it at late package load instead of directly tying it to path updates, so that
I'll give this a shot. |
add test
@aparajit-pratap PTAL - implemented notifications when adding package paths. |
@@ -3229,4 +3229,13 @@ You can manage this in Preferences -> Security.</value> | |||
<data name="TrustLocationSkippedNotification" xml:space="preserve"> | |||
<value>No trusted location has been added.</value> | |||
</data> | |||
<data name="MessagePackageTargetOtherHosts2" xml:space="preserve"> | |||
<value>The package or one of its dependencies targets a different environment, such as Revit, Civil 3D, Advance Steel, Alias or FormIt. This can cause instability and unexpected problems.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be specific about which host specifically the package is targeting rather than saying it could be one of the many?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That will require refactoring the functions which check what the targets are - I think it gets a bit complicated for two reasons.
- In some instances we are checking a package and all its dependencies - I guess it's unlikely they depend on different hosts. Probably a strange edge case.
- The current implementation just bails when it finds any issue, so we can return that first reason for failure I think fairly easily, but building up the complete list of different targets could possibly make the search quite slow in some cases (lots of dependencies) - and potentially confusing.
Is it okay to just return something like:
The package or one of its dependencies targets {X} which is different from the current Dynamo environment.This can cause instability and unexpected problems.
Or do we need to ensure the list is complete to include all targets which we reasoned were a failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we have that information already? Isn't it how we are calculating stuff in CheckIfPackagesTargetOtherHosts
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think I meant just the first host.
{ | ||
add | ||
{ | ||
notificationLogged+=value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjkkirschner thanks for responding to my questions. As far as the message is concerned about the non-matching host, feel free to disregard it if it's too difficult a refactor. It's a minor point as I thought it might be nice to have that additional info for the user as to what host their downloaded package is actually targeting.
@aparajit-pratap @QilongTang given the timing, I will merge this, and cherry pick to 2.15 given this task is scoped for release in jira. I can attempt to make improvements to the message in master. |
pass here: I ran it a few more times and sometimes it looks like another one of those issues with checking |
…t host. (DynamoDS#12990) * add notifications for packages with other host at startup time refactor where check is fix existing tests * fix and better notification * add test * fix tests * comments * Update PackageManagerExtension.cs * Update PackageManagerViewExtensionTests.cs * typo * also check hosts at package load add test
…t host. (#12990) (#13010) * add notifications for packages with other host at startup time refactor where check is fix existing tests * fix and better notification * add test * fix tests * comments * Update PackageManagerExtension.cs * Update PackageManagerViewExtensionTests.cs * typo * also check hosts at package load add test
Hi @mjkkirschner, I noticed this new notification now that Dynamo Core 2.15 is shipped with the latest Civil 3D update (2023.1). It's convenient that you were doing your testing with my package as well! I find the message a little confusing because it says that my package targets a different host, which would be true if it was installed for Sandbox. But why does this message show in Dynamo for Civil 3D? Is it a bug, or do I need to change something in my pkg.json file? My ultimate goal is for this notification to not appear for Civil 3D users so they don't wonder if they did something wrong. |
Hi @mzjensen that sounds like a bug because it looks like your package already marks a host dependency on Civil3d. I will file a bug to investigate. |
@mjkkirschner - sounds good, thanks. FWIW, I also see the same message when installing the IronPython 2.7 package, which doesn't seem right. |
yes, I think if you were to debug you would see that Civil 3D is providing an unexpected host name... |
at the moment I'm not clear if this will work - but as a workaround you could try not setting the host dependencies to anything, and publishing locally to see if that works to avoid the notification. |
Purpose
https://jira.autodesk.com/browse/DYN-4884
Follow up for the work @sm6srw started: https://jira.autodesk.com/browse/DYN-4880
PR does the following:
package manager extension
and out ofpackage manager client view model
.notification after install.
notification when adding package path.
In addition to these cases, startup also generates a notification of course.
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Add notifications at startup for packages that target a different host than current Dynamo context.
Reviewers
(FILL ME IN) Reviewer 1 (If possible, assign the Reviewer for the PR)
(FILL ME IN, optional) Any additional notes to reviewers or testers.
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of