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

Linter ViewExtension #11634

Merged

Conversation

SHKnudsen
Copy link
Contributor

@SHKnudsen SHKnudsen commented Apr 20, 2021

Purpose

This PR does:

  • Adds new view extension that:
    • Enables users to select between loaded linter extension
    • Displays all Node- and GraphRule issues from the selected linter

Linter ViewExtension

LinterView_v2_x175

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

Reviewers

@saintentropy @nate-peters @BogdanZavu

FYIs

@mjkkirschner

<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\bin\AnyCPU\Debug\</OutputPath>
Copy link
Member

@mjkkirschner mjkkirschner Apr 20, 2021

Choose a reason for hiding this comment

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

I think these projects should probably be setup with the imported output paths and assembly shared info generator, unless you want this assembly to have a different version number purposefully.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mjkkirschner hm, should be setup with the Assembly Shared info, but not sure i know about the imported output paths where are they coming from?

Copy link
Member

Choose a reason for hiding this comment

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

the output paths should be coming from:
https://github.com/DynamoDS/Dynamo/blob/master/src/Config/CS.props#L7
if you are importing this - I think if you define them again here you'll overwite that import if it appears further up in the csproj file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea i was importing it, not sure how i ended up overwriting it.. Should be fixed now.

@SHKnudsen
Copy link
Contributor Author

SHKnudsen commented Apr 28, 2021

Made some updates to the UI, FYI @nate-peters
image

Help link to Documentaiton Browser

ezgif com-gif-maker (3)

@BogdanZavu
Copy link
Contributor

@SHKnudsen since we merged the linter manager branch let's rebase this one

@@ -131,7 +131,8 @@ private void OnRuleEvaluated(IRuleEvaluationResult result)
}
}

private LinterExtensionBase GetLinterExtension(LinterExtensionDescriptor activeLinter)

internal LinterExtensionBase GetLinterExtension(LinterExtensionDescriptor activeLinter)
{
return this.extensionManager.
Copy link
Contributor

Choose a reason for hiding this comment

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

activeLinter might be null

@BogdanZavu
Copy link
Contributor

BogdanZavu commented May 4, 2021

I would say to account for no active linter descriptor as a valid use case (e.g we are throwing during SerializationConverters::WriteJson on startup ).
This will be the initial state I believe once we go live but also users might decide (most likely temporarily) to not have any linting even if they have a few linters available.

@SHKnudsen SHKnudsen marked this pull request as ready for review May 5, 2021 15:30
@BogdanZavu
Copy link
Contributor

@SHKnudsen based on our last discussion I think there only a few things left before we can merge :
have a guid for None descriptor
remove debugger.break statements and TestLinterExtension project
Now or in the PR from AGD-2060 to master, let's limit api exposure until this becomes available as public api (when we refactor our rules in the extension) by making LinterExtensionBase internal and preventing LinterViewExtension from showing up in the UI.
If I missed anything please add

@SHKnudsen
Copy link
Contributor Author

@BogdanZavu is there a mechanism to prevent the extension to show up?

@BogdanZavu
Copy link
Contributor

BogdanZavu commented May 6, 2021

@SHKnudsen I would say to interfere when all the ViewExtensions are being loaded ( in DynamoView.xaml.cs ) and skip our extension from the beginning based on its UniquiId. Cant' think of anything better.

@mjkkirschner
Copy link
Member

mjkkirschner commented May 6, 2021 via email

@SHKnudsen
Copy link
Contributor Author

@QilongTang would you be able to help with Mikes comment above? 👆

@QilongTang
Copy link
Contributor

Aaron implemented a way to disable extensions - I can’t remember where the config is loaded from though

On May 6, 2021, at 2:16 PM, Bogdan Zavu @.***> wrote:  @SHKnudsen I would say to interfere when all the ViewExtensions are being loaded and skip our extension from the beginning based on its UniquiId. Cant' think of anything better. https://github.com/SHKnudsen/Dynamo/blob/c7e3c19e8b7feacecd8b2b1d9159ad7cc4b446af/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs#L160 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

@QilongTang would you be able to help with Mikes comment above? 👆

Please refer to the following view extension manifest file: https://github.com/DynamoDS/Dynamo/blob/master/src/NodeAutoCompleteViewExtension/NodeAutoComplete_ViewExtensionDefinition.xml#L4. If you implement this and include the IsEnabled field, it can act as a switch to turn on loading this view extension or not. If you do not include this field, the view extension will be treated as always loaded. Happy to answer any more question.

@SHKnudsen
Copy link
Contributor Author

Ah, so easy! thanks, @QilongTang .

@BogdanZavu this should be ready now unless there are additional comments?

@BogdanZavu BogdanZavu merged commit cd60aef into DynamoDS:AGD-2060-Linting-API May 7, 2021
@SHKnudsen SHKnudsen mentioned this pull request May 7, 2021
8 tasks
BogdanZavu pushed a commit that referenced this pull request May 7, 2021
* Initial commit

* Move event subscription to extension base class + add property changed filter to rules

* comment updates

* Update LinterExtensionBase.cs

* Update InputNodesNotAllowedRule.cs

* Add Deactivate method to linterExtensionBase + LinterManager tests

* comment updates

* Initial commit

* Add issues count to WorkspaceSaving

* add scrollviewer

* Dispose LinterManager

* Make concrete issues internal

* summaries on IRuleIssue

* comment updates

* Update severity code icon

* Serialize linter manager to dyn file

* clear ruleEvaluationResults on workspace change

* Remove test extension

* Show names instead of GUIDs

* add help doc

* clean up

* Handle GraphRuleEvaluationResults nodeIds changes

* Update LintingViewExtension.csproj

* Update LintingViewExtension.csproj

* Update SerializationConverters.cs

* Fix failing serialization test

* comment updates

* revert changes to test file

* fix available linters binding

* add rules back in test ext

* comment updates

* remove output path

* Update LinterManagerTests.cs

* comment updates

* hide LinterViewExtension and LinterExtensionBase

* Update LinterViewModel.cs
BogdanZavu pushed a commit that referenced this pull request May 11, 2021
* Linter manager (#11606)

* Initial commit

* Move event subscription to extension base class + add property changed filter to rules

* comment updates

* Update LinterExtensionBase.cs

* Update InputNodesNotAllowedRule.cs

* Add Deactivate method to linterExtensionBase + LinterManager tests

* comment updates

* Dispose LinterManager

* comment updates

* Serialize linter manager to dyn file

* clear ruleEvaluationResults on workspace change

* Remove test extension

* Handle GraphRuleEvaluationResults nodeIds changes

* Update SerializationConverters.cs

* Fix failing serialization test

* comment updates

* revert changes to test file

* Linter ViewExtension (#11634)

* Initial commit

* Move event subscription to extension base class + add property changed filter to rules

* comment updates

* Update LinterExtensionBase.cs

* Update InputNodesNotAllowedRule.cs

* Add Deactivate method to linterExtensionBase + LinterManager tests

* comment updates

* Initial commit

* Add issues count to WorkspaceSaving

* add scrollviewer

* Dispose LinterManager

* Make concrete issues internal

* summaries on IRuleIssue

* comment updates

* Update severity code icon

* Serialize linter manager to dyn file

* clear ruleEvaluationResults on workspace change

* Remove test extension

* Show names instead of GUIDs

* add help doc

* clean up

* Handle GraphRuleEvaluationResults nodeIds changes

* Update LintingViewExtension.csproj

* Update LintingViewExtension.csproj

* Update SerializationConverters.cs

* Fix failing serialization test

* comment updates

* revert changes to test file

* fix available linters binding

* add rules back in test ext

* comment updates

* remove output path

* Update LinterManagerTests.cs

* comment updates

* hide LinterViewExtension and LinterExtensionBase

* Update LinterViewModel.cs

* if statements

* remove Prism

* clean up
BogdanZavu added a commit that referenced this pull request May 11, 2021
* Linter manager (#11606)

* Initial commit

* Move event subscription to extension base class + add property changed filter to rules

* comment updates

* Update LinterExtensionBase.cs

* Update InputNodesNotAllowedRule.cs

* Add Deactivate method to linterExtensionBase + LinterManager tests

* comment updates

* Dispose LinterManager

* comment updates

* Serialize linter manager to dyn file

* clear ruleEvaluationResults on workspace change

* Remove test extension

* Handle GraphRuleEvaluationResults nodeIds changes

* Update SerializationConverters.cs

* Fix failing serialization test

* comment updates

* revert changes to test file

* Linter ViewExtension (#11634)

* Initial commit

* Move event subscription to extension base class + add property changed filter to rules

* comment updates

* Update LinterExtensionBase.cs

* Update InputNodesNotAllowedRule.cs

* Add Deactivate method to linterExtensionBase + LinterManager tests

* comment updates

* Initial commit

* Add issues count to WorkspaceSaving

* add scrollviewer

* Dispose LinterManager

* Make concrete issues internal

* summaries on IRuleIssue

* comment updates

* Update severity code icon

* Serialize linter manager to dyn file

* clear ruleEvaluationResults on workspace change

* Remove test extension

* Show names instead of GUIDs

* add help doc

* clean up

* Handle GraphRuleEvaluationResults nodeIds changes

* Update LintingViewExtension.csproj

* Update LintingViewExtension.csproj

* Update SerializationConverters.cs

* Fix failing serialization test

* comment updates

* revert changes to test file

* fix available linters binding

* add rules back in test ext

* comment updates

* remove output path

* Update LinterManagerTests.cs

* comment updates

* hide LinterViewExtension and LinterExtensionBase

* Update LinterViewModel.cs

* remove unused test files

* Fix pr comments (#11677)

* Linter manager (#11606)

* Initial commit

* Move event subscription to extension base class + add property changed filter to rules

* comment updates

* Update LinterExtensionBase.cs

* Update InputNodesNotAllowedRule.cs

* Add Deactivate method to linterExtensionBase + LinterManager tests

* comment updates

* Dispose LinterManager

* comment updates

* Serialize linter manager to dyn file

* clear ruleEvaluationResults on workspace change

* Remove test extension

* Handle GraphRuleEvaluationResults nodeIds changes

* Update SerializationConverters.cs

* Fix failing serialization test

* comment updates

* revert changes to test file

* Linter ViewExtension (#11634)

* Initial commit

* Move event subscription to extension base class + add property changed filter to rules

* comment updates

* Update LinterExtensionBase.cs

* Update InputNodesNotAllowedRule.cs

* Add Deactivate method to linterExtensionBase + LinterManager tests

* comment updates

* Initial commit

* Add issues count to WorkspaceSaving

* add scrollviewer

* Dispose LinterManager

* Make concrete issues internal

* summaries on IRuleIssue

* comment updates

* Update severity code icon

* Serialize linter manager to dyn file

* clear ruleEvaluationResults on workspace change

* Remove test extension

* Show names instead of GUIDs

* add help doc

* clean up

* Handle GraphRuleEvaluationResults nodeIds changes

* Update LintingViewExtension.csproj

* Update LintingViewExtension.csproj

* Update SerializationConverters.cs

* Fix failing serialization test

* comment updates

* revert changes to test file

* fix available linters binding

* add rules back in test ext

* comment updates

* remove output path

* Update LinterManagerTests.cs

* comment updates

* hide LinterViewExtension and LinterExtensionBase

* Update LinterViewModel.cs

* if statements

* remove Prism

* clean up

Co-authored-by: BogdanZavu <[email protected]>
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