Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
* release/2.3.0: (153 commits)
  (#23) Move call to SetRemotePackageNamesIfAllSpecified
  (#1901) Revert commit to display location
  (maint) Update Authenticode Signature
  (tests) Some minor tweaks for test consistency
  (#310) Set-EnvironmentVariable: delete values properly
  (tests) Remove v2 import tests
  (#310) Fix test issues
  (#310) Fixup v2 compatibility
  (tests) Working on tests during pairing session
  (#2050) Add Pester test for --ignore-pinned option
  (#3381) Add Pester tests for rule command
  (#1144) Add Pester test to cover hash validation
  (#72) Add Pester tests to cover new functionality
  (test) Update assertions for push commands
  (#1310) Add Pester test to validate output
  (#23) Add tests to handle install all
  (#2200) Add test for new enhanced exit code
  (#1764) Add test for new enhanced exit code
  (#1760) Add test for new enhanced exit code
  (#1759) Add test for new enhanced exit code
  ...
  • Loading branch information
gep13 committed Jun 5, 2024
2 parents 256e235 + 80f86d5 commit 5dc8330
Show file tree
Hide file tree
Showing 440 changed files with 23,688 additions and 6,019 deletions.
71 changes: 38 additions & 33 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,28 @@ indent_size = 4
dotnet_diagnostic.RS0030.severity=error
dotnet_diagnostic.RS0031.severity=error
dotnet_diagnostic.RS0035.severity=error
csharp_using_directive_placement = inside_namespace:silent
csharp_using_directive_placement = outside_namespace:warning
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_namespace_declarations = block_scoped:suggestion
csharp_prefer_braces = true:error
csharp_style_namespace_declarations = block_scoped:error
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_prefer_top_level_statements = false:error
csharp_style_expression_bodied_methods = false:warning
csharp_style_expression_bodied_constructors = false:warning
csharp_style_expression_bodied_operators = false:warning
csharp_style_expression_bodied_properties = false:warning
csharp_style_expression_bodied_indexers = false:warning
csharp_style_expression_bodied_accessors = false:warning
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_local_functions = false:error
csharp_indent_labels = no_change
csharp_space_around_binary_operators = before_and_after
csharp_style_throw_expression = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_throw_expression = true:silent
csharp_style_prefer_null_check_over_type_check = true:error
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = false:warning
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
Expand All @@ -55,9 +55,13 @@ csharp_style_prefer_pattern_matching = true:suggestion
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
csharp_style_var_elsewhere = true:suggestion
csharp_style_var_for_built_in_types = true:warning
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = false:silent
csharp_style_prefer_primary_constructors = false:error
csharp_style_prefer_readonly_struct_member = true:suggestion
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true:silent
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true:silent

[*.{cs,vb}]
#### Naming styles ####
Expand Down Expand Up @@ -149,31 +153,32 @@ tab_width = 4
indent_size = 4
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_object_initializer = true:warning
dotnet_style_collection_initializer = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_namespace_match_folder = true:error
dotnet_style_readonly_field = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
dotnet_style_require_accessibility_modifiers = for_non_interface_members:error
dotnet_style_allow_multiple_blank_lines_experimental = true:silent
dotnet_style_allow_statement_immediately_after_block_experimental = true:silent
dotnet_code_quality_unused_parameters = all:suggestion
dotnet_code_quality_unused_parameters = all:error
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_qualification_for_property = false:error
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_event = false:error
dotnet_style_prefer_collection_expression = true:suggestion
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build with .Net Framework
shell: powershell
run: ./build.ps1 --verbosity=diagnostic --target=CI --testExecutionType=unit --shouldRunOpenCover=false
- name: Upload Windows build results
uses: actions/upload-artifact@v3
Expand Down
212 changes: 202 additions & 10 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,22 @@ import jetbrains.buildServer.configs.kotlin.v2019_2.Dependencies
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.pullRequests
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.finishBuildTrigger
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.ScheduleTrigger
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule
import jetbrains.buildServer.configs.kotlin.v2019_2.vcs.GitVcsRoot

project {
buildType(Chocolatey)
buildType(ChocolateySchd)
buildType(ChocolateyQA)
buildType(ChocolateySign)
buildType(ChocolateyDockerWin)
buildType(ChocolateyPosix)
}

object Chocolatey : BuildType({
id = AbsoluteId("Chocolatey")
name = "Build"
name = "Chocolatey CLI (Built with Unit Tests)"

artifactRules = """
""".trimIndent()
Expand Down Expand Up @@ -59,8 +63,7 @@ object Chocolatey : BuildType({
script {
name = "Call Cake"
scriptContent = """
IF "%teamcity.build.triggeredBy%" == "Schedule Trigger" (SET TestType=all) ELSE (SET TestType=unit)
call build.official.bat --verbosity=diagnostic --target=CI --testExecutionType=%%TestType%% --shouldRunOpenCover=false
build.official.bat --verbosity=diagnostic --target=CI --testExecutionType=unit --shouldRunOpenCover=false
""".trimIndent()
}
}
Expand All @@ -69,6 +72,69 @@ object Chocolatey : BuildType({
vcs {
branchFilter = ""
}
}

features {
pullRequests {
provider = github {
authType = token {
token = "%system.GitHubPAT%"
}
}
}
}

requirements {
doesNotExist("docker.server.version")
}
})

object ChocolateySchd : BuildType({
id = AbsoluteId("ChocolateySchd")
name = "Chocolatey CLI (Scheduled Integration Testing)"

artifactRules = """
""".trimIndent()

params {
param("env.vcsroot.branch", "%vcsroot.branch%")
param("env.Git_Branch", "%teamcity.build.vcs.branch.Chocolatey_ChocolateyVcsRoot%")
param("teamcity.git.fetchAllHeads", "true")
password("env.GITHUB_PAT", "%system.GitHubPAT%", display = ParameterDisplay.HIDDEN, readOnly = true)
}

vcs {
root(DslContext.settingsRoot)

branchFilter = """
+:*
""".trimIndent()
}

steps {
powerShell {
name = "Prerequisites"
scriptMode = script {
content = """
if ((Get-WindowsFeature -Name NET-Framework-Features).InstallState -ne 'Installed') {
Install-WindowsFeature -Name NET-Framework-Features
}
choco install windows-sdk-7.1 netfx-4.0.3-devpack --confirm --no-progress
exit ${'$'}LastExitCode
""".trimIndent()
}
}

script {
name = "Call Cake"
scriptContent = """
build.official.bat --verbosity=diagnostic --target=CI --testExecutionType=all --shouldRunOpenCover=false --shouldRunAnalyze=false --shouldRunIlMerge=false --shouldObfuscateOutputAssemblies=false --shouldRunChocolatey=false --shouldRunNuGet=false --shouldAuthenticodeSignMsis=false --shouldAuthenticodeSignOutputAssemblies=false --shouldAuthenticodeSignPowerShellScripts=false
""".trimIndent()
}
}

triggers {
schedule {
schedulingPolicy = daily {
hour = 2
Expand All @@ -82,13 +148,139 @@ object Chocolatey : BuildType({
}
}

features {
pullRequests {
provider = github {
authType = token {
token = "%system.GitHubPAT%"
}
requirements {
doesNotExist("docker.server.version")
}
})

object ChocolateyQA : BuildType({
id = AbsoluteId("ChocolateyQA")
name = "Chocolatey CLI (SonarQube)"

artifactRules = """
""".trimIndent()

params {
param("env.vcsroot.branch", "%vcsroot.branch%")
param("env.Git_Branch", "%teamcity.build.vcs.branch.Chocolatey_ChocolateyVcsRoot%")
param("env.SONARQUBE_ID", "choco")
param("teamcity.git.fetchAllHeads", "true")
password("env.GITHUB_PAT", "%system.GitHubPAT%", display = ParameterDisplay.HIDDEN, readOnly = true)
}

vcs {
root(DslContext.settingsRoot)

branchFilter = """
+:*
""".trimIndent()
}

steps {
powerShell {
name = "Prerequisites"
scriptMode = script {
content = """
if ((Get-WindowsFeature -Name NET-Framework-Features).InstallState -ne 'Installed') {
Install-WindowsFeature -Name NET-Framework-Features
}
choco install windows-sdk-7.1 netfx-4.0.3-devpack dotnet-6.0-runtime --confirm --no-progress
exit ${'$'}LastExitCode
""".trimIndent()
}
}

script {
name = "Call Cake"
scriptContent = """
build.official.bat --verbosity=diagnostic --target=CI --testExecutionType=none --shouldRunAnalyze=false --shouldRunIlMerge=false --shouldObfuscateOutputAssemblies=false --shouldRunChocolatey=false --shouldRunNuGet=false --shouldRunSonarQube=true --shouldRunDependencyCheck=true --shouldAuthenticodeSignMsis=false --shouldAuthenticodeSignOutputAssemblies=false --shouldAuthenticodeSignPowerShellScripts=false
""".trimIndent()
}
}

triggers {
schedule {
schedulingPolicy = weekly {
dayOfWeek = ScheduleTrigger.DAY.Saturday
hour = 2
minute = 45
}
branchFilter = """
+:<default>
""".trimIndent()
triggerBuild = always()
withPendingChangesOnly = false
}
}

requirements {
doesNotExist("docker.server.version")
}
})

object ChocolateySign : BuildType({
id = AbsoluteId("ChocolateySign")
name = "Chocolatey CLI (Script Signing)"

artifactRules = """
""".trimIndent()

params {
param("env.vcsroot.branch", "%vcsroot.branch%")
param("env.Git_Branch", "%teamcity.build.vcs.branch.Chocolatey_ChocolateyVcsRoot%")
param("env.FORCE_OFFICIAL_AUTHENTICODE_SIGNATURE", "true")
param("teamcity.git.fetchAllHeads", "true")
password("env.GITHUB_PAT", "%system.GitHubPAT%", display = ParameterDisplay.HIDDEN, readOnly = true)
}

vcs {
root(DslContext.settingsRoot)

branchFilter = """
+:*
""".trimIndent()
}

steps {
powerShell {
name = "Prerequisites"
scriptMode = script {
content = """
if ((Get-WindowsFeature -Name NET-Framework-Features).InstallState -ne 'Installed') {
Install-WindowsFeature -Name NET-Framework-Features
}
choco install windows-sdk-7.1 netfx-4.0.3-devpack dotnet-6.0-runtime --confirm --no-progress
exit ${'$'}LastExitCode
""".trimIndent()
}
}

step {
name = "Include Signing Keys"
type = "PrepareSigningEnvironment"
}

script {
name = "Call Cake"
scriptContent = """
build.official.bat --verbosity=diagnostic --target=Sign-PowerShellScripts --exclusive
""".trimIndent()
}
}

triggers {
vcs {
triggerRules = """
+:nuspec/**/*.ps1
+:nuspec/**/*.psm1
+:nuspec/**/*.psd1
+:src/chocolatey.resources/**/*.ps1
+:src/chocolatey.resources/**/*.psm1
+:src/chocolatey.resources/**/*.psd1
""".trimIndent()
branchFilter = "+:develop"
}
}

Expand Down Expand Up @@ -261,4 +453,4 @@ object ChocolateyPosix : BuildType({
contains("docker.server.osType", "linux")
exists("docker.server.version")
}
})
})
4 changes: 2 additions & 2 deletions .templates/default/issue-note.sbn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{
if issue_label == "Bug" || issue_label == "Bug Fix" || issue_label == "Bug Fixes"
}}- Fix - {{ issue.title }} - see [#{{ issue.number }}]({{ issue.html_url }}).
}}- Fix - {{ issue.title }} - see [#{{ issue.public_number }}]({{ issue.html_url }}).
{{ else
}}- {{ issue.title }} - see [#{{ issue.number }}]({{ issue.html_url }}).
}}- {{ issue.title }} - see [#{{ issue.public_number }}]({{ issue.html_url }}).
{{ end -}}
4 changes: 2 additions & 2 deletions .templates/default/release-info.sbn
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{
if issues.count > 0
if commits.count > 0
}}As part of this release we had [{{ commits.count }} {{ commits.count | string.pluralize "commit" "commits" }}]({{ commits.html_url }}) which resulted in [{{ issues.count }} {{ issues.count | string.pluralize "issue" "issues" }}]({{ milestone.target.html_url }}?closed=1) being closed.
}}As part of this release we had [{{ commits.count }} {{ commits.count | string.pluralize "commit" "commits" }}]({{ commits.html_url }}) which resulted in [{{ issues.count }} {{ issues.count | string.pluralize "issue" "issues" }}]({{ milestone.target.html_url }}?{{ milestone.query_string }}) being closed.
{{ else
}}As part of this release we had [{{ issues.count }} {{ issues.count | string.pluralize "issue" "issues" }}]({{ milestone.target.html_url }}?closed=1) closed.
}}As part of this release we had [{{ issues.count }} {{ issues.count | string.pluralize "issue" "issues" }}]({{ milestone.target.html_url }}?{{ milestone.query_string }}) closed.
{{ end
else if commits.count > 0
}}As part of this release we had [{{ commits.count }} {{ commits.count | string.pluralize "commit" "commits" }}]({{ commits.html_url }}).
Expand Down
Loading

0 comments on commit 5dc8330

Please sign in to comment.