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: Fix for issue 448 #1301

Merged
merged 18 commits into from
Jun 18, 2019
Merged

SqlSetup: Fix for issue 448 #1301

merged 18 commits into from
Jun 18, 2019

Conversation

nesith
Copy link
Contributor

@nesith nesith commented Mar 6, 2019

Pull Request (PR) description

  • Changes to SqlSetup
    • Changed the logic of how default value of FailoverClusterGroupName is
      set since that was preventing the resource to be able to be debugged
      (issue #448).

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry under the Unreleased section of the change log 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

@nesith
Copy link
Contributor Author

nesith commented Mar 6, 2019

@johlju PR

@johlju johlju added the needs review The pull request needs a code review. label Mar 6, 2019
Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on @nesith)


CHANGELOG.md, line 37 at r1 (raw file):

...as this was causing
the...

Maybe this is more descriptive: ...since that was preventing the resource to be able to be debugged ([issue #448](https://github.com/PowerShell/SqlServerDsc/issues/448)).


DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1, line 1029 at r1 (raw file):

    # Fixing issue 448, setting FailoverClusterGroupName to default value if not specified in configuration
    

We can remove this blank row.


DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1, line 1030 at r1 (raw file):

if(

We should use space between the if-statement and the parenthesis if (.


DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1, line 1032 at r1 (raw file):

$boundParameters.FailoverClusterGroupName

I think it is better to assign it like below, because it it is not part of $PSBoundParameters we don't want it there after we set the default value either. That could indicate wrongly in later code that the user assigned the value when we in fact assigned the default value. $PSBoundParameters should normally only contain those parameters that the user assigned in the configuration. 🙂

$FailoverClusterGroupName = "SQL Server($InstanceName)"

DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1, line 1032 at r1 (raw file):

"SQL Server($InstanceName)"

There should be a space in the name "SQL Server ($InstanceName)" if I look at the old code. 🙂


DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1, line 2155 at r1 (raw file):

    Write-Verbose -Message ($script:localizedData.FeaturesFound -f $($getTargetResourceResult.Features))

    # Fixing issue 448, setting FailoverClusterGroupName to default value if not specified in configuration

Please update this block with the same changes as was made above.


DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.psm1, line 2194 at r1 (raw file):

}#>

This this extra #> should be removed?


DSCResources/MSFT_SqlSetup/MSFT_SqlSetup.schema.mof, line 56 at r1 (raw file):

[Write, Description("The name of the resource group to create for the clustered SQL Server instance.")] String FailoverClusterGroupName;

This should still say ... . Default is 'SQL Server (InstanceName)'., because it still applies, right?

@johlju
Copy link
Member

johlju commented Mar 6, 2019

There are merge conflicts since your PR was not based on the latest changes. Could you please rebase against branch dev using git rebase (not by using git pull or git merge, to keep the commit history). If you don't know how to rebase your local dev and working branch, please look at how to Resolve merge conflicts.
Let me know if you need any assistance.

@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 Mar 6, 2019
@nesith
Copy link
Contributor Author

nesith commented Mar 17, 2019

Sorry had a very busy couple of weeks at work, I will fix the issues sometime this week.

@johlju
Copy link
Member

johlju commented Mar 17, 2019

@nesith no worries. Looking forward merging this. 🙂

@johlju
Copy link
Member

johlju commented Mar 20, 2019

When you have time to work on this, then this PR need to be rebased too because of changes been merged into dev 😃

@codecov-io
Copy link

codecov-io commented Mar 21, 2019

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##            dev   #1301    +/-   ##
=====================================
+ Coverage    98%     98%   +<1%     
=====================================
  Files        36      36            
  Lines      5331    5335     +4     
=====================================
+ Hits       5225    5229     +4     
  Misses      106     106

@nesith
Copy link
Contributor Author

nesith commented Apr 7, 2019

@johlju Hi, Seems the chnages I made to the dynamic variables as per your comments are breaking the tests, I will have a look at this this weekend

@johlju
Copy link
Member

johlju commented Apr 8, 2019

@nesith sounds great! :) Let me know when you are done and I continue the review.

@SteveL-MSFT SteveL-MSFT added this to Waiting for code fix in powershell/dscresources May 14, 2019
@johlju johlju added needs review The pull request needs a code review. and removed waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels Jun 17, 2019
Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r3.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @nesith)

a discussion (no related file):
We should add a test that covers this change. I will help resolve that in a day or so. Just a reminder to myself. 🙂


@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 17, 2019
@johlju johlju changed the title Fix for issue 448 SqlSetup: Fix for issue 448 Jun 17, 2019
@johlju johlju added needs review The pull request needs a code review. and removed waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels Jun 18, 2019
Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

a discussion (no related file):

Previously, johlju (Johan Ljunggren) wrote…

We should add a test that covers this change. I will help resolve that in a day or so. Just a reminder to myself. 🙂

This change was already covered by tests.


Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@johlju
Copy link
Member

johlju commented Jun 18, 2019

Closing and reopening to kick off the tests again,

@johlju johlju closed this Jun 18, 2019
@johlju johlju reopened this Jun 18, 2019
@johlju johlju added ready for merge The pull request was approved by the community and is ready to be merged by a maintainer. and removed needs review The pull request needs a code review. labels Jun 18, 2019
@johlju johlju merged commit e8298d5 into dsccommunity:dev Jun 18, 2019
@johlju
Copy link
Member

johlju commented Jun 18, 2019

@nesith Thank you sending in this PR! I took it over the finish line now. 🙂

@johlju johlju removed the ready for merge The pull request was approved by the community and is ready to be merged by a maintainer. label Jun 18, 2019
@SteveL-MSFT SteveL-MSFT removed this from Waiting for code fix in powershell/dscresources Nov 27, 2019
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.

SqlSetup: Unable to enable debug mode
3 participants