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

Missing settings for xWebAppPoolDefaults #324

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

onurbiyik
Copy link

@onurbiyik onurbiyik commented Dec 19, 2017

Fixes #105.

This is mostly based on existing xWebAppPool code. There is some code duplication introduced between these two resources with this change, which means there is room for refactoring.


This change is Reviewable

@onurbiyik
Copy link
Author

Integration tests need to be updated. I should get back working on it.

@johlju
Copy link
Member

johlju commented Apr 23, 2018

@onurbiyik Impressive work here! I will review this one for you, I hope you still can work on this?

@johlju johlju added the needs review The pull request needs a code review. label Apr 23, 2018
@onurbiyik
Copy link
Author

@johlju Thank you. I can work on this but probably not very soon.

I appreciate if you can review this.

Note that most changes were based on how xWebAppPool code looked by the time I was working on it. So, any changes committed since then should be incorporated to xWebAppPoolDefaults as well.

@johlju
Copy link
Member

johlju commented Apr 24, 2018

@onurbiyik I can review it.

Regarding changes to xWebAppPool. If both share a lot of code, we should start by adding helper functions for those new changes. Otherwise xWebAppPoolDefaults resource will be left behind quickly. If changes to xWebAppPool was done in a helper function, tests of xWebAppPoolDefaults would help make sure those changes didn't break xWebAppPoolDefaults, and vice verse.

@johlju
Copy link
Member

johlju commented Apr 24, 2018

This was a big one to review, took a while :) Again, impressive work.


Reviewed 3 of 5 files at r1, 4 of 4 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


README.md, line 227 at r2 (raw file):

autoStart

We should use PascalCase on all these parameter names. For example 'AutoStart' (upper 'A'). Throughout this resource parameters.


README.md, line 1137 at r2 (raw file):

autoStart

We should use PascalCase on all these parameter names. For example 'AutoStart' (upper 'A'). Throughout this example.


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1, line 29 at r2 (raw file):

Name = 'autoStart'

We should use PascalCase on all these parameter names. For example Name = 'AutoStart' (upper 'A'). Throughout this file.


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1, line 149 at r2 (raw file):

function Set-TargetResource {
    <#

Please move this comment-based help block above the function Set-TargetResource {-statement.


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1, line 169 at r2 (raw file):

        [Boolean] $autoStart,

Please add [Parameter()] for each of the parameters in Set-TargetResource and Test-TargetResource (see the parameter $ManagedRuntimeVersion as an example how the parameter should be formatted. Throughout.


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1, line 169 at r2 (raw file):

$autoStart

We should use PascalCase on all these parameter names. For example $AutoStart (upper 'A'). Throughout this file, both Set-TargetResource and Test-TargetResource


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1, line 171 at r2 (raw file):

[String]

Please change to [System.String]. Throughout this file.


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.psm1, line 182 at r2 (raw file):

[Boolean]

Please change to [System.Boolean]. Throughout this file.


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.schema.mof, line 5 at r2 (raw file):

class MSFT_xWebAppPoolDefaults : OMI_BaseResource
{
    [Key, Description("Dummy value because we need a key, always 'Machine'"), ValueMap{"Machine"}, Values{"Machine"}] string ApplyTo;

We should use the single instance method here so it's cleare it can only be used once per configuration, and align with other resources that are alike.
https://docs.microsoft.com/en-us/powershell/dsc/singleinstance

Example of it here: https://github.com/PowerShell/xComputerManagement/blob/dev/Modules/xComputerManagement/DSCResources/MSFT_xPowerPlan/MSFT_xPowerPlan.schema.mof


DSCResources/MSFT_xWebAppPoolDefaults/MSFT_xWebAppPoolDefaults.schema.mof, line 7 at r2 (raw file):

autoStart

We should use PascalCase on all these property names. For example 'AutoStart' (upper 'A'). Throughout this file.


Examples/Sample_xWebAppPoolDefaults.ps1, line 25 at r2 (raw file):

autoStart

We should use PascalCase on all these parameter names. For example 'AutoStart' (upper 'A'). Throughout this file.


Tests/Integration/MSFT_xWebAppPoolDefaults.config.ps1, line 26 at r2 (raw file):

autoStart

We should use PascalCase on all these parameter names. For example 'AutoStart' (upper 'A'). Throughout this file.


Tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1, line 86 at r2 (raw file):

                    Should Be $TestParameters['Credential'].GetNetworkCredential().Password
                }
                elseif ($parameter.Name -eq 'ApplyTo')

Couldn't we test this property just like any other?


Tests/Unit/MSFT_xWebAppPoolDefaults.tests.ps1, line 478 at r2 (raw file):

                It 'Should return True' {
                    Test-TargetResource -ApplyTo Machine @testParamsSplat |

We could splat all parameters if we are splatting. Throughout this file.


Comments from Reviewable

@johlju johlju added waiting for author response The pull request is waiting for the author to respond to comments in the pull request. 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. waiting for author response The pull request is waiting for the author to respond to comments in the pull request. labels Apr 24, 2018
@codecov-io
Copy link

codecov-io commented May 4, 2018

Codecov Report

❗ No coverage uploaded for pull request base (dev@d022234). Click here to learn what that means.
The diff coverage is 90%.

Impacted file tree graph

@@         Coverage Diff          @@
##             dev   #324   +/-   ##
====================================
  Coverage       ?    89%           
====================================
  Files          ?     14           
  Lines          ?   2354           
  Branches       ?      0           
====================================
  Hits           ?   2108           
  Misses         ?    246           
  Partials       ?      0

@johlju
Copy link
Member

johlju commented May 4, 2018

It seems you got commits from other contributors into this PR, but now worries, it is easy to resolve. To solve this you need to rebase your working branch using git rebase. Here is a link on how to rebase the working branch (same as resolving merge conflicts); https://github.com/PowerShell/DscResources/blob/master/GettingStartedWithGitHub.md#resolve-merge-conflicts
Let me know if you get stuck.

@johlju
Copy link
Member

johlju commented May 9, 2018

@onurbiyik Looks better now! There are still a conflicting file. Could you try the rebase again? Make sure to fetch from the "upstream" before doing rebase (steps in link in previous comment). Let me know if I can help! 🙂

@onurbiyik
Copy link
Author

Thank you for keeping a close eye on this pr. That was helpful.

I need to rework on this issue - not just merely rebase and merge - and incorporate your review comments. It will take some time for me to get on it though.

@johlju
Copy link
Member

johlju commented May 9, 2018

@onurbiyik No worries. When you write 'Done' on the review comments I will be back to continue the review. 🙂 Let me know if you need any help before that.

@johlju
Copy link
Member

johlju commented May 23, 2018

Labeling this 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 the PR is taken up again.

@johlju johlju added abandoned The pull request has been abandoned. 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 May 23, 2018
@johlju johlju changed the base branch from dev to master December 30, 2019 12:18
@gstorme
Copy link

gstorme commented Feb 10, 2020

@onurbiyik are you still working on this?
If not, how can someone else take up on the review comments to proceed with this PR?

@regedit32
Copy link
Member

@johlju johlju changed the base branch from master to main January 7, 2021 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
abandoned The pull request has been abandoned.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xWebAppPoolDefaults missing bunch of settings
5 participants