Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into andrueastman/python3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
andrueastman committed Jan 13, 2025
2 parents 61ce5f7 + ceabce9 commit 2e7bec6
Show file tree
Hide file tree
Showing 48 changed files with 4,660 additions and 75 deletions.
6 changes: 6 additions & 0 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ parameters:
os: "linux"
image: "ubuntu-latest"
pool: Azure-Pipelines-1ESPT-ExDShared
- architecture: "linux-arm64"
jobPrefix: "linux_arm64"
os: "linux"
image: "ubuntu-latest"
pool: Azure-Pipelines-1ESPT-ExDShared
- architecture: "osx-x64"
jobPrefix: "osx_x64"
os: "macOS"
Expand Down Expand Up @@ -575,6 +580,7 @@ extends:
win_x64_build_binaries,
win_x86_build_binaries,
linux_x64_build_binaries,
linux_arm64_build_binaries,
osx_x64_build_binaries,
osx_arm64_build_binaries,
]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
uses: docker/build-push-action@v6.10.0
uses: docker/build-push-action@v6.11.0
with:
push: false
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
- name: Push to GitHub Packages - Nightly
if: contains(github.ref, env.PREVIEW_BRANCH)
uses: docker/build-push-action@v6.10.0
uses: docker/build-push-action@v6.11.0
with:
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
Expand All @@ -104,7 +104,7 @@ jobs:
# we can't get the sequence number from ADO so we default it back to github run number
- name: Push to GitHub Packages - Release
if: contains(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v6.10.0
uses: docker/build-push-action@v6.11.0
with:
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/idempotency-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
- ruby
- php
- python
- dart
description:
- "./tests/Kiota.Builder.IntegrationTests/InheritingErrors.yaml"
- "./tests/Kiota.Builder.IntegrationTests/NoUnderscoresInModel.yaml"
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- ruby
- php
- python
- dart
description:
- "./tests/Kiota.Builder.IntegrationTests/InheritingErrors.yaml"
- "./tests/Kiota.Builder.IntegrationTests/EnumHandling.yaml"
Expand Down Expand Up @@ -109,6 +110,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup Dart
if: matrix.language == 'dart'
uses: dart-lang/setup-dart@v1
with:
sdk: "stable"

- name: Check if test is suppressed
id: check-suppressed
Expand Down
23 changes: 22 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,27 @@
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Launch Dart",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/kiota/bin/Debug/net8.0/kiota.dll",
"args": [
"generate",
"--openapi",
"https://raw.githubusercontent.com/microsoftgraph/msgraph-sdk-powershell/dev/openApiDocs/v1.0/Mail.yml",
"--language",
"dart",
"-o",
"${workspaceFolder}/samples/msgraph-mail/java/utilities/src/main/java/graphjavav4/utilities",
"-n",
"graphdart4.utilities"
],
"cwd": "${workspaceFolder}/src/kiota",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": "Launch CLI (CSharp)",
"type": "coreclr",
Expand Down Expand Up @@ -385,4 +406,4 @@
"processId": "${command:pickProcess}"
}
]
}
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [1.22.1] - 2025-01-10

### Added

### Changed
- Fixed a bug in the VS Code extension plugin generation [#5978](https://github.com/microsoft/kiota/issues/5978)

## [1.22.0] - 2025-01-09

### Added

- Adds code generation for the `Dart` programming language.Credit to @ricardoboss, @joanne-ter-maat, @Kees-Schotanus, @andreaTP, @baywet[#3745](https://github.com/microsoft/kiota/issues/3745)
- Added new linux arm64 binary builds for Kiota CLI

### Changed

- Fixed a bug in generation when a referenced schema in an allOf was a primitive [#5701](https://github.com/microsoft/kiota/issues/5701).
- Fixed a bug where inherited error models would be missing interface declarations. [#5888](https://github.com/microsoft/kiota/issues/5888)
- Fixed a bug where oneOf/anyOf schemas with single references to inheritance or intersections would be missing properties. [#5921](https://github.com/microsoft/kiota/issues/5921)
Expand Down Expand Up @@ -1522,3 +1538,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Initial GitHub release

2 changes: 1 addition & 1 deletion it/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Generate the code:
And finally run the test:

```bash
./it/exec-cmd.ps1 -language ${LANG}
./it/exec-cmd.ps1 -descriptionUrl ${FILE/URL} -language ${LANG}
```
3 changes: 3 additions & 0 deletions it/dart/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pubspec.lock
.dart_tool/
src/
24 changes: 24 additions & 0 deletions it/dart/basic/test/api_client_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import 'package:microsoft_kiota_abstractions/microsoft_kiota_abstractions.dart';
import 'package:microsoft_kiota_http/microsoft_kiota_http.dart';
import 'package:test/test.dart';
import '../lib/api_client.dart';
import '../lib/models/error.dart';

void main() {
group('apiclient', () {
test('basic endpoint test', () {
final requestAdapter = HttpClientRequestAdapter(
client: KiotaClientFactory.createClient(),
authProvider: AnonymousAuthenticationProvider(),
pNodeFactory: ParseNodeFactoryRegistry.defaultInstance,
sWriterFactory: SerializationWriterFactoryRegistry.defaultInstance,
);
requestAdapter.baseUrl = "http://localhost:1080";
var client = ApiClient(requestAdapter);
expect(
() => client.api.v1.topics.getAsync(),
throwsA(predicate(
(e) => e is Error && e.id == 'my-sample-id' && e.code == 123)));
});
});
}
22 changes: 22 additions & 0 deletions it/dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: kiota_dart_generate
description: api generation
version: 0.0.1
publish_to: none

environment:
sdk: ^3.6.0

# Add regular dependencies here.
dependencies:
microsoft_kiota_abstractions: ^0.0.1
microsoft_kiota_http: ^0.0.1
microsoft_kiota_serialization_form: ^0.0.1
microsoft_kiota_serialization_text: ^0.0.1
microsoft_kiota_serialization_json: ^0.0.1
microsoft_kiota_serialization_multipart: ^0.0.1
http: ^1.2.2
uuid: ^4.5.1

dev_dependencies:
lints: ^5.1.1
test: ^1.25.14
23 changes: 23 additions & 0 deletions it/exec-cmd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,29 @@ elseif ($language -eq "python") {
Pop-Location
}
}
elseif ($language -eq "dart") {
Invoke-Call -ScriptBlock {
dart pub get
dart analyze lib/
} -ErrorAction Stop

if ($mockServerTest) {
Push-Location $itTestPath

$itTestPathSources = Join-Path -Path $testPath -ChildPath "lib"
$itTestPathDest = Join-Path -Path $itTestPath -ChildPath "lib"
if (Test-Path $itTestPathDest) {
Remove-Item $itTestPathDest -Force -Recurse
}
Copy-Item -Path $itTestPathSources -Destination $itTestPathDest -Recurse

Invoke-Call -ScriptBlock {
dart test
} -ErrorAction Stop

Pop-Location
}
}
Pop-Location

if (!([string]::IsNullOrEmpty($mockSeverITFolder))) {
Expand Down
3 changes: 3 additions & 0 deletions it/get-additional-arguments.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ if ($language -eq "csharp") {
elseif ($language -eq "java") {
$command = " --output `"./it/$language/src/apisdk`""
}
elseif ($language -eq "dart") {
$command = " --output `"./it/$language/lib`""
}
elseif ($language -eq "go") {
$command = " --output `"./it/$language/client`" --namespace-name `"integrationtest/client`""
}
Expand Down
68 changes: 34 additions & 34 deletions it/typescript/package-lock.json

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

14 changes: 7 additions & 7 deletions it/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
},
"dependencies": {
"@azure/identity": "^4.5.0",
"@microsoft/kiota-abstractions": "^1.0.0-preview.78",
"@microsoft/kiota-authentication-azure": "^1.0.0-preview.78",
"@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.78",
"@microsoft/kiota-serialization-form": "^1.0.0-preview.78",
"@microsoft/kiota-serialization-json": "^1.0.0-preview.78",
"@microsoft/kiota-serialization-multipart": "^1.0.0-preview.78",
"@microsoft/kiota-serialization-text": "^1.0.0-preview.78",
"@microsoft/kiota-abstractions": "^1.0.0-preview.79",
"@microsoft/kiota-authentication-azure": "^1.0.0-preview.79",
"@microsoft/kiota-http-fetchlibrary": "^1.0.0-preview.79",
"@microsoft/kiota-serialization-form": "^1.0.0-preview.79",
"@microsoft/kiota-serialization-json": "^1.0.0-preview.79",
"@microsoft/kiota-serialization-multipart": "^1.0.0-preview.79",
"@microsoft/kiota-serialization-text": "^1.0.0-preview.79",
"express": "^5.0.1",
"node-fetch": "^2.7.0"
}
Expand Down
3 changes: 2 additions & 1 deletion src/Kiota.Builder/GenerationLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ public enum GenerationLanguage
Go,
Swift,
Ruby,
CLI
CLI,
Dart,
}
4 changes: 2 additions & 2 deletions src/Kiota.Builder/Kiota.Builder.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<LangVersion>Latest</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -15,7 +15,7 @@
<Title>Microsoft.OpenApi.Kiota.Builder</Title>
<PackageId>Microsoft.OpenApi.Kiota.Builder</PackageId>
<PackageOutputPath>./nupkg</PackageOutputPath>
<VersionPrefix>1.22.0</VersionPrefix>
<VersionPrefix>1.23.0</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<PackageReleaseNotes>
https://github.com/microsoft/kiota/releases
Expand Down
Loading

0 comments on commit 2e7bec6

Please sign in to comment.