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

adding some fixes #428

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

adding some fixes #428

wants to merge 3 commits into from

Conversation

gaelcolas
Copy link
Owner

@gaelcolas gaelcolas commented Apr 25, 2023

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 gaelcolas requested a review from johlju April 25, 2023 05:32
@codecov
Copy link

codecov bot commented Apr 25, 2023

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           

Copy link
Collaborator

@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.

Asking @johlju to review and assess the impact.

Actually didn't realize that this was different for some modules in DSC Community. It will fail on for example ExchangeDsc but for example SqlServerDsc and others already have this change. Simple fix by adding the correct config. The impact will be som maintaining work to unblock PRs. But this change is good and needed.

Looks good if the RequiredModules file do not need updating.

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @gaelcolas)

a discussion (no related file):
Might make sure the module is added here too. Maybe the if statement need to revised too?

If ($PLASTER_PARAM_ModuleType -in @('dsccommunity','CompleteSample') -or $PLASTER_PARAM_Features -Contains ('All') -or $PLASTER_PARAM_Features -Contains ('DSCResources')) {
@"
'DscResource.Common' = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
xDscResourceDesigner = 'latest'
'DscResource.DocGenerator' = 'latest'
"@

Code quote (from Sampler/Templates/Build/build.yaml.template):

  DscResource.Test:
    - 'Task.*'


build.yaml line 177 at r1 (raw file):

  GitHubFilesToAdd:
    - 'CHANGELOG.md'
  ReleaseAssets:

Curious. Is this used somewhere by something?

Code quote:

ReleaseAssets:

@gaelcolas
Copy link
Owner Author

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

@johlju
Copy link
Collaborator

johlju commented Apr 26, 2023

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
Copy link
Collaborator

johlju commented Apr 26, 2023

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:

@johlju
Copy link
Collaborator

johlju commented Sep 5, 2023

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

Copy link
Collaborator

@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, 3 unresolved discussions (waiting on @gaelcolas)


Sampler/Templates/Build/build.yaml.template line 255 at r1 (raw file):

@"

DscTest:

Must have the key MainGitBranch: set to <%= ${PLASTER_PARAM_MainGitBranch} %> under the key DscTest.

@johlju
Copy link
Collaborator

johlju commented Sep 5, 2023

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.

$script:testResults = Invoke-DscResourceTest @dscTestParams

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
Copy link
Collaborator

johlju commented Sep 5, 2023

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

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.

2 participants