Skip to content

Commit

Permalink
Merge branch 'main' into test-fix-issue-#871
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored Mar 26, 2023
2 parents 80cd226 + c780423 commit 57b32b6
Show file tree
Hide file tree
Showing 267 changed files with 34,326 additions and 9,682 deletions.
File renamed without changes.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/03_command_proposal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: New command proposal
description: If you have a proposal for a new public command that you think should be added to this module. The new command that is proposed shall be able to be used by a new or existing resource.
title: "NewCommandName: New command proposal"
labels: []
assignees: []
body:
- type: markdown
attributes:
value: |
Please replace `NewCommandName` in the issue title (above) with your proposed command name.
Thank you for contributing and making this module better!
- type: textarea
id: description
attributes:
label: Command proposal
description: Provide information how this command will/should work and how it will help users.
validations:
required: true
- type: textarea
id: proposedParameters
attributes:
label: Proposed parameters
description: |
List all the proposed parameters and any parameter sets that the command should have. For each parameter provide a detailed description, the data type, if a default value should be used, and if the property is limited to a set of values.
value: |
Parameter | Mandatory | Data type | Description | Default value | Allowed values
--- | --- | --- | --- | --- | ---
ParameterName | Yes | String | Detailed description | None | None
validations:
required: true
- type: textarea
id: considerations
attributes:
label: Special considerations or limitations
description: |
Provide any considerations or limitations you can think of that a contributor should take in account when coding the proposed command, and or what limitations a user will encounter or should consider when using the proposed command.
validations:
required: true
101 changes: 101 additions & 0 deletions .github/ISSUE_TEMPLATE/05_problem_with_command.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Problem with a command
description: If you want to report a bug or suggest an enhancement to a public command in this module.
labels: []
assignees: []
body:
- type: markdown
attributes:
value: |
TITLE: Please be descriptive not sensationalist.
Your feedback and support is greatly appreciated, thanks for contributing!
Please provide information regarding your issue under each section below.
**Write N/A in sections that do not apply, or if the information is not available.**
- type: textarea
id: description
attributes:
label: Problem description
description: Details of the scenario you tried and the problem that is occurring, or the enhancement you are suggesting.
validations:
required: true
- type: textarea
id: logs
attributes:
label: Verbose logs
description: |
Verbose logs showing the problem. **NOTE! Sensitive information should be obfuscated.** _Will be automatically formatted as plain text._
placeholder: |
Paste verbose logs here
render: text
validations:
required: true
- type: textarea
id: reproducible
attributes:
label: How to reproduce
description: Provide the steps to reproduce the problem.
validations:
required: true
- type: textarea
id: expectedBehavior
attributes:
label: Expected behavior
description: Describe what you expected to happen.
validations:
required: true
- type: textarea
id: currentBehavior
attributes:
label: Current behavior
description: Describe what actually happens.
validations:
required: true
- type: textarea
id: suggestedSolution
attributes:
label: Suggested solution
description: Do you have any suggestions how to solve the issue?
validations:
required: true
- type: textarea
id: targetNodeOS
attributes:
label: Operating system the target node is running
description: |
Please provide as much as possible about the node running the command. _Will be automatically formatted as plain text._
To help with this information:
- On a Linux distribution, please provide the distribution name, version, and release. The following command can help get this information: `cat /etc/*-release && cat /proc/version`
- On a Windows OS please provide edition, version, build, and language. The following command can help get this information: `Get-ComputerInfo -Property @('OsName','OsOperatingSystemSKU','OSArchitecture','WindowsVersion','WindowsBuildLabEx','OsLanguage','OsMuiLanguages')`
placeholder: |
Add operating system information here
render: text
validations:
required: true
- type: textarea
id: targetNodePS
attributes:
label: PowerShell version and build the target node is running
description: |
Please provide the version and build of PowerShell the target node is running. _Will be automatically formatted as plain text._
To help with this information, please run this command: `$PSVersionTable`
placeholder: |
Add PowerShell information here
render: text
validations:
required: true
- type: textarea
id: moduleVersion
attributes:
label: Module version used
description: |
Please provide the version of the module that was used. _Will be automatically formatted as plain text._
To help with this information, please run this command where you encountered the problem: `Get-Module -Name 'SqlServerDsc' -ListAvailable | ft Name,Version,Path`
placeholder: |
Add module information here
render: text
validations:
required: true
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
67 changes: 67 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Code analysis

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

# cSpell: ignore potatoqualitee codeql SARIF
jobs:
pssa:
name: PSScriptAnalyzer
runs-on: windows-latest
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
#actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Module
shell: powershell
run: |
Write-Information -MessageData 'Module is being built so that examples can be scanned.' -InformationAction 'Continue'
.\build.ps1 -ResolveDependency -Tasks 'build'
- name: Run PSScriptAnalyzer
shell: powershell
run: |
Write-Information -MessageData 'Prepare the test pipeline.' -InformationAction 'Continue'
.\build.ps1 -Tasks 'noop'
Write-Information -MessageData 'Load SMO stubs into session.' -InformationAction 'Continue'
Add-Type -Path './tests/Unit/Stubs/SMO.cs'
Write-Information -MessageData 'Import module ConvertToSARIF into the session.' -InformationAction 'Continue'
Import-Module -Name 'ConvertToSARIF' -Force
Write-Information -MessageData 'Import module PSScriptAnalyzer into the session.' -InformationAction 'Continue'
Import-Module -Name 'PSScriptAnalyzer' -Force
$filesToScan = Get-ChildItem -Path './source/' -Recurse -Include @('*.psm1', '*.ps1') -File
Write-Information -MessageData ("Will scan the files:`n`r`t{0}." -f ($filesToScan.FullName -join "`n`r`t")) -InformationAction 'Continue'
Write-Information -MessageData 'Running PSScriptAnalyzer.' -InformationAction 'Continue'
$pssaError = $filesToScan |
Invoke-ScriptAnalyzer -Settings './.vscode/analyzersettings.psd1'
$parseErrorTypes = @(
'TypeNotFound'
'RequiresModuleInvalid'
)
Write-Information -MessageData ('Filter out reported parse errors that is unable to be resolved in source files: {0}' -f ($parseErrorTypes -join ', ')) -InformationAction 'Continue'
$pssaError = $pssaError |
Where-Object -FilterScript {
$_.RuleName -notin $parseErrorTypes
}
Write-Information -MessageData 'Converting PSScriptAnalyzer result to SARIF.' -InformationAction 'Continue'
$pssaError |
ConvertTo-SARIF -FilePath 'results.sarif'
Write-Information -MessageData 'Analyzing done.' -InformationAction 'Continue'
- name: Upload SARIF results
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
- uses: actions/stale@v8
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 40 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.'
close-issue-message: 'This issue has been automatically closed because it is has not had activity from the community in the last 40 days. If this issue was wrongly closed, for a issue author please comment and re-open it, if you are not the issue author comment with a reason for it to be reopened and tag a maintainer in the comment.'
days-before-issue-stale: 30
days-before-issue-close: 40
exempt-issue-labels: 'bug,enhancement,tests,documentation,resource proposal,on hold,resolved'
exempt-issue-labels: 'bug,enhancement,tests,documentation,resource proposal,command proposal,on hold,resolved'
stale-issue-label: 'stale'
stale-pr-message: 'Labeling this pull request (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 this PR is taken up again.'
days-before-pr-stale: 14
Expand Down
13 changes: 9 additions & 4 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@
'UseSyntacticallyCorrectExamples'
)

# TODO: This is not excluded correctly, see test QA/ScriptAnalyzer.Tests.ps1 for more information.
ExcludeRules = @(
'TypeNotFound'
)
<#
The following types are not rules but parse errors reported by PSScriptAnalyzer
so they cannot be ecluded. They need to be filtered out from the result of
Invoke-ScriptAnalyzer.
TypeNotFound - Because classes in the project cannot be found unless built.
RequiresModuleInvalid - Because 'using module' in prefix.ps1 cannot be resolved as source file.
#>
ExcludeRules = @()

Rules = @{
PSUseConsistentWhitespace = @{
Expand Down
6 changes: 4 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.useConstantStrings": true,
"powershell.developer.bundledModulesPath": "${cwd}/output/RequiredModules",
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1",
"powershell.scriptAnalysis.settingsPath": ".vscode/analyzersettings.psd1",
"powershell.scriptAnalysis.enable": true,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
Expand Down Expand Up @@ -98,9 +98,11 @@
},
"powershell.pester.useLegacyCodeLens": false,
"pester.testFilePath": [
"[tT]ests/[qQ][aA]/*.[tT]ests.[pP][sS]1",
"[tT]ests/[uU]nit/**/*.[tT]ests.[pP][sS]1",
"[tT]ests/[uU]nit/*.[tT]ests.[pP][sS]1"
],
"pester.runTestsInNewProcess": false,
"pester.runTestsInNewProcess": true,
"pester.pesterModulePath": "./output/RequiredModules/Pester",
"powershell.pester.codeLens": true,
"pester.suppressCodeLensNotice": true
Expand Down
Loading

0 comments on commit 57b32b6

Please sign in to comment.