Skip to content

Task: extract and create npm package #6172

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

Merged
merged 244 commits into from
Apr 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
244 commits
Select commit Hold shift + click to select a range
6d2218e
add unit test fundamentals
thewahome Feb 4, 2025
86b2409
add getKiotaVersion tests
thewahome Feb 4, 2025
8e589e6
remove context.extension.packageJson dependency from module
thewahome Feb 4, 2025
c1d8748
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 5, 2025
a032891
[temp] skip tests
thewahome Feb 5, 2025
9d32c57
add test argument
thewahome Feb 5, 2025
6c1d8c9
fix: improve error handling in download process
thewahome Feb 5, 2025
1300386
feat: add follow-redirects dependency and update tests for compatibility
thewahome Feb 5, 2025
475ba2b
remove unnecessary request handling
thewahome Feb 5, 2025
7e2f33a
add request lifecycle management
thewahome Feb 5, 2025
fd33227
simplify the test
thewahome Feb 5, 2025
49fd7f0
ensure kiota is present
thewahome Feb 5, 2025
08ad4fd
update test commands in CI workflow to use unit tests
thewahome Feb 5, 2025
652f768
Task: decouple search (#6105)
thewahome Feb 6, 2025
337f86d
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 6, 2025
707b07e
expose getKiotaVersion from module
thewahome Feb 6, 2025
6f9f9f5
Chore: get language information (#6109)
thewahome Feb 7, 2025
8717cd4
Chore: decouple update clients (#6108)
thewahome Feb 7, 2025
b079c53
Chore: decouple open api tree functions (#6117)
thewahome Feb 7, 2025
5df0735
format export statements for consistency
thewahome Feb 7, 2025
768a225
Chore: decouple migrate lockfile (#6107)
thewahome Feb 7, 2025
a0fd3e8
Chore: decouple delete workspace item (#6106)
thewahome Feb 7, 2025
47c7e47
Chore: decouple generate functions (#6116)
thewahome Feb 7, 2025
038dddc
remove references to the old connectToKiota function
thewahome Feb 7, 2025
fabda77
consolidate Kiota enums into the module
thewahome Feb 7, 2025
6bd631b
Refactor imports in test files and utility modules for consistency
thewahome Feb 7, 2025
f901a37
export lean index.ts interface
thewahome Feb 7, 2025
d1e44a5
correct test naming
thewahome Feb 10, 2025
7f7d88a
throw error instead of returning undefined
thewahome Feb 10, 2025
92cae2d
fix imports
thewahome Feb 10, 2025
40d7cd6
add error handling to kiota connection functions
thewahome Feb 10, 2025
9aa91ae
refactor migration and logging functions to improve success handling …
thewahome Feb 10, 2025
a37cbaa
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 10, 2025
5e0a8e9
restore other tests
thewahome Feb 10, 2025
f002899
adjust testing process
thewahome Feb 11, 2025
baedd37
add types to config
thewahome Feb 11, 2025
e64663d
check for success
thewahome Feb 11, 2025
46bacdb
update test configuration to exclude spec files from coverage
thewahome Feb 11, 2025
7db2b6d
update tsconfig to include only jest types and enable skipLibCheck
thewahome Feb 11, 2025
3a0cb71
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 11, 2025
69e4071
remove kiotaVersion and runtimeDependencies from vscode to the interop
thewahome Feb 11, 2025
dc1e6a1
add kiotaVersion back for scripts to run
thewahome Feb 11, 2025
b433771
restore runtime dependencies because of scripts
thewahome Feb 11, 2025
98cdcd2
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 12, 2025
5e2e52a
update parameters in scripts to update both files
thewahome Feb 13, 2025
1ef338d
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 13, 2025
620bed7
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 13, 2025
d2f77b9
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 13, 2025
ecd8c3a
refactor: replace sinon with jest for mocking in test files
thewahome Feb 13, 2025
9134dc4
remove the try catch as it does not provide any value and messes up t…
thewahome Feb 13, 2025
a40a415
Chore: change testing framework vscode test (#6153)
thewahome Feb 13, 2025
3f73425
Chore: remove sinon (#6154)
thewahome Feb 13, 2025
38610e3
respond to PR comments
thewahome Feb 17, 2025
1b181c4
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 17, 2025
ebe859f
rename showKiotaResult function for clarity
thewahome Feb 18, 2025
9cb216e
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 18, 2025
bd8ff50
Chore: document exposed interop functions (#6142)
thewahome Feb 18, 2025
4c9f88f
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 18, 2025
eea0051
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 18, 2025
81c5ff3
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 18, 2025
76056db
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 19, 2025
5168790
update variable name for release version in build workflow
thewahome Feb 19, 2025
72ee955
extract content to folder in root of project
thewahome Feb 19, 2025
d0b900b
add missing packages
thewahome Feb 19, 2025
082e500
add npmignore file
thewahome Feb 19, 2025
75332bf
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 19, 2025
edfd0df
remove build step
thewahome Feb 19, 2025
287e1e8
update imports to use '@microsoft/kiota' instead of '../kiotaInterop'
thewahome Feb 19, 2025
73b23a2
add 'run tests' step
thewahome Feb 19, 2025
69df1d2
add coverage step
thewahome Feb 19, 2025
49e7427
exclude interop from coverage
thewahome Feb 19, 2025
514e659
add configuration files for Lerna
thewahome Feb 20, 2025
8f807dc
add both tests
thewahome Feb 20, 2025
4e0425c
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 20, 2025
27bed51
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Feb 20, 2025
00e8d41
remove kiotaInterop from coverage exclusions
thewahome Feb 20, 2025
5e875e2
exclude kiotaInterop from coverage
thewahome Feb 20, 2025
b89d60e
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' of …
thewahome Feb 20, 2025
eb1aa8b
remove explicit unit test step
thewahome Feb 20, 2025
19653dc
add spec files to test inclusions
thewahome Feb 20, 2025
3f52d94
update coverage exclusions and test inclusions in configuration files
thewahome Feb 20, 2025
ac1b048
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 20, 2025
dd7a388
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Feb 20, 2025
a0d530b
reduce configurations
thewahome Feb 20, 2025
21e65ca
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 21, 2025
af35143
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Feb 21, 2025
e41f155
update TypeScript configuration for ES6 module support
thewahome Feb 21, 2025
2242ef2
set type as module
thewahome Feb 21, 2025
e812dcf
rename jest config
thewahome Feb 21, 2025
87b9aba
add dist folder
thewahome Feb 21, 2025
edf6f26
move to dependencies
thewahome Feb 21, 2025
d61303a
use new identifier
thewahome Feb 21, 2025
7a51dc4
revert
thewahome Feb 21, 2025
2c40a83
use require instead of import
thewahome Feb 21, 2025
73d8310
fix failing commands
thewahome Feb 21, 2025
c5f3828
update import statements and streamline exports in npm package
thewahome Feb 21, 2025
0a6938f
update package configuration for ESM and CJS support
thewahome Feb 24, 2025
212a24e
add package lock file
thewahome Feb 24, 2025
724fa70
change from ci to install
thewahome Feb 24, 2025
faa34cd
fix linting
thewahome Feb 24, 2025
d8b0db7
ignore dist folder
thewahome Feb 24, 2025
a234815
limit testing to spec.ts files
thewahome Feb 24, 2025
d6cbf58
reduce tests scope
thewahome Feb 24, 2025
a2aabdd
use Mocha instead of Jest; update configurations and dependencies
thewahome Feb 24, 2025
2cff43a
reference package via alias on webpack
thewahome Feb 24, 2025
8a39de1
[temp] skip unresponsive tests
thewahome Feb 24, 2025
0100fd3
remove unnecessary path connection
thewahome Feb 25, 2025
97b1b59
enhance CI workflow for code coverage
thewahome Feb 25, 2025
3fa5ce2
set coverage test
thewahome Feb 25, 2025
03b2df3
add missed coverage test
thewahome Feb 25, 2025
b1b00d1
clean before coverage
thewahome Feb 25, 2025
808f6b5
build before testing
thewahome Feb 25, 2025
ea5cc3f
enhance matrix
thewahome Feb 25, 2025
1e04aa8
add missing package scripts
thewahome Feb 25, 2025
2f8768f
update artifact path in build workflow
thewahome Feb 25, 2025
b8eb883
rename exported item
thewahome Feb 25, 2025
c783893
remove duplicates
thewahome Feb 25, 2025
75dce54
reorder commands
thewahome Feb 25, 2025
42b2d50
no dependencies
thewahome Feb 25, 2025
0385acc
rename final product
thewahome Feb 25, 2025
29b1928
Install npm package from local [temporary]
thewahome Feb 25, 2025
ebc945e
Show final package.json
thewahome Feb 25, 2025
aa884d8
inspect package after packaging
thewahome Feb 25, 2025
e56a2bd
install after
thewahome Feb 25, 2025
60c9cb8
remove manual link
thewahome Feb 25, 2025
6fad528
clean install
thewahome Feb 25, 2025
56cd38e
run sonar cloud analysis
thewahome Feb 25, 2025
a0be09b
fix package definitions
thewahome Feb 25, 2025
ba5aedd
include the runtime.json file
thewahome Feb 25, 2025
85b1fd7
load runtime.json from the kiota package and log the path
thewahome Feb 25, 2025
5695b7a
update runtime.json path resolution to use package root
thewahome Feb 25, 2025
25890ce
copy the package.json files
thewahome Feb 25, 2025
d9015de
build before packing
thewahome Feb 25, 2025
19e6857
update build workflow to install vsce and log kiota runtime.json
thewahome Feb 25, 2025
4720759
fix failing install
thewahome Feb 25, 2025
c05aee7
[experiment] link befre build
thewahome Feb 25, 2025
0dd6de5
add conditions
thewahome Feb 25, 2025
8767d03
remove deprecated steps
thewahome Feb 25, 2025
d6bbbdd
build workflow and package structure for VSCode extension
thewahome Feb 26, 2025
e5ce8e1
install dependencies from root directory
thewahome Feb 26, 2025
b56566d
use root folder to allow testing
thewahome Feb 26, 2025
7523084
rescope tests
thewahome Feb 27, 2025
e3ef809
separate tests
thewahome Feb 27, 2025
bd4e5e7
enhance tests scope
thewahome Feb 27, 2025
4644b03
package extension
thewahome Feb 27, 2025
9c0eea8
remove alias
thewahome Feb 27, 2025
602d09a
only install from extension level during packing
thewahome Feb 27, 2025
6c7ee09
add package.json to .vscodeignore
thewahome Feb 27, 2025
61c374b
add root folder to .vscodeignore
thewahome Feb 27, 2025
b9d79ca
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Feb 27, 2025
52e17d1
npm install instead of ci
thewahome Feb 27, 2025
934289a
skip vscode paths as they are covered by their own sonar cloud test
thewahome Feb 27, 2025
906c53d
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Feb 27, 2025
c0023f1
add initalisable configuration (#6249)
thewahome Mar 11, 2025
3a952f6
initialise binary file location
thewahome Mar 12, 2025
bf8a70f
fix downloading
thewahome Mar 12, 2025
68b7ef1
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Mar 12, 2025
ab7f629
Task: minimise function requirements (#6276)
thewahome Mar 13, 2025
99520f6
rename clientClassName to pluginName when generating plugins
thewahome Mar 14, 2025
069db8c
Add debug capability in VSCode and initial integration tests
luisjfdez Mar 14, 2025
2923097
Close input stream in rpc connection
luisjfdez Mar 14, 2025
b66112f
setup integration tests and ability to run unit and/or integration tests
luisjfdez Mar 14, 2025
e981684
download and install integration test
luisjfdez Mar 14, 2025
72d8225
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Mar 14, 2025
fe17125
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Mar 17, 2025
ec443fa
add types/sinon
thewahome Mar 17, 2025
f4be978
Merge branch 'task/extension/extract-and-create-npm-package-integrati…
luisjfdez Mar 17, 2025
cc7cea6
Merge branch 'main' into task/extension/remove-kiota-interop-tight-co…
thewahome Mar 18, 2025
e7e5058
Merge branch 'task/extension/remove-kiota-interop-tight-coupling' int…
thewahome Mar 18, 2025
892b1a7
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 19, 2025
8a98469
fix linting errors introduced by merge
thewahome Mar 19, 2025
96a954f
remove duplicate imports
thewahome Mar 19, 2025
4954eec
delete interop folder
thewahome Mar 19, 2025
28121b8
Update external interface for npm package
luisjfdez Mar 19, 2025
b13f5de
revert connect using stdio/stdout
luisjfdez Mar 19, 2025
cefb2d2
align with signature changes
thewahome Mar 19, 2025
8871efa
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 19, 2025
ea4cd1d
integration tests to get tree and generate plugin
luisjfdez Mar 20, 2025
8f957ee
sequential run of integration tests
luisjfdez Mar 20, 2025
b023d6f
refine generatePlugin interface
luisjfdez Mar 20, 2025
f5a68ba
unify plugin type variable naming for consistency
thewahome Mar 20, 2025
67eb69f
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 20, 2025
badd7ea
Task: publish npm package
thewahome Mar 21, 2025
2855cf9
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 21, 2025
e216d48
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 21, 2025
2cd73ab
rename library
thewahome Mar 21, 2025
1371b55
Merge branch 'task/extension/extract-and-create-npm-package' of https…
thewahome Mar 21, 2025
ebd6239
Update .azure-pipelines/ci-build.yml
thewahome Mar 21, 2025
19a09c8
Servers, security mapping and initial plugin result
luisjfdez Mar 24, 2025
6e90100
Merge branch 'task/extension/extract-and-create-npm-package' into fea…
luisjfdez Mar 24, 2025
7425fa4
Fix pluginType param in npm generate integration test
luisjfdez Mar 24, 2025
1c72ed9
Run unit tests only, pending to use compiled companion kiota version…
luisjfdez Mar 24, 2025
e74ed37
Linting
luisjfdez Mar 24, 2025
4d060d9
Run only unit tests until using specific kiota version
luisjfdez Mar 24, 2025
1f5b603
Merge pull request #6325 from microsoft/feature/generate-plugin-mappi…
luisjfdez Mar 24, 2025
059e298
Fix plugin type name during mapping
luisjfdez Mar 24, 2025
5724b5c
Chore: bundle binaries (#6332)
thewahome Mar 25, 2025
e0a7f94
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 25, 2025
8339807
Changes to fix merge from main
luisjfdez Mar 25, 2025
aa2dc83
Additional test and minor refactor
luisjfdez Mar 25, 2025
76d0fe8
Merge branch 'task/extension/extract-and-create-npm-package' into tas…
luisjfdez Mar 25, 2025
94d9736
Merge pull request #6344 from microsoft/task/npm-generate-mapping
luisjfdez Mar 25, 2025
960a99e
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 25, 2025
0c5f30d
update CI pipeline to use Windows 2022 image
thewahome Mar 25, 2025
7aafc64
Update .github/workflows/build-vscode-extension.yml
thewahome Mar 26, 2025
25337fd
appy suggested changes
thewahome Mar 26, 2025
6c470e2
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 26, 2025
f90fa9e
Manage Reference Id extension in getKiotaTree and plugin generation
luisjfdez Mar 26, 2025
3e0c4f9
Merge branch 'task/extension/extract-and-create-npm-package' of https…
luisjfdez Mar 26, 2025
44a21a5
Address PR comments with refactor and removal of unused namespaces
luisjfdez Mar 26, 2025
65e2e22
Add basic API info in response of getKiotaTree #6346
luisjfdez Mar 26, 2025
9702d22
Refactor AuthExtensions and add tests
luisjfdez Mar 26, 2025
25390f6
Refactor EnsureSecuritySchemeExtensions
luisjfdez Mar 26, 2025
7614fb6
Fix dotnet format errors
luisjfdez Mar 26, 2025
422f091
Task: add adaptivecard info (#6353)
thewahome Mar 27, 2025
60513e0
Merge pull request #6354 from microsoft/task/extension/add-api-info-t…
luisjfdez Mar 27, 2025
37cb9e4
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 27, 2025
ad40d8c
Chore: run integration tests ci (#6361)
thewahome Mar 27, 2025
8af7806
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Mar 27, 2025
92af964
Update .azure-pipelines/ci-build.yml
thewahome Mar 28, 2025
47c6f08
Chore: test multiple architectures (#6365)
thewahome Mar 28, 2025
0e8a936
Add flag to be able to apply kiota validation rules on getKiotaTree o…
luisjfdez Mar 31, 2025
7ec4481
getKiotaTree integration tests and fix mappings RPC-package
luisjfdez Mar 31, 2025
0105e24
fix linting
luisjfdez Mar 31, 2025
ce89f0d
Merge pull request #6371 from microsoft/task/package/flag-for-kiota-r…
luisjfdez Mar 31, 2025
f4665d1
Merge pull request #6374 from microsoft/task/extension/get-kiota-tree…
luisjfdez Mar 31, 2025
f1dd8ac
Merge branch 'main' into task/extension/extract-and-create-npm-package
luisjfdez Mar 31, 2025
5e15493
export public interfaces
luisjfdez Apr 1, 2025
d3ecb24
Remove legacy interfaces
luisjfdez Apr 1, 2025
75e456a
Merge pull request #6378 from microsoft/task/package/export-interfaces
luisjfdez Apr 1, 2025
5b3a8d9
Task: runtime version override (#6377)
thewahome Apr 1, 2025
423a34c
Sideloading env variable to copy kiota zip from
luisjfdez Apr 1, 2025
0a9c231
Run tests sequentially
luisjfdez Apr 1, 2025
15695cc
Use valid download version
luisjfdez Apr 1, 2025
500075c
Merge pull request #6387 from microsoft/task/extension/use-env-for-si…
luisjfdez Apr 1, 2025
66a238c
make call to searchDescription async
thewahome Apr 1, 2025
d65d2bf
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Apr 1, 2025
3fe9a86
check that values are not null
thewahome Apr 2, 2025
7525e9b
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Apr 2, 2025
fdf2b86
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Apr 2, 2025
2507d7f
chore: simplify npm install command and update environment variable f…
thewahome Apr 3, 2025
3cc5903
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Apr 3, 2025
7f45dae
ci: add build extension job to handle build matrix results
thewahome Apr 3, 2025
bc0a5cc
Merge branch 'main' into task/extension/extract-and-create-npm-package
thewahome Apr 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 112 additions & 7 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -609,18 +609,21 @@ extends:
submodules: true
- task: NodeTool@0
inputs:
versionSpec: "18.x"
versionSpec: "20.x"
- 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
displayName: "Get Kiota's version-number from .csproj"
- pwsh: $(Build.SourcesDirectory)/scripts/update-vscode-releases.ps1 -version $(artifactVersion)$(versionSuffix) -packageJsonFilePath $(Build.SourcesDirectory)/vscode/microsoft-kiota/package.json -runtimeFilePath $(Build.SourcesDirectory)/vscode/microsoft-kiota/src/kiotaInterop/runtime.json -binaryFolderPath $(Build.ArtifactStagingDirectory)/Binaries
- pwsh: $(Build.SourcesDirectory)/scripts/update-vscode-releases.ps1 -version $(artifactVersion)$(versionSuffix) -packageJsonFilePath $(Build.SourcesDirectory)/vscode/microsoft-kiota/package.json -runtimeFilePath $(Build.SourcesDirectory)/vscode/npm-package/runtime.json -binaryFolderPath $(Build.ArtifactStagingDirectory)/Binaries
displayName: "Update VSCode extension version-number"
- script: npm i -g @vscode/vsce
displayName: "Install vsce"
- script: npm ci
displayName: "Install dependencies"
workingDirectory: $(Build.SourcesDirectory)/vscode/microsoft-kiota
- script: npm i -g @vscode/vsce rimraf
displayName: "Install Global dependencies"
workingDirectory: $(Build.SourcesDirectory)/vscode
- script: |
npm install
npm list
displayName: "Install vscode dependencies"
workingDirectory: $(Build.SourcesDirectory)/vscode
- script: vsce package --pre-release
displayName: "Package VSCode extension as pre-release"
workingDirectory: $(Build.SourcesDirectory)/vscode/microsoft-kiota
Expand Down Expand Up @@ -687,6 +690,65 @@ extends:
inputs:
artifactName: VSCode
targetPath: "$(Build.ArtifactStagingDirectory)/VSCode"
- job: build_npm_package
dependsOn:
[
win_x64_build_binaries,
win_x86_build_binaries,
linux_x64_build_binaries,
linux_arm64_build_binaries,
osx_x64_build_binaries,
osx_arm64_build_binaries,
]
pool:
name: Azure-Pipelines-1ESPT-ExDShared
os: linux
image: ubuntu-latest
templateContext:
sdl:
baseline:
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
submodules: true
- task: NodeTool@0
inputs:
versionSpec: "20.x"
- 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
displayName: "Get Kiota's version-number from .csproj"
- pwsh: $(Build.SourcesDirectory)/scripts/update-vscode-releases.ps1 -version $(artifactVersion)$(versionSuffix) -packageJsonFilePath $(Build.SourcesDirectory)/vscode/microsoft-kiota/package.json -runtimeFilePath $(Build.SourcesDirectory)/vscode/npm-package/runtime.json -binaryFolderPath $(Build.ArtifactStagingDirectory)/Binaries
displayName: "Update NPM package version-number"
- script: |
npm i -g rimraf
displayName: "Install Global dependencies"
- script: npm install
displayName: "Install package dependencies"
workingDirectory: $(Build.SourcesDirectory)/vscode
- script: npm run package:package
displayName: "Package"
workingDirectory: $(Build.SourcesDirectory)/vscode
- task: CopyFiles@2
displayName: Prepare staging folder for upload
inputs:
targetFolder: $(Build.ArtifactStagingDirectory)/npm-package
sourceFolder: $(Build.SourcesDirectory)/vscode/npm-package
contents: |
*.tgz
- task: 1ES.PublishPipelineArtifact@1
displayName: "Publish Artifact: Npm Package"
inputs:
artifactName: npm-package
targetPath: "$(Build.ArtifactStagingDirectory)/npm-package"

- stage: deploy
condition: and(or(contains(variables['build.sourceBranch'], 'refs/tags/v'), eq(variables['build.sourceBranch'], '${{ parameters.previewBranch }}')), succeeded())
Expand Down Expand Up @@ -763,6 +825,9 @@ extends:
- input: pipelineArtifact
artifactName: changelog
targetPath: "$(Pipeline.Workspace)/changelog"
- input: pipelineArtifact
artifactName: npm-package
targetPath: "$(Pipeline.Workspace)/npm-package"
- ${{ each distribution in parameters.distributions }}:
- input: pipelineArtifact
artifactName: Binaries_${{ distribution.jobPrefix }}
Expand Down Expand Up @@ -794,6 +859,7 @@ extends:
assets: |
$(Pipeline.Workspace)/*.zip
$(Pipeline.Workspace)/*.vsix
$(Pipeline.Workspace)/*.tgz
$(Pipeline.Workspace)/*.nupkg
$(Pipeline.Workspace)/*.snupkg
addChangeLog: false
Expand All @@ -809,6 +875,7 @@ extends:
assets: |
$(Pipeline.Workspace)/*.zip
$(Pipeline.Workspace)/*.vsix
$(Pipeline.Workspace)/*.tgz
$(Pipeline.Workspace)/*.nupkg
$(Pipeline.Workspace)/*.snupkg
addChangeLog: false
Expand Down Expand Up @@ -974,3 +1041,41 @@ extends:
"$(Build.SourcesDirectory)"
displayName: "Build and Push Release Image"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v')
- job: deploy_npm
pool:
name: Azure-Pipelines-1ESPT-ExDShared
os: windows
image: windows-2022
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: npm-package
targetPath: $(Pipeline.Workspace)/npm-package
- input: pipelineArtifact
artifactName: scripts
targetPath: "$(Pipeline.Workspace)/scripts"
dependsOn:
- github_release
steps:
- task: NodeTool@0
inputs:
versionSpec: "20.x"
- task: EsrpRelease@7
inputs:
connectedservicename: 'Federated DevX ESRP Managed Identity Connection'
keyvaultname: 'akv-prod-eastus'
authcertname: 'ReferenceLibraryPrivateCert'
signcertname: 'ReferencePackagePublisherCertificate'
clientid: '65035b7f-7357-4f29-bf25-c5ee5c3949f8'
intent: 'PackageDistribution'
contenttype: 'npm'
contentsource: 'Folder'
folderlocation: '$(Pipeline.Workspace)/npm-package/'
waitforreleasecompletion: true
owners: $(NPM_OWNERS_LIST)
approvers: $(NPM_APPROVERS_LIST)
serviceendpointurl: 'https://api.esrp.microsoft.com'
mainpublisher: 'ESRPRELPACMAN'
domaintenantid: 'cdc5aeea-15c5-4db6-b079-fcadd2505dc2'
149 changes: 127 additions & 22 deletions .github/workflows/build-vscode-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,155 @@ jobs:
id: checksecret_job
run: |
echo "is_SONAR_TOKEN_set=${{ env.SONAR_TOKEN != '' }}" >> $GITHUB_OUTPUT
build_extension:

test_and_generate_binaries:
needs: [checksecret]
runs-on: ubuntu-latest
strategy:
matrix:
binaries:
- architecture: win-x64
os: windows-latest
- architecture: linux-x64
os: ubuntu-latest
- architecture: osx-arm64
os: macOS-latest
runs-on: ${{ matrix.binaries.os }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Use .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'

- id: last_release
run: |
$releaseVersion = gh release list --exclude-drafts --exclude-pre-releases --json tagName,isLatest | ConvertFrom-Json | ? {$_.isLatest -eq $true} | select -first 1 -ExpandProperty tagName
$releaseVersion = "$releaseVersion" -replace '^v', ''
Write-Output "RELEASE_VERSION=$releaseVersion" >> $Env:GITHUB_OUTPUT
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: scripts/update-vscode-releases.ps1 -version "${{ steps.last_release.outputs.RELEASE_VERSION }}" -packageJsonFilePath "./vscode/microsoft-kiota/package.json" -runtimeFilePath "./vscode/microsoft-kiota/src/kiotaInterop/runtime.json" -online

- run: scripts/update-vscode-releases.ps1 -version "v${{ steps.last_release.outputs.RELEASE_VERSION }}" -packageJsonFilePath "./vscode/microsoft-kiota/package.json" -runtimeFilePath "./vscode/npm-package/runtime.json" -online
shell: pwsh

- name: Install dependencies
run: npm install
working-directory: vscode/microsoft-kiota
- run: npm run lint
working-directory: vscode/microsoft-kiota
- name: run tests(linux)
if: runner.os == 'Linux'
run: xvfb-run -a npm run test:coverage
working-directory: vscode/microsoft-kiota
- name: run tests
if: runner.os != 'Linux'
run: npm run test:coverage
working-directory: vscode/microsoft-kiota
working-directory: vscode

- name: Publish kiota for testing - ${{ matrix.binaries.os }} - ${{ matrix.binaries.architecture }}
run: |
dotnet publish src/kiota/kiota.csproj -c Release --runtime ${{ matrix.binaries.architecture }} -p:PublishSingleFile=true --self-contained --output vscode/npm-package/.kiotabin/${{ steps.last_release.outputs.RELEASE_VERSION }}/${{ matrix.binaries.architecture }} -f net9.0
shell: pwsh

- name: Lint
run: npm run lint
working-directory: vscode

- name: Run tests - package
run: |
if [[ "${{ matrix.binaries.os }}" == "ubuntu-latest" ]]; then
xvfb-run -a npm run test:package:coverage
else
npm run test:package:coverage
fi
shell: bash
working-directory: vscode

- name: Run tests - vscode
run: |
if [[ "${{ matrix.binaries.os }}" == "ubuntu-latest" ]]; then
xvfb-run -a npm run test:vscode:coverage
else
npm run test:vscode:coverage
fi
shell: bash
working-directory: vscode

- name: Run sonar cloud analysis
if: needs.checksecret.outputs.is_SONAR_TOKEN_set == 'true'
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: vscode/microsoft-kiota
- run: npm run package
working-directory: vscode/microsoft-kiota
- run: npm i -g @vscode/vsce
- run: vsce package
working-directory: vscode/microsoft-kiota
projectBaseDir: vscode
args: >
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info,../npm-package/coverage/lcov.info

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.binaries.architecture }}
path: vscode/npm-package/.kiotabin/${{ steps.last_release.outputs.RELEASE_VERSION }}/${{ matrix.binaries.architecture }}
retention-days: 3

build:
needs: [test_and_generate_binaries]
runs-on: ubuntu-latest
strategy:
matrix:
builds:
- name: "VS Code Extension"
path: "microsoft-kiota"
id: "vscode"
item: "vsix"
- name: "Npm Package"
path: "npm-package"
id: "package"
item: "tgz"
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20.x

- id: last_release
run: |
$releaseVersion = gh release list --exclude-drafts --exclude-pre-releases --json tagName,isLatest | ConvertFrom-Json | ? {$_.isLatest -eq $true} | select -first 1 -ExpandProperty tagName
Write-Output "RELEASE_VERSION=$releaseVersion" >> $Env:GITHUB_OUTPUT
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: scripts/update-vscode-releases.ps1 -version "${{ steps.last_release.outputs.RELEASE_VERSION }}" -packageJsonFilePath "./vscode/microsoft-kiota/package.json" -runtimeFilePath "./vscode/npm-package/runtime.json" -online
shell: pwsh

- name: Install dependencies
run: npm install
working-directory: vscode

- run: npm run package:${{ matrix.builds.id }}
if: matrix.builds.id == 'package'
name: 'Package - ${{ matrix.builds.id }}'
working-directory: vscode

- run: |
npm i -g @vscode/vsce
vsce package
working-directory: vscode/${{ matrix.builds.path }}
name: 'Package - ${{ matrix.builds.id }}'
if: matrix.builds.id == 'vscode'

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: vscode-extension
path: vscode/microsoft-kiota/*.vsix
name: ${{ matrix.builds.name }}
path: vscode/${{ matrix.builds.path }}/*.${{ matrix.builds.item }}

build_extension:
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: All build matrix options are successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: One or more build matrix options failed
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,6 @@ samples/
it/openapi.yaml

idempotency-results/
vscode/npm-package/dist/*
vscode/npm-package/coverage/*
vscode/npm-package/.kiotabin/*
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions scripts/update-vscode-releases.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ $extensionVersion = $versionParts[0] + "." + $versionParts[1] + "." + $updatedPa
$packageJson.version = $extensionVersion
$runtimeDependencies = $runtimeJson.runtimeDependencies

# Update the version in the package.json located in the same directory as runtimeJson
$runtimeJsonDirectory = Split-Path -Path $runtimeFilePath -Parent
$runtimePackageJsonFilePath = Join-Path -Path $runtimeJsonDirectory -ChildPath "package.json"
if (Test-Path $runtimePackageJsonFilePath) {
$runtimePackageJson = Get-Content $runtimePackageJsonFilePath | ConvertFrom-Json
$runtimePackageJson.version = $version
Set-Content $runtimePackageJsonFilePath ($runtimePackageJson | ConvertTo-Json -Depth 10)
}

if ($online) {
Write-Warning "Downloading binaries from GitHub."
$binaryFolderPath = Join-Path ($Env:TEMP ?? $PWD) ".kiota-vscode-$version" # $Env:TEMP is not available on GitHub Actions
Expand Down
5 changes: 5 additions & 0 deletions src/Kiota.Builder/Configuration/GenerationConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ public bool ClearCache
get; set;
}
public HashSet<string> DisabledValidationRules { get; set; } = new(0, StringComparer.OrdinalIgnoreCase);
public bool? IncludeKiotaValidationRules
{
get; set;
}
public int MaxDegreeOfParallelism { get; set; } = -1;
public object Clone()
{
Expand All @@ -153,6 +157,7 @@ public object Clone()
ExcludePatterns = new(ExcludePatterns ?? Enumerable.Empty<string>(), StringComparer.OrdinalIgnoreCase),
ClearCache = ClearCache,
DisabledValidationRules = new(DisabledValidationRules ?? Enumerable.Empty<string>(), StringComparer.OrdinalIgnoreCase),
IncludeKiotaValidationRules = IncludeKiotaValidationRules,
MaxDegreeOfParallelism = MaxDegreeOfParallelism,
SkipGeneration = SkipGeneration,
Operation = Operation,
Expand Down
Loading
Loading