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

Support 'preview' in version #2155

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ changelog:
labels:
- Ignore
authors:
- dependabot[bot]
- dependabot
categories:
- title: Enhancements & Features ✨
labels:
50 changes: 17 additions & 33 deletions .pipelines/PowerShellEditorServices-Official.yml
Original file line number Diff line number Diff line change
@@ -52,7 +52,10 @@ extends:
- pwsh: |
[xml]$xml = Get-Content PowerShellEditorServices.Common.props
$version = $xml.Project.PropertyGroup.VersionPrefix
$prerelease = $xml.Project.PropertyGroup.VersionSuffix
if ($prerelease) { $version += "-$prerelease" }
Write-Output "##vso[task.setvariable variable=version;isOutput=true]$version"
Write-Output "##vso[task.setvariable variable=prerelease;isOutput=true]$(-not [string]::IsNullOrEmpty($prerelease))"
name: package
displayName: Get version from project properties
- task: onebranch.pipeline.version@1
@@ -61,17 +64,17 @@ extends:
system: Custom
customVersion: $(package.version)
- task: UseDotNet@2
displayName: Install .NET 8.x SDK
displayName: Use .NET 8.x SDK
inputs:
packageType: sdk
version: 8.x
- task: UseDotNet@2
displayName: Install .NET 7.x runtime
displayName: Use .NET 7.x runtime (for tests)
inputs:
packageType: runtime
version: 7.x
- task: UseDotNet@2
displayName: Install .NET 6.x runtime
displayName: Use .NET 6.x runtime (for tests)
inputs:
packageType: runtime
version: 6.x
@@ -80,29 +83,22 @@ extends:
inputs:
pwsh: true
filePath: tools/installPSResources.ps1
- task: PowerShell@2
- pwsh: Invoke-Build TestFull -Configuration $(BuildConfiguration)
displayName: Build and test
inputs:
targetType: inline
pwsh: true
script: Invoke-Build TestFull -Configuration $(BuildConfiguration)
- task: PublishTestResults@2
displayName: Publish test results
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
failTaskOnFailedTests: true
- task: PowerShell@2
- pwsh: |
$assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/module/PowerShellEditorServices/bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll")
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
Write-Host "##vso[task.LogIssue type=error;]Was not built in release configuration!"
exit 1
}
displayName: Assert release configuration
inputs:
targetType: inline
pwsh: true
script: |
$assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/module/PowerShellEditorServices/bin/Core/Microsoft.PowerShell.EditorServices.Hosting.dll")
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
Write-Host "##vso[task.LogIssue type=error;]Was not built in release configuration!"
exit 1
}
continueOnError: true
- task: onebranch.pipeline.signing@1
displayName: Sign 1st-party files
inputs:
@@ -136,22 +132,10 @@ extends:
dependsOn: build
variables:
version: $[ stageDependencies.build.main.outputs['package.version'] ]
prerelease: $[ stageDependencies.build.main.outputs['package.prerelease'] ]
drop: $(Pipeline.Workspace)/drop_build_main
jobs:
- job: validation
displayName: Manual validation
pool:
type: agentless
timeoutInMinutes: 1440
steps:
- task: ManualValidation@0
displayName: Wait 24 hours for validation
inputs:
notifyUsers: $(Build.RequestedForEmail)
instructions: Please validate the release
timeoutInMinutes: 1440
- job: github
dependsOn: validation
displayName: Publish draft to GitHub
pool:
type: windows
@@ -176,7 +160,7 @@ extends:
tagSource: userSpecifiedTag
tag: v$(version)
isDraft: true
isPreRelease: $(prerelease)
addChangeLog: false
releaseNotesSource: inline
releaseNotesInline: |
# TODO: Generate release notes on GitHub!
releaseNotesInline: "<!-- TODO: Generate release notes on GitHub! -->"
26 changes: 14 additions & 12 deletions tools/updateVersion.ps1
Original file line number Diff line number Diff line change
@@ -16,30 +16,32 @@ if ($LASTEXITCODE -ne 0) {

$v = "$($Version.Major).$($Version.Minor).$($Version.Patch)"

$path = "PowerShellEditorServices.Common.props"
$f = Get-Content -Path $path
$Path = "PowerShellEditorServices.Common.props"
$f = Get-Content -Path $Path
$f = $f -replace '^(?<prefix>\s+<VersionPrefix>)(.+)(?<suffix></VersionPrefix>)$', "`${prefix}${v}`${suffix}"
$f = $f -replace '^(?<prefix>\s+<VersionSuffix>)(.*)(?<suffix></VersionSuffix>)$', "`${prefix}$($Version.PreReleaseLabel)`${suffix}"
$f | Set-Content -Path $path
git add $path
$f | Set-Content -Path $Path
git add $Path

$path = "module/PowerShellEditorServices/PowerShellEditorServices.psd1"
$f = Get-Content -Path $path
$Path = "module/PowerShellEditorServices/PowerShellEditorServices.psd1"
$f = Get-Content -Path $Path
$f = $f -replace "^(?<prefix>ModuleVersion = ')(.+)(?<suffix>')`$", "`${prefix}${v}`${suffix}"
$f | Set-Content -Path $path
git add $path
$f | Set-Content -Path $Path
git add $Path

$path = "CHANGELOG.md"
$Changelog = Get-Content -Path $path
$Path = "CHANGELOG.md"
$Changelog = Get-Content -Path $Path
@(
$Changelog[0..1]
"## v$Version"
"### $([datetime]::Now.ToString('dddd, MMMM dd, yyyy'))"
""
"See more details at the GitHub Release for [v$Version](https://github.com/PowerShell/PowerShellEditorServices/releases/tag/v$Version)."
""
$Changes
""
$Changelog[2..$Changelog.Length]
) | Set-Content -Encoding utf8NoBOM -Path $path
git add $path
) | Set-Content -Encoding utf8NoBOM -Path $Path
git add $Path

git commit --edit --message "v$($Version): $Changes"

Unchanged files with check annotations Beta

{
new OmniSharpFileSystemWatcher()
{
GlobPattern = "**/*.{ps1,psm1}",

Check warning on line 50 in src/PowerShellEditorServices/Services/TextDocument/Handlers/DidChangeWatchedFilesHandler.cs

GitHub Actions / dotnet (windows-latest)

Possible null reference assignment.

Check warning on line 50 in src/PowerShellEditorServices/Services/TextDocument/Handlers/DidChangeWatchedFilesHandler.cs

GitHub Actions / ert

Possible null reference assignment.

Check warning on line 50 in src/PowerShellEditorServices/Services/TextDocument/Handlers/DidChangeWatchedFilesHandler.cs

GitHub Actions / themis

Possible null reference assignment.

Check warning on line 50 in src/PowerShellEditorServices/Services/TextDocument/Handlers/DidChangeWatchedFilesHandler.cs

GitHub Actions / analyze (csharp)

Possible null reference assignment.

Check warning on line 50 in src/PowerShellEditorServices/Services/TextDocument/Handlers/DidChangeWatchedFilesHandler.cs

GitHub Actions / dotnet (macos-latest)

Possible null reference assignment.

Check warning on line 50 in src/PowerShellEditorServices/Services/TextDocument/Handlers/DidChangeWatchedFilesHandler.cs

GitHub Actions / dotnet (ubuntu-latest)

Possible null reference assignment.
Kind = WatchKind.Create | WatchKind.Delete | WatchKind.Change,
},
},
namespace PowerShellEditorServices.Test.E2E
{
[Trait("Category", "LSP")]
public class LanguageServerProtocolMessageTests : IClassFixture<LSPTestsFixture>, IDisposable

Check warning on line 31 in test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

GitHub Actions / dotnet (windows-latest)

'LanguageServerProtocolMessageTests' is coupled with '120' different types from '31' different namespaces. Rewrite or refactor the code to decrease its class coupling below '96'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1506)

Check warning on line 31 in test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

GitHub Actions / dotnet (macos-latest)

'LanguageServerProtocolMessageTests' is coupled with '120' different types from '31' different namespaces. Rewrite or refactor the code to decrease its class coupling below '96'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1506)

Check warning on line 31 in test/PowerShellEditorServices.Test.E2E/LanguageServerProtocolMessageTests.cs

GitHub Actions / dotnet (ubuntu-latest)

'LanguageServerProtocolMessageTests' is coupled with '120' different types from '31' different namespaces. Rewrite or refactor the code to decrease its class coupling below '96'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1506)
{
// Borrowed from `VersionUtils` which can't be used here due to an initialization problem.
private static bool IsLinux { get; } = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
protected PsesStdioProcess _psesProcess;
public int ProcessId => _psesProcess.Id;
public async Task InitializeAsync()

Check warning on line 44 in test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs

GitHub Actions / dotnet (windows-latest)

'InitializeAsync' is coupled with '42' different types from '21' different namespaces. Rewrite or refactor the code to decrease its class coupling below '41'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1506)

Check warning on line 44 in test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs

GitHub Actions / dotnet (macos-latest)

'InitializeAsync' is coupled with '42' different types from '21' different namespaces. Rewrite or refactor the code to decrease its class coupling below '41'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1506)

Check warning on line 44 in test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs

GitHub Actions / dotnet (ubuntu-latest)

'InitializeAsync' is coupled with '42' different types from '21' different namespaces. Rewrite or refactor the code to decrease its class coupling below '41'. (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1506)
{
LoggerFactory factory = new();
_psesProcess = new PsesStdioProcess(factory, IsDebugAdapterTests);