Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task: remove kiota interop tight coupling #6096

Open
wants to merge 78 commits into
base: main
Choose a base branch
from

Conversation

thewahome
Copy link
Contributor

@thewahome thewahome commented Feb 5, 2025

Overview

Closes #6084

Notes

Introduces a new module to decouple the Kiota Interop code from the VS Code extension. The most significant changes involve the addition of unit tests, and refactoring of command implementations of the interop module by moving all of them away into the module.

Changes

  • The installation of the binaries is done inside the Application folder > {AppData}\Microsoft Kiota\.kiotabin regardless of OS. Moving the .kiotabin folder outside of the vscode extension environment enabling sharing with different apps on the same device
  • All references to vscode were removed from the kiota interop code
  • Command implementations that depended on connectToKiota have moved to the module library as independent functions exported via the index.ts file
  • Added unit tests to directly test functions related to the interop changes without spinning up a vscode environment
  • For ease of use, the modlue exposes all functions with more than one argument to use a monad instead of multiple arguments
  • Introduced the runtime.json file with the intent to ship it together with the module so that it can carry the binary information (in the runtimeDependencies property) and the kiotaVersion number.
  • The package.json file in the vscode extension no-longer carries the runtimeDependencies and kiotaVersion properties.
  • Update the powershell scripts and build pipelines to support the new version and runtime locations

Onokaev
Onokaev previously approved these changes Feb 18, 2025
calebkiage
calebkiage previously approved these changes Feb 18, 2025
@thewahome thewahome dismissed stale reviews from Onokaev and calebkiage via 81c5ff3 February 18, 2025 19:01
calebkiage
calebkiage previously approved these changes Feb 19, 2025
- name: run tests(linux)
if: runner.os == 'Linux'
run: xvfb-run -a npm run test-with-coverage
run: xvfb-run -a npm run test:coverage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving a note so we can better understand what's the situation with coverage.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got to go through it. The changes introduced by this PR: #6171 removed the filter that keeps the vscode folder outside of the dotnet sonarqube checks. Without this filter the vscode extension will definitely fail the checks because the workflow uses dotnet to test.

Some more configuration work will be required to bring in the report from the sonarqube checks that are already placed inside the build-vscode-extension.yml similar to the comment that comes in when the dotnet side is checked. Currently what we have is the production of the code coverage and a connection to the sonarqube host and not the handover back to the PR.

This work is however outside the scope of this PR and may need its own item and prioritisation

@@ -0,0 +1,257 @@
export enum KiotaGenerationLanguage {
// eslint-disable-next-line @typescript-eslint/naming-convention
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this file be in the lib section as well?

Copy link

Quality Gate Failed Quality Gate failed for 'kiota'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove tight coupling of Kiota Interop code and the VS Code Extension
4 participants