diff --git a/build/TriggerReleaseBuild.yml b/build/TriggerReleaseBuild.yml index 941be2a..97a2ec9 100644 --- a/build/TriggerReleaseBuild.yml +++ b/build/TriggerReleaseBuild.yml @@ -1,6 +1,38 @@ trigger: - release -steps: -- script: echo Triggering ADO Build - displayName: 'Triggering ADO Build' \ No newline at end of file +resources: + repositories: + - repository: templates_onebranch + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + - repository: m365Pipelines + type: git + name: 1ESPipelineTemplates/M365GPT + ref: refs/tags/release + +extends: + template: v1/M365.Official.PipelineTemplate.yml@m365Pipelines + parameters: + sdl: + roslyn: + enabled: true + arrow: + serviceConnection: DevHome Build VM Generation + baseline: + baselineFile: $(Build.SourcesDirectory)\guardian\SDL\.gdnbaselines + pool: + name: Azure-Pipelines-1ESPT-ExDShared + image: windows-2022 + os: windows + customBuildTags: + - ES365AIMigrationTooling + stages: + - stage: Trigger_Build + dependsOn: [] + jobs: + - job: Trigger_Build + steps: + - script: echo Triggering ADO Build + displayName: 'Triggering ADO Build' \ No newline at end of file diff --git a/build/TriggerStagingBuild.yml b/build/TriggerStagingBuild.yml index 3d4f50e..c13329c 100644 --- a/build/TriggerStagingBuild.yml +++ b/build/TriggerStagingBuild.yml @@ -1,6 +1,38 @@ trigger: - staging -steps: -- script: echo Triggering ADO Build - displayName: 'Triggering ADO Build' \ No newline at end of file +resources: + repositories: + - repository: templates_onebranch + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + - repository: m365Pipelines + type: git + name: 1ESPipelineTemplates/M365GPT + ref: refs/tags/release + +extends: + template: v1/M365.Official.PipelineTemplate.yml@m365Pipelines + parameters: + sdl: + roslyn: + enabled: true + arrow: + serviceConnection: DevHome Build VM Generation + baseline: + baselineFile: $(Build.SourcesDirectory)\guardian\SDL\.gdnbaselines + pool: + name: Azure-Pipelines-1ESPT-ExDShared + image: windows-2022 + os: windows + customBuildTags: + - ES365AIMigrationTooling + stages: + - stage: Trigger_Build + dependsOn: [] + jobs: + - job: Trigger_Build + steps: + - script: echo Triggering ADO Build + displayName: 'Triggering ADO Build' \ No newline at end of file diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index c00faf0..1a5365b 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -20,7 +20,7 @@ parameters: - release variables: - MSIXVersion: '0.1400' + MSIXVersion: '0.1500' solution: '**/GitHubExtension.sln' appxPackageDir: 'AppxPackages' testOutputArtifactDir: 'TestResults' @@ -59,8 +59,6 @@ extends: - task: NuGetToolInstaller@1 - task: NuGetAuthenticate@1 - inputs: - nuGetServiceConnections: 'DevHomeInternal' - task: PowerShell@2 displayName: Replace Stubbed Files @@ -81,9 +79,8 @@ extends: restoreSolution: '$(solution)' feedsToUse: 'config' nugetConfigPath: 'nuget.config' - externalFeedCredentials: 'DevHomeInternal' - - task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@3 + - task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@4 displayName: Send and Download Localization Files for Artifacts condition: and(eq(variables['EnableLocalization'], 'true'), eq(variables['UpdateLocalization'], 'true')) inputs: @@ -98,7 +95,7 @@ extends: appendRelativeDir: true pseudoSetting: Included - - task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@3 + - task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@4 displayName: Download and Use Localization Files condition: eq(variables['EnableLocalization'], 'true') retryCountOnTaskFailure: 2 @@ -148,46 +145,45 @@ extends: filePath: 'build/scripts/Build.ps1' arguments: -Platform "${{ platform }}" -Configuration "${{ configuration }}" -Version $(MSIXVersion) -BuildStep "msix" -AzureBuildingBranch "$(BuildingBranch)" -IsAzurePipelineBuild -ClientId $(GitHubClientId) -ClientSecret $(GitHubClientSecret) - - task: EsrpCodeSigning@2 - inputs: - ConnectedServiceName: 'Xlang Code Signing' - FolderPath: '$(appxPackageDir)\${{ configuration }}' - Pattern: '*.msix' - signConfigType: 'inlineSignParams' - inlineOperation: | - [ - { - "keycode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "Microsoft" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "http://www.microsoft.com" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd sha256" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - } - ] - SessionTimeout: '60' - MaxConcurrency: '50' - MaxRetryAttempts: '5' + - template: ./build/templates/EsrpSigning-Steps.yml@self + parameters: + displayName: Submit *.msix to ESRP for code signing + inputs: + FolderPath: '$(appxPackageDir)\${{ configuration }}' + Pattern: '*.msix' + UseMinimatch: true + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "keycode": "CP-230012", + "operationSetCode": "SigntoolSign", + "parameters": [ + { + "parameterName": "OpusName", + "parameterValue": "Microsoft" + }, + { + "parameterName": "OpusInfo", + "parameterValue": "http://www.microsoft.com" + }, + { + "parameterName": "PageHash", + "parameterValue": "/NPH" + }, + { + "parameterName": "FileDigest", + "parameterValue": "/fd sha256" + }, + { + "parameterName": "TimeStamp", + "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + } + ], + "toolName": "signtool.exe", + "toolVersion": "6.2.9304.0" + } + ] # Commented out until our implementation is fixed # - task: AzureKeyVault@1 @@ -292,46 +288,45 @@ extends: filePath: 'build/scripts/Build.ps1' arguments: -Configuration "${{ configuration }}" -Version $(MSIXVersion) -BuildStep "msixbundle" -IsAzurePipelineBuild - - task: EsrpCodeSigning@2 - inputs: - ConnectedServiceName: 'Xlang Code Signing' - FolderPath: 'AppxBundles\${{ configuration }}' - Pattern: '*.msixbundle' - signConfigType: 'inlineSignParams' - inlineOperation: | - [ - { - "keycode": "CP-230012", - "operationSetCode": "SigntoolSign", - "parameters": [ - { - "parameterName": "OpusName", - "parameterValue": "Microsoft" - }, - { - "parameterName": "OpusInfo", - "parameterValue": "http://www.microsoft.com" - }, - { - "parameterName": "PageHash", - "parameterValue": "/NPH" - }, - { - "parameterName": "FileDigest", - "parameterValue": "/fd sha256" - }, - { - "parameterName": "TimeStamp", - "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - } - ], - "toolName": "signtool.exe", - "toolVersion": "6.2.9304.0" - } - ] - SessionTimeout: '60' - MaxConcurrency: '50' - MaxRetryAttempts: '5' + - template: ./build/templates/EsrpSigning-Steps.yml@self + parameters: + displayName: Submit *.msixbundle to ESRP for code signing + inputs: + FolderPath: 'AppxBundles\${{ configuration }}' + Pattern: '*.msixbundle' + UseMinimatch: true + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "keycode": "CP-230012", + "operationSetCode": "SigntoolSign", + "parameters": [ + { + "parameterName": "OpusName", + "parameterValue": "Microsoft" + }, + { + "parameterName": "OpusInfo", + "parameterValue": "http://www.microsoft.com" + }, + { + "parameterName": "PageHash", + "parameterValue": "/NPH" + }, + { + "parameterName": "FileDigest", + "parameterValue": "/fd sha256" + }, + { + "parameterName": "TimeStamp", + "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + } + ], + "toolName": "signtool.exe", + "toolVersion": "6.2.9304.0" + } + ] templateContext: outputs: @@ -365,7 +360,7 @@ extends: artifactName: MsixBundle_Release targetPath: StorePublish - - task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@3 + - task: MicrosoftTDBuild.tdbuild-task.tdbuild-task.TouchdownBuildTask@4 displayName: Download and Use Localization Files condition: eq(variables['EnableLocalization'], 'true') retryCountOnTaskFailure: 2 @@ -390,11 +385,11 @@ extends: $Files | % { Move-Item -Verbose $_.Directory $_.Directory.Parent.Parent -EA:Ignore } pwsh: true - - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@2 + - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@3 displayName: 'Create Staging StoreBroker Package' condition: eq(variables['BuildingBranch'], 'staging') inputs: - serviceEndpoint: 'DevHomeGitHubExtensionCanary StoreBroker' + serviceEndpoint: 'DevHomeGithubExtensionCanary StoreBroker ServiceConnection' sbConfigPath: '$(System.DefaultWorkingDirectory)\build\store\canary\SBConfig.json' sourceFolder: 'StorePublish' contents: '*.msixbundle' @@ -403,11 +398,11 @@ extends: outSBName: DevHomeStoreSubmissionPackage pdpInclude: 'PDP.xml' - - task: MS-RDX-MRO.windows-store-publish-dev.publish-task.store-publish@2 + - task: MS-RDX-MRO.windows-store-publish-dev.publish-task.store-publish@3 displayName: 'Publish Staging StoreBroker Package' condition: eq(variables['BuildingBranch'], 'staging') inputs: - serviceEndpoint: 'DevHomeGitHubExtensionCanary StoreBroker' + serviceEndpoint: 'DevHomeGithubExtensionCanary StoreBroker ServiceConnection' appId: 9N806ZKPW85R inputMethod: JsonAndZip jsonPath: '$(System.DefaultWorkingDirectory)\SBOutDir\DevHomeStoreSubmissionPackage.json' @@ -418,11 +413,11 @@ extends: jsonZipUpdateMetadata: true updateImages: true - - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@2 + - task: MS-RDX-MRO.windows-store-publish-dev.package-task.store-package@3 displayName: 'Create Release StoreBroker Package' condition: eq(variables['BuildingBranch'], 'release') inputs: - serviceEndpoint: 'DevHomeGitHubExtension StoreBroker' + serviceEndpoint: 'DevHomeGithubExtension StoreBroker ServiceConnection' sbConfigPath: '$(System.DefaultWorkingDirectory)\build\store\preview\SBConfig.json' sourceFolder: 'StorePublish' contents: '*.msixbundle' @@ -431,11 +426,11 @@ extends: outSBName: DevHomeStoreSubmissionPackage pdpInclude: 'PDP.xml' - - task: MS-RDX-MRO.windows-store-publish-dev.publish-task.store-publish@2 + - task: MS-RDX-MRO.windows-store-publish-dev.publish-task.store-publish@3 displayName: 'Publish Release StoreBroker Package' condition: eq(variables['BuildingBranch'], 'release') inputs: - serviceEndpoint: 'DevHomeGitHubExtension StoreBroker' + serviceEndpoint: 'DevHomeGithubExtension StoreBroker ServiceConnection' appId: 9NZCC27PR6N6 inputMethod: JsonAndZip jsonPath: '$(System.DefaultWorkingDirectory)\SBOutDir\DevHomeStoreSubmissionPackage.json' diff --git a/build/scripts/CreateBuildInfo.ps1 b/build/scripts/CreateBuildInfo.ps1 index de6a73b..07ac422 100644 --- a/build/scripts/CreateBuildInfo.ps1 +++ b/build/scripts/CreateBuildInfo.ps1 @@ -5,7 +5,7 @@ Param( ) $Major = "0" -$Minor = "14" +$Minor = "15" $Patch = "99" # default to 99 for local builds $versionSplit = $Version.Split("."); diff --git a/build/templates/EsrpSigning-Steps.yml b/build/templates/EsrpSigning-Steps.yml new file mode 100644 index 0000000..63eb25b --- /dev/null +++ b/build/templates/EsrpSigning-Steps.yml @@ -0,0 +1,22 @@ +parameters: + - name: displayName + type: string + default: ESRP Code Signing + - name: inputs + type: object + default: {} + +steps: + - task: EsrpCodeSigning@5 + displayName: ${{ parameters.displayName }} + inputs: + ConnectedServiceName: $(EsrpConnectedServiceName) + AppRegistrationClientId: $(EsrpAppRegistrationClientId) + AppRegistrationTenantId: $(EsrpAppRegistrationTenantId) + AuthAKVName: $(EsrpAuthAKVName) + AuthCertName: $(EsrpAuthCertName) + AuthSignCertName: $(EsrpAuthSignCertName) + SessionTimeout: '60' + MaxConcurrency: '50' + MaxRetryAttempts: '5' + ${{ insert }}: ${{ parameters.inputs }} diff --git a/exclusion.dic b/exclusion.dic index 548f38a..3569188 100644 --- a/exclusion.dic +++ b/exclusion.dic @@ -12,3 +12,4 @@ Stringify riid Impl microsoft +octokit diff --git a/src/GitHubExtension/Client/Validation.cs b/src/GitHubExtension/Client/Validation.cs index d731b91..99da1c8 100644 --- a/src/GitHubExtension/Client/Validation.cs +++ b/src/GitHubExtension/Client/Validation.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -using GitHubExtension.DataModel; using Octokit; using Serilog; diff --git a/src/GitHubExtension/DataManager/GitHubSearchManger.cs b/src/GitHubExtension/DataManager/GitHubSearchManager.cs similarity index 95% rename from src/GitHubExtension/DataManager/GitHubSearchManger.cs rename to src/GitHubExtension/DataManager/GitHubSearchManager.cs index 90d61d2..300c50b 100644 --- a/src/GitHubExtension/DataManager/GitHubSearchManger.cs +++ b/src/GitHubExtension/DataManager/GitHubSearchManager.cs @@ -4,7 +4,6 @@ using GitHubExtension.Client; using GitHubExtension.DataManager; using Microsoft.Windows.DevHome.SDK; -using Octokit; using Serilog; namespace GitHubExtension; @@ -53,7 +52,7 @@ public async Task SearchForGitHubIssuesOrPRs(Octokit.SearchIssuesRequest request await SearchForGitHubIssuesOrPRs(request, initiator, category, client, options); } - private async Task SearchForGitHubIssuesOrPRs(Octokit.SearchIssuesRequest request, string initiator, SearchCategory category, GitHubClient client, RequestOptions? options = null) + private async Task SearchForGitHubIssuesOrPRs(Octokit.SearchIssuesRequest request, string initiator, SearchCategory category, Octokit.GitHubClient client, RequestOptions? options = null) { Log.Information(Name, $"Searching for issues or pull requests for widget {initiator}"); request.State = Octokit.ItemState.Open; diff --git a/src/GitHubExtension/Widgets/GitHubReleasesWidget.cs b/src/GitHubExtension/Widgets/GitHubReleasesWidget.cs index 80c1e52..6d061d2 100644 --- a/src/GitHubExtension/Widgets/GitHubReleasesWidget.cs +++ b/src/GitHubExtension/Widgets/GitHubReleasesWidget.cs @@ -6,7 +6,6 @@ using GitHubExtension.DataManager; using GitHubExtension.Helpers; using GitHubExtension.Widgets.Enums; -using Octokit; namespace GitHubExtension.Widgets; diff --git a/src/GitHubExtension/Widgets/GitHubRepositoryWidget.cs b/src/GitHubExtension/Widgets/GitHubRepositoryWidget.cs index 990e7bf..067b36a 100644 --- a/src/GitHubExtension/Widgets/GitHubRepositoryWidget.cs +++ b/src/GitHubExtension/Widgets/GitHubRepositoryWidget.cs @@ -46,6 +46,19 @@ public string GetUnescapedIssueQuery() return Uri.UnescapeDataString(GetIssueQuery()).Replace('+', ' '); } + // If the user changed the URL after clicking submit and clicked + // saved just after, we change it back to what was before to not corrupt our saved data. + private void CorrectUrl() + { + var configurationData = JsonNode.Parse(ConfigurationData); + if (configurationData != null) + { + configurationData["url"] = RepositoryUrl; + ConfigurationData = configurationData.ToJsonString(); + UpdateWidget(); + } + } + public override void OnActionInvoked(WidgetActionInvokedArgs actionInvokedArgs) { var verb = GetWidgetActionForVerb(actionInvokedArgs.Verb); @@ -60,6 +73,7 @@ public override void OnActionInvoked(WidgetActionInvokedArgs actionInvokedArgs) case WidgetAction.Save: UpdateTitle(JsonNode.Parse(actionInvokedArgs.Data)); base.OnActionInvoked(actionInvokedArgs); + CorrectUrl(); break; default: @@ -256,7 +270,7 @@ public string GetConfiguration(string dataUrl) { "owner", repository.Owner.Login }, { "milestone", string.Empty }, { "project", repository.Description }, - { "url", repository.HtmlUrl }, + { "url", RepositoryUrl }, { "query", GetUnescapedIssueQuery() }, };