From 128b3787db8a1a15bcba57389ca81eb161579152 Mon Sep 17 00:00:00 2001 From: thewahome Date: Tue, 15 Oct 2024 13:14:18 +0300 Subject: [PATCH 01/58] Check for missing translations --- .github/workflows/check-translations.yml | 34 +++++++++++ scripts/check-translations.ps1 | 75 ++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 .github/workflows/check-translations.yml create mode 100644 scripts/check-translations.ps1 diff --git a/.github/workflows/check-translations.yml b/.github/workflows/check-translations.yml new file mode 100644 index 0000000000..b9bec792b5 --- /dev/null +++ b/.github/workflows/check-translations.yml @@ -0,0 +1,34 @@ +name: Check Translations + +on: + workflow_dispatch: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + check-translations: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 18.x + + - name: Run translation check + working-directory: vscode/microsoft-kiota + run: scripts/check-translations.ps1 + shell: pwsh + + - name: Upload untranslated strings + if: failure() + uses: actions/upload-artifact@v2 + with: + name: untranslated-strings + path: vscode/microsoft-kiota/untranslated_strings.html diff --git a/scripts/check-translations.ps1 b/scripts/check-translations.ps1 new file mode 100644 index 0000000000..d785eff13f --- /dev/null +++ b/scripts/check-translations.ps1 @@ -0,0 +1,75 @@ +# Step 1: Find all instances of vscode.l10n.t() and extract the strings from .ts and .tsx files +Get-ChildItem -Path src -Recurse -Include *.ts, *.tsx | +Select-String -Pattern 'vscode.l10n.t\("([^"]+)"\)' | +ForEach-Object { $_.Matches.Groups[1].Value } | +Sort-Object | +Out-File -FilePath "strings.txt" + +# Step 2: Check translation files in the l10n folder +$results = @() +foreach ($file in Get-ChildItem -Path "l10n" -Filter bundle.l10n.*.json -Recurse) { + $translations = Get-Content $file.FullName | + Select-String -Pattern '"[^"]+"' | + ForEach-Object { $_.Matches.Groups[0].Value.Trim('"') } | + Sort-Object + + $missing = Compare-Object (Get-Content "strings.txt") $translations -PassThru | + Where-Object { $_.SideIndicator -eq "<=" } + + if ($missing) { + $untranslatedItems = $missing | ForEach-Object { "
  • $_
  • " } + $results += [PSCustomObject]@{ + "LanguageFile" = "$($file.Name) ($($untranslatedItems.Count) found)" + "UntranslatedStrings" = "" + } + } +} + +# Create the HTML table +$htmlTable = @" + + + + + + +

    Untranslated Strings

    + + + + + +"@ + +foreach ($result in $results) { + $htmlTable += "" +} + +$htmlTable += @" +
    Language FileUntranslated Strings
    $($result.LanguageFile)$($result.UntranslatedStrings)
    + + +"@ + +$htmlTable | Out-File -FilePath "untranslated_strings.html" + +if ($results.Count -gt 0) { + Write-Host "Untranslated strings found. See untranslated_strings.html for details." -ForegroundColor Red + exit 1 +} +else { + Write-Host "All strings have translations." -ForegroundColor Green +} From 91c669ced32ade421dcf03abbab22b15de540f9e Mon Sep 17 00:00:00 2001 From: thewahome Date: Tue, 15 Oct 2024 13:24:13 +0300 Subject: [PATCH 02/58] upgrade upload artifacts version --- .github/workflows/check-translations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-translations.yml b/.github/workflows/check-translations.yml index b9bec792b5..6d2c69d243 100644 --- a/.github/workflows/check-translations.yml +++ b/.github/workflows/check-translations.yml @@ -28,7 +28,7 @@ jobs: - name: Upload untranslated strings if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: untranslated-strings path: vscode/microsoft-kiota/untranslated_strings.html From ef47c9a34166e8b1c20056945e8015904ab6b7c5 Mon Sep 17 00:00:00 2001 From: thewahome Date: Tue, 15 Oct 2024 13:27:16 +0300 Subject: [PATCH 03/58] Fix translation check script path in check-translations.yml --- .github/workflows/check-translations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-translations.yml b/.github/workflows/check-translations.yml index 6d2c69d243..df3b5aa024 100644 --- a/.github/workflows/check-translations.yml +++ b/.github/workflows/check-translations.yml @@ -20,10 +20,11 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18.x + - name: Run translation check working-directory: vscode/microsoft-kiota - run: scripts/check-translations.ps1 + run: ./scripts/check-translations.ps1 shell: pwsh - name: Upload untranslated strings From 03dde6ebe112a9b9bd0972c5ab91e2008b9dc937 Mon Sep 17 00:00:00 2001 From: thewahome Date: Tue, 15 Oct 2024 13:37:29 +0300 Subject: [PATCH 04/58] change working directories --- .github/workflows/check-translations.yml | 2 -- scripts/check-translations.ps1 | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/check-translations.yml b/.github/workflows/check-translations.yml index df3b5aa024..adf436535d 100644 --- a/.github/workflows/check-translations.yml +++ b/.github/workflows/check-translations.yml @@ -21,9 +21,7 @@ jobs: with: node-version: 18.x - - name: Run translation check - working-directory: vscode/microsoft-kiota run: ./scripts/check-translations.ps1 shell: pwsh diff --git a/scripts/check-translations.ps1 b/scripts/check-translations.ps1 index d785eff13f..600ee2a86d 100644 --- a/scripts/check-translations.ps1 +++ b/scripts/check-translations.ps1 @@ -1,5 +1,5 @@ # Step 1: Find all instances of vscode.l10n.t() and extract the strings from .ts and .tsx files -Get-ChildItem -Path src -Recurse -Include *.ts, *.tsx | +Get-ChildItem -Path vscode/microsoft-kiota/src -Recurse -Include *.ts, *.tsx | Select-String -Pattern 'vscode.l10n.t\("([^"]+)"\)' | ForEach-Object { $_.Matches.Groups[1].Value } | Sort-Object | From c67f86b0e9915c7c10987ae5c9a89ffa5752c15a Mon Sep 17 00:00:00 2001 From: thewahome Date: Tue, 15 Oct 2024 13:51:29 +0300 Subject: [PATCH 05/58] correct where items are checked --- .github/workflows/check-translations.yml | 5 ++--- scripts/check-translations.ps1 | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-translations.yml b/.github/workflows/check-translations.yml index adf436535d..1515e522ea 100644 --- a/.github/workflows/check-translations.yml +++ b/.github/workflows/check-translations.yml @@ -20,14 +20,13 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18.x - + - name: Run translation check run: ./scripts/check-translations.ps1 shell: pwsh - name: Upload untranslated strings - if: failure() uses: actions/upload-artifact@v4 with: name: untranslated-strings - path: vscode/microsoft-kiota/untranslated_strings.html + path: ./untranslated_strings.html diff --git a/scripts/check-translations.ps1 b/scripts/check-translations.ps1 index 600ee2a86d..8798d9a428 100644 --- a/scripts/check-translations.ps1 +++ b/scripts/check-translations.ps1 @@ -7,7 +7,7 @@ Out-File -FilePath "strings.txt" # Step 2: Check translation files in the l10n folder $results = @() -foreach ($file in Get-ChildItem -Path "l10n" -Filter bundle.l10n.*.json -Recurse) { +foreach ($file in Get-ChildItem -Path "vscode/microsoft-kiota/l10n" -Filter bundle.l10n.*.json -Recurse) { $translations = Get-Content $file.FullName | Select-String -Pattern '"[^"]+"' | ForEach-Object { $_.Matches.Groups[0].Value.Trim('"') } | From 7eee5b5845a0c4ec5e0c58098e7bc0e39a499504 Mon Sep 17 00:00:00 2001 From: thewahome Date: Tue, 15 Oct 2024 14:03:45 +0300 Subject: [PATCH 06/58] No exit with errror --- scripts/check-translations.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/check-translations.ps1 b/scripts/check-translations.ps1 index 8798d9a428..2e07a93b1b 100644 --- a/scripts/check-translations.ps1 +++ b/scripts/check-translations.ps1 @@ -68,7 +68,6 @@ $htmlTable | Out-File -FilePath "untranslated_strings.html" if ($results.Count -gt 0) { Write-Host "Untranslated strings found. See untranslated_strings.html for details." -ForegroundColor Red - exit 1 } else { Write-Host "All strings have translations." -ForegroundColor Green From c3e6f4460121cddedeba710c14bdb2c371831dd5 Mon Sep 17 00:00:00 2001 From: thewahome Date: Tue, 15 Oct 2024 14:11:24 +0300 Subject: [PATCH 07/58] provide summary --- scripts/check-translations.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/check-translations.ps1 b/scripts/check-translations.ps1 index 2e07a93b1b..8d4821925d 100644 --- a/scripts/check-translations.ps1 +++ b/scripts/check-translations.ps1 @@ -19,7 +19,8 @@ foreach ($file in Get-ChildItem -Path "vscode/microsoft-kiota/l10n" -Filter bund if ($missing) { $untranslatedItems = $missing | ForEach-Object { "
  • $_
  • " } $results += [PSCustomObject]@{ - "LanguageFile" = "$($file.Name) ($($untranslatedItems.Count) found)" + "LanguageFile" = "$($file.Name)" + "Count" = "$($untranslatedItems.Count) found" "UntranslatedStrings" = "
      $($untranslatedItems -join "`n")
    " } } @@ -55,7 +56,7 @@ $htmlTable = @" "@ foreach ($result in $results) { - $htmlTable += "$($result.LanguageFile)$($result.UntranslatedStrings)" + $htmlTable += "$($result.LanguageFile) ($($result.Count))$($result.UntranslatedStrings)" } $htmlTable += @" @@ -66,8 +67,14 @@ $htmlTable += @" $htmlTable | Out-File -FilePath "untranslated_strings.html" +# Output a summary table to the workflow log if ($results.Count -gt 0) { Write-Host "Untranslated strings found. See untranslated_strings.html for details." -ForegroundColor Red + Write-Host "| Language File | Count |" + Write-Host "|----------------------------------------|---------|" + foreach ($result in $results) { + Write-Host "| $($result.LanguageFile) | $($result.Count) |" + } } else { Write-Host "All strings have translations." -ForegroundColor Green From 2247d7a23fd5de1ac470c2d7a4fb243daf54c25e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 15 Oct 2024 09:23:16 -0400 Subject: [PATCH 08/58] Update .github/workflows/check-translations.yml --- .github/workflows/check-translations.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-translations.yml b/.github/workflows/check-translations.yml index 1515e522ea..09b02848a1 100644 --- a/.github/workflows/check-translations.yml +++ b/.github/workflows/check-translations.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: 22.x - name: Run translation check run: ./scripts/check-translations.ps1 From 2cbfb159d10ecf1fbf9abf2bfc9d60f0ca41dfd0 Mon Sep 17 00:00:00 2001 From: thewahome Date: Wed, 16 Oct 2024 09:49:21 +0300 Subject: [PATCH 09/58] translation strings unique and parameterised --- scripts/check-translations.ps1 | 46 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/scripts/check-translations.ps1 b/scripts/check-translations.ps1 index 8d4821925d..86a70da5a5 100644 --- a/scripts/check-translations.ps1 +++ b/scripts/check-translations.ps1 @@ -1,8 +1,23 @@ # Step 1: Find all instances of vscode.l10n.t() and extract the strings from .ts and .tsx files -Get-ChildItem -Path vscode/microsoft-kiota/src -Recurse -Include *.ts, *.tsx | -Select-String -Pattern 'vscode.l10n.t\("([^"]+)"\)' | -ForEach-Object { $_.Matches.Groups[1].Value } | -Sort-Object | +$withParamsPattern = 'vscode\.l10n\.t\(["' + "`'" + '`](.+?)["' + "`'" + '`],' +Get-ChildItem -Path vscode/microsoft-kiota/src -Recurse -Include *.ts, *.tsx | +Select-String -Pattern $withParamsPattern | +ForEach-Object { $_.Matches.Groups[1].Value } | +Sort-Object | +Get-Unique | +Out-File -FilePath "strings_with_params.txt" + +$withoutParamsPattern = 'vscode\.l10n\.t\(["' + "`'" + '`]([^"' + "`'" + '`]+)["' + "`'" + '`]\)' +Get-ChildItem -Path vscode/microsoft-kiota/src -Recurse -Include *.ts, *.tsx | +Select-String -Pattern $withoutParamsPattern | +ForEach-Object { $_.Matches.Groups[1].Value } | +Sort-Object | +Get-Unique | +Out-File -FilePath "strings_without_params.txt" + +Get-Content strings_with_params.txt, strings_without_params.txt | +Sort-Object | +Get-Unique | Out-File -FilePath "strings.txt" # Step 2: Check translation files in the l10n folder @@ -12,10 +27,9 @@ foreach ($file in Get-ChildItem -Path "vscode/microsoft-kiota/l10n" -Filter bund Select-String -Pattern '"[^"]+"' | ForEach-Object { $_.Matches.Groups[0].Value.Trim('"') } | Sort-Object - - $missing = Compare-Object (Get-Content "strings.txt") $translations -PassThru | + $missing = Compare-Object (Get-Content "strings.txt") $translations -PassThru | Where-Object { $_.SideIndicator -eq "<=" } - + if ($missing) { $untranslatedItems = $missing | ForEach-Object { "
  • $_
  • " } $results += [PSCustomObject]@{ @@ -32,18 +46,9 @@ $htmlTable = @" @@ -54,17 +59,14 @@ $htmlTable = @" Untranslated Strings "@ - foreach ($result in $results) { $htmlTable += "$($result.LanguageFile) ($($result.Count))$($result.UntranslatedStrings)" } - $htmlTable += @" "@ - $htmlTable | Out-File -FilePath "untranslated_strings.html" # Output a summary table to the workflow log From 75b5411edbe74090bd2ba5378c3297db99fcc4bd Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Tue, 22 Oct 2024 15:13:19 +0300 Subject: [PATCH 10/58] make regex into a continuous string Co-authored-by: Caleb Kiage <747955+calebkiage@users.noreply.github.com> --- scripts/check-translations.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-translations.ps1 b/scripts/check-translations.ps1 index 86a70da5a5..c606ec9c61 100644 --- a/scripts/check-translations.ps1 +++ b/scripts/check-translations.ps1 @@ -1,5 +1,5 @@ # Step 1: Find all instances of vscode.l10n.t() and extract the strings from .ts and .tsx files -$withParamsPattern = 'vscode\.l10n\.t\(["' + "`'" + '`](.+?)["' + "`'" + '`],' +$withParamsPattern = 'vscode\.l10n\.t\(["''`](.+?)["''`],' Get-ChildItem -Path vscode/microsoft-kiota/src -Recurse -Include *.ts, *.tsx | Select-String -Pattern $withParamsPattern | ForEach-Object { $_.Matches.Groups[1].Value } | From e810655e98cfe4c4176413fb414c5e2f74c40ef7 Mon Sep 17 00:00:00 2001 From: thewahome Date: Mon, 25 Nov 2024 13:27:19 +0300 Subject: [PATCH 11/58] move to correct location to avoid noise --- .../openApidescription/searchOrOpenApiDescriptionCommand.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts index a701f233b7..6536ded89d 100644 --- a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts +++ b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts @@ -63,7 +63,7 @@ export class SearchOrOpenApiDescriptionCommand extends Command { if (config.descriptionPath) { await openTreeViewWithProgress(() => this._openApiTreeProvider.setDescriptionUrl(config.descriptionPath!)); + await vscode.window.showInformationMessage(vscode.l10n.t('You can now select the required endpoints from {0}', this._openApiTreeProvider.apiTitle!)); } - await vscode.window.showInformationMessage(vscode.l10n.t('You can now select the required endpoints from {0}', this._openApiTreeProvider.apiTitle!)); } } From 5ca9725f5fdb7b5582fb7a33e404b440c096434a Mon Sep 17 00:00:00 2001 From: thewahome Date: Mon, 25 Nov 2024 14:08:59 +0300 Subject: [PATCH 12/58] show generate after loading api for the first time --- .../searchOrOpenApiDescriptionCommand.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts index 6536ded89d..5ee0859099 100644 --- a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts +++ b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts @@ -63,7 +63,15 @@ export class SearchOrOpenApiDescriptionCommand extends Command { if (config.descriptionPath) { await openTreeViewWithProgress(() => this._openApiTreeProvider.setDescriptionUrl(config.descriptionPath!)); - await vscode.window.showInformationMessage(vscode.l10n.t('You can now select the required endpoints from {0}', this._openApiTreeProvider.apiTitle!)); + + const generateAnswer = vscode.l10n.t("Generate"); + const response = await vscode.window.showInformationMessage( + vscode.l10n.t('Click on Generate after selecting the paths in the API Explorer'), + generateAnswer + ); + if (response === generateAnswer) { + await vscode.commands.executeCommand(`${treeViewId}.generateClient`); + } } } } From 37966c7e5b60a0c4ab574e3ded5abb13995fa67e Mon Sep 17 00:00:00 2001 From: thewahome Date: Mon, 25 Nov 2024 14:09:17 +0300 Subject: [PATCH 13/58] show regenerate after loading api from a workspace --- .../microsoft-kiota/src/commands/editPathsCommand.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts index 311215a8ab..80d925e1ea 100644 --- a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts +++ b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts @@ -1,3 +1,5 @@ +import * as vscode from 'vscode'; + import { extensionId, treeViewId } from "../constants"; import { ClientOrPluginProperties } from "../kiotaInterop"; import { OpenApiTreeProvider } from "../providers/openApiTreeProvider"; @@ -27,5 +29,14 @@ export class EditPathsCommand extends Command { private async loadEditPaths(clientOrPluginKey: string, clientOrPluginObject: ClientOrPluginProperties) { await openTreeViewWithProgress(() => this._openApiTreeProvider.loadEditPaths(clientOrPluginKey, clientOrPluginObject)); + + const regenerateAnswer = vscode.l10n.t("Regenerate"); + const response = await vscode.window.showInformationMessage( + vscode.l10n.t('Click on Regenerate after selecting the paths in the API Explorer'), + regenerateAnswer + ); + if (response === regenerateAnswer) { + await vscode.commands.executeCommand(`kiota.regenerate`); + } } } From 724e74d28bd34ed3197f085034b532a21cc1c30f Mon Sep 17 00:00:00 2001 From: thewahome Date: Mon, 25 Nov 2024 15:29:43 +0300 Subject: [PATCH 14/58] add and respect do not show again option --- .../src/commands/editPathsCommand.ts | 34 +++++++++------ .../searchOrOpenApiDescriptionCommand.ts | 41 +++++++++++-------- vscode/microsoft-kiota/src/constants.ts | 1 + vscode/microsoft-kiota/src/extension.ts | 2 +- 4 files changed, 47 insertions(+), 31 deletions(-) diff --git a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts index 80d925e1ea..6be7a54c0d 100644 --- a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts +++ b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts @@ -1,6 +1,6 @@ import * as vscode from 'vscode'; -import { extensionId, treeViewId } from "../constants"; +import { extensionId, SHOW_MESSAGE_AFTER_API_LOAD, treeViewId } from "../constants"; import { ClientOrPluginProperties } from "../kiotaInterop"; import { OpenApiTreeProvider } from "../providers/openApiTreeProvider"; import { WorkspaceGenerationContext } from "../types/WorkspaceGenerationContext"; @@ -10,11 +10,11 @@ import { Command } from "./Command"; export class EditPathsCommand extends Command { - private _openApiTreeProvider: OpenApiTreeProvider; - - public constructor(openApiTreeProvider: OpenApiTreeProvider) { + constructor( + private openApiTreeProvider: OpenApiTreeProvider, + private context: vscode.ExtensionContext + ) { super(); - this._openApiTreeProvider = openApiTreeProvider; } public getName(): string { @@ -23,20 +23,28 @@ export class EditPathsCommand extends Command { public async execute({ clientOrPluginKey, clientOrPluginObject }: Partial): Promise { await this.loadEditPaths(clientOrPluginKey!, clientOrPluginObject!); - this._openApiTreeProvider.resetInitialState(); + this.openApiTreeProvider.resetInitialState(); await updateTreeViewIcons(treeViewId, false, true); } private async loadEditPaths(clientOrPluginKey: string, clientOrPluginObject: ClientOrPluginProperties) { - await openTreeViewWithProgress(() => this._openApiTreeProvider.loadEditPaths(clientOrPluginKey, clientOrPluginObject)); + await openTreeViewWithProgress(() => this.openApiTreeProvider.loadEditPaths(clientOrPluginKey, clientOrPluginObject)); const regenerateAnswer = vscode.l10n.t("Regenerate"); - const response = await vscode.window.showInformationMessage( - vscode.l10n.t('Click on Regenerate after selecting the paths in the API Explorer'), - regenerateAnswer - ); - if (response === regenerateAnswer) { - await vscode.commands.executeCommand(`kiota.regenerate`); + const showGenerateMessage = this.context.globalState.get(SHOW_MESSAGE_AFTER_API_LOAD, true); + + if (showGenerateMessage) { + const doNotShowAgainOption = vscode.l10n.t("Do not show this again"); + const response = await vscode.window.showInformationMessage( + vscode.l10n.t('Click on Regenerate after selecting the paths in the API Explorer'), + regenerateAnswer, + doNotShowAgainOption + ); + if (response === regenerateAnswer) { + await vscode.commands.executeCommand(`kiota.regenerate`); + } else if (response === doNotShowAgainOption) { + await this.context.globalState.update(SHOW_MESSAGE_AFTER_API_LOAD, false); + } } } } diff --git a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts index 5ee0859099..4dbca1de20 100644 --- a/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts +++ b/vscode/microsoft-kiota/src/commands/openApidescription/searchOrOpenApiDescriptionCommand.ts @@ -1,7 +1,7 @@ import TelemetryReporter from "@vscode/extension-telemetry"; import * as vscode from "vscode"; -import { extensionId, treeViewId } from "../../constants"; +import { extensionId, SHOW_MESSAGE_AFTER_API_LOAD, treeViewId } from "../../constants"; import { setDeepLinkParams } from "../../handlers/deepLinkParamsHandler"; import { searchSteps } from "../../modules/steps/searchSteps"; import { OpenApiTreeProvider } from "../../providers/openApiTreeProvider"; @@ -13,13 +13,11 @@ import { searchDescription } from "./searchDescription"; export class SearchOrOpenApiDescriptionCommand extends Command { - private _openApiTreeProvider: OpenApiTreeProvider; - private _context: vscode.ExtensionContext; - - constructor(openApiTreeProvider: OpenApiTreeProvider, context: vscode.ExtensionContext) { + constructor( + private openApiTreeProvider: OpenApiTreeProvider, + private context: vscode.ExtensionContext + ) { super(); - this._openApiTreeProvider = openApiTreeProvider; - this._context = context; } public getName(): string { @@ -31,7 +29,7 @@ export class SearchOrOpenApiDescriptionCommand extends Command { if (Object.keys(searchParams).length > 0) { let [params, errorsArray] = validateDeepLinkQueryParams(searchParams); setDeepLinkParams(params); - const reporter = new TelemetryReporter(this._context.extension.packageJSON.telemetryInstrumentationKey); + const reporter = new TelemetryReporter(this.context.extension.packageJSON.telemetryInstrumentationKey); reporter.sendTelemetryEvent("DeepLinked searchOrOpenApiDescription", { "searchParameters": JSON.stringify(searchParams), "validationErrors": errorsArray.join(", ") @@ -40,7 +38,7 @@ export class SearchOrOpenApiDescriptionCommand extends Command { // proceed to enable loading of openapi description const yesAnswer = vscode.l10n.t("Yes, override it"); - if (this._openApiTreeProvider.hasChanges()) { + if (this.openApiTreeProvider.hasChanges()) { const response = await vscode.window.showWarningMessage( vscode.l10n.t( "Before adding a new API description, consider that your changes and current selection will be lost."), @@ -58,19 +56,28 @@ export class SearchOrOpenApiDescriptionCommand extends Command { title: vscode.l10n.t("Searching...") }, (progress, _) => { const settings = getExtensionSettings(extensionId); - return searchDescription(this._context, x, settings.clearCache); + return searchDescription(this.context, x, settings.clearCache); })); if (config.descriptionPath) { - await openTreeViewWithProgress(() => this._openApiTreeProvider.setDescriptionUrl(config.descriptionPath!)); + await openTreeViewWithProgress(() => this.openApiTreeProvider.setDescriptionUrl(config.descriptionPath!)); const generateAnswer = vscode.l10n.t("Generate"); - const response = await vscode.window.showInformationMessage( - vscode.l10n.t('Click on Generate after selecting the paths in the API Explorer'), - generateAnswer - ); - if (response === generateAnswer) { - await vscode.commands.executeCommand(`${treeViewId}.generateClient`); + const showGenerateMessage = this.context.globalState.get(SHOW_MESSAGE_AFTER_API_LOAD, true); + + if (showGenerateMessage) { + const doNotShowAgainOption = vscode.l10n.t("Do not show this again"); + const response = await vscode.window.showInformationMessage( + vscode.l10n.t('Click on Generate after selecting the paths in the API Explorer'), + generateAnswer, + doNotShowAgainOption + ); + + if (response === generateAnswer) { + await vscode.commands.executeCommand(`${treeViewId}.generateClient`); + } else if (response === doNotShowAgainOption) { + await this.context.globalState.update(SHOW_MESSAGE_AFTER_API_LOAD, false); + } } } } diff --git a/vscode/microsoft-kiota/src/constants.ts b/vscode/microsoft-kiota/src/constants.ts index 4c627f2e39..d8463811d1 100644 --- a/vscode/microsoft-kiota/src/constants.ts +++ b/vscode/microsoft-kiota/src/constants.ts @@ -15,3 +15,4 @@ export const APIMANIFEST = "apimanifest"; export const REMIND_ME_LATER_FLAG = 'remindMeLater'; export const API_MANIFEST_FILE = "apimanifest.json"; export const MANIFEST_KIOTA_VERSION_KEY = "x-ms-kiota-version"; +export const SHOW_MESSAGE_AFTER_API_LOAD = "show-message-after-api-load"; diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index d681521038..62e3aa6017 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -68,7 +68,7 @@ export async function activate( const removeFromSelectedEndpointsCommand = new RemoveFromSelectedEndpointsCommand(openApiTreeProvider); const filterDescriptionCommand = new FilterDescriptionCommand(openApiTreeProvider); const openDocumentationPageCommand = new OpenDocumentationPageCommand(); - const editPathsCommand = new EditPathsCommand(openApiTreeProvider); + const editPathsCommand = new EditPathsCommand(openApiTreeProvider, context); const searchOrOpenApiDescriptionCommand = new SearchOrOpenApiDescriptionCommand(openApiTreeProvider, context); const generateClientCommand = new GenerateClientCommand(openApiTreeProvider, context, dependenciesInfoProvider, setWorkspaceGenerationContext, kiotaOutputChannel); const regenerateCommand = new RegenerateCommand(context, openApiTreeProvider, kiotaOutputChannel); From ddf5474f332211784418feeb07e6f885fe5faeb8 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 25 Nov 2024 13:44:17 -0500 Subject: [PATCH 15/58] fix: single entry one/any of merging Signed-off-by: Vincent Biret --- CHANGELOG.md | 5 +- .../Extensions/OpenApiSchemaExtensions.cs | 38 +++- src/Kiota.Builder/KiotaBuilder.cs | 10 + .../Kiota.Builder.Tests/KiotaBuilderTests.cs | 176 ++++++++++++++++++ 4 files changed, 223 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17076aa315..224f085f85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Fixed python generation in scenarios with opening/closing tags for code comments. [#5636](https://github.com/microsoft/kiota/issues/5636) -- Fixed Python error when a class inherits from a base class and implements an interface. [5637](https://github.com/microsoft/kiota/issues/5637) -- Fix anyOf/oneOf generation in TypeScript. [5353](https://github.com/microsoft/kiota/issues/5353) +- Fixed Python error when a class inherits from a base class and implements an interface. [#5637](https://github.com/microsoft/kiota/issues/5637) +- Fixed a bug where one/any schemas with single schema entries would be missing properties. [#5808](https://github.com/microsoft/kiota/issues/5808) +- Fixed anyOf/oneOf generation in TypeScript. [5353](https://github.com/microsoft/kiota/issues/5353) - Fixed invalid code in Php caused by "*/*/" in property description. [5635](https://github.com/microsoft/kiota/issues/5635) - Fixed TypeScript generation error when generating usings from shaken serializers. [#5634](https://github.com/microsoft/kiota/issues/5634) diff --git a/src/Kiota.Builder/Extensions/OpenApiSchemaExtensions.cs b/src/Kiota.Builder/Extensions/OpenApiSchemaExtensions.cs index c5ed4b24e9..890231960c 100644 --- a/src/Kiota.Builder/Extensions/OpenApiSchemaExtensions.cs +++ b/src/Kiota.Builder/Extensions/OpenApiSchemaExtensions.cs @@ -68,9 +68,9 @@ public static bool HasAnyProperty(this OpenApiSchema? schema) { return schema?.Properties is { Count: > 0 }; } - public static bool IsInclusiveUnion(this OpenApiSchema? schema) + public static bool IsInclusiveUnion(this OpenApiSchema? schema, uint exclusiveMinimumNumberOfEntries = 1) { - return schema?.AnyOf?.Count(static x => IsSemanticallyMeaningful(x, true)) > 1; + return schema?.AnyOf?.Count(static x => IsSemanticallyMeaningful(x, true)) > exclusiveMinimumNumberOfEntries; // so we don't consider any of object/nullable as a union type } @@ -89,6 +89,36 @@ public static bool IsInherited(this OpenApiSchema? schema) return schema.MergeIntersectionSchemaEntries(schemasToExclude, true, filter); } + internal static OpenApiSchema? MergeInclusiveUnionSchemaEntries(this OpenApiSchema? schema) + { + if (schema is null || !schema.IsInclusiveUnion(0)) return null; + var result = new OpenApiSchema(schema); + result.AnyOf.Clear(); + foreach (var subSchema in schema.AnyOf) + { + foreach (var property in subSchema.Properties) + { + result.Properties.TryAdd(property.Key, property.Value); + } + } + return result; + } + + internal static OpenApiSchema? MergeExclusiveUnionSchemaEntries(this OpenApiSchema? schema) + { + if (schema is null || !schema.IsExclusiveUnion(0)) return null; + var result = new OpenApiSchema(schema); + result.OneOf.Clear(); + foreach (var subSchema in schema.OneOf) + { + foreach (var property in subSchema.Properties) + { + result.Properties.TryAdd(property.Key, property.Value); + } + } + return result; + } + internal static OpenApiSchema? MergeIntersectionSchemaEntries(this OpenApiSchema? schema, HashSet? schemasToExclude = default, bool overrideIntersection = false, Func? filter = default) { if (schema is null) return null; @@ -123,9 +153,9 @@ public static bool IsIntersection(this OpenApiSchema? schema) return meaningfulSchemas?.Count(static x => !string.IsNullOrEmpty(x.Reference?.Id)) > 1 || meaningfulSchemas?.Count(static x => string.IsNullOrEmpty(x.Reference?.Id)) > 1; } - public static bool IsExclusiveUnion(this OpenApiSchema? schema) + public static bool IsExclusiveUnion(this OpenApiSchema? schema, uint exclusiveMinimumNumberOfEntries = 1) { - return schema?.OneOf?.Count(static x => IsSemanticallyMeaningful(x, true)) > 1; + return schema?.OneOf?.Count(static x => IsSemanticallyMeaningful(x, true)) > exclusiveMinimumNumberOfEntries; // so we don't consider one of object/nullable as a union type } private static readonly HashSet oDataTypes = new(StringComparer.OrdinalIgnoreCase) { diff --git a/src/Kiota.Builder/KiotaBuilder.cs b/src/Kiota.Builder/KiotaBuilder.cs index fd4e0887c2..40c3207ff9 100644 --- a/src/Kiota.Builder/KiotaBuilder.cs +++ b/src/Kiota.Builder/KiotaBuilder.cs @@ -1895,6 +1895,16 @@ private CodeElement AddModelDeclarationIfDoesntExist(OpenApiUrlTreeNode currentN // multiple allOf entries that do not translate to inheritance return createdClass; } + else if (schema.MergeInclusiveUnionSchemaEntries() is { } iUMergedSchema && + AddModelClass(currentNode, iUMergedSchema, declarationName, currentNamespace, currentOperation, inheritsFrom) is CodeClass uICreatedClass) + { + return uICreatedClass; + } + else if (schema.MergeExclusiveUnionSchemaEntries() is { } eUMergedSchema && + AddModelClass(currentNode, eUMergedSchema, declarationName, currentNamespace, currentOperation, inheritsFrom) is CodeClass uECreatedClass) + { + return uECreatedClass; + } return AddModelClass(currentNode, schema, declarationName, currentNamespace, currentOperation, inheritsFrom); } return existingDeclaration; diff --git a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs index 606bbe5c62..a62089926f 100644 --- a/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs +++ b/tests/Kiota.Builder.Tests/KiotaBuilderTests.cs @@ -8536,6 +8536,182 @@ public async Task InheritanceWithAllOfBaseClassNoAdditionalPropertiesAsync() Assert.Equal("baseDirectoryObject", link.StartBlock.Inherits.Name); } + [Fact] + public async Task ExclusiveUnionSingleEntriesMergingAsync() + { + var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); + await using var fs = await GetDocumentStreamAsync( +""" +openapi: 3.0.0 +info: + title: "Generator not generating oneOf if the containing schema has type: object" + version: "1.0.0" +servers: + - url: https://mytodos.doesnotexist/ +paths: + /uses-components: + post: + description: Return something + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/UsesComponents" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UsesComponents" +components: + schemas: + ExampleWithSingleOneOfWithTypeObject: + type: object + oneOf: + - $ref: "#/components/schemas/Component1" + discriminator: + propertyName: objectType + ExampleWithSingleOneOfWithoutTypeObject: + oneOf: + - $ref: "#/components/schemas/Component2" + discriminator: + propertyName: objectType + + UsesComponents: + type: object + properties: + component_with_single_oneof_with_type_object: + $ref: "#/components/schemas/ExampleWithSingleOneOfWithTypeObject" + component_with_single_oneof_without_type_object: + $ref: "#/components/schemas/ExampleWithSingleOneOfWithoutTypeObject" + + Component1: + type: object + required: + - objectType + properties: + objectType: + type: string + one: + type: string + + Component2: + type: object + required: + - objectType + properties: + objectType: + type: string + two: + type: string +"""); + var mockLogger = new Mock>(); + var builder = new KiotaBuilder(mockLogger.Object, new GenerationConfiguration { ClientClassName = "Graph", OpenAPIFilePath = tempFilePath }, _httpClient); + var document = await builder.CreateOpenApiDocumentAsync(fs); + var node = builder.CreateUriSpace(document); + var codeModel = builder.CreateSourceModel(node); + + // Verify that all three classes referenced by the discriminator inherit from baseDirectoryObject + var withObjectClass = codeModel.FindChildByName("ExampleWithSingleOneOfWithTypeObject"); + Assert.NotNull(withObjectClass); + var oneProperty = withObjectClass.FindChildByName("one", false); + Assert.NotNull(oneProperty); + + var withoutObjectClass = codeModel.FindChildByName("Component2"); + Assert.NotNull(withObjectClass); + var twoProperty = withoutObjectClass.FindChildByName("two", false); + Assert.NotNull(twoProperty); + } + + [Fact] + public async Task InclusiveUnionSingleEntriesMergingAsync() + { + var tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetTempFileName()); + await using var fs = await GetDocumentStreamAsync( +""" +openapi: 3.0.0 +info: + title: "Generator not generating anyOf if the containing schema has type: object" + version: "1.0.0" +servers: + - url: https://mytodos.doesnotexist/ +paths: + /uses-components: + post: + description: Return something + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/UsesComponents" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/UsesComponents" +components: + schemas: + ExampleWithSingleOneOfWithTypeObject: + type: object + anyOf: + - $ref: "#/components/schemas/Component1" + discriminator: + propertyName: objectType + ExampleWithSingleOneOfWithoutTypeObject: + anyOf: + - $ref: "#/components/schemas/Component2" + discriminator: + propertyName: objectType + + UsesComponents: + type: object + properties: + component_with_single_oneof_with_type_object: + $ref: "#/components/schemas/ExampleWithSingleOneOfWithTypeObject" + component_with_single_oneof_without_type_object: + $ref: "#/components/schemas/ExampleWithSingleOneOfWithoutTypeObject" + + Component1: + type: object + required: + - objectType + properties: + objectType: + type: string + one: + type: string + + Component2: + type: object + required: + - objectType + properties: + objectType: + type: string + two: + type: string +"""); + var mockLogger = new Mock>(); + var builder = new KiotaBuilder(mockLogger.Object, new GenerationConfiguration { ClientClassName = "Graph", OpenAPIFilePath = tempFilePath }, _httpClient); + var document = await builder.CreateOpenApiDocumentAsync(fs); + var node = builder.CreateUriSpace(document); + var codeModel = builder.CreateSourceModel(node); + + // Verify that all three classes referenced by the discriminator inherit from baseDirectoryObject + var withObjectClass = codeModel.FindChildByName("ExampleWithSingleOneOfWithTypeObject"); + Assert.NotNull(withObjectClass); + var oneProperty = withObjectClass.FindChildByName("one", false); + Assert.NotNull(oneProperty); + + var withoutObjectClass = codeModel.FindChildByName("Component2"); + Assert.NotNull(withObjectClass); + var twoProperty = withoutObjectClass.FindChildByName("two", false); + Assert.NotNull(twoProperty); + } + [Fact] public async Task NestedIntersectionTypeAllOfAsync() { From 3174e6c6a4b94d5496220fcc4487c49fbd16fe33 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 25 Nov 2024 14:35:10 -0500 Subject: [PATCH 16/58] fix: nullable information for enum collections Signed-off-by: Vincent Biret --- src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs index 2bee2503fb..b2a97e360b 100644 --- a/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/CSharp/CodeMethodWriter.cs @@ -140,7 +140,7 @@ private void WriteFactoryMethodBodyForUnionModel(CodeMethod codeElement, CodeCla } else if (propertyType.TypeDefinition is CodeClass && propertyType.IsCollection || propertyType.TypeDefinition is null || propertyType.TypeDefinition is CodeEnum) { - var typeName = conventions.GetTypeString(propertyType, codeElement, true, false); + var typeName = conventions.GetTypeString(propertyType, codeElement, true, propertyType.TypeDefinition is CodeEnum && propertyType.CollectionKind is not CodeTypeBase.CodeTypeCollectionKind.None); var valueVarName = $"{property.Name.ToFirstCharacterLowerCase()}Value"; writer.WriteLine($"{(includeElse ? "else " : string.Empty)}if({parseNodeParameter.Name.ToFirstCharacterLowerCase()}.{GetDeserializationMethodName(propertyType, codeElement)} is {typeName} {valueVarName})"); writer.WriteBlock(lines: $"{ResultVarName}.{property.Name.ToFirstCharacterUpperCase()} = {valueVarName};"); @@ -161,7 +161,7 @@ private void WriteFactoryMethodBodyForIntersectionModel(CodeMethod codeElement, { if (property.Type is CodeType propertyType) { - var typeName = conventions.GetTypeString(propertyType, codeElement, true, false); + var typeName = conventions.GetTypeString(propertyType, codeElement, true, propertyType.TypeDefinition is CodeEnum && propertyType.CollectionKind is not CodeTypeBase.CodeTypeCollectionKind.None); var valueVarName = $"{property.Name.ToFirstCharacterLowerCase()}Value"; writer.WriteLine($"{(includeElse ? "else " : string.Empty)}if({parseNodeParameter.Name.ToFirstCharacterLowerCase()}.{GetDeserializationMethodName(propertyType, codeElement)} is {typeName} {valueVarName})"); writer.WriteBlock(lines: $"{ResultVarName}.{property.Name.ToFirstCharacterUpperCase()} = {valueVarName};"); From 6d69bcd60a087dd7d50ac11940e6f797b017155f Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 25 Nov 2024 14:48:18 -0500 Subject: [PATCH 17/58] fix: cast for go enum types Signed-off-by: Vincent Biret --- src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs index 542be4f681..df2e4abd69 100644 --- a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs @@ -195,7 +195,7 @@ private void WriteFactoryMethodBodyForIntersectionModel(CodeMethod codeElement, WriteCollectionCast(propertyTypeImportName, valueVarName, "cast", writer, isInterfaceType ? string.Empty : "*", !isInterfaceType); valueVarName = "cast"; } - else if (propertyType.TypeDefinition is CodeClass || propertyType.TypeDefinition is CodeInterface) + else if (propertyType.TypeDefinition is CodeClass || propertyType.TypeDefinition is CodeInterface || propertyType.TypeDefinition is CodeEnum) { writer.StartBlock($"if {GetTypeAssertion(valueVarName, propertyTypeImportName, "cast", "ok")}; ok {{"); valueVarName = "cast"; From 7477648e11ca1dd82e340b9d2771110eefe193da Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Mon, 25 Nov 2024 15:11:22 -0500 Subject: [PATCH 18/58] fix: missing block close Signed-off-by: Vincent Biret --- src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs index df2e4abd69..c17a8b0044 100644 --- a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs @@ -201,7 +201,7 @@ private void WriteFactoryMethodBodyForIntersectionModel(CodeMethod codeElement, valueVarName = "cast"; } writer.WriteLine($"{ResultVarName}.{property.Setter!.Name.ToFirstCharacterUpperCase()}({valueVarName})"); - if (!propertyType.IsCollection && (propertyType.TypeDefinition is CodeClass || propertyType.TypeDefinition is CodeInterface)) + if (!propertyType.IsCollection && (propertyType.TypeDefinition is CodeClass || propertyType.TypeDefinition is CodeInterface || propertyType.TypeDefinition is CodeEnum)) writer.CloseBlock(); writer.DecreaseIndent(); } From 5d2944ed29c2bccb620db5ddd04717943e02947b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 26 Nov 2024 13:00:22 -0500 Subject: [PATCH 19/58] fix: adds missing pointer symbol Signed-off-by: Vincent Biret --- src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs index c17a8b0044..ea026bd4c8 100644 --- a/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/Go/CodeMethodWriter.cs @@ -197,6 +197,10 @@ private void WriteFactoryMethodBodyForIntersectionModel(CodeMethod codeElement, } else if (propertyType.TypeDefinition is CodeClass || propertyType.TypeDefinition is CodeInterface || propertyType.TypeDefinition is CodeEnum) { + if (propertyType.TypeDefinition is CodeEnum) + { + propertyTypeImportName = conventions.GetTypeString(property.Type, parentClass, false, true); + } writer.StartBlock($"if {GetTypeAssertion(valueVarName, propertyTypeImportName, "cast", "ok")}; ok {{"); valueVarName = "cast"; } From 0b454441e4722a4012ab7a89bec73160b86d82bb Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Wed, 27 Nov 2024 17:51:00 +0300 Subject: [PATCH 20/58] Feature: show plugins and clients in panel (#5784) --- src/kiota/Rpc/IServer.cs | 2 + src/kiota/Rpc/Server.cs | 25 +++ vscode/microsoft-kiota/package-lock.json | 4 +- vscode/microsoft-kiota/package.json | 36 ++++- vscode/microsoft-kiota/package.nls.json | 2 +- .../deleteWorkspaceItemCommand.ts | 80 ++++++++++ .../deleteWorkspaceItem/removeItem.ts | 32 ++++ .../src/commands/editPathsCommand.ts | 8 +- vscode/microsoft-kiota/src/extension.ts | 15 +- .../src/modules/workspace/index.ts | 9 ++ .../workspace/workspaceContentService.ts | 43 +++++ .../src/providers/openApiTreeProvider.ts | 9 +- .../src/providers/sharedService.ts | 35 ++++ .../src/providers/workspaceTreeProvider.ts | 151 +++++++++++++----- .../deleteWorkspaceItemCommand.test.ts | 44 +++++ vscode/microsoft-kiota/src/util.ts | 2 + 16 files changed, 439 insertions(+), 58 deletions(-) create mode 100644 vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts create mode 100644 vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/removeItem.ts create mode 100644 vscode/microsoft-kiota/src/modules/workspace/index.ts create mode 100644 vscode/microsoft-kiota/src/modules/workspace/workspaceContentService.ts create mode 100644 vscode/microsoft-kiota/src/providers/sharedService.ts create mode 100644 vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts diff --git a/src/kiota/Rpc/IServer.cs b/src/kiota/Rpc/IServer.cs index de7a284c0a..2ec90beb7a 100644 --- a/src/kiota/Rpc/IServer.cs +++ b/src/kiota/Rpc/IServer.cs @@ -14,4 +14,6 @@ internal interface IServer Task InfoForDescriptionAsync(string descriptionPath, bool clearCache, CancellationToken cancellationToken); Task> GeneratePluginAsync(string openAPIFilePath, string outputPath, PluginType[] pluginTypes, string[] includePatterns, string[] excludePatterns, string clientClassName, bool cleanOutput, bool clearCache, string[] disabledValidationRules, ConsumerOperation operation, CancellationToken cancellationToken); Task> MigrateFromLockFileAsync(string lockDirectoryPath, CancellationToken cancellationToken); + Task> RemoveClientAsync(string clientName, bool cleanOutput, CancellationToken cancellationToken); + Task> RemovePluginAsync(string pluginName, bool cleanOutput, CancellationToken cancellationToken); } diff --git a/src/kiota/Rpc/Server.cs b/src/kiota/Rpc/Server.cs index e866eab942..b60155710b 100644 --- a/src/kiota/Rpc/Server.cs +++ b/src/kiota/Rpc/Server.cs @@ -299,4 +299,29 @@ private static string NormalizeSlashesInPath(string path) return path.Replace('/', '\\'); return path.Replace('\\', '/'); } + + public Task> RemoveClientAsync(string clientName, bool cleanOutput, CancellationToken cancellationToken) + => RemoveClientOrPluginAsync(clientName, cleanOutput, "Client", (workspaceManagementService, clientName, cleanOutput, cancellationToken) => workspaceManagementService.RemoveClientAsync(clientName, cleanOutput, cancellationToken), cancellationToken); + + private static async Task> RemoveClientOrPluginAsync(string clientName, bool cleanOutput, string typeName, Func removal, CancellationToken cancellationToken) + { + ArgumentException.ThrowIfNullOrEmpty(clientName); + ArgumentException.ThrowIfNullOrEmpty(typeName); + ArgumentNullException.ThrowIfNull(removal); + var logger = new ForwardedLogger(); + try + { + var workspaceManagementService = new WorkspaceManagementService(logger, httpClient, IsConfigPreviewEnabled.Value); + await removal(workspaceManagementService, clientName, cleanOutput, cancellationToken).ConfigureAwait(false); + logger.LogInformation("{TypeName} {ClientName} removed successfully!", typeName, clientName); + } + catch (Exception ex) + { + logger.LogCritical(ex, "error removing the {TypeName}: {ExceptionMessage}", typeName.ToLowerInvariant(), ex.Message); + } + return logger.LogEntries; + } + + public async Task> RemovePluginAsync(string pluginName, bool cleanOutput, CancellationToken cancellationToken) + => await RemoveClientOrPluginAsync(pluginName, cleanOutput, "Plugin", (workspaceManagementService, pluginName, cleanOutput, cancellationToken) => workspaceManagementService.RemovePluginAsync(pluginName, cleanOutput, cancellationToken), cancellationToken); } diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 4cc68c294d..12305789f0 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -1,12 +1,12 @@ { "name": "kiota", - "version": "1.18.100000001", + "version": "1.21.100000001", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kiota", - "version": "1.18.100000001", + "version": "1.21.100000001", "license": "MIT", "dependencies": { "@vscode/extension-telemetry": "^0.9.8", diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index 789703dfe9..266efb9622 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -3,8 +3,8 @@ "displayName": "Microsoft Kiota", "publisher": "ms-graph", "description": "Client generator for HTTP REST APIs described by OpenAPI which helps eliminate the need to take a dependency on a different API client for every API that you need to call, as well as limiting the generation to the exact API surface area you're interested in, thanks to a filtering capability.", - "version": "1.18.100000001", - "kiotaVersion": "1.18.0", + "version": "1.21.100000001", + "kiotaVersion": "1.21.0", "telemetryInstrumentationKey": "4c6357e0-daf9-42b5-bdfb-67878f8957b5", "icon": "images/logo.png", "engines": { @@ -217,12 +217,14 @@ "views": { "kiota-openapi-explorer": [ { - "id": "kiota.openApiExplorer", - "name": "%kiota.openApiExplorer.name%" + "id": "kiota.workspace", + "name": "%kiota.workspace.name%", + "order": 1 }, { - "id": "kiota.workspace", - "name": "%kiota.workspace.name%" + "id": "kiota.openApiExplorer", + "name": "%kiota.openApiExplorer.name%", + "order": 2 } ], "kiota-dependencies-info": [ @@ -301,6 +303,16 @@ "command": "kiota.openApiExplorer.removeAllFromSelectedEndpoints", "when": "view == kiota.openApiExplorer && viewItem != clientNameOrPluginName", "group": "inline@5" + }, + { + "command": "kiota.workspace.selectItem", + "when": "viewItem == item", + "group": "inline@1" + }, + { + "command": "kiota.workspace.deleteItem", + "when": "viewItem == item", + "group": "inline@2" } ], "commandPalette": [ @@ -437,6 +449,18 @@ { "command": "kiota.migrateFromLockFile", "title": "%kiota.migrateClients.title%" + }, + { + "command": "kiota.workspace.selectItem", + "title": "%kiota.openApiExplorer.editPaths.title%", + "category": "Kiota", + "icon": "$(bracket)" + }, + { + "command": "kiota.workspace.deleteItem", + "title": "%kiota.openApiExplorer.removeFromSelectedEndpoints.title%", + "category": "Kiota", + "icon": "$(trash)" } ], "languages": [ diff --git a/vscode/microsoft-kiota/package.nls.json b/vscode/microsoft-kiota/package.nls.json index 5c7baf619a..d1c0f02166 100644 --- a/vscode/microsoft-kiota/package.nls.json +++ b/vscode/microsoft-kiota/package.nls.json @@ -29,7 +29,7 @@ "kiota.openApiExplorer.openFile.title": "Open file", "kiota.workspace.name": "My Workspace", "kiota.openApiExplorer.regenerateButton.title": "Re-generate", - "kiota.openApiExplorer.editPaths.title": "Edit paths", + "kiota.openApiExplorer.editPaths.title": "Select", "kiota.openApiExplorer.refresh.title": "Refresh", "kiota.migrateClients.title": "Migrate API clients" } diff --git a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts new file mode 100644 index 0000000000..bc6dd91a41 --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/deleteWorkspaceItemCommand.ts @@ -0,0 +1,80 @@ +import TelemetryReporter from "@vscode/extension-telemetry"; +import * as vscode from "vscode"; + +import { extensionId } from "../../constants"; +import { getLogEntriesForLevel, KiotaLogEntry, LogLevel } from "../../kiotaInterop"; +import { WorkspaceTreeItem } from "../../providers/workspaceTreeProvider"; +import { isPluginType } from "../../util"; +import { exportLogsAndShowErrors } from "../../utilities/logging"; +import { Command } from "../Command"; +import { removeClient, removePlugin } from "./removeItem"; + +export class DeleteWorkspaceItemCommand extends Command { + constructor( + private _context: vscode.ExtensionContext, + private _kiotaOutputChannel: vscode.LogOutputChannel + ) { + super(); + } + + public getName(): string { + return `${extensionId}.workspace.deleteItem`; + } + + public async execute(workspaceTreeItem: WorkspaceTreeItem): Promise { + const type = workspaceTreeItem.category && isPluginType(workspaceTreeItem.category) ? "plugin" : "client"; + const yesAnswer: vscode.MessageItem = { title: vscode.l10n.t("Yes") }; + const noAnswer: vscode.MessageItem = { title: vscode.l10n.t("No") }; + + const response = await vscode.window.showWarningMessage( + vscode.l10n.t("Do you want to delete this item?"), + yesAnswer, + noAnswer + ); + + if (response?.title === yesAnswer.title) { + const result = await this.deleteItem(type, workspaceTreeItem); + if (result) { + const isSuccess = result.some(k => k.message.includes('removed successfully')); + if (isSuccess) { + void vscode.window.showInformationMessage(vscode.l10n.t('{0} removed successfully.', workspaceTreeItem.label)); + await vscode.commands.executeCommand('kiota.workspace.refresh'); + } else { + await exportLogsAndShowErrors(result, this._kiotaOutputChannel); + } + } + } + } + + private async deleteItem(type: string, workspaceTreeItem: WorkspaceTreeItem): Promise { + const itemName = workspaceTreeItem.label; + const result = await vscode.window.withProgress({ + location: vscode.ProgressLocation.Notification, + cancellable: false, + title: vscode.l10n.t(`Removing ${type}...`) + }, async (progress, _) => { + const start = performance.now(); + const result = type === "plugin" ? await removePlugin( + this._context, + itemName, + false, + ) : await removeClient( + this._context, + itemName, + false, + ); + const duration = performance.now() - start; + const errorsCount = result ? getLogEntriesForLevel(result, LogLevel.critical, LogLevel.error).length : 0; + const reporter = new TelemetryReporter(this._context.extension.packageJSON.telemetryInstrumentationKey); + reporter.sendRawTelemetryEvent(`${extensionId}.remove${type}.completed`, { + "pluginType": itemName, + "errorsCount": errorsCount.toString(), + }, { + "duration": duration, + }); + return result; + }); + return result; + } +} + diff --git a/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/removeItem.ts b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/removeItem.ts new file mode 100644 index 0000000000..8b906d30e9 --- /dev/null +++ b/vscode/microsoft-kiota/src/commands/deleteWorkspaceItem/removeItem.ts @@ -0,0 +1,32 @@ +import * as vscode from "vscode"; +import * as rpc from "vscode-jsonrpc/node"; + +import { connectToKiota, KiotaLogEntry } from "../../kiotaInterop"; + +export function removePlugin(context: vscode.ExtensionContext, pluginName: string, cleanOutput: boolean): Promise { + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType2( + "RemovePlugin" + ); + const result = await connection.sendRequest( + request, + pluginName, + cleanOutput + ); + return result; + }); +}; + +export function removeClient(context: vscode.ExtensionContext, clientName: string, cleanOutput: boolean): Promise { + return connectToKiota(context, async (connection) => { + const request = new rpc.RequestType2( + "RemoveClient" + ); + const result = await connection.sendRequest( + request, + clientName, + cleanOutput + ); + return result; + }); +}; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts index 311215a8ab..2775d21d86 100644 --- a/vscode/microsoft-kiota/src/commands/editPathsCommand.ts +++ b/vscode/microsoft-kiota/src/commands/editPathsCommand.ts @@ -1,3 +1,5 @@ +import * as vscode from "vscode"; + import { extensionId, treeViewId } from "../constants"; import { ClientOrPluginProperties } from "../kiotaInterop"; import { OpenApiTreeProvider } from "../providers/openApiTreeProvider"; @@ -8,11 +10,8 @@ import { Command } from "./Command"; export class EditPathsCommand extends Command { - private _openApiTreeProvider: OpenApiTreeProvider; - - public constructor(openApiTreeProvider: OpenApiTreeProvider) { + public constructor(private _openApiTreeProvider: OpenApiTreeProvider) { super(); - this._openApiTreeProvider = openApiTreeProvider; } public getName(): string { @@ -23,6 +22,7 @@ export class EditPathsCommand extends Command { await this.loadEditPaths(clientOrPluginKey!, clientOrPluginObject!); this._openApiTreeProvider.resetInitialState(); await updateTreeViewIcons(treeViewId, false, true); + await vscode.commands.executeCommand('kiota.workspace.refresh'); } private async loadEditPaths(clientOrPluginKey: string, clientOrPluginObject: ClientOrPluginProperties) { diff --git a/vscode/microsoft-kiota/src/extension.ts b/vscode/microsoft-kiota/src/extension.ts index d681521038..748f13d760 100644 --- a/vscode/microsoft-kiota/src/extension.ts +++ b/vscode/microsoft-kiota/src/extension.ts @@ -4,6 +4,7 @@ import TelemetryReporter from '@vscode/extension-telemetry'; import * as vscode from "vscode"; import { CloseDescriptionCommand } from './commands/closeDescriptionCommand'; +import { DeleteWorkspaceItemCommand } from './commands/deleteWorkspaceItem/deleteWorkspaceItemCommand'; import { EditPathsCommand } from './commands/editPathsCommand'; import { GenerateClientCommand } from './commands/generate/generateClientCommand'; import { displayGenerationResults } from './commands/generate/generation-util'; @@ -27,10 +28,12 @@ import { UriHandler } from './handlers/uriHandler'; import { ClientOrPluginProperties } from "./kiotaInterop"; +import { WorkspaceContentService } from './modules/workspace'; import { CodeLensProvider } from './providers/codelensProvider'; import { DependenciesViewProvider } from "./providers/dependenciesViewProvider"; import { OpenApiTreeNode, OpenApiTreeProvider } from "./providers/openApiTreeProvider"; -import { loadTreeView } from './providers/workspaceTreeProvider'; +import { SharedService } from './providers/sharedService'; +import { loadTreeView, WorkspaceTreeItem, WorkspaceTreeProvider } from './providers/workspaceTreeProvider'; import { getExtensionSettings } from "./types/extensionSettings"; import { GeneratedOutputState } from './types/GeneratedOutputState'; import { WorkspaceGenerationContext } from "./types/WorkspaceGenerationContext"; @@ -50,11 +53,14 @@ export async function activate( kiotaOutputChannel = vscode.window.createOutputChannel("Kiota", { log: true, }); - const openApiTreeProvider = new OpenApiTreeProvider(context, () => getExtensionSettings(extensionId)); + const sharedService = SharedService.getInstance(); + const workspaceContentService = new WorkspaceContentService(); + const openApiTreeProvider = new OpenApiTreeProvider(context, () => getExtensionSettings(extensionId), sharedService); const dependenciesInfoProvider = new DependenciesViewProvider( context.extensionUri ); const reporter = new TelemetryReporter(context.extension.packageJSON.telemetryInstrumentationKey); + const workspaceTreeProvider = new WorkspaceTreeProvider(workspaceContentService, sharedService); const setWorkspaceGenerationContext = (params: Partial) => { workspaceGenerationContext = { ...workspaceGenerationContext, ...params }; @@ -76,9 +82,10 @@ export async function activate( const closeDescriptionCommand = new CloseDescriptionCommand(openApiTreeProvider); const statusCommand = new StatusCommand(); const selectLockCommand = new SelectLockCommand(openApiTreeProvider); + const deleteWorkspaceItemCommand = new DeleteWorkspaceItemCommand(context, kiotaOutputChannel); const updateClientsCommand = new UpdateClientsCommand(context, kiotaOutputChannel); - await loadTreeView(context); + await loadTreeView(context, workspaceTreeProvider); await checkForLockFileAndPrompt(context); let codeLensProvider = new CodeLensProvider(); context.subscriptions.push( @@ -125,6 +132,8 @@ export async function activate( await regenerateCommand.execute({ clientOrPluginKey, clientOrPluginObject, generationType }); }), registerCommandWithTelemetry(reporter, migrateFromLockFileCommand.getName(), async (uri: vscode.Uri) => await migrateFromLockFileCommand.execute(uri)), + registerCommandWithTelemetry(reporter, deleteWorkspaceItemCommand.getName(), async (workspaceTreeItem: WorkspaceTreeItem) => await deleteWorkspaceItemCommand.execute(workspaceTreeItem)), + ); // create a new status bar item that we can now manage diff --git a/vscode/microsoft-kiota/src/modules/workspace/index.ts b/vscode/microsoft-kiota/src/modules/workspace/index.ts new file mode 100644 index 0000000000..a7c863ab8e --- /dev/null +++ b/vscode/microsoft-kiota/src/modules/workspace/index.ts @@ -0,0 +1,9 @@ +import { ClientOrPluginProperties } from "../../kiotaInterop"; +import WorkspaceContentService from "./workspaceContentService"; + +export interface WorkspaceContent { + version: string; + clients: Record; + plugins: Record; +} +export { WorkspaceContentService }; diff --git a/vscode/microsoft-kiota/src/modules/workspace/workspaceContentService.ts b/vscode/microsoft-kiota/src/modules/workspace/workspaceContentService.ts new file mode 100644 index 0000000000..a7997b2444 --- /dev/null +++ b/vscode/microsoft-kiota/src/modules/workspace/workspaceContentService.ts @@ -0,0 +1,43 @@ +import * as vscode from 'vscode'; +import * as path from 'path'; +import * as fs from 'fs'; + +import { WorkspaceContent } from "."; +import { KIOTA_WORKSPACE_FILE } from "../../constants"; +import { getWorkspaceJsonPath } from '../../util'; + +class WorkspaceContentService { + constructor() { } + + public async load(): Promise { + const isWorkspacePresent = await this.isKiotaWorkspaceFilePresent(); + if (!isWorkspacePresent) { + return; + } + try { + const workspaceJson = vscode.workspace.textDocuments.find(doc => doc.fileName.endsWith(KIOTA_WORKSPACE_FILE)); + if (!workspaceJson) { + throw new Error('Workspace file not found'); + } + const content = workspaceJson.getText(); + return JSON.parse(content); + } catch (error) { + console.error('Error loading workspace.json:', error); + } + } + + async isKiotaWorkspaceFilePresent(): Promise { + if (!vscode.workspace.workspaceFolders || vscode.workspace.workspaceFolders.length === 0) { + return false; + } + const workspaceFileDir = path.resolve(getWorkspaceJsonPath()); + try { + await fs.promises.access(workspaceFileDir); + } catch (error) { + return false; + } + return true; + } +} + +export default WorkspaceContentService; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts b/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts index 26386edcb1..56622108b4 100644 --- a/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts +++ b/vscode/microsoft-kiota/src/providers/openApiTreeProvider.ts @@ -21,20 +21,24 @@ import { } from '../kiotaInterop'; import { ExtensionSettings } from '../types/extensionSettings'; import { updateTreeViewIcons } from '../util'; +import { SharedService } from './sharedService'; export class OpenApiTreeProvider implements vscode.TreeDataProvider { private _onDidChangeTreeData: vscode.EventEmitter = new vscode.EventEmitter(); readonly onDidChangeTreeData: vscode.Event = this._onDidChangeTreeData.event; public apiTitle?: string; private initialStateHash: string = ''; + constructor( private readonly context: vscode.ExtensionContext, private readonly settingsGetter: () => ExtensionSettings, + private readonly sharedService: SharedService, private _descriptionUrl?: string, public includeFilters: string[] = [], - public excludeFilters: string[] = []) { - + public excludeFilters: string[] = [], + ) { } + private _workspaceFilePath?: string; private _workspaceFile?: ConfigurationFile | Partial = {}; public get isWorkspaceFileLoaded(): boolean { @@ -332,6 +336,7 @@ export class OpenApiTreeProvider implements vscode.TreeDataProvider = new Map(); + + private constructor() { } + + public static getInstance(): SharedService { + if (!SharedService.instance) { + SharedService.instance = new SharedService(); + } + return SharedService.instance; + } + + public get(key: K): SharedState[K] | undefined { + return this.state.get(key); + } + + public set(key: K, value: SharedState[K]): void { + this.state.set(key, value); + } + + public clear(key: K): void { + this.state.delete(key); + } + + // Method to reset the singleton instance for testing + public static resetInstance(): void { + SharedService.instance = new SharedService(); + } +} \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/providers/workspaceTreeProvider.ts b/vscode/microsoft-kiota/src/providers/workspaceTreeProvider.ts index 0f7ec33fa7..70c9540f13 100644 --- a/vscode/microsoft-kiota/src/providers/workspaceTreeProvider.ts +++ b/vscode/microsoft-kiota/src/providers/workspaceTreeProvider.ts @@ -1,71 +1,142 @@ import * as vscode from 'vscode'; -import * as path from 'path'; -import * as fs from 'fs'; - -import { KIOTA_WORKSPACE_FILE } from '../constants'; -import { getWorkspaceJsonPath } from '../util'; - -export class WorkspaceTreeProvider implements vscode.TreeDataProvider { - public isWSPresent: boolean; - private _onDidChangeTreeData: vscode.EventEmitter = new vscode.EventEmitter(); - readonly onDidChangeTreeData: vscode.Event = this._onDidChangeTreeData.event; - constructor(isWSPresent: boolean) { - this.isWSPresent = isWSPresent; + +import { CLIENTS, KIOTA_WORKSPACE_FILE, PLUGINS } from '../constants'; +import { ClientOrPluginProperties } from '../kiotaInterop'; +import { WorkspaceContent, WorkspaceContentService } from '../modules/workspace'; +import { getWorkspaceJsonPath, isClientType, isPluginType } from '../util'; +import { SharedService } from './sharedService'; + +export class WorkspaceTreeItem extends vscode.TreeItem { + constructor( + public readonly label: string, + public readonly collapsibleState: vscode.TreeItemCollapsibleState, + public readonly type: 'root' | 'category' | 'item' | 'info', + public readonly category?: string, + public readonly properties?: ClientOrPluginProperties, + public command?: vscode.Command + ) { + super(label, collapsibleState); + this.contextValue = type; + } +} + +export class WorkspaceTreeProvider implements vscode.TreeDataProvider { + private _onDidChangeTreeData: vscode.EventEmitter = new vscode.EventEmitter(); + readonly onDidChangeTreeData: vscode.Event = this._onDidChangeTreeData.event; + private workspaceContent: WorkspaceContent | undefined = undefined; + + constructor( + private workspaceContentService: WorkspaceContentService, + private sharedService: SharedService + ) { + void this.loadContent(); } async refreshView(): Promise { + await this.loadContent(); this._onDidChangeTreeData.fire(); } - async getChildren(element?: vscode.TreeItem): Promise { - if (!this.isWSPresent) { + async loadContent(): Promise { + this.workspaceContent = await this.workspaceContentService.load(); + } + + async getChildren(element?: WorkspaceTreeItem): Promise { + if (!this.workspaceContent) { return []; } + if (!element) { - return [new vscode.TreeItem(KIOTA_WORKSPACE_FILE, vscode.TreeItemCollapsibleState.None)]; + const hasClients = this.workspaceContent?.clients && Object.keys(this.workspaceContent.clients).length > 0; + const hasPlugins = this.workspaceContent?.plugins && Object.keys(this.workspaceContent.plugins).length > 0; + const collapsibleState = (hasClients || hasPlugins) ? vscode.TreeItemCollapsibleState.Expanded : vscode.TreeItemCollapsibleState.Collapsed; + return [ + new WorkspaceTreeItem(KIOTA_WORKSPACE_FILE, collapsibleState, 'root') + ]; + } + + if (this.workspaceContent) { + if (element.label === KIOTA_WORKSPACE_FILE) { + const children: WorkspaceTreeItem[] = []; + if (Object.keys(this.workspaceContent.clients).length > 0) { + children.push(new WorkspaceTreeItem(CLIENTS, vscode.TreeItemCollapsibleState.Expanded, 'category')); + } + if (Object.keys(this.workspaceContent.plugins).length > 0) { + children.push(new WorkspaceTreeItem(PLUGINS, vscode.TreeItemCollapsibleState.Expanded, 'category')); + } + if (children.length === 0) { + children.push(new WorkspaceTreeItem(vscode.l10n.t("No clients or plugins are available"), vscode.TreeItemCollapsibleState.None, 'info')); + } + return children; + } + + if (isClientType(element.label)) { + return Object.keys(this.workspaceContent.clients).map(clientName => + new WorkspaceTreeItem(clientName, vscode.TreeItemCollapsibleState.None, 'item', CLIENTS, this.getProperties(clientName, CLIENTS)) + ); + } + + if (isPluginType(element.label)) { + return Object.keys(this.workspaceContent.plugins).map(pluginName => + new WorkspaceTreeItem(pluginName, vscode.TreeItemCollapsibleState.None, 'item', PLUGINS, this.getProperties(pluginName, CLIENTS)) + ); + } } return []; } - getTreeItem(element: vscode.TreeItem): vscode.TreeItem { - if (element) { - element.command = { - command: 'kiota.workspace.openWorkspaceFile', - title: vscode.l10n.t("Open File"), - arguments: [vscode.Uri.file(getWorkspaceJsonPath())] - }; - element.contextValue = 'file'; + getProperties(name: string, category: string): ClientOrPluginProperties | undefined { + if (category && category === CLIENTS) { + return this.workspaceContent?.clients[name]; + } + return this.workspaceContent?.plugins[name]; + } + + getTreeItem(element: WorkspaceTreeItem): WorkspaceTreeItem { + if (!element) { + return element; + } + + switch (element.type) { + case 'root': + element.command = { + command: 'kiota.workspace.openWorkspaceFile', + title: vscode.l10n.t("Open File"), + arguments: [vscode.Uri.file(getWorkspaceJsonPath())] + }; + element.contextValue = 'folder'; + break; + + case 'item': + const key = element.label; + const clientOrPluginKey = this.sharedService.get('clientOrPluginKey'); + element.iconPath = (clientOrPluginKey && clientOrPluginKey === key) ? + new vscode.ThemeIcon('folder-opened') : + new vscode.ThemeIcon('folder'); + break; } return element; } + } async function openResource(resource: vscode.Uri): Promise { await vscode.window.showTextDocument(resource); } -async function isKiotaWorkspaceFilePresent(): Promise { - if (!vscode.workspace.workspaceFolders || vscode.workspace.workspaceFolders.length === 0) { - return false; - } - const workspaceFileDir = path.resolve(getWorkspaceJsonPath()); - try { - await fs.promises.access(workspaceFileDir); - } catch (error) { - return false; - } - return true; -} -export async function loadTreeView(context: vscode.ExtensionContext): Promise { - const treeDataProvider = new WorkspaceTreeProvider(await isKiotaWorkspaceFilePresent()); +export async function loadTreeView(context: vscode.ExtensionContext, treeDataProvider: WorkspaceTreeProvider): Promise { context.subscriptions.push(vscode.workspace.onDidChangeWorkspaceFolders(async () => { - treeDataProvider.isWSPresent = await isKiotaWorkspaceFilePresent(); await vscode.commands.executeCommand('kiota.workspace.refresh'); // Refresh the tree view when workspace folders change })); context.subscriptions.push(vscode.window.createTreeView('kiota.workspace', { treeDataProvider })); context.subscriptions.push(vscode.commands.registerCommand('kiota.workspace.openWorkspaceFile', openResource)); context.subscriptions.push(vscode.commands.registerCommand('kiota.workspace.refresh', async () => { - treeDataProvider.isWSPresent = await isKiotaWorkspaceFilePresent(); await treeDataProvider.refreshView(); })); -} + context.subscriptions.push( + vscode.commands.registerCommand('kiota.workspace.selectItem', async (workspaceTreeItem: WorkspaceTreeItem) => { + const { label, properties, category } = workspaceTreeItem; + await vscode.commands.executeCommand('kiota.editPaths', label, properties, category); + }) + ); +}; \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts b/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts new file mode 100644 index 0000000000..cc721a2566 --- /dev/null +++ b/vscode/microsoft-kiota/src/test/suite/commands/deleteWorkspaceItemCommand.test.ts @@ -0,0 +1,44 @@ +import assert from "assert"; +import * as sinon from "sinon"; +import * as vscode from 'vscode'; + +import { DeleteWorkspaceItemCommand } from '../../../commands/deleteWorkspaceItem/deleteWorkspaceItemCommand'; +import { WorkspaceTreeItem } from '../../../providers/workspaceTreeProvider'; + +suite('DeleteWorkspaceItemCommand Tests', () => { + let context: vscode.ExtensionContext; + let outputChannel: vscode.LogOutputChannel; + let command: DeleteWorkspaceItemCommand; + let workspaceTreeItem: WorkspaceTreeItem; + + setup(() => { + context = { extension: { packageJSON: { telemetryInstrumentationKey: 'test-key' } } } as any; + outputChannel = { appendLine: sinon.stub() } as any; + command = new DeleteWorkspaceItemCommand(context, outputChannel); + workspaceTreeItem = { label: 'test-item', category: 'plugin' } as any; + }); + + teardown(() => { + sinon.restore(); + }); + + test('getName should return correct command name', () => { + assert.strictEqual("kiota.workspace.deleteItem", command.getName()); + }); + + test('execute should show success message and refresh workspace on success', async () => { + const yesAnswer: vscode.MessageItem = { title: vscode.l10n.t("Yes") }; + + const showWarningMessageStub = sinon.stub(vscode.window, 'showWarningMessage').resolves(yesAnswer); + const showInformationMessageStub = sinon.stub(vscode.window, 'showInformationMessage').resolves(); + const executeCommandStub = sinon.stub(vscode.commands, 'executeCommand').resolves(); + const deleteItemStub = sinon.stub(command as any, 'deleteItem').resolves([{ message: 'removed successfully' }]); + + await command.execute(workspaceTreeItem); + + assert.strictEqual(showWarningMessageStub.calledOnce, true); + assert.strictEqual(showInformationMessageStub.calledOnce, true); + assert.strictEqual(executeCommandStub.calledWith('kiota.workspace.refresh'), true); + assert.strictEqual(deleteItemStub.calledOnce, true); + }); +}); \ No newline at end of file diff --git a/vscode/microsoft-kiota/src/util.ts b/vscode/microsoft-kiota/src/util.ts index c61ab8fcb4..b07930e64d 100644 --- a/vscode/microsoft-kiota/src/util.ts +++ b/vscode/microsoft-kiota/src/util.ts @@ -171,3 +171,5 @@ export function isValidUrl(url: string): boolean { return false; } } + + From c25992eab618437b2355eea204a713df8174c557 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 13:00:17 -0500 Subject: [PATCH 21/58] chore: removes unused variable Signed-off-by: Vincent Biret --- .../Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index cd5af624ad..ae2ccc8a38 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -747,7 +747,6 @@ public async Task MergesAllOfRequestBodyAsync(string content, Action>(); var openAPIDocumentDS = new OpenApiDocumentDownloadService(_httpClient, _logger); var outputDirectory = Path.Combine(workingDirectory, "output"); var generationConfiguration = new GenerationConfiguration From 4bd8a76f887053573b8bad5c36cbd74fe4e59828 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 13:12:01 -0500 Subject: [PATCH 22/58] fix: removes invalid discriminator mappings for plugin export --- .../Plugins/PluginsGenerationService.cs | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index 6a1e73c972..56efe89985 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -61,6 +61,7 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de var descriptionWriter = new OpenApiYamlWriter(fileWriter); var trimmedPluginDocument = GetDocumentWithTrimmedComponentsAndResponses(OAIDocument); trimmedPluginDocument = InlineRequestBodyAllOf(trimmedPluginDocument); + RemoveDiscriminatorMappingEntriesReferencingAbsentSchemas(trimmedPluginDocument); trimmedPluginDocument.SerializeAsV3(descriptionWriter); descriptionWriter.Flush(); @@ -105,6 +106,28 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de } } + private sealed class MappingCleanupVisitor(OpenApiDocument openApiDocument) : OpenApiVisitorBase + { + private readonly OpenApiDocument _document = openApiDocument; + + public override void Visit(OpenApiSchema schema) + { + if (schema.Discriminator?.Mapping is null) + return; + var keysToRemove = schema.Discriminator.Mapping.Where(x => !_document.Components.Schemas.ContainsKey(x.Value.Split('/', StringSplitOptions.RemoveEmptyEntries)[^1])).Select(static x => x.Key).ToArray(); + foreach (var key in keysToRemove) + schema.Discriminator.Mapping.Remove(key); + base.Visit(schema); + } + } + + private static void RemoveDiscriminatorMappingEntriesReferencingAbsentSchemas(OpenApiDocument document) + { + var visitor = new MappingCleanupVisitor(document); + var walker = new OpenApiWalker(visitor); + walker.Walk(document); + } + private static OpenApiDocument InlineRequestBodyAllOf(OpenApiDocument openApiDocument) { if (openApiDocument.Paths is null) return openApiDocument; From 7e438201709166c7c907e9788a8e6791422e0b9f Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 13:31:02 -0500 Subject: [PATCH 23/58] fix: inlining of allOf for plugins now emits right reference fix: inlining of allOf for plugins now includes all properties Signed-off-by: Vincent Biret --- .../Plugins/PluginsGenerationService.cs | 122 +++++------------- 1 file changed, 32 insertions(+), 90 deletions(-) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index 56efe89985..f1f85477e2 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -61,7 +61,9 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de var descriptionWriter = new OpenApiYamlWriter(fileWriter); var trimmedPluginDocument = GetDocumentWithTrimmedComponentsAndResponses(OAIDocument); trimmedPluginDocument = InlineRequestBodyAllOf(trimmedPluginDocument); - RemoveDiscriminatorMappingEntriesReferencingAbsentSchemas(trimmedPluginDocument); + PrepareDescriptionForCopilot(trimmedPluginDocument); + // trimming a second time to remove any components that are no longer used after the inlining + trimmedPluginDocument = GetDocumentWithTrimmedComponentsAndResponses(trimmedPluginDocument); trimmedPluginDocument.SerializeAsV3(descriptionWriter); descriptionWriter.Flush(); @@ -121,11 +123,36 @@ public override void Visit(OpenApiSchema schema) } } - private static void RemoveDiscriminatorMappingEntriesReferencingAbsentSchemas(OpenApiDocument document) + private sealed class AllOfPropertiesRetrievalVisitor : OpenApiVisitorBase { - var visitor = new MappingCleanupVisitor(document); - var walker = new OpenApiWalker(visitor); - walker.Walk(document); + public override void Visit(OpenApiSchema schema) + { + if (schema.AllOf is not { Count: > 0 }) + return; + var allPropertiesToAdd = GetAllProperties(schema).ToArray(); + foreach (var (key, value) in allPropertiesToAdd) + schema.Properties.TryAdd(key, value); + schema.AllOf.Clear(); + base.Visit(schema); + } + + private static IEnumerable> GetAllProperties(OpenApiSchema schema) + { + return schema.AllOf is not null ? + schema.AllOf.SelectMany(static x => GetAllProperties(x)).Union(schema.Properties) : + schema.Properties; + } + } + + private static void PrepareDescriptionForCopilot(OpenApiDocument document) + { + var allOfPropertiesRetrievalVisitor = new AllOfPropertiesRetrievalVisitor(); + var allOfPropertiesRetrievalWalker = new OpenApiWalker(allOfPropertiesRetrievalVisitor); + allOfPropertiesRetrievalWalker.Walk(document); + + var mappingCleanupVisitor = new MappingCleanupVisitor(document); + var mappingCleanupWalker = new OpenApiWalker(mappingCleanupVisitor); + mappingCleanupWalker.Walk(document); } private static OpenApiDocument InlineRequestBodyAllOf(OpenApiDocument openApiDocument) @@ -137,8 +164,6 @@ private static OpenApiDocument InlineRequestBodyAllOf(OpenApiDocument openApiDoc foreach (var contentItem in contentItems) { var schema = contentItem.Schema; - // Merge all schemas in allOf `schema.MergeAllOfSchemaEntries()` doesn't seem to do the right thing. - schema = MergeAllOfInSchema(schema); schema = SelectFirstAnyOfOrOneOf(schema); contentItem.Schema = schema; } @@ -163,89 +188,6 @@ private static OpenApiDocument InlineRequestBodyAllOf(OpenApiDocument openApiDoc } return newSchema; } - static OpenApiSchema? MergeAllOfInSchema(OpenApiSchema? schema) - { - if (schema?.AllOf is not { Count: > 0 }) return schema; - var newSchema = new OpenApiSchema(); - foreach (var apiSchema in schema.AllOf) - { - if (apiSchema.Title is not null) newSchema.Title = apiSchema.Title; - if (!string.IsNullOrEmpty(apiSchema.Type)) - { - if (!string.IsNullOrEmpty(newSchema.Type) && newSchema.Type != apiSchema.Type) - { - throw new InvalidOperationException( - $"The schemas in allOf cannot have different types: '{newSchema.Type}' and '{apiSchema.Type}'."); - } - newSchema.Type = apiSchema.Type; - } - if (apiSchema.Format is not null) newSchema.Format = apiSchema.Format; - if (!string.IsNullOrEmpty(apiSchema.Description)) newSchema.Description = apiSchema.Description; - if (apiSchema.Maximum is not null) newSchema.Maximum = apiSchema.Maximum; - if (apiSchema.ExclusiveMaximum is not null) newSchema.ExclusiveMaximum = apiSchema.ExclusiveMaximum; - if (apiSchema.Minimum is not null) newSchema.Minimum = apiSchema.Minimum; - if (apiSchema.ExclusiveMinimum is not null) newSchema.ExclusiveMinimum = apiSchema.ExclusiveMinimum; - if (apiSchema.MaxLength is not null) newSchema.MaxLength = apiSchema.MaxLength; - if (apiSchema.MinLength is not null) newSchema.MinLength = apiSchema.MinLength; - if (!string.IsNullOrEmpty(apiSchema.Pattern)) newSchema.Pattern = apiSchema.Pattern; - if (apiSchema.MultipleOf is not null) newSchema.MultipleOf = apiSchema.MultipleOf; - if (apiSchema.Default is not null) newSchema.Default = apiSchema.Default; - if (apiSchema.ReadOnly) newSchema.ReadOnly = apiSchema.ReadOnly; - if (apiSchema.WriteOnly) newSchema.WriteOnly = apiSchema.WriteOnly; - if (apiSchema.Not is not null) newSchema.Not = apiSchema.Not; - if (apiSchema.Required is { Count: > 0 }) - { - foreach (var r in apiSchema.Required.Where(static r => !string.IsNullOrEmpty(r))) - { - newSchema.Required.Add(r); - } - } - if (apiSchema.Items is not null) newSchema.Items = apiSchema.Items; - if (apiSchema.MaxItems is not null) newSchema.MaxItems = apiSchema.MaxItems; - if (apiSchema.MinItems is not null) newSchema.MinItems = apiSchema.MinItems; - if (apiSchema.UniqueItems is not null) newSchema.UniqueItems = apiSchema.UniqueItems; - if (apiSchema.Properties is not null) - { - foreach (var property in apiSchema.Properties) - { - newSchema.Properties.TryAdd(property.Key, property.Value); - } - } - if (apiSchema.MaxProperties is not null) newSchema.MaxProperties = apiSchema.MaxProperties; - if (apiSchema.MinProperties is not null) newSchema.MinProperties = apiSchema.MinProperties; - if (apiSchema.AdditionalPropertiesAllowed) newSchema.AdditionalPropertiesAllowed = true; - if (apiSchema.AdditionalProperties is not null) newSchema.AdditionalProperties = apiSchema.AdditionalProperties; - if (apiSchema.Discriminator is not null) newSchema.Discriminator = apiSchema.Discriminator; - if (apiSchema.Example is not null) newSchema.Example = apiSchema.Example; - if (apiSchema.Enum is not null) - { - foreach (var enumValue in apiSchema.Enum) - { - newSchema.Enum.Add(enumValue); - } - } - if (apiSchema.Nullable) newSchema.Nullable = apiSchema.Nullable; - if (apiSchema.ExternalDocs is not null) newSchema.ExternalDocs = apiSchema.ExternalDocs; - if (apiSchema.Deprecated) newSchema.Deprecated = apiSchema.Deprecated; - if (apiSchema.Xml is not null) newSchema.Xml = apiSchema.Xml; - if (apiSchema.Extensions is not null) - { - foreach (var extension in apiSchema.Extensions) - { - newSchema.Extensions.Add(extension.Key, extension.Value); - } - } - if (apiSchema.Reference is not null) newSchema.Reference = apiSchema.Reference; - if (apiSchema.Annotations is not null) - { - foreach (var annotation in apiSchema.Annotations) - { - newSchema.Annotations.Add(annotation.Key, annotation.Value); - } - } - } - return newSchema; - } } [GeneratedRegex(@"[^a-zA-Z0-9_]+", RegexOptions.IgnoreCase | RegexOptions.Singleline, 2000)] From 72d00e56eaceea83318634e4ee5556dbfa0de175 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 14:13:01 -0500 Subject: [PATCH 24/58] fix any/oneOf selection for plugins generation Signed-off-by: Vincent Biret --- .../Plugins/PluginsGenerationService.cs | 127 +++++++++++++----- 1 file changed, 91 insertions(+), 36 deletions(-) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index f1f85477e2..2af5acbe33 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -11,6 +11,7 @@ using Kiota.Builder.OpenApiExtensions; using Microsoft.Extensions.Logging; using Microsoft.OpenApi.ApiManifest; +using Microsoft.OpenApi.Interfaces; using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Services; using Microsoft.OpenApi.Writers; @@ -60,10 +61,10 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de #pragma warning restore CA2007 // Consider calling ConfigureAwait on the awaited task var descriptionWriter = new OpenApiYamlWriter(fileWriter); var trimmedPluginDocument = GetDocumentWithTrimmedComponentsAndResponses(OAIDocument); - trimmedPluginDocument = InlineRequestBodyAllOf(trimmedPluginDocument); PrepareDescriptionForCopilot(trimmedPluginDocument); // trimming a second time to remove any components that are no longer used after the inlining trimmedPluginDocument = GetDocumentWithTrimmedComponentsAndResponses(trimmedPluginDocument); + trimmedPluginDocument.Info.Title = trimmedPluginDocument.Info.Title[..^9]; // removing the second ` - Subset` suffix from the title trimmedPluginDocument.SerializeAsV3(descriptionWriter); descriptionWriter.Flush(); @@ -144,8 +145,97 @@ private static IEnumerable> GetAllProperties } } + private sealed class SelectFirstAnyOneOfVisitor : OpenApiVisitorBase + { + public override void Visit(OpenApiSchema schema) + { + if (schema.AnyOf is { Count: > 0 }) + { + CopyRelevantInformation(schema.AnyOf[0], schema); + schema.AnyOf.Clear(); + } + if (schema.OneOf is { Count: > 0 }) + { + CopyRelevantInformation(schema.OneOf[0], schema); + schema.OneOf.Clear(); + } + base.Visit(schema); + } + private static void CopyRelevantInformation(OpenApiSchema source, OpenApiSchema target) + { + if (!string.IsNullOrEmpty(source.Type)) + target.Type = source.Type; + if (!string.IsNullOrEmpty(source.Format)) + target.Format = source.Format; + if (source.Items is not null) + target.Items = source.Items; + if (source.Properties is not null) + target.Properties = new Dictionary(source.Properties); + if (source.Required is not null) + target.Required = new HashSet(source.Required); + if (source.AdditionalProperties is not null) + target.AdditionalProperties = source.AdditionalProperties; + if (source.Enum is not null) + target.Enum = [.. source.Enum]; + if (source.ExclusiveMaximum is not null) + target.ExclusiveMaximum = source.ExclusiveMaximum; + if (source.ExclusiveMinimum is not null) + target.ExclusiveMinimum = source.ExclusiveMinimum; + if (source.Maximum is not null) + target.Maximum = source.Maximum; + if (source.Minimum is not null) + target.Minimum = source.Minimum; + if (source.MaxItems is not null) + target.MaxItems = source.MaxItems; + if (source.MinItems is not null) + target.MinItems = source.MinItems; + if (source.MaxLength is not null) + target.MaxLength = source.MaxLength; + if (source.MinLength is not null) + target.MinLength = source.MinLength; + if (source.Pattern is not null) + target.Pattern = source.Pattern; + if (source.MaxProperties is not null) + target.MaxProperties = source.MaxProperties; + if (source.MinProperties is not null) + target.MinProperties = source.MinProperties; + if (source.UniqueItems is not null) + target.UniqueItems = source.UniqueItems; + if (source.Nullable) + target.Nullable = true; + if (source.ReadOnly) + target.ReadOnly = true; + if (source.WriteOnly) + target.WriteOnly = true; + if (source.Deprecated) + target.Deprecated = true; + if (source.Xml is not null) + target.Xml = source.Xml; + if (source.ExternalDocs is not null) + target.ExternalDocs = source.ExternalDocs; + if (source.Example is not null) + target.Example = source.Example; + if (source.Extensions is not null) + target.Extensions = new Dictionary(source.Extensions); + if (source.Discriminator is not null) + target.Discriminator = source.Discriminator; + if (!string.IsNullOrEmpty(source.Description)) + target.Description = source.Description; + if (!string.IsNullOrEmpty(source.Title)) + target.Title = source.Title; + if (source.Default is not null) + target.Default = source.Default; + if (source.Reference is not null) + target.Reference = source.Reference; + } + } + private static void PrepareDescriptionForCopilot(OpenApiDocument document) { + var selectFirstAnyOneOfVisitor = new SelectFirstAnyOneOfVisitor(); + var selectFirstAnyOneOfWalker = new OpenApiWalker(selectFirstAnyOneOfVisitor); + selectFirstAnyOneOfWalker.Walk(document); + var allOfPropertiesRetrievalVisitor = new AllOfPropertiesRetrievalVisitor(); var allOfPropertiesRetrievalWalker = new OpenApiWalker(allOfPropertiesRetrievalVisitor); allOfPropertiesRetrievalWalker.Walk(document); @@ -155,41 +245,6 @@ private static void PrepareDescriptionForCopilot(OpenApiDocument document) mappingCleanupWalker.Walk(document); } - private static OpenApiDocument InlineRequestBodyAllOf(OpenApiDocument openApiDocument) - { - if (openApiDocument.Paths is null) return openApiDocument; - var contentItems = openApiDocument.Paths.Values.Where(static x => x?.Operations is not null) - .SelectMany(static x => x.Operations.Values.Where(static x => x?.RequestBody?.Content is not null) - .SelectMany(static x => x.RequestBody.Content.Values)); - foreach (var contentItem in contentItems) - { - var schema = contentItem.Schema; - schema = SelectFirstAnyOfOrOneOf(schema); - contentItem.Schema = schema; - } - - return openApiDocument; - - static OpenApiSchema? SelectFirstAnyOfOrOneOf(OpenApiSchema? schema) - { - if (schema?.AnyOf is not { Count: > 0 } && schema?.OneOf is not { Count: > 0 }) return schema; - OpenApiSchema newSchema; - if (schema.AnyOf is { Count: > 0 }) - { - newSchema = schema.AnyOf[0]; - } - else if (schema.OneOf is { Count: > 0 }) - { - newSchema = schema.OneOf[0]; - } - else - { - newSchema = schema; - } - return newSchema; - } - } - [GeneratedRegex(@"[^a-zA-Z0-9_]+", RegexOptions.IgnoreCase | RegexOptions.Singleline, 2000)] private static partial Regex PluginNameCleanupRegex(); From 1459e8d868f53165801c0f6422cd44a3c16766f2 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 14:21:45 -0500 Subject: [PATCH 25/58] fix: remove error status description Signed-off-by: Vincent Biret --- .../Plugins/PluginsGenerationService.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index 2af5acbe33..0a4b527717 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -230,8 +230,25 @@ private static void CopyRelevantInformation(OpenApiSchema source, OpenApiSchema } } + private sealed class ErrorResponsesCleanupVisitor : OpenApiVisitorBase + { + public override void Visit(OpenApiOperation operation) + { + if (operation.Responses is null) + return; + var errorResponses = operation.Responses.Where(static x => x.Key.StartsWith('4') || x.Key.StartsWith('5')).ToArray(); + foreach (var (key, value) in errorResponses) + operation.Responses.Remove(key); + base.Visit(operation); + } + } + private static void PrepareDescriptionForCopilot(OpenApiDocument document) { + var errorResponsesCleanupVisitor = new ErrorResponsesCleanupVisitor(); + var errorResponsesCleanupWalker = new OpenApiWalker(errorResponsesCleanupVisitor); + errorResponsesCleanupWalker.Walk(document); + var selectFirstAnyOneOfVisitor = new SelectFirstAnyOneOfVisitor(); var selectFirstAnyOneOfWalker = new OpenApiWalker(selectFirstAnyOneOfVisitor); selectFirstAnyOneOfWalker.Walk(document); From d150295ecec68a3f9ea06fe3044d5a3b448a17e4 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 14:29:00 -0500 Subject: [PATCH 26/58] feat: removes external documentation links Signed-off-by: Vincent Biret --- .../Plugins/PluginsGenerationService.cs | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index 0a4b527717..b5f07b3494 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -243,8 +243,40 @@ public override void Visit(OpenApiOperation operation) } } + private sealed class ExternalDocumentationCleanupVisitor : OpenApiVisitorBase + { + public override void Visit(OpenApiDocument doc) + { + if (doc.ExternalDocs is not null) + doc.ExternalDocs = null; + base.Visit(doc); + } + public override void Visit(OpenApiOperation operation) + { + if (operation.ExternalDocs is not null) + operation.ExternalDocs = null; + base.Visit(operation); + } + public override void Visit(OpenApiSchema schema) + { + if (schema.ExternalDocs is not null) + schema.ExternalDocs = null; + base.Visit(schema); + } + public override void Visit(OpenApiTag tag) + { + if (tag.ExternalDocs is not null) + tag.ExternalDocs = null; + base.Visit(tag); + } + } + private static void PrepareDescriptionForCopilot(OpenApiDocument document) { + var externalDocumentationCleanupVisitor = new ExternalDocumentationCleanupVisitor(); + var externalDocumentationCleanupWalker = new OpenApiWalker(externalDocumentationCleanupVisitor); + externalDocumentationCleanupWalker.Walk(document); + var errorResponsesCleanupVisitor = new ErrorResponsesCleanupVisitor(); var errorResponsesCleanupWalker = new OpenApiWalker(errorResponsesCleanupVisitor); errorResponsesCleanupWalker.Walk(document); From f672a59d920aa672acbc3ee7553fbd389f171dc4 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 14:51:28 -0500 Subject: [PATCH 27/58] fix: failing unit tests Signed-off-by: Vincent Biret --- src/Kiota.Builder/Plugins/PluginsGenerationService.cs | 10 ++++++---- .../Plugins/PluginsGenerationServiceTests.cs | 5 ++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index b5f07b3494..1406aa91c7 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -131,6 +131,8 @@ public override void Visit(OpenApiSchema schema) if (schema.AllOf is not { Count: > 0 }) return; var allPropertiesToAdd = GetAllProperties(schema).ToArray(); + foreach (var allOfEntry in schema.AllOf) + SelectFirstAnyOneOfVisitor.CopyRelevantInformation(allOfEntry, schema, false, false, false); foreach (var (key, value) in allPropertiesToAdd) schema.Properties.TryAdd(key, value); schema.AllOf.Clear(); @@ -161,7 +163,7 @@ public override void Visit(OpenApiSchema schema) } base.Visit(schema); } - private static void CopyRelevantInformation(OpenApiSchema source, OpenApiSchema target) + internal static void CopyRelevantInformation(OpenApiSchema source, OpenApiSchema target, bool includeProperties = true, bool includeReference = true, bool includeDiscriminator = true) { if (!string.IsNullOrEmpty(source.Type)) target.Type = source.Type; @@ -169,7 +171,7 @@ private static void CopyRelevantInformation(OpenApiSchema source, OpenApiSchema target.Format = source.Format; if (source.Items is not null) target.Items = source.Items; - if (source.Properties is not null) + if (source.Properties is not null && includeProperties) target.Properties = new Dictionary(source.Properties); if (source.Required is not null) target.Required = new HashSet(source.Required); @@ -217,7 +219,7 @@ private static void CopyRelevantInformation(OpenApiSchema source, OpenApiSchema target.Example = source.Example; if (source.Extensions is not null) target.Extensions = new Dictionary(source.Extensions); - if (source.Discriminator is not null) + if (source.Discriminator is not null && includeDiscriminator) target.Discriminator = source.Discriminator; if (!string.IsNullOrEmpty(source.Description)) target.Description = source.Description; @@ -225,7 +227,7 @@ private static void CopyRelevantInformation(OpenApiSchema source, OpenApiSchema target.Title = source.Title; if (source.Default is not null) target.Default = source.Default; - if (source.Reference is not null) + if (source.Reference is not null && includeReference) target.Reference = source.Reference; } } diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index ae2ccc8a38..652d9d1c14 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -210,7 +210,6 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() var workingDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); var simpleDescriptionPath = Path.Combine(workingDirectory) + "description.yaml"; await File.WriteAllTextAsync(simpleDescriptionPath, simpleDescriptionContent); - var mockLogger = new Mock>(); var openAPIDocumentDS = new OpenApiDocumentDownloadService(_httpClient, _logger); var outputDirectory = Path.Combine(workingDirectory, "output"); var generationConfiguration = new GenerationConfiguration @@ -268,10 +267,10 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Empty(resultDocument.Components.Schemas);// no schema is referenced. so ensure they are all removed Assert.Empty(resultDocument.Extensions); // no extension at root (unsupported extension is removed) Assert.Equal(2, resultDocument.Paths.Count); // document has only two paths - Assert.Equal(originalDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count, resultDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count); // Responses are still intact. + Assert.Equal(originalDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count - 1, resultDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count); // We removed the error response Assert.NotEmpty(resultDocument.Paths["/test"].Operations[OperationType.Get].Responses["200"].Description); // response description string is not empty Assert.Empty(resultDocument.Paths["/test"].Operations[OperationType.Get].Extensions); // NO UNsupported extension - Assert.Equal(originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count, resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count); // Responses are still intact. + Assert.Equal(originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count - 1, resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count); // Responses are still intact. Assert.NotEmpty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Description);// response description string is not empty Assert.Single(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Extensions); // 1 supported extension still present in operation } From 3962cb79a6f6ba510edd47ed355d27ccd92fc47f Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 15:17:56 -0500 Subject: [PATCH 28/58] chore: adds test data for all of cleanup Signed-off-by: Vincent Biret --- .../Plugins/PluginsGenerationServiceTests.cs | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index 652d9d1c14..d2f2ac9549 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -193,6 +193,10 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() responses: '200': description: + content: + application/json: + schema: + $ref: '#/components/schemas/microsoft.graph.message' '500': description: api error response components: @@ -206,7 +210,17 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() id: type: string '@odata.type': - type: string"; + type: string + microsoft.graph.message: + allOf: + - $ref: '#/components/schemas/microsoft.graph.entity' + - type: object + title: message + properties: + subject: + type: string + body: + type: string"; var workingDirectory = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); var simpleDescriptionPath = Path.Combine(workingDirectory) + "description.yaml"; await File.WriteAllTextAsync(simpleDescriptionPath, simpleDescriptionContent); @@ -250,7 +264,7 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Equal(originalDocument.Paths["/test"].Operations[OperationType.Get].Description, resultingManifest.Document.Functions[0].Description);// pulls from description Assert.Equal(originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Summary, resultingManifest.Document.Functions[1].Description);// pulls from summary - Assert.Single(originalDocument.Components.Schemas);// one schema originally + Assert.Equal(2, originalDocument.Components.Schemas.Count);// one schema originally Assert.Single(originalDocument.Extensions); // single unsupported extension at root Assert.Equal(2, originalDocument.Paths.Count); // document has only two paths Assert.Equal(2, originalDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count); // 2 responses originally @@ -264,7 +278,7 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Empty(diagnostic.Errors); // Assertions / validations - Assert.Empty(resultDocument.Components.Schemas);// no schema is referenced. so ensure they are all removed + Assert.Single(resultDocument.Components.Schemas);// no schema is referenced. so ensure they are all removed Assert.Empty(resultDocument.Extensions); // no extension at root (unsupported extension is removed) Assert.Equal(2, resultDocument.Paths.Count); // document has only two paths Assert.Equal(originalDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count - 1, resultDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count); // We removed the error response @@ -273,6 +287,7 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Equal(originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count - 1, resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count); // Responses are still intact. Assert.NotEmpty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Description);// response description string is not empty Assert.Single(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Extensions); // 1 supported extension still present in operation + Assert.Empty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.AllOf); // allOf were merged } #region Security From 9482a8455e419c463c44a9a26cf234897770fa5b Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 15:20:37 -0500 Subject: [PATCH 29/58] chore: adds test data for external docs removal Signed-off-by: Vincent Biret --- .../Plugins/PluginsGenerationServiceTests.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index d2f2ac9549..c524d7d6b1 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -171,6 +171,9 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() /test: get: description: description for test path + externalDocs: + description: external docs for test path + url: http://localhost/test x-random-extension: true responses: '200': @@ -264,6 +267,7 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Equal(originalDocument.Paths["/test"].Operations[OperationType.Get].Description, resultingManifest.Document.Functions[0].Description);// pulls from description Assert.Equal(originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Summary, resultingManifest.Document.Functions[1].Description);// pulls from summary + Assert.NotNull(originalDocument.Paths["/test"].Operations[OperationType.Get].ExternalDocs); // existing external docs Assert.Equal(2, originalDocument.Components.Schemas.Count);// one schema originally Assert.Single(originalDocument.Extensions); // single unsupported extension at root Assert.Equal(2, originalDocument.Paths.Count); // document has only two paths @@ -283,6 +287,7 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Equal(2, resultDocument.Paths.Count); // document has only two paths Assert.Equal(originalDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count - 1, resultDocument.Paths["/test"].Operations[OperationType.Get].Responses.Count); // We removed the error response Assert.NotEmpty(resultDocument.Paths["/test"].Operations[OperationType.Get].Responses["200"].Description); // response description string is not empty + Assert.Null(resultDocument.Paths["/test"].Operations[OperationType.Get].ExternalDocs); // external docs are removed Assert.Empty(resultDocument.Paths["/test"].Operations[OperationType.Get].Extensions); // NO UNsupported extension Assert.Equal(originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count - 1, resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count); // Responses are still intact. Assert.NotEmpty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Description);// response description string is not empty From 13c04769a3d78e7297d30bdc2583e44fbfd853ec Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 15:24:01 -0500 Subject: [PATCH 30/58] chore: adds test for any of selection Signed-off-by: Vincent Biret --- .../Plugins/PluginsGenerationServiceTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index c524d7d6b1..b5f86312b5 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -211,7 +211,9 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() type: object properties: id: - type: string + anyOf: + - type: string + - type: integer '@odata.type': type: string microsoft.graph.message: @@ -275,6 +277,7 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Single(originalDocument.Paths["/test"].Operations[OperationType.Get].Extensions); // 1 UNsupported extension Assert.Equal(2, originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Count); // 2 responses originally Assert.Single(originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Extensions); // 1 supported extension + Assert.Equal(2, originalDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.AllOf[0].Properties["id"].AnyOf.Count); // anyOf we selected // Validate the output open api file var resultOpenApiFile = File.OpenRead(Path.Combine(outputDirectory, OpenApiFileName)); @@ -293,6 +296,8 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.NotEmpty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Description);// response description string is not empty Assert.Single(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Extensions); // 1 supported extension still present in operation Assert.Empty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.AllOf); // allOf were merged + Assert.Empty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.Properties["id"].AnyOf); // anyOf we selected + Assert.Equal("string", resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.Properties["id"].Type); } #region Security From 59ffddab1254b44c56c261adc85b9622387b7a92 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 15:25:48 -0500 Subject: [PATCH 31/58] chore: adds a test for error responses removal Signed-off-by: Vincent Biret --- .../Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index b5f86312b5..6743f5c63a 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -298,6 +298,7 @@ public async Task GeneratesManifestAndCleansUpInputDescriptionAsync() Assert.Empty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.AllOf); // allOf were merged Assert.Empty(resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.Properties["id"].AnyOf); // anyOf we selected Assert.Equal("string", resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses["200"].Content["application/json"].Schema.Properties["id"].Type); + Assert.DoesNotContain("500", resultDocument.Paths["/test/{id}"].Operations[OperationType.Get].Responses.Keys, StringComparer.OrdinalIgnoreCase); // We removed the error response } #region Security From 494a05d38bc3f984840bd9e18a69ba28a965040d Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Wed, 27 Nov 2024 15:28:30 -0500 Subject: [PATCH 32/58] docs: adds changelog entry for openapi plugins generation Signed-off-by: Vincent Biret --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d85163d3e4..3256dc56bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed invalid code in Php caused by "*/*/" in property description. [5635](https://github.com/microsoft/kiota/issues/5635) - Fixed a bug where discriminator property name lookup could end up in an infinite loop. [#5771](https://github.com/microsoft/kiota/issues/5771) - Fixed TypeScript generation error when generating usings from shaken serializers. [#5634](https://github.com/microsoft/kiota/issues/5634) +- Multiple fixed and improvements in OpenAPI description generation for plugins. [#5806](https://github.com/microsoft/kiota/issues/5806) ## [1.20.0] - 2024-11-07 From 84eaacca10b3d47b0a613229adc50658c4cb4e01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:38:22 +0000 Subject: [PATCH 33/58] chore(deps-dev): bump pyjwt[crypto] from 2.10.0 to 2.10.1 in /it/python Bumps [pyjwt[crypto]](https://github.com/jpadilla/pyjwt) from 2.10.0 to 2.10.1. - [Release notes](https://github.com/jpadilla/pyjwt/releases) - [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst) - [Commits](https://github.com/jpadilla/pyjwt/compare/2.10.0...2.10.1) --- updated-dependencies: - dependency-name: pyjwt[crypto] dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index db8bccbe26..3c170bf64a 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -122,7 +122,7 @@ portalocker==3.0.0 ; python_version >= '3.5' and platform_system == 'Windows' pycparser==2.22 -pyjwt[crypto]==2.10.0 ; python_version >= '3.7' +pyjwt[crypto]==2.10.1 ; python_version >= '3.7' python-dateutil==2.9.0.post0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2' From adc188490c60cfd10dfb8837e892e4d2b185c44a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:38:59 +0000 Subject: [PATCH 34/58] chore(deps-dev): bump aiohttp from 3.11.7 to 3.11.8 in /it/python Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.11.7 to 3.11.8. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.11.7...v3.11.8) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index db8bccbe26..1bb5386a3c 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -66,7 +66,7 @@ yapf==0.43.0 zipp==3.21.0 ; python_version >= '3.7' -aiohttp==3.11.7 ; python_version >= '3.6' +aiohttp==3.11.8 ; python_version >= '3.6' aiosignal==1.3.1 ; python_version >= '3.7' From 1db1f62b3d3fe52526ea188f8ae1a24c0a932825 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:50:40 +0000 Subject: [PATCH 35/58] chore(deps-dev): bump @types/node in /vscode/microsoft-kiota Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.10.0 to 22.10.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index 12305789f0..f9006f292a 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -731,9 +731,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.10.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz", - "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==", + "version": "22.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", "dev": true, "dependencies": { "undici-types": "~6.20.0" From 8b952588edd874cc061dee62098f70c86c48ba7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 08:55:05 +0000 Subject: [PATCH 36/58] chore(deps-dev): bump @types/node in /it/typescript Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.10.0 to 22.10.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/typescript/package-lock.json | 8 ++++---- it/typescript/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 712b827a99..19cd62aabc 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -23,7 +23,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.11.0", - "@types/node": "^22.10.0", + "@types/node": "^22.10.1", "@typescript-eslint/eslint-plugin": "^8.16.0", "@typescript-eslint/parser": "^8.16.0", "esbuild": "^0.24.0", @@ -936,9 +936,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.10.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz", - "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==", + "version": "22.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", "dev": true, "dependencies": { "undici-types": "~6.20.0" diff --git a/it/typescript/package.json b/it/typescript/package.json index 3b66561cf9..0a98074d26 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -20,7 +20,7 @@ "devDependencies": { "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.11.0", - "@types/node": "^22.10.0", + "@types/node": "^22.10.1", "@typescript-eslint/eslint-plugin": "^8.16.0", "@typescript-eslint/parser": "^8.16.0", "esbuild": "^0.24.0", From aa826c1c36feb3defbf4a818c4a3012b70d51c1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:11:25 +0300 Subject: [PATCH 37/58] chore(deps-dev): bump cryptography from 43.0.3 to 44.0.0 in /it/python (#5846) Bumps [cryptography](https://github.com/pyca/cryptography) from 43.0.3 to 44.0.0. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/43.0.3...44.0.0) --- updated-dependencies: - dependency-name: cryptography dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 1bb5386a3c..ee647e87dd 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -82,7 +82,7 @@ azure-identity==1.19.0 cffi==1.17.1 -cryptography==43.0.3 ; python_version >= '3.7' +cryptography==44.0.0 ; python_version >= '3.7' frozenlist==1.5.0 ; python_version >= '3.7' From f10f9ac185ca7dc9dc236078f78a71410a54018a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:37:28 +0000 Subject: [PATCH 38/58] chore(deps-dev): bump @types/adm-zip in /vscode/microsoft-kiota Bumps [@types/adm-zip](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/adm-zip) from 0.5.6 to 0.5.7. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/adm-zip) --- updated-dependencies: - dependency-name: "@types/adm-zip" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 9 ++++----- vscode/microsoft-kiota/package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index f9006f292a..a15157cb07 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@stylistic/eslint-plugin-ts": "^2.11.0", - "@types/adm-zip": "^0.5.6", + "@types/adm-zip": "^0.5.7", "@types/chai": "^5.0.1", "@types/mocha": "^10.0.10", "@types/node": "22.x", @@ -649,11 +649,10 @@ } }, "node_modules/@types/adm-zip": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.6.tgz", - "integrity": "sha512-lRlcSLg5Yoo7C2H2AUiAoYlvifWoCx/se7iUNiCBTfEVVYFVn+Tr9ZGed4K73tYgLe9O4PjdJvbxlkdAOx/qiw==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.7.tgz", + "integrity": "sha512-DNEs/QvmyRLurdQPChqq0Md4zGvPwHerAJYWk9l2jCbD1VPpnzRJorOdiq4zsw09NFbYnhfsoEhWtxIzXpn2yw==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*" } diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index 266efb9622..64c0b50aa3 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -492,7 +492,7 @@ }, "devDependencies": { "@stylistic/eslint-plugin-ts": "^2.11.0", - "@types/adm-zip": "^0.5.6", + "@types/adm-zip": "^0.5.7", "@types/chai": "^5.0.1", "@types/mocha": "^10.0.10", "@types/node": "22.x", From 978ffad44a79d703c53b87a9a2bcde005184ab5e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 08:46:40 -0500 Subject: [PATCH 39/58] ci: adds artifacts for scripts due to new security requirements Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 69 ++++++++++++++++++++++------- scripts/get-release-notes.ps1 | 8 +++- scripts/get-version-from-csproj.ps1 | 8 +++- 3 files changed, 66 insertions(+), 19 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 859a534df2..17a958ad05 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -116,6 +116,44 @@ extends: artifactName: AppSettings targetPath: "$(Build.ArtifactStagingDirectory)/AppSettings" + # upload the scripts directory as scripts artifact + + - task: 1ES.PublishPipelineArtifact@1 + displayName: "Publish Artifact: scripts" + inputs: + artifactName: scripts + targetPath: $(Build.SourcesDirectory)/scripts + + # upload the csproj file as csproj artifact + + - task: CopyFiles@2 + displayName: Prepare staging folder for upload + inputs: + targetFolder: $(Build.ArtifactStagingDirectory)/csproj + sourceFolder: $(Build.SourcesDirectory)/src/kiota + Contents: "*.csproj" + + - task: 1ES.PublishPipelineArtifact@1 + displayName: "Publish Artifact: csproj" + inputs: + artifactName: csproj + targetPath: "$(Build.ArtifactStagingDirectory)/csproj" + + # upload the changelog file as changelog artifact + + - task: CopyFiles@2 + displayName: Prepare staging folder for upload + inputs: + targetFolder: $(Build.ArtifactStagingDirectory)/changelog + sourceFolder: $(Build.SourcesDirectory) + Contents: "CHANGELOG.md" + + - task: 1ES.PublishPipelineArtifact@1 + displayName: "Publish Artifact: changelog" + inputs: + artifactName: changelog + targetPath: "$(Build.ArtifactStagingDirectory)/changelog" + - job: build dependsOn: [update_appsettings] pool: @@ -318,7 +356,7 @@ extends: inputs: targetFolder: $(Build.ArtifactStagingDirectory)/Nugets sourceFolder: $(Build.ArtifactStagingDirectory) - content: "*.nupkg" + Contents: "*.*nupkg" - task: 1ES.PublishPipelineArtifact@1 displayName: "Publish Artifact: Nugets" @@ -716,11 +754,15 @@ extends: - input: pipelineArtifact artifactName: Nugets targetPath: "$(Pipeline.Workspace)" - sdl: - baseline: - baselineFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnbaselines - suppression: - suppressionFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnsuppress + - input: pipelineArtifact + artifactName: scripts + targetPath: "$(Pipeline.Workspace)" + - input: pipelineArtifact + artifactName: csproj + targetPath: "$(Pipeline.Workspace)" + - input: pipelineArtifact + artifactName: changelog + targetPath: "$(Pipeline.Workspace)" dependsOn: [] environment: kiota-github-releases strategy: @@ -728,23 +770,20 @@ extends: deploy: steps: - download: none - - checkout: self - clean: true - submodules: true - ${{ each distribution in parameters.distributions }}: - task: DownloadPipelineArtifact@2 displayName: Download ${{ distribution.jobPrefix }} binaries from artifacts inputs: artifact: Binaries_${{ distribution.jobPrefix }} source: current - - pwsh: $(Build.SourcesDirectory)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} + - pwsh: $(Pipeline.Workspace)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} displayName: "Set version suffix" - - pwsh: $(Build.SourcesDirectory)/scripts/get-version-from-csproj.ps1 + - pwsh: $(Pipeline.Workspace)/scripts/get-version-from-csproj.ps1 -csprojPath "$(Pipeline.Workspace)/csproj/kiota.csproj" displayName: "Get Kiota's version-number from .csproj" - - pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version $(artifactVersion) -createNotes + - pwsh: $(Pipeline.Workspace)/scripts/get-release-notes.ps1 -version $(artifactVersion) -createNotes -changelogPath "$(Pipeline.Workspace)/changelog/CHANGELOG.md" condition: eq(variables['isPrerelease'], 'false') displayName: "Get release notes from CHANGELOG.md" - - pwsh: $(Build.SourcesDirectory)/scripts/get-release-notes.ps1 -version Unreleased -createNotes + - pwsh: $(Pipeline.Workspace)/scripts/get-release-notes.ps1 -version Unreleased -createNotes -changelogPath "$(Pipeline.Workspace)/changelog/CHANGELOG.md" condition: eq(variables['isPrerelease'], 'true') displayName: "Get release notes from CHANGELOG.md" - task: GitHubRelease@1 @@ -755,7 +794,7 @@ extends: tag: "v$(artifactVersion)" title: "v$(artifactVersion)" releaseNotesSource: filePath - releaseNotesFilePath: $(Build.SourcesDirectory)/release-notes.txt + releaseNotesFilePath: $(Pipeline.Workspace)/release-notes.txt assets: | $(Pipeline.Workspace)/*.zip $(Pipeline.Workspace)/*.vsix @@ -770,7 +809,7 @@ extends: tag: "v$(artifactVersion)$(versionSuffix)" title: "v$(artifactVersion)$(versionSuffix)" releaseNotesSource: filePath - releaseNotesFilePath: $(Build.SourcesDirectory)/release-notes.txt + releaseNotesFilePath: $(Pipeline.Workspace)/release-notes.txt assets: | $(Pipeline.Workspace)/*.zip $(Pipeline.Workspace)/*.vsix diff --git a/scripts/get-release-notes.ps1 b/scripts/get-release-notes.ps1 index c3b1f02e3e..a775fca87b 100644 --- a/scripts/get-release-notes.ps1 +++ b/scripts/get-release-notes.ps1 @@ -4,12 +4,16 @@ param ( $version, [switch] [bool] - $createNotes + $createNotes, + [string] + $changelogPath = "" ) $version = $version.TrimStart("v") -$changelogPath = Join-Path -Path $PSScriptRoot -ChildPath "../CHANGELOG.md" +if ($changelogPath -eq "") { + $changelogPath = Join-Path -Path $PSScriptRoot -ChildPath "../CHANGELOG.md" +} $changeLogContent = Get-Content $changelogPath -Raw $headerLine = "## [$version]" diff --git a/scripts/get-version-from-csproj.ps1 b/scripts/get-version-from-csproj.ps1 index 2f6aaea5e9..649bab7ee2 100644 --- a/scripts/get-version-from-csproj.ps1 +++ b/scripts/get-version-from-csproj.ps1 @@ -1,9 +1,13 @@ param ( [switch] [bool] - $isGHA + $isGHA, + [string] + $csprojPath = "" ) -$csprojPath = Join-Path $PSScriptRoot "../src/kiota/kiota.csproj" +if ($csprojPath -eq "") { + $csprojPath = Join-Path $PSScriptRoot "../src/kiota/kiota.csproj" +} $xml = [Xml] (Get-Content $csprojPath) $version = $xml.Project.PropertyGroup.VersionPrefix[0] Write-Output "csproj version is $version" From 06d7e57d2a525f3d2e6c99565eb1eb15e3830338 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 08:48:43 -0500 Subject: [PATCH 40/58] fix: use 1es tasks Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 17a958ad05..8f341ddd09 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -393,7 +393,7 @@ extends: inputs: version: 8.x - - task: DownloadPipelineArtifact@2 + - task: 1ES.DownloadPipelineArtifact@1 inputs: artifact: AppSettings source: current @@ -600,7 +600,7 @@ extends: inputs: versionSpec: "18.x" - ${{ each distribution in parameters.distributions }}: - - task: DownloadPipelineArtifact@2 + - task: 1ES.DownloadPipelineArtifact@1 displayName: Download ${{ distribution.jobPrefix }} binaries from artifacts inputs: artifact: Binaries_${{ distribution.jobPrefix }} @@ -706,7 +706,7 @@ extends: - checkout: self clean: true submodules: true - - task: DownloadPipelineArtifact@2 + - task: 1ES.DownloadPipelineArtifact@1 inputs: artifact: VSCode source: current From 933c01c5426f7f1fd3c5d1e3afa9f2516635b98a Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 08:49:26 -0500 Subject: [PATCH 41/58] fix: additional 1es task replacement Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 8f341ddd09..45de69711b 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -171,7 +171,7 @@ extends: clean: true submodules: true - - task: DownloadPipelineArtifact@2 + - task: 1ES.DownloadPipelineArtifact@1 inputs: artifact: AppSettings source: current @@ -771,7 +771,7 @@ extends: steps: - download: none - ${{ each distribution in parameters.distributions }}: - - task: DownloadPipelineArtifact@2 + - task: 1ES.DownloadPipelineArtifact@1 displayName: Download ${{ distribution.jobPrefix }} binaries from artifacts inputs: artifact: Binaries_${{ distribution.jobPrefix }} From c6271b3a2dd8b8ae4e1da2b92fcee46aef41e7c9 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 08:57:08 -0500 Subject: [PATCH 42/58] fix: switches download steps to inputs Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 50 +++++++++++++++-------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 45de69711b..90aa261269 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -166,17 +166,15 @@ extends: baselineFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnbaselines suppression: suppressionFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnsuppress + inputs: + - input: pipelineArtifact + artifactName: AppSettings + targetPath: $(Build.ArtifactStagingDirectory)/AppSettings steps: - checkout: self clean: true submodules: true - - task: 1ES.DownloadPipelineArtifact@1 - inputs: - artifact: AppSettings - source: current - targetPath: $(Build.ArtifactStagingDirectory)/AppSettings - - pwsh: | Copy-Item $(Build.ArtifactStagingDirectory)/AppSettings/appsettings.json $(Build.SourcesDirectory)/src/kiota/appsettings.json -Force -Verbose displayName: Copy the appsettings.json @@ -379,6 +377,10 @@ extends: baselineFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnbaselines suppression: suppressionFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnsuppress + inputs: + - input: pipelineArtifact + artifactName: AppSettings + targetPath: $(Build.ArtifactStagingDirectory)/AppSettings steps: - checkout: self @@ -393,12 +395,6 @@ extends: inputs: version: 8.x - - task: 1ES.DownloadPipelineArtifact@1 - inputs: - artifact: AppSettings - source: current - targetPath: $(Build.ArtifactStagingDirectory)/AppSettings - - pwsh: | Copy-Item $(Build.ArtifactStagingDirectory)/AppSettings/appsettings.json $(Build.SourcesDirectory)/src/kiota/appsettings.json -Force -Verbose displayName: Copy the appsettings.json @@ -592,6 +588,11 @@ extends: baselineFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnbaselines suppression: suppressionFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnsuppress + inputs: + - ${{ each distribution in parameters.distributions }}: + - input: pipelineArtifact + artifactName: Binaries_${{ distribution.jobPrefix }} + targetPath: $(Build.ArtifactStagingDirectory)/Binaries steps: - checkout: self clean: true @@ -599,13 +600,6 @@ extends: - task: NodeTool@0 inputs: versionSpec: "18.x" - - ${{ each distribution in parameters.distributions }}: - - task: 1ES.DownloadPipelineArtifact@1 - displayName: Download ${{ distribution.jobPrefix }} binaries from artifacts - inputs: - artifact: Binaries_${{ distribution.jobPrefix }} - source: current - targetPath: $(Build.ArtifactStagingDirectory)/Binaries - pwsh: $(Build.SourcesDirectory)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} displayName: "Set version suffix" - pwsh: $(Build.SourcesDirectory)/scripts/get-version-from-csproj.ps1 @@ -687,6 +681,11 @@ extends: - stage: deploy condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded()) dependsOn: build + templateContext: + inputs: + - input: pipelineArtifact + artifactName: VSCode + targetPath: $(Build.ArtifactStagingDirectory)/VSCode jobs: - job: vs_marketplace pool: @@ -706,10 +705,6 @@ extends: - checkout: self clean: true submodules: true - - task: 1ES.DownloadPipelineArtifact@1 - inputs: - artifact: VSCode - source: current - task: NodeTool@0 inputs: versionSpec: "18.x" @@ -763,6 +758,9 @@ extends: - input: pipelineArtifact artifactName: changelog targetPath: "$(Pipeline.Workspace)" + - ${{ each distribution in parameters.distributions }}: + - input: pipelineArtifact + artifactName: Binaries_${{ distribution.jobPrefix }} dependsOn: [] environment: kiota-github-releases strategy: @@ -770,12 +768,6 @@ extends: deploy: steps: - download: none - - ${{ each distribution in parameters.distributions }}: - - task: 1ES.DownloadPipelineArtifact@1 - displayName: Download ${{ distribution.jobPrefix }} binaries from artifacts - inputs: - artifact: Binaries_${{ distribution.jobPrefix }} - source: current - pwsh: $(Pipeline.Workspace)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} displayName: "Set version suffix" - pwsh: $(Pipeline.Workspace)/scripts/get-version-from-csproj.ps1 -csprojPath "$(Pipeline.Workspace)/csproj/kiota.csproj" From 79dc51151f568009d7dece67a634873433ff75d8 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 09:32:21 -0500 Subject: [PATCH 43/58] ci: fix vscode deployment job type and input Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 90aa261269..8f70c85bfd 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -681,11 +681,6 @@ extends: - stage: deploy condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded()) dependsOn: build - templateContext: - inputs: - - input: pipelineArtifact - artifactName: VSCode - targetPath: $(Build.ArtifactStagingDirectory)/VSCode jobs: - job: vs_marketplace pool: @@ -693,23 +688,24 @@ extends: os: linux image: ubuntu-latest templateContext: - sdl: - baseline: - baselineFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnbaselines - suppression: - suppressionFile: $(Build.SourcesDirectory)/guardian/SDL/common/.gdnsuppress + type: releaseJob + isProduction: true + inputs: + - input: pipelineArtifact + artifactName: VSCode + targetPath: $(Build.ArtifactStagingDirectory)/VSCode + - input: pipelineArtifact + artifactName: scripts + targetPath: "$(Pipeline.Workspace)" dependsOn: - github_release steps: - download: none - - checkout: self - clean: true - submodules: true - task: NodeTool@0 inputs: versionSpec: "18.x" - pwsh: npm i -g @vscode/vsce - - pwsh: $(Build.SourcesDirectory)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} + - pwsh: $(Pipeline.Workspace)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} displayName: "Set version suffix" - task: AzureCLI@2 inputs: @@ -751,13 +747,13 @@ extends: targetPath: "$(Pipeline.Workspace)" - input: pipelineArtifact artifactName: scripts - targetPath: "$(Pipeline.Workspace)" + targetPath: "$(Pipeline.Workspace)/scripts" - input: pipelineArtifact artifactName: csproj - targetPath: "$(Pipeline.Workspace)" + targetPath: "$(Pipeline.Workspace)/csproj" - input: pipelineArtifact artifactName: changelog - targetPath: "$(Pipeline.Workspace)" + targetPath: "$(Pipeline.Workspace)/changelog" - ${{ each distribution in parameters.distributions }}: - input: pipelineArtifact artifactName: Binaries_${{ distribution.jobPrefix }} From a7ffb5d8b1a29a4a331abffd83c457c4fbb86975 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 12:07:31 -0500 Subject: [PATCH 44/58] fix: removes downlaod none steps Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 8f70c85bfd..35f3f066d2 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -700,7 +700,6 @@ extends: dependsOn: - github_release steps: - - download: none - task: NodeTool@0 inputs: versionSpec: "18.x" @@ -763,7 +762,6 @@ extends: runOnce: deploy: steps: - - download: none - pwsh: $(Pipeline.Workspace)/scripts/get-prerelease-version.ps1 -currentBranch $(Build.SourceBranch) -previewBranch ${{ parameters.previewBranch }} displayName: "Set version suffix" - pwsh: $(Pipeline.Workspace)/scripts/get-version-from-csproj.ps1 -csprojPath "$(Pipeline.Workspace)/csproj/kiota.csproj" @@ -824,7 +822,6 @@ extends: runOnce: deploy: steps: - - download: none - powershell: | Remove-Item "$(Pipeline.Workspace)/Microsoft.OpenApi.Kiota.Builder.*.nupkg" -Verbose displayName: remove other nupkgs to avoid duplication @@ -854,7 +851,6 @@ extends: runOnce: deploy: steps: - - download: none - powershell: | Remove-Item "$(Pipeline.Workspace)/Microsoft.OpenApi.Kiota.*.nupkg" -Verbose -Exclude "*.Builder.*" displayName: remove other nupkgs to avoid duplication From 465cae13de008d88b7dc7b9c0a54bc5ac2e67487 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 12:54:58 -0500 Subject: [PATCH 45/58] fix: wrong path to changelog --- .azure-pipelines/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index 35f3f066d2..ef27cf5aae 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -780,7 +780,7 @@ extends: tag: "v$(artifactVersion)" title: "v$(artifactVersion)" releaseNotesSource: filePath - releaseNotesFilePath: $(Pipeline.Workspace)/release-notes.txt + releaseNotesFilePath: $(Pipeline.Workspace)/changelog/release-notes.txt assets: | $(Pipeline.Workspace)/*.zip $(Pipeline.Workspace)/*.vsix @@ -795,7 +795,7 @@ extends: tag: "v$(artifactVersion)$(versionSuffix)" title: "v$(artifactVersion)$(versionSuffix)" releaseNotesSource: filePath - releaseNotesFilePath: $(Pipeline.Workspace)/release-notes.txt + releaseNotesFilePath: $(Pipeline.Workspace)/changelog/release-notes.txt assets: | $(Pipeline.Workspace)/*.zip $(Pipeline.Workspace)/*.vsix From 3edf722eafbfced63c53698b98ee4a13bb07fcf2 Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Fri, 29 Nov 2024 13:34:46 -0500 Subject: [PATCH 46/58] ci: fixes paths for vscode publish Signed-off-by: Vincent Biret --- .azure-pipelines/ci-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/ci-build.yml b/.azure-pipelines/ci-build.yml index ef27cf5aae..c9ebf81771 100644 --- a/.azure-pipelines/ci-build.yml +++ b/.azure-pipelines/ci-build.yml @@ -693,10 +693,10 @@ extends: inputs: - input: pipelineArtifact artifactName: VSCode - targetPath: $(Build.ArtifactStagingDirectory)/VSCode + targetPath: $(Pipeline.Workspace)/VSCode - input: pipelineArtifact artifactName: scripts - targetPath: "$(Pipeline.Workspace)" + targetPath: "$(Pipeline.Workspace)/scripts" dependsOn: - github_release steps: @@ -713,7 +713,7 @@ extends: scriptLocation: "inlineScript" inlineScript: | $aadToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv - Get-ChildItem -Path $(Pipeline.Workspace) -Filter *.vsix -Recurse | ForEach-Object { + Get-ChildItem -Path $(Pipeline.Workspace)/VSCode -Filter *.vsix -Recurse | ForEach-Object { $packagePath = $_.FullName $manifestPath = $packagePath.Replace("vsix", "manifest") $signaturePath = $packagePath.Replace("vsix", "signature.p7s") From 02b679bc22ecea80790412ebf8e5f3d6c279c225 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:14:04 +0000 Subject: [PATCH 47/58] chore(deps): bump YamlDotNet from 16.2.0 to 16.2.1 Bumps [YamlDotNet](https://github.com/aaubry/YamlDotNet) from 16.2.0 to 16.2.1. - [Release notes](https://github.com/aaubry/YamlDotNet/releases) - [Commits](https://github.com/aaubry/YamlDotNet/compare/v16.2.0...v16.2.1) --- updated-dependencies: - dependency-name: YamlDotNet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- src/Kiota.Builder/Kiota.Builder.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Kiota.Builder/Kiota.Builder.csproj b/src/Kiota.Builder/Kiota.Builder.csproj index 6bf2e472f7..20e57e46d5 100644 --- a/src/Kiota.Builder/Kiota.Builder.csproj +++ b/src/Kiota.Builder/Kiota.Builder.csproj @@ -53,7 +53,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + From fd54566d20de5712b0a6c85c64b15873a060bf8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:18:26 +0000 Subject: [PATCH 48/58] chore(deps-dev): bump aiohttp from 3.11.8 to 3.11.9 in /it/python Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.11.8 to 3.11.9. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.11.8...v3.11.9) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 825248fc3d..b141196163 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -66,7 +66,7 @@ yapf==0.43.0 zipp==3.21.0 ; python_version >= '3.7' -aiohttp==3.11.8 ; python_version >= '3.6' +aiohttp==3.11.9 ; python_version >= '3.6' aiosignal==1.3.1 ; python_version >= '3.7' From 3c2400a060f256a3e401d4f6746221afa5453fe0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:18:35 +0000 Subject: [PATCH 49/58] chore(deps-dev): bump pytest from 8.3.3 to 8.3.4 in /it/python Bumps [pytest](https://github.com/pytest-dev/pytest) from 8.3.3 to 8.3.4. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.3...8.3.4) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 825248fc3d..4929502d32 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -42,7 +42,7 @@ pluggy==1.5.0 ; python_version >= '3.7' pylint==3.3.1 -pytest==8.3.3 +pytest==8.3.4 pytest-asyncio==0.24.0 From 6571b13bc4da9f028b00c577e5c86bc4c17f2112 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:18:46 +0000 Subject: [PATCH 50/58] chore(deps-dev): bump pylint from 3.3.1 to 3.3.2 in /it/python Bumps [pylint](https://github.com/pylint-dev/pylint) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.3.1...v3.3.2) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 825248fc3d..cf6ef409bf 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -40,7 +40,7 @@ platformdirs==4.3.6 ; python_version >= '3.7' pluggy==1.5.0 ; python_version >= '3.7' -pylint==3.3.1 +pylint==3.3.2 pytest==8.3.3 From 5c1f7bee64177e8fb77368fb32fff1666a031b38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:19:01 +0000 Subject: [PATCH 51/58] chore(deps-dev): bump yarl from 1.18.0 to 1.18.3 in /it/python Bumps [yarl](https://github.com/aio-libs/yarl) from 1.18.0 to 1.18.3. - [Release notes](https://github.com/aio-libs/yarl/releases) - [Changelog](https://github.com/aio-libs/yarl/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/yarl/compare/v1.18.0...v1.18.3) --- updated-dependencies: - dependency-name: yarl dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index 825248fc3d..3b8cf557c0 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -136,5 +136,5 @@ sniffio==1.3.1 ; python_version >= '3.7' uritemplate==4.1.1 ; python_version >= '3.6' -yarl==1.18.0 ; python_version >= '3.7' +yarl==1.18.3 ; python_version >= '3.7' From 7d5b91f9328427cec7d41075b559686d92aa5dcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:47:22 +0000 Subject: [PATCH 52/58] chore(deps-dev): bump eslint in /it/typescript in the eslint group Bumps the eslint group in /it/typescript with 1 update: [eslint](https://github.com/eslint/eslint). Updates `eslint` from 9.15.0 to 9.16.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.15.0...v9.16.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] --- it/typescript/package-lock.json | 16 ++++++++-------- it/typescript/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 19cd62aabc..60bfd787e6 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -27,7 +27,7 @@ "@typescript-eslint/eslint-plugin": "^8.16.0", "@typescript-eslint/parser": "^8.16.0", "esbuild": "^0.24.0", - "eslint": "^9.15.0", + "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", "minimist": "^1.2.8", "prettier": "^3.4.1", @@ -675,9 +675,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", - "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1652,9 +1652,9 @@ } }, "node_modules/eslint": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", - "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -1662,7 +1662,7 @@ "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.9.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.15.0", + "@eslint/js": "9.16.0", "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", diff --git a/it/typescript/package.json b/it/typescript/package.json index 0a98074d26..b67ad0140a 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -24,7 +24,7 @@ "@typescript-eslint/eslint-plugin": "^8.16.0", "@typescript-eslint/parser": "^8.16.0", "esbuild": "^0.24.0", - "eslint": "^9.15.0", + "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", "minimist": "^1.2.8", "prettier": "^3.4.1", From 3aa447ed0d60aee7f8652d914dc6181a5ea617ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:07:21 +0000 Subject: [PATCH 53/58] chore(deps-dev): bump eslint Bumps the eslint group in /vscode/microsoft-kiota with 1 update: [eslint](https://github.com/eslint/eslint). Updates `eslint` from 9.15.0 to 9.16.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.15.0...v9.16.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 16 ++++++++-------- vscode/microsoft-kiota/package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index a15157cb07..e5601c1e07 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -29,7 +29,7 @@ "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "^2.4.1", "chai": "^5.1.2", - "eslint": "^9.15.0", + "eslint": "^9.16.0", "glob": "^11.0.0", "mocha": "^10.8.2", "sinon": "^19.0.2", @@ -193,9 +193,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", - "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2254,9 +2254,9 @@ } }, "node_modules/eslint": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", - "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", @@ -2264,7 +2264,7 @@ "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.9.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.15.0", + "@eslint/js": "9.16.0", "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index 64c0b50aa3..fc76d17b8b 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -503,7 +503,7 @@ "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "^2.4.1", "chai": "^5.1.2", - "eslint": "^9.15.0", + "eslint": "^9.16.0", "glob": "^11.0.0", "mocha": "^10.8.2", "sinon": "^19.0.2", From 6b5ed3e23881493528ed291c828e6f392b11ca80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:50:00 +0000 Subject: [PATCH 54/58] chore(deps-dev): bump the eslint group Bumps the eslint group in /vscode/microsoft-kiota with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 8.16.0 to 8.17.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.17.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.16.0 to 8.17.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.17.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 88 ++++++++++++------------ vscode/microsoft-kiota/package.json | 4 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index e5601c1e07..fabe25f1aa 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -24,8 +24,8 @@ "@types/node": "22.x", "@types/sinon": "^17.0.3", "@types/vscode": "^1.95.0", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", + "@typescript-eslint/eslint-plugin": "^8.17.0", + "@typescript-eslint/parser": "^8.17.0", "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "^2.4.1", "chai": "^5.1.2", @@ -763,16 +763,16 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz", - "integrity": "sha512-5YTHKV8MYlyMI6BaEG7crQ9BhSc8RxzshOReKwZwRWN0+XvvTOm+L/UYLCYxFpfwYuAAqhxiq4yae0CMFwbL7Q==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz", + "integrity": "sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/type-utils": "8.16.0", - "@typescript-eslint/utils": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/type-utils": "8.17.0", + "@typescript-eslint/utils": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -796,15 +796,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.16.0.tgz", - "integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.17.0.tgz", + "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/typescript-estree": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "debug": "^4.3.4" }, "engines": { @@ -824,13 +824,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", - "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz", + "integrity": "sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0" + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -841,13 +841,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.16.0.tgz", - "integrity": "sha512-IqZHGG+g1XCWX9NyqnI/0CX5LL8/18awQqmkZSl2ynn8F76j579dByc0jhfVSnSnhf7zv76mKBQv9HQFKvDCgg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz", + "integrity": "sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.16.0", - "@typescript-eslint/utils": "8.16.0", + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/utils": "8.17.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -868,9 +868,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", - "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.17.0.tgz", + "integrity": "sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -881,13 +881,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", - "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz", + "integrity": "sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -909,15 +909,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", - "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz", + "integrity": "sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/typescript-estree": "8.16.0" + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -936,12 +936,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", - "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz", + "integrity": "sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/types": "8.17.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index fc76d17b8b..a271fac246 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -498,8 +498,8 @@ "@types/node": "22.x", "@types/sinon": "^17.0.3", "@types/vscode": "^1.95.0", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", + "@typescript-eslint/eslint-plugin": "^8.17.0", + "@typescript-eslint/parser": "^8.17.0", "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "^2.4.1", "chai": "^5.1.2", From bc3b7e42aaa1f3edf04931fee40e711e18460f36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:50:24 +0000 Subject: [PATCH 55/58] chore(deps-dev): bump mocha in /vscode/microsoft-kiota Bumps [mocha](https://github.com/mochajs/mocha) from 10.8.2 to 11.0.1. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/main/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v10.8.2...v11.0.1) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- vscode/microsoft-kiota/package-lock.json | 265 +++++++++++++++++++++-- vscode/microsoft-kiota/package.json | 2 +- 2 files changed, 247 insertions(+), 20 deletions(-) diff --git a/vscode/microsoft-kiota/package-lock.json b/vscode/microsoft-kiota/package-lock.json index e5601c1e07..c96da7aad2 100644 --- a/vscode/microsoft-kiota/package-lock.json +++ b/vscode/microsoft-kiota/package-lock.json @@ -31,7 +31,7 @@ "chai": "^5.1.2", "eslint": "^9.16.0", "glob": "^11.0.0", - "mocha": "^10.8.2", + "mocha": "^11.0.1", "sinon": "^19.0.2", "ts-loader": "^9.5.1", "typemoq": "^2.1.0", @@ -995,6 +995,32 @@ "node": ">=18" } }, + "node_modules/@vscode/test-cli/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@vscode/test-cli/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/@vscode/test-cli/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "node_modules/@vscode/test-cli/node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -1039,6 +1065,106 @@ "dev": true, "license": "ISC" }, + "node_modules/@vscode/test-cli/node_modules/mocha": { + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@vscode/test-cli/node_modules/mocha/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vscode/test-cli/node_modules/mocha/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@vscode/test-cli/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/@vscode/test-cli/node_modules/mocha/node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@vscode/test-cli/node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", @@ -1056,6 +1182,58 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@vscode/test-cli/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@vscode/test-cli/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@vscode/test-cli/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@vscode/test-cli/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/@vscode/test-electron": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.4.1.tgz", @@ -3617,11 +3795,10 @@ } }, "node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.0.1.tgz", + "integrity": "sha512-+3GkODfsDG71KSCQhc4IekSW+ItCK/kiez1Z28ksWvYhKXV/syxMlerR/sC7whDp7IyreZ4YxceMLdTs5hQE8A==", "dev": true, - "license": "MIT", "dependencies": { "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", @@ -3630,7 +3807,7 @@ "diff": "^5.2.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", - "glob": "^8.1.0", + "glob": "^10.4.5", "he": "^1.2.0", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", @@ -3649,7 +3826,7 @@ "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/mocha/node_modules/ansi-regex": { @@ -3682,32 +3859,66 @@ "license": "MIT" }, "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, - "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=12" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "dependencies": { + "@isaacs/cliui": "^8.0.2" }, "funding": { "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/mocha/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true + }, "node_modules/mocha/node_modules/minimatch": { "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, - "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -3715,6 +3926,22 @@ "node": ">=10" } }, + "node_modules/mocha/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mocha/node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", diff --git a/vscode/microsoft-kiota/package.json b/vscode/microsoft-kiota/package.json index fc76d17b8b..ec0bef4688 100644 --- a/vscode/microsoft-kiota/package.json +++ b/vscode/microsoft-kiota/package.json @@ -505,7 +505,7 @@ "chai": "^5.1.2", "eslint": "^9.16.0", "glob": "^11.0.0", - "mocha": "^10.8.2", + "mocha": "^11.0.1", "sinon": "^19.0.2", "ts-loader": "^9.5.1", "typemoq": "^2.1.0", From ad9337a0eed4067f1eed72856a8b4a19066f40a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:53:39 +0000 Subject: [PATCH 56/58] chore(deps-dev): bump the eslint group in /it/typescript with 2 updates Bumps the eslint group in /it/typescript with 2 updates: [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) and [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser). Updates `@typescript-eslint/eslint-plugin` from 8.16.0 to 8.17.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.17.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.16.0 to 8.17.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.17.0/packages/parser) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint - dependency-name: "@typescript-eslint/parser" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: eslint ... Signed-off-by: dependabot[bot] --- it/typescript/package-lock.json | 88 ++++++++++++++++----------------- it/typescript/package.json | 4 +- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/it/typescript/package-lock.json b/it/typescript/package-lock.json index 60bfd787e6..68f5ff9a79 100644 --- a/it/typescript/package-lock.json +++ b/it/typescript/package-lock.json @@ -24,8 +24,8 @@ "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.11.0", "@types/node": "^22.10.1", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", + "@typescript-eslint/eslint-plugin": "^8.17.0", + "@typescript-eslint/parser": "^8.17.0", "esbuild": "^0.24.0", "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", @@ -945,16 +945,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.16.0.tgz", - "integrity": "sha512-5YTHKV8MYlyMI6BaEG7crQ9BhSc8RxzshOReKwZwRWN0+XvvTOm+L/UYLCYxFpfwYuAAqhxiq4yae0CMFwbL7Q==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.17.0.tgz", + "integrity": "sha512-HU1KAdW3Tt8zQkdvNoIijfWDMvdSweFYm4hWh+KwhPstv+sCmWb89hCIP8msFm9N1R/ooh9honpSuvqKWlYy3w==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/type-utils": "8.16.0", - "@typescript-eslint/utils": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/type-utils": "8.17.0", + "@typescript-eslint/utils": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -978,15 +978,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.16.0.tgz", - "integrity": "sha512-D7DbgGFtsqIPIFMPJwCad9Gfi/hC0PWErRRHFnaCWoEDYi5tQUDiJCTmGUbBiLzjqAck4KcXt9Ayj0CNlIrF+w==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.17.0.tgz", + "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/typescript-estree": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "debug": "^4.3.4" }, "engines": { @@ -1006,13 +1006,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.16.0.tgz", - "integrity": "sha512-mwsZWubQvBki2t5565uxF0EYvG+FwdFb8bMtDuGQLdCCnGPrDEDvm1gtfynuKlnpzeBRqdFCkMf9jg1fnAK8sg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.17.0.tgz", + "integrity": "sha512-/ewp4XjvnxaREtqsZjF4Mfn078RD/9GmiEAtTeLQ7yFdKnqwTOgRMSvFz4et9U5RiJQ15WTGXPLj89zGusvxBg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0" + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1023,13 +1023,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.16.0.tgz", - "integrity": "sha512-IqZHGG+g1XCWX9NyqnI/0CX5LL8/18awQqmkZSl2ynn8F76j579dByc0jhfVSnSnhf7zv76mKBQv9HQFKvDCgg==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.17.0.tgz", + "integrity": "sha512-q38llWJYPd63rRnJ6wY/ZQqIzPrBCkPdpIsaCfkR3Q4t3p6sb422zougfad4TFW9+ElIFLVDzWGiGAfbb/v2qw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.16.0", - "@typescript-eslint/utils": "8.16.0", + "@typescript-eslint/typescript-estree": "8.17.0", + "@typescript-eslint/utils": "8.17.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1050,9 +1050,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.16.0.tgz", - "integrity": "sha512-NzrHj6thBAOSE4d9bsuRNMvk+BvaQvmY4dDglgkgGC0EW/tB3Kelnp3tAKH87GEwzoxgeQn9fNGRyFJM/xd+GQ==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.17.0.tgz", + "integrity": "sha512-gY2TVzeve3z6crqh2Ic7Cr+CAv6pfb0Egee7J5UAVWCpVvDI/F71wNfolIim4FE6hT15EbpZFVUj9j5i38jYXA==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1063,13 +1063,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.16.0.tgz", - "integrity": "sha512-E2+9IzzXMc1iaBy9zmo+UYvluE3TW7bCGWSF41hVWUE01o8nzr1rvOQYSxelxr6StUvRcTMe633eY8mXASMaNw==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.17.0.tgz", + "integrity": "sha512-JqkOopc1nRKZpX+opvKqnM3XUlM7LpFMD0lYxTqOTKQfCWAmxw45e3qlOCsEqEB2yuacujivudOFpCnqkBDNMw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/visitor-keys": "8.16.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/visitor-keys": "8.17.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1115,15 +1115,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.16.0.tgz", - "integrity": "sha512-C1zRy/mOL8Pj157GiX4kaw7iyRLKfJXBR3L82hk5kS/GyHcOFmy4YUq/zfZti72I9wnuQtA/+xzft4wCC8PJdA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.17.0.tgz", + "integrity": "sha512-bQC8BnEkxqG8HBGKwG9wXlZqg37RKSMY7v/X8VEWD8JG2JuTHuNK0VFvMPMUKQcbk6B+tf05k+4AShAEtCtJ/w==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.16.0", - "@typescript-eslint/types": "8.16.0", - "@typescript-eslint/typescript-estree": "8.16.0" + "@typescript-eslint/scope-manager": "8.17.0", + "@typescript-eslint/types": "8.17.0", + "@typescript-eslint/typescript-estree": "8.17.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1142,12 +1142,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.16.0.tgz", - "integrity": "sha512-pq19gbaMOmFE3CbL0ZB8J8BFCo2ckfHBfaIsaOZgBIF4EoISJIdLX5xRhd0FGB0LlHReNRuzoJoMGpTjq8F2CQ==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.17.0.tgz", + "integrity": "sha512-1Hm7THLpO6ww5QU6H/Qp+AusUUl+z/CAm3cNZZ0jQvon9yicgO7Rwd+/WWRpMKLYV6p2UvdbR27c86rzCPpreg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.16.0", + "@typescript-eslint/types": "8.17.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { diff --git a/it/typescript/package.json b/it/typescript/package.json index b67ad0140a..f8b1154825 100644 --- a/it/typescript/package.json +++ b/it/typescript/package.json @@ -21,8 +21,8 @@ "@es-exec/esbuild-plugin-start": "^0.0.5", "@stylistic/eslint-plugin-ts": "^2.11.0", "@types/node": "^22.10.1", - "@typescript-eslint/eslint-plugin": "^8.16.0", - "@typescript-eslint/parser": "^8.16.0", + "@typescript-eslint/eslint-plugin": "^8.17.0", + "@typescript-eslint/parser": "^8.17.0", "esbuild": "^0.24.0", "eslint": "^9.16.0", "eslint-config-prettier": "^9.1.0", From 9c250cf5aed4aeadc58dcf13b3ee8ee3c0752866 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 09:15:29 +0000 Subject: [PATCH 57/58] chore(deps-dev): bump the kiota-dependencies group Bumps the kiota-dependencies group in /it/python with 7 updates: | Package | From | To | | --- | --- | --- | | [microsoft-kiota-abstractions](https://github.com/microsoft/kiota-python) | `1.6.2` | `1.6.3` | | [microsoft-kiota-http](https://github.com/microsoft/kiota-python) | `1.6.2` | `1.6.3` | | [microsoft-kiota-authentication-azure](https://github.com/microsoft/kiota-python) | `1.6.2` | `1.6.3` | | [microsoft-kiota-serialization-json](https://github.com/microsoft/kiota-python) | `1.6.2` | `1.6.3` | | [microsoft-kiota-serialization-text](https://github.com/microsoft/kiota-python) | `1.6.2` | `1.6.3` | | [microsoft-kiota-serialization-form](https://github.com/microsoft/kiota-python) | `1.6.2` | `1.6.3` | | [microsoft-kiota-serialization-multipart](https://github.com/microsoft/kiota-python) | `1.6.2` | `1.6.3` | Updates `microsoft-kiota-abstractions` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/microsoft/kiota-python/releases) - [Changelog](https://github.com/microsoft/kiota-python/blob/main/release-please-config.json) - [Commits](https://github.com/microsoft/kiota-python/compare/microsoft-kiota-abstractions-v1.6.2...microsoft-kiota-abstractions-v1.6.3) Updates `microsoft-kiota-http` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/microsoft/kiota-python/releases) - [Changelog](https://github.com/microsoft/kiota-python/blob/main/release-please-config.json) - [Commits](https://github.com/microsoft/kiota-python/compare/microsoft-kiota-http-v1.6.2...microsoft-kiota-http-v1.6.3) Updates `microsoft-kiota-authentication-azure` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/microsoft/kiota-python/releases) - [Changelog](https://github.com/microsoft/kiota-python/blob/main/release-please-config.json) - [Commits](https://github.com/microsoft/kiota-python/compare/microsoft-kiota-authentication-azure-v1.6.2...microsoft-kiota-authentication-azure-v1.6.3) Updates `microsoft-kiota-serialization-json` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/microsoft/kiota-python/releases) - [Changelog](https://github.com/microsoft/kiota-python/blob/main/release-please-config.json) - [Commits](https://github.com/microsoft/kiota-python/compare/microsoft-kiota-serialization-json-v1.6.2...microsoft-kiota-serialization-json-v1.6.3) Updates `microsoft-kiota-serialization-text` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/microsoft/kiota-python/releases) - [Changelog](https://github.com/microsoft/kiota-python/blob/main/release-please-config.json) - [Commits](https://github.com/microsoft/kiota-python/compare/microsoft-kiota-serialization-text-v1.6.2...microsoft-kiota-serialization-text-v1.6.3) Updates `microsoft-kiota-serialization-form` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/microsoft/kiota-python/releases) - [Changelog](https://github.com/microsoft/kiota-python/blob/main/release-please-config.json) - [Commits](https://github.com/microsoft/kiota-python/compare/microsoft-kiota-serialization-form-v1.6.2...microsoft-kiota-serialization-form-v1.6.3) Updates `microsoft-kiota-serialization-multipart` from 1.6.2 to 1.6.3 - [Release notes](https://github.com/microsoft/kiota-python/releases) - [Changelog](https://github.com/microsoft/kiota-python/blob/main/release-please-config.json) - [Commits](https://github.com/microsoft/kiota-python/compare/microsoft-kiota-serialization-multipart-v1.6.2...microsoft-kiota-serialization-multipart-v1.6.3) --- updated-dependencies: - dependency-name: microsoft-kiota-abstractions dependency-type: direct:development update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: microsoft-kiota-http dependency-type: direct:development update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: microsoft-kiota-authentication-azure dependency-type: direct:development update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: microsoft-kiota-serialization-json dependency-type: direct:development update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: microsoft-kiota-serialization-text dependency-type: direct:development update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: microsoft-kiota-serialization-form dependency-type: direct:development update-type: version-update:semver-patch dependency-group: kiota-dependencies - dependency-name: microsoft-kiota-serialization-multipart dependency-type: direct:development update-type: version-update:semver-patch dependency-group: kiota-dependencies ... Signed-off-by: dependabot[bot] --- it/python/requirements-dev.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/it/python/requirements-dev.txt b/it/python/requirements-dev.txt index e945f7572c..2ffa525f63 100644 --- a/it/python/requirements-dev.txt +++ b/it/python/requirements-dev.txt @@ -98,19 +98,19 @@ httpx[http2]==0.27.2 hyperframe==6.0.1 ; python_full_version >= '3.6.1' -microsoft-kiota-abstractions==1.6.2 +microsoft-kiota-abstractions==1.6.3 -microsoft-kiota-authentication-azure==1.6.2 +microsoft-kiota-authentication-azure==1.6.3 -microsoft-kiota-http==1.6.2 +microsoft-kiota-http==1.6.3 -microsoft-kiota-serialization-json==1.6.2 +microsoft-kiota-serialization-json==1.6.3 -microsoft-kiota-serialization-text==1.6.2 +microsoft-kiota-serialization-text==1.6.3 -microsoft-kiota-serialization-form==1.6.2 +microsoft-kiota-serialization-form==1.6.3 -microsoft-kiota-serialization-multipart==1.6.2 +microsoft-kiota-serialization-multipart==1.6.3 msal==1.31.1 From f1efd749275b0eca9ff5277acd26df46cca419cc Mon Sep 17 00:00:00 2001 From: Charles Wahome Date: Tue, 3 Dec 2024 15:59:34 +0300 Subject: [PATCH 58/58] Fix: Click away dismisses steps (#5866) --- vscode/microsoft-kiota/src/modules/steps/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vscode/microsoft-kiota/src/modules/steps/index.ts b/vscode/microsoft-kiota/src/modules/steps/index.ts index 92441f98b5..fcfbd17b7b 100644 --- a/vscode/microsoft-kiota/src/modules/steps/index.ts +++ b/vscode/microsoft-kiota/src/modules/steps/index.ts @@ -113,7 +113,7 @@ export class MultiStepInput { input.title = title; input.step = step; input.totalSteps = totalSteps; - input.ignoreFocusOut = ignoreFocusOut ?? false; + input.ignoreFocusOut = ignoreFocusOut ?? true; input.placeholder = placeholder; input.items = items; input.buttons = [ @@ -160,7 +160,7 @@ export class MultiStepInput { input.totalSteps = totalSteps; input.value = value || ''; input.prompt = prompt; - input.ignoreFocusOut = ignoreFocusOut ?? false; + input.ignoreFocusOut = ignoreFocusOut ?? true; input.placeholder = placeholder; input.buttons = [ ...(this.steps.length > 1 ? [QuickInputButtons.Back] : []),