Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into merge-all-2
Browse files Browse the repository at this point in the history
  • Loading branch information
johnoliver committed Feb 13, 2024
2 parents 6aec1a1 + f37b3dc commit 50444e7
Show file tree
Hide file tree
Showing 2,093 changed files with 101,589 additions and 119,569 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/dotnet:1": {
"version": "7"
"version": "8"
},
"ghcr.io/jlaundry/devcontainer-features/azure-functions-core-tools:1": {}
},
Expand Down
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ dotnet_diagnostic.IDE0071.severity = warning # Simplify interpolation
dotnet_diagnostic.IDE0073.severity = warning # Require file header
dotnet_diagnostic.IDE0082.severity = warning # Convert typeof to nameof
dotnet_diagnostic.IDE0090.severity = warning # Simplify new expression
dotnet_diagnostic.IDE0130.severity = warning # Namespace does not match folder structure
dotnet_diagnostic.IDE0161.severity = warning # Use file-scoped namespace

# Suppressed diagnostics
Expand All @@ -159,6 +158,7 @@ dotnet_diagnostic.CA1032.severity = none # We're using RCS1194 which seems to co
dotnet_diagnostic.CA1034.severity = none # Do not nest type. Alternatively, change its accessibility so that it is not externally visible
dotnet_diagnostic.CA1062.severity = none # Disable null check, C# already does it for us
dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters
dotnet_diagnostic.CA1508.severity = none # Avoid dead conditional code. Too many false positives.
dotnet_diagnostic.CA1510.severity = none
dotnet_diagnostic.CA1805.severity = none # Member is explicitly initialized to its default value
dotnet_diagnostic.CA1822.severity = none # Member does not access instance data and can be marked as static
Expand Down Expand Up @@ -220,6 +220,7 @@ dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary suppression.
dotnet_diagnostic.IDE0080.severity = none # Remove unnecessary suppression operator.
dotnet_diagnostic.IDE0100.severity = none # Remove unnecessary equality operator
dotnet_diagnostic.IDE0110.severity = none # Remove unnecessary discards
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure
dotnet_diagnostic.IDE0032.severity = none # Use auto property
dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace
dotnet_diagnostic.IDE1006.severity = warning # Naming rule violations
Expand Down
1 change: 1 addition & 0 deletions .github/_typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extend-exclude = [

[default.extend-words]
ACI = "ACI" # Azure Container Instance
exercize = "exercize" #test typos

[default.extend-identifiers]
ags = "ags" # Azure Graph Service
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/check-coverage.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
param (
[string]$JsonReportPath,
[double]$CoverageThreshold
)

$jsonContent = Get-Content $JsonReportPath -Raw | ConvertFrom-Json
$coverageBelowThreshold = $false

function Get-FormattedValue($number) {
$formattedNumber = "{0:N1}" -f $number
$icon = if ($number -ge $CoverageThreshold) { '' } else { '' }

return "$formattedNumber% $icon"
}

$lineCoverage = $jsonContent.summary.linecoverage
$branchCoverage = $jsonContent.summary.branchcoverage

if ($lineCoverage -lt $CoverageThreshold -or $branchCoverage -lt $CoverageThreshold) {
$coverageBelowThreshold = $true
}

$totalTableData = [PSCustomObject]@{
'Metric' = 'Total Coverage'
'Line Coverage' = Get-FormattedValue $lineCoverage
'Branch Coverage' = Get-FormattedValue $branchCoverage
}

$totalTableData | Format-Table -AutoSize

$assemblyTableData = @()

foreach ($assembly in $jsonContent.coverage.assemblies) {
$assemblyName = $assembly.name
$assemblyLineCoverage = $assembly.coverage
$assemblyBranchCoverage = $assembly.branchcoverage

if ($assemblyLineCoverage -lt $CoverageThreshold -or $assemblyBranchCoverage -lt $CoverageThreshold) {
$coverageBelowThreshold = $true
}

$assemblyTableData += [PSCustomObject]@{
'Assembly Name' = $assemblyName
'Line' = Get-FormattedValue $assemblyLineCoverage
'Branch' = Get-FormattedValue $assemblyBranchCoverage
}
}

$assemblyTableData | Format-Table -AutoSize

if ($coverageBelowThreshold) {
Write-Host "Code coverage is lower than defined threshold: $CoverageThreshold. Stopping the task."
exit 1
}
36 changes: 27 additions & 9 deletions .github/workflows/dotnet-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
merge_group:
branches: ["main"]

env:
COVERAGE_THRESHOLD: 80

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -51,19 +54,15 @@ jobs:
include:
- { dotnet: "6.0-jammy", os: "ubuntu", configuration: Debug }
- { dotnet: "7.0-jammy", os: "ubuntu", configuration: Release }
- {
dotnet: "8.0-preview-jammy",
os: "ubuntu",
configuration: Release,
}
- { dotnet: "8.0-jammy", os: "ubuntu", configuration: Release }
- { dotnet: "6.0", os: "windows", configuration: Release }
- {
dotnet: "7.0",
os: "windows",
configuration: Debug,
integration-tests: true,
}
- { dotnet: "8.0-preview", os: "windows", configuration: Release }
- { dotnet: "8.0", os: "windows", configuration: Release }

runs-on: ubuntu-latest
container:
Expand All @@ -84,15 +83,15 @@ jobs:
- name: Run Unit Tests
run: |
export UT_PROJECTS=$(find ./dotnet -type f -name "*.UnitTests.csproj" | tr '\n' ' ')
export UT_PROJECTS=$(find ./dotnet -type f -name "*.UnitTests.csproj" | grep -v -E "(Planners.Core.UnitTests.csproj|Experimental.Orchestration.Flow.UnitTests.csproj|Experimental.Assistants.UnitTests.csproj)" | tr '\n' ' ')
for project in $UT_PROJECTS; do
dotnet test -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx
dotnet test -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx --collect:"XPlat Code Coverage" --results-directory:"TestResults/Coverage/"
done
- name: Run Integration Tests
if: github.event_name != 'pull_request' && matrix.integration-tests
run: |
export INTEGRATION_TEST_PROJECTS=$(find ./dotnet -type f -name "*IntegrationTests.csproj" | tr '\n' ' ')
export INTEGRATION_TEST_PROJECTS=$(find ./dotnet -type f -name "*IntegrationTests.csproj" | grep -v "Experimental.Orchestration.Flow.IntegrationTests.csproj" | tr '\n' ' ')
for project in $INTEGRATION_TEST_PROJECTS; do
dotnet test -c ${{ matrix.configuration }} $project --no-build -v Normal --logger trx
done
Expand All @@ -105,9 +104,28 @@ jobs:
AzureOpenAIEmbeddings__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
AzureOpenAI__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
AzureOpenAIEmbeddings__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
Planners__AzureOpenAI__ApiKey: ${{ secrets.PLANNERS__AZUREOPENAI__APIKEY }}
Planners__AzureOpenAI__Endpoint: ${{ secrets.PLANNERS__AZUREOPENAI__ENDPOINT }}
Planners__AzureOpenAI__DeploymentName: ${{ vars.PLANNERS__AZUREOPENAI__DEPLOYMENTNAME }}
Planners__OpenAI__ApiKey: ${{ secrets.PLANNERS__OPENAI__APIKEY }}
Planners__OpenAI__ModelId: ${{ vars.PLANNERS__OPENAI__MODELID }}
Bing__ApiKey: ${{ secrets.BING__APIKEY }}
OpenAI__ApiKey: ${{ secrets.OPENAI__APIKEY }}

# Generate test reports and check coverage
- name: Generate test reports
uses: danielpalme/[email protected]
with:
reports: "./TestResults/Coverage/**/coverage.cobertura.xml"
targetdir: "./TestResults/Reports"
reporttypes: "JsonSummary"
# Report for production packages only
assemblyfilters: "+Microsoft.SemanticKernel.Abstractions;+Microsoft.SemanticKernel.Core;+Microsoft.SemanticKernel.PromptTemplates.Handlebars;+Microsoft.SemanticKernel.Connectors.OpenAI;+Microsoft.SemanticKernel.Yaml;"

- name: Check coverage
shell: pwsh
run: .github/workflows/check-coverage.ps1 -JsonReportPath "TestResults/Reports/Summary.json" -CoverageThreshold $env:COVERAGE_THRESHOLD

# This final job is required to satisfy the merge queue. It must only run (or succeed) if no tests failed
dotnet-build-and-test-check:
if: always()
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dotnet-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ jobs:
- { os: ubuntu-latest, dotnet: '6.0', configuration: Debug }
- { os: ubuntu-latest, dotnet: '6.0', configuration: Release }
- { os: ubuntu-latest, dotnet: '7.0', configuration: Release }
- { os: ubuntu-latest, dotnet: '8.0-preview', configuration: Release }
- { os: ubuntu-latest, dotnet: '8.0', configuration: Release }

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
clean: true

- name: Find solutions
shell: bash
run: echo "solutions=$(find ./ -type f -name "*.sln" | tr '\n' ' ')" >> $GITHUB_ENV
Expand All @@ -43,7 +43,7 @@ jobs:
for solution in ${{ env.solutions }}; do
docker run --rm -v $(pwd):/app -w /app -e GITHUB_ACTIONS='true' mcr.microsoft.com/dotnet/sdk:${{ matrix.dotnet }} /bin/sh -c "dotnet build -c ${{ matrix.configuration }} /app/$solution"
done
- name: Find test projects
shell: bash
run: echo "testprojects=$(find ./dotnet -type f -name "*UnitTests.csproj" | tr '\n' ' ')" >> $GITHUB_ENV
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ jobs:
matrix:
include:
#- { dotnet: '6.0', configuration: Release, os: ubuntu-latest }
- { dotnet: '7.0', configuration: Release, os: ubuntu-latest }
#- { dotnet: '8.0-preview', configuration: Release, os: ubuntu-latest }
#- { dotnet: '7.0', configuration: Release, os: ubuntu-latest }
- { dotnet: '8.0', configuration: Release, os: ubuntu-latest }

runs-on: ${{ matrix.os }}
env:
NUGET_CERT_REVOCATION_MODE: offline

steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
if: github.event_name == 'pull_request'
Expand All @@ -56,16 +56,20 @@ jobs:
if: github.event_name != 'pull_request' || steps.changed-files.outputs.added_modified != '' || steps.changed-files.outcome == 'failure'
run: |
csproj_files=()
exclude_files=("Planners.Core.csproj" "Planners.Core.UnitTests.csproj" "Experimental.Orchestration.Flow.csproj" "Experimental.Orchestration.Flow.UnitTests.csproj" "Experimental.Orchestration.Flow.IntegrationTests.csproj")
if [[ ${{ steps.changed-files.outcome }} == 'success' ]]; then
for file in ${{ steps.changed-files.outputs.added_modified }}; do
echo "$file was changed"
dir="./$file"
while [[ $dir != "." && $dir != "/" && $dir != $GITHUB_WORKSPACE ]]; do
if find "$dir" -maxdepth 1 -name "*.csproj" -print -quit | grep -q .; then
csproj_files+=("$(find "$dir" -maxdepth 1 -name "*.csproj" -print -quit)")
csproj_path="$(find "$dir" -maxdepth 1 -name "*.csproj" -print -quit)"
if [[ ! "${exclude_files[@]}" =~ "${csproj_path##*/}" ]]; then
csproj_files+=("$csproj_path")
fi
break
fi
dir=$(echo ${dir%/*})
done
done
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
os: [ubuntu-latest]
configuration: [Debug]
runs-on: ${{ matrix.os }}
steps:
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'pull_request' }}
with:
Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/java-format.yml

This file was deleted.

18 changes: 9 additions & 9 deletions .github/workflows/markdown-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Check .md links
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
branches: ["main", "java-development"]

permissions:
contents: read

Expand All @@ -13,11 +13,11 @@ jobs:
runs-on: ubuntu-latest
# check out the latest version of the code
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

# Checks the status of hyperlinks in .md files in verbose mode
- name: Check links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
config-file: ".github/workflows/markdown-link-check-config.json"
# Checks the status of hyperlinks in .md files in verbose mode
- name: Check links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: "yes"
config-file: ".github/workflows/markdown-link-check-config.json"
Loading

0 comments on commit 50444e7

Please sign in to comment.