Skip to content

Commit

Permalink
Merge branch 'main' into feat/OAI-3-1
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Jan 16, 2025
2 parents f507645 + 267d724 commit c7390c5
Show file tree
Hide file tree
Showing 67 changed files with 5,048 additions and 326 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
40 changes: 40 additions & 0 deletions .github/policies/branch-protection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: kiota-branch-protection
description: Branch protection policy for the kiota repository
resource: repository
configuration:
branchProtectionRules:
- branchNamePattern: main
# Specifies whether this branch can be deleted. boolean
allowsDeletions: false
# Specifies whether forced pushes are allowed on this branch. boolean
allowsForcePushes: false
# Specifies whether new commits pushed to the matching branches dismiss pull request review approvals. boolean
dismissStaleReviews: true
# Specifies whether admins can overwrite branch protection. boolean
isAdminEnforced: false
# Indicates whether "Require a pull request before merging" is enabled. boolean
requiresPullRequestBeforeMerging: true
# Specifies the number of pull request reviews before merging. int (0-6). Should be null/empty if PRs are not required
requiredApprovingReviewsCount: 2
# Require review from Code Owners. Requires requiredApprovingReviewsCount. boolean
requireCodeOwnersReview: true
# Are commits required to be signed. boolean.
requiresCommitSignatures: false
# Are conversations required to be resolved before merging? boolean
requiresConversationResolution: true
# Are merge commits prohibited from being pushed to this branch. boolean
requiresLinearHistory: false
# Required status checks to pass before merging. Values can be any string, but if the value does not correspond to any existing status check, the status check will be stuck on pending for status since nothing exists to push an actual status
requiredStatusChecks:
- license/cla
- Analyze (csharp)
- dotnet-build
- check-idempotency-tests
- check-integration-tests
- build_extension
# Require branches to be up to date before merging
requiresStrictStatusChecks: true
# Indicates whether there are restrictions on who can push. boolean. Should be set with whoCanPush.
restrictsPushes: false
# Restrict who can dismiss pull request reviews. boolean
restrictsReviewDismissals: false
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.12.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.12.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.12.0
with:
push: true
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ on:
]

jobs:
build:
dotnet-build:
runs-on: ubuntu-latest

steps:
Expand Down
14 changes: 14 additions & 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 Expand Up @@ -112,3 +113,16 @@ jobs:
with:
artifact_name: "generator"
min_bytes: "0"

# Aggregates result of the idempotency tests for use in branch policy
check-idempotency-tests:
runs-on: ubuntu-latest
needs: idempotency
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
19 changes: 19 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 Expand Up @@ -151,3 +157,16 @@ jobs:
with:
artifact_name: "generator"
min_bytes: "0"

# Aggregates result of the integration tests for use in branch policy
check-integration-tests:
runs-on: ubuntu-latest
needs: integration
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
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}"
}
]
}
}
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [1.22.3]

### Added

- Added dart generation to Visual Studio Code extension.

### Changed

- Fixed a bug in the VS Code extension deeplink with the API Center extension [#6004](https://github.com/microsoft/kiota/issues/6004)

- Drops Python 3.8 support by removing deprecated type aliases from generated code. [microsoft/kiota-python#349](https://github.com/microsoft/kiota-python/issues/349)
- Removes superfluous inline imports in serializer methods in Python Generation.

## [1.22.2]

### Added

### Changed

- Fixed a bug showing an error popup in the VS Code extension after generation [5988](https://github.com/microsoft/kiota/issues/5988)

## [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 @@ -1521,3 +1559,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}
```
16 changes: 8 additions & 8 deletions it/csharp/dotnet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.13.1" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.16.3" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.16.3" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.16.3" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.16.3" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.16.3" />
<PackageReference Include="Microsoft.kiota.Serialization.Multipart" Version="1.16.3" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.16.3" />
<PackageReference Include="Azure.Identity" Version="1.13.2" />
<PackageReference Include="Microsoft.Kiota.Abstractions" Version="1.16.4" />
<PackageReference Include="Microsoft.Kiota.Authentication.Azure" Version="1.16.4" />
<PackageReference Include="Microsoft.Kiota.Http.HttpClientLibrary" Version="1.16.4" />
<PackageReference Include="Microsoft.Kiota.Serialization.Form" Version="1.16.4" />
<PackageReference Include="Microsoft.Kiota.Serialization.Json" Version="1.16.4" />
<PackageReference Include="Microsoft.kiota.Serialization.Multipart" Version="1.16.4" />
<PackageReference Include="Microsoft.Kiota.Serialization.Text" Version="1.16.4" />

<Compile Remove="basic\**" />
</ItemGroup>
Expand Down
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
10 changes: 5 additions & 5 deletions it/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module integrationtest
go 1.23

require (
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.1
github.com/microsoft/kiota-abstractions-go v1.8.1
github.com/microsoft/kiota-authentication-azure-go v1.1.0
github.com/microsoft/kiota-http-go v1.4.7
Expand All @@ -14,7 +14,7 @@ require (
)

require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.2 // indirect
github.com/cjlapao/common-go v0.0.41 // indirect
Expand All @@ -32,9 +32,9 @@ require (
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit c7390c5

Please sign in to comment.