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

Removed unnecessary entries #55

Merged
merged 13 commits into from May 15, 2023

Conversation

raandree
Copy link

@raandree raandree commented Apr 21, 2023

Pull Request (PR) description

In PowerShell 7, DSC resources published by this module cannot be found due to this bug: Get-DscResource doesn't identify the class based DSC resource PowerShell/PSDesiredStateConfiguration#117. This PR removes the unnecessary entries in the module manifest.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the file CHANGELOG.md.
    Entry should say what was changed and how that affects users (if applicable), and
    reference the issue being resolved (if applicable).
  • Resource documentation added/updated in comment-based help.
  • Resource parameter descriptions added/updated in comment-based help.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@raandree raandree requested a review from johlju April 21, 2023 14:51
@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #55 (d34f400) into master (7608302) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff          @@
##           master   PowerShell/PowerShell#55   +/-   ##
====================================
  Coverage      35%   35%           
====================================
  Files           5     5           
  Lines         445   445           
====================================
  Hits          160   160           
  Misses        285   285           
Impacted Files Coverage Δ
source/Classes/005.RoleCapabilitiesUtility.ps1 0% <ø> (ø)
source/Classes/005.SessionConfigurationUtility.ps1 0% <ø> (ø)
source/Classes/020.JeaRoleCapabilities.ps1 0% <ø> (ø)
source/Classes/020.JeaSessionConfiguration.ps1 0% <ø> (ø)

@johlju johlju added the needs review The pull request needs a code review. label Apr 21, 2023
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 1 of 3 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @raandree)


build.yaml line 37 at r2 (raw file):

    - Create_changelog_release_output
    - Generate_Conceptual_Help
    #- Generate_Wiki_Content

Why do we have to remove this task?

Code quote:

#- Generate_Wiki_Content

build.yaml line 54 at r2 (raw file):

    - publish_module_to_gallery
    - Publish_Release_To_GitHub
    #- Publish_GitHub_Wiki_Content

Why do we have to remove this task?

Code quote:

#- Publish_GitHub_Wiki_Content

build.yaml line 67 at r2 (raw file):

    - Modules/DscResource.Common
  Script:
    - tests/Unit

We usually have just the unit tests here so that ./build.ps1 -Task test does not make permanent changes to a contributors dev machine. Integration tests will run if this is just set to tests. We usually make a user opt-in to run them by running ./build.ps1 -Task test -PesterScript ./tests/Integration. Are the integration tests in the repo such that they do not make changes to a contributors machine?

Code quote:

- tests/Unit

source/JeaDsc.psd1 line 29 at r2 (raw file):

    VariablesToExport    = @()

    AliasesToExport      = @()

Do we need to remove AliasesToExport too? It would be good to have that one working as ModuleBuilder will generate that one automatically if there are aliases on on public commands.

Code quote:

AliasesToExport      = @()

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: all files reviewed, 4 unresolved discussions (waiting on @raandree)


source/JeaDsc.psd1 line 29 at r2 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Do we need to remove AliasesToExport too? It would be good to have that one working as ModuleBuilder will generate that one automatically if there are aliases on on public commands.

In my tests (thanks to @raandree for steps to reproduce) I saw that it is enough to remove CmdletsToExport. I suggest just removing that property, and add a unit test e.g. tests/QA/check_module_manifest.tests.ps1 and add the folder tests/QA as a folder to run for task test.

Copy link
Author

@raandree raandree left a comment

Choose a reason for hiding this comment

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

Thanks, done all the changes

Reviewable status: 1 of 10 files reviewed, 4 unresolved discussions (waiting on @johlju)


build.yaml line 37 at r2 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Why do we have to remove this task?

Done, thanks for your last fix.


build.yaml line 54 at r2 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

Why do we have to remove this task?

Done, thanks for your last fix.


build.yaml line 67 at r2 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

We usually have just the unit tests here so that ./build.ps1 -Task test does not make permanent changes to a contributors dev machine. Integration tests will run if this is just set to tests. We usually make a user opt-in to run them by running ./build.ps1 -Task test -PesterScript ./tests/Integration. Are the integration tests in the repo such that they do not make changes to a contributors machine?

I see, makes sense. Done.


source/JeaDsc.psd1 line 29 at r2 (raw file):

Previously, johlju (Johan Ljunggren) wrote…

In my tests (thanks to @raandree for steps to reproduce) I saw that it is enough to remove CmdletsToExport. I suggest just removing that property, and add a unit test e.g. tests/QA/check_module_manifest.tests.ps1 and add the folder tests/QA as a folder to run for task test.

Done.

@raandree
Copy link
Author

@johlju, do you think this is ready to be merged?

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:

Reviewed 5 of 8 files at r3, 4 of 4 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @raandree)


tests/QA/Module.Tests.ps1 line 8 at r4 (raw file):

    It "Does not contain key 'CmdletsToExport'" {
        $psd1.ContainsKey('CmdletsToExport') | Should Be $false

We should use Should -BeFalse. But can be fixed in a new PR that converts the tests to Pester 5.


tests/QA/Module.Tests.ps1 line 12 at r4 (raw file):

    It "Does contain key 'DscResourcesToExport'" {
        $psd1.ContainsKey('DscResourcesToExport') | Should Be $true

We should use Should -BeTrue. But can be fixed in a new PR that converts the tests to Pester 5.

@johlju johlju merged commit 64be2b6 into dsccommunity:master May 15, 2023
9 checks passed
@johlju johlju removed the needs review The pull request needs a code review. label May 15, 2023
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.

None yet

2 participants