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

SqlSetup: Connect-SQLAnalysis no longer using LoadWithPartialName() #1150

Closed
wants to merge 7 commits into from

Conversation

johlju
Copy link
Member

@johlju johlju commented Jun 14, 2018

Pull Request (PR) description

  • Now the correct assembly should load when using the helper function
    Connect-SQLAnalysis. Previously is was using LoadWithPartialName() which
    meant that it would load the first assembly in GAC, regardless of which
    PowerShell module was used (SQLPS or SqlSever).

This Pull Request (PR) fixes the following issues

Maybe helps with issue #812.

Task list

  • Added an entry under the Unreleased section in the CHANGELOG.md? Entry
    should say what was changed, and how that affects users (if applicable).
  • Resource documentation added/updated in README.md?
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help?
  • Comment-based help added/updated?
  • Localization strings added/updated in all localization files as appropriate?
  • Examples appropriately added/updated?
  • Unit tests added/updated?
    See DSC Resource Testing Guidelines.
  • Integration tests added/updated (where possible)?
    See DSC Resource Testing Guidelines.
  • New/changed code adheres to
    DSC Resource Style Guidelines
    and Best Practices?

This change is Reviewable

@johlju johlju changed the title Changes to SqlSetup SqlSetup: Connect-SQLAnalysis not using LoadWithPartialName() Jun 14, 2018
@johlju johlju added the needs review The pull request needs a code review. label Jun 14, 2018
@johlju johlju changed the title SqlSetup: Connect-SQLAnalysis not using LoadWithPartialName() SqlSetup: Connect-SQLAnalysis no longer using LoadWithPartialName() Jun 14, 2018
@johlju johlju added waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. and removed needs review The pull request needs a code review. labels Jun 14, 2018
@johlju
Copy link
Member Author

johlju commented Jun 14, 2018

Wasn't so easy as I thought, have to get back to this at another time.

Failing on this when using SQLPS module:

VERBOSE: INTEGRATION ERROR MESSAGE: PowerShell DSC resource MSFT_SqlSetup  failed to execute Set-TargetResource functionality with error message: System.InvalidOperationException: Failed to connected to Analysis Services instance 'APPVYR-WIN\DSCTABULAR'. ---> System.Management.Automation.PSArgumentException: Cannot find type [Microsoft.AnalysisServices.Server]: verify that the assembly containing this type is loaded.

@codecov-io
Copy link

codecov-io commented Jun 14, 2018

Codecov Report

Merging #1150 into dev will increase coverage by <1%.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##            dev   #1150    +/-   ##
=====================================
+ Coverage    98%     98%   +<1%     
=====================================
  Files        36      36            
  Lines      4830    4840    +10     
=====================================
+ Hits       4756    4766    +10     
  Misses       74      74

@stale
Copy link

stale bot commented Jun 28, 2018

Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again.

@stale stale bot added the abandoned The pull request has been abandoned. label Jun 28, 2018
@johlju johlju force-pushed the fix-loadwithpartial branch from 8e26d72 to 86e076f Compare July 30, 2018 14:41
@stale stale bot removed the abandoned The pull request has been abandoned. label Jul 30, 2018
@stale
Copy link

stale bot commented Aug 13, 2018

Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again.

@stale stale bot added the abandoned The pull request has been abandoned. label Aug 13, 2018
@johlju johlju force-pushed the fix-loadwithpartial branch from 86e076f to 7e74046 Compare September 21, 2018 08:19
@stale stale bot removed the abandoned The pull request has been abandoned. label Sep 21, 2018
@stale
Copy link

stale bot commented Oct 5, 2018

Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again.

@stale stale bot added the abandoned The pull request has been abandoned. label Oct 5, 2018
@johlju johlju force-pushed the fix-loadwithpartial branch from 7e74046 to 49e13d9 Compare January 24, 2019 19:43
@stale stale bot removed the abandoned The pull request has been abandoned. label Jan 24, 2019
@johlju
Copy link
Member Author

johlju commented Jan 27, 2019

So the problem with removing LoadWithPartial is that the module SQLPS does not load the type Microsoft.AnalysisServices.Server, and I can't find a way to load it. Although, if we install the module SqlServer and use that it works, because SqlServer do load the type. But using that moduel as a requirement is a breaking change.
But I do want to remove LoadWithPartial as it has problem using that. I will change the integration tests to install the SqlServer module and we see where we are from there.

@johlju johlju force-pushed the fix-loadwithpartial branch from 2f0f2d1 to d277b97 Compare February 4, 2019 09:27
@johlju
Copy link
Member Author

johlju commented Feb 4, 2019

I going in the direction of require the SqlServer module for working with Analysis Services, unless someone know another way of loading the types (without using LoadWithPartial).
But for me to do that we need to have a resource for downloading modules, and that is in the works in the PowerShellGet repo.

@stale
Copy link

stale bot commented Feb 18, 2019

Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again.

@stale stale bot added the abandoned The pull request has been abandoned. label Feb 18, 2019
@johlju
Copy link
Member Author

johlju commented Mar 20, 2019

The resource PSModule has been released in the latest PowerShellGet module. So now we can move forward with this PR I think. But this will be a breaking change, as it no longer will support the SQLPS module, but only the SqlServer module. Because the SqlServer module correctly loads the correct assemblies needed to not have to do LoadWithPartial().

@johlju johlju added the breaking change When used on an issue, the issue has been determined to be a breaking change. label Mar 20, 2019
@johlju johlju changed the title SqlSetup: Connect-SQLAnalysis no longer using LoadWithPartialName() BREAKING CHANGE: SqlSetup: Connect-SQLAnalysis no longer using LoadWithPartialName() Mar 20, 2019
johlju added 3 commits March 20, 2019 18:17
- Now the correct assembly should load when using the helper function
  Connect-SQLAnalysis. Previously is was using LoadWithPartialName() which
  meant that it would load the first assembly in GAC, regardless of which
  PowerShell module was used (SQLPS or SqlSever).
@johlju johlju force-pushed the fix-loadwithpartial branch from d277b97 to 48999d3 Compare March 20, 2019 17:19
@johlju johlju changed the title BREAKING CHANGE: SqlSetup: Connect-SQLAnalysis no longer using LoadWithPartialName() SqlSetup: Connect-SQLAnalysis no longer using LoadWithPartialName() Mar 21, 2019
@johlju johlju removed the breaking change When used on an issue, the issue has been determined to be a breaking change. label Mar 21, 2019
@johlju
Copy link
Member Author

johlju commented Mar 21, 2019

Added this new functionality under a feature flag; 'AnalysisServicesConnection'. This makes it to be a non-breaking change this release. In a future release we can make this the default.

@johlju
Copy link
Member Author

johlju commented Mar 21, 2019

Closing a reopening to kick off the tests.

@johlju johlju closed this Mar 21, 2019
@johlju johlju reopened this Mar 21, 2019
@kwirkykat kwirkykat removed abandoned The pull request has been abandoned. waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels Mar 21, 2019
@johlju johlju added the waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. label Mar 21, 2019
@johlju
Copy link
Member Author

johlju commented Jun 17, 2019

Closing this PR due to inactivity. If there are someone who wants to work on this issue or PR please open a new PR.

@johlju johlju closed this Jun 17, 2019
@johlju johlju removed the waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. label Apr 10, 2020
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.

3 participants