Sampler icon indicating copy to clipboard operation
Sampler copied to clipboard

adding some fixes

Open gaelcolas opened this issue 1 year ago • 7 comments

Fixing template and deprecating an old task we probably shouldn't be using anymore...

Asking @johlju to review and assess the impact.


This change is Reviewable

gaelcolas avatar Apr 25 '23 05:04 gaelcolas

Codecov Report

Merging #428 (52f2237) into main (16933e1) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@         Coverage Diff         @@
##           main   #428   +/-   ##
===================================
  Coverage    81%    81%           
===================================
  Files        44     44           
  Lines      2319   2319           
===================================
  Hits       1899   1899           
  Misses      420    420           

codecov[bot] avatar Apr 25 '23 05:04 codecov[bot]

We probably should raise an issue in the affected repos before merging/releasing then. Yes, I should think through the changes required for the RequiredModules. For me the old task was always a problem in new projects.

Regarding the ReleaseAssets:, it's not used by default, but it's very useful to add stuff to the GitHub release... https://github.com/chocolatey-community/Chocolatey/releases/tag/v0.2.0-preview0009

For instance in the Chocolatey module I add the Azure Automanage Machine Configuration packages/zips: image

gaelcolas avatar Apr 26 '23 05:04 gaelcolas

Regarding the ReleaseAssets:, it's not used by default, but it's very useful to add stuff to the GitHub release...

Cool. Will see if I can implement it for SqlServerDsc (and then add it to Sampler).

johlju avatar Apr 26 '23 10:04 johlju

We probably should raise an issue in the affected repos before merging/releasing then.

Maybe I have a script to create an issue in several repos. Though, I wonder if it easier to just propose a PR in each repo, then we can fix the the VM image to windows-latest for the build phase too.

Repos that need to change:

  • [ ] https://github.com/dsccommunity/SharePointDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/NetworkingDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/HyperVDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/JeaDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/ExchangeDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/NpmDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/ComputerManagementDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/DFSDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/xPSDesiredStateConfiguration/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/StorageDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/ConfigMgrCBDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/xRemoteDesktopSessionHost/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/WSManDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/DnsServerDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/WebAdministrationDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/DscResource.DocGenerator/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/CertificateDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/xCredSSP/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/GPRegistryPolicyDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/SecurityPolicyDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/ActiveDirectoryDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/FailoverClusterDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/SChannelDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/xDhcpServer/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/FileContentDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/iSCSIDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/FSRMDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/ActiveDirectoryCSDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/AzureDevOpsDsc/blob/main/build.yaml
  • [ ] https://github.com/dsccommunity/OfficeOnlineServerDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/PostgreSqlDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/xBitlocker/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/DpkgPackage/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/GitHubEnterpriseDsc/blob/master/build.yaml
  • [ ] https://github.com/dsccommunity/xWindowsUpdate/blob/master/build.yaml

johlju avatar Apr 26 '23 10:04 johlju

I will slowly fix the most used repos so we can get this merged.

johlju avatar Sep 05 '23 12:09 johlju

After trying to update SharePointDsc and failed - concluded the task in Sampler cannot be removed because the new task in DscResource.Test only support Pester 5 currently. The task in Sampler uses the v4 tests in DscResource.Test.

The DscResource.Test command Invoke-DscResourceTest it seems it can run both the v4 and v5 tests depending on what version is installed but the new task does not use that command - not sure why, maybe we never got that far. There need to be a refactoring of the command and the new task. There are a lot of logic in the new task that is not in the command. But that might just be okay since the task knows how to read from build.yaml, but in the end maybe it should call the command as well.

Old task calls the command.

https://github.com/gaelcolas/Sampler/blob/a14049c5241e75f52270d292c026d67dac173a92/.build/tasks/DscResource.Test.build.ps1#L232

The new task calls Invoke-Pester directly.

https://github.com/dsccommunity/DscResource.Test/blob/88d3e7bb7aa59406d6fc3ff260649be6b462c0e6/source/tasks/Invoke_HQRM_Tests.build.ps1#L458-L465

johlju avatar Sep 05 '23 14:09 johlju

This is to much work to do now. :/ I put it back on the back-burner...

johlju avatar Sep 05 '23 14:09 johlju