Skip to content

Commit

Permalink
Merge branch 'experimental-java' into fix-timeskill-test
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoborges committed Jul 10, 2023
2 parents b9d30fe + c0d7709 commit 8787996
Show file tree
Hide file tree
Showing 201 changed files with 4,205 additions and 5,374 deletions.
33 changes: 31 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,57 @@

version: 2
updates:
# Maintain dependencies for nuget
- package-ecosystem: "nuget"
directory: "samples/apps/copilot-chat-app/webapi"
schedule:
interval: "weekly"
day: "monday"
labels:
- "copilot chat"
- "dependencies"

# Maintain dependencies for nuget
- package-ecosystem: "nuget"
directory: "dotnet/"
schedule:
interval: "weekly"
day: "monday"
ignore:
# For all System.* and Microsoft.Extensions/Bcl.* packages, ignore all major version updates
- dependency-name: "System.*"
update-types: ["version-update:semver-major"]
- dependency-name: "Microsoft.Extensions.*"
update-types: ["version-update:semver-major"]
- dependency-name: "Microsoft.Bcl.*"
update-types: ["version-update:semver-major"]
labels:
- ".NET"
- "dependencies"

# Maintain dependencies for nuget
- package-ecosystem: "nuget"
directory: "samples/"
directory: "samples/dotnet"
schedule:
interval: "weekly"

day: "monday"

# Maintain dependencies for npm
- package-ecosystem: "npm"
directory: "samples/apps"
schedule:
interval: "weekly"
day: "monday"

# Maintain dependencies for pip
- package-ecosystem: "pip"
directory: "python/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "python"
- "dependencies"

# Maintain dependencies for github-actions
- package-ecosystem: "github-actions"
Expand All @@ -36,3 +64,4 @@ updates:
directory: "/"
schedule:
interval: "weekly"
day: "monday"
31 changes: 24 additions & 7 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Add 'kernel' label to any change within Connectors, Extensions, Skills, and tests directories
kernel:
- "dotnet/src/Connectors/**/*"
- "dotnet/src/Extensions/**/*"
- "dotnet/src/Skills/**/*"
- "dotnet/src/IntegrationTests/**/*"
- "dotnet/src/SemanticKernel.UnitTests/**/*"
- dotnet/src/Connectors/**/*
- dotnet/src/Extensions/**/*
- dotnet/src/Skills/**/*
- dotnet/src/IntegrationTests/**/*
- dotnet/src/SemanticKernel.UnitTests/**/*

# Add 'kernel.core' label to any change within the 'SemanticKernel', 'SemanticKernel.Abstractions', or 'SemanticKernel.MetaPackage' directories
kernel.core:
Expand All @@ -16,11 +16,28 @@ kernel.core:
python:
- python/**/*

# Add 'java' label to any change within the 'java' directory
java:
- java/**/*

# Add 'samples' label to any change within the 'samples' directory
samples:
- samples/**/*

# Add '.NET' label to any change within samples or kernel 'dotnet' directories.
.NET:
- dotnet/src/**/*
- samples/**/dotnet/**/*
- dotnet/**/*

# Add 'copilot chat' label to any change within the 'samples/apps/copilot-chat-app' directory
copilot chat:
- samples/apps/copilot-chat-app/**/*

# Add 'documentation' label to any change within the 'docs' directory, or any '.md' files
documentation:
- docs/**/*
- '**/*.md'

# Add 'memory' label to any memory connectors in dotnet/ or python/
memory:
- dotnet/src/Connectors/Connectors.Memory.*/**/*
- python/semantic_kernel/connectors/memory/**/*
131 changes: 71 additions & 60 deletions .github/workflows/copilot-chat-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Copilot Chat Tests
on:
workflow_dispatch:
push:
branches: [ "main", "feature*" ]
paths:
- 'samples/apps/copilot-chat-app/**'
branches: ["main", "feature*"]
paths:
- "samples/apps/copilot-chat-app/**"

permissions:
contents: read
Expand All @@ -17,70 +17,81 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
cache-dependency-path: samples/apps/copilot-chat-app/webapp/yarn.lock
cache: 'yarn'
- uses: actions/setup-node@v3
with:
node-version: 16
cache-dependency-path: samples/apps/copilot-chat-app/webapp/yarn.lock
cache: "yarn"

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Install dependencies
run: yarn install
- name: Install dependencies
run: yarn install

- name: Install Playwright Browsers
run: yarn playwright install --with-deps
- name: Install Playwright Browsers
run: yarn playwright install --with-deps

- name: Update AIService configuration
working-directory: samples/apps/copilot-chat-app/webapi
env:
AzureOpenAI__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
AzureOpenAI__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
run: |
dotnet dev-certs https
dotnet user-secrets set "AIService:Key" "$AzureOpenAI__ApiKey"
dotnet user-secrets set "AIService:Endpoint" "$AzureOpenAI__Endpoint"
- name: Update AIService configuration
working-directory: samples/apps/copilot-chat-app/webapi
env:
AzureOpenAI__ApiKey: ${{ secrets.AZUREOPENAI__APIKEY }}
AzureOpenAI__Endpoint: ${{ secrets.AZUREOPENAI__ENDPOINT }}
run: |
dotnet dev-certs https
dotnet user-secrets set "AIService:Key" "$AzureOpenAI__ApiKey"
dotnet user-secrets set "AIService:Endpoint" "$AzureOpenAI__Endpoint"
- name: Start service in background
working-directory: samples/apps/copilot-chat-app/webapi
run: |
dotnet run > service-log.txt 2>&1 &
for attempt in {0..20}; do
jobs
echo 'Waiting for service to start...';
if curl -k https://localhost:40443/healthz; then
echo;
echo 'Service started';
break;
fi;
- name: Start service in background
working-directory: samples/apps/copilot-chat-app/webapi
run: |
dotnet run > service-log.txt 2>&1 &
for attempt in {0..20}; do
jobs
echo 'Waiting for service to start...';
if curl -k https://localhost:40443/healthz; then
echo;
echo 'Service started';
break;
fi;
sleep 5;
done
sleep 5;
done
- name: Run Playwright tests
env:
REACT_APP_BACKEND_URI: https://localhost:40443/
REACT_APP_AAD_CLIENT_ID: ${{ secrets.COPILOT_CHAT_REACT_APP_AAD_CLIENT_ID }}
REACT_APP_AAD_AUTHORITY: https://login.microsoftonline.com/common
REACT_APP_TEST_USER_ACCOUNT: ${{ secrets.COPILOT_CHAT_TEST_USER_ACCOUNT }}
REACT_APP_TEST_USER_PASSWORD: ${{ secrets.COPILOT_CHAT_TEST_USER_PASSWORD }}
run: yarn playwright test
- name: Run Playwright tests
env:
REACT_APP_BACKEND_URI: https://localhost:40443/
REACT_APP_AAD_CLIENT_ID: ${{ secrets.COPILOT_CHAT_REACT_APP_AAD_CLIENT_ID }}
REACT_APP_AAD_AUTHORITY: https://login.microsoftonline.com/common

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: samples/apps/copilot-chat-app/webapp/playwright-report/
retention-days: 30
REACT_APP_TEST_USER_ACCOUNT1: ${{ secrets.COPILOT_CHAT_TEST_USER_ACCOUNT1 }}
REACT_APP_TEST_USER_ACCOUNT1_INITIALS: ${{ secrets.COPILOT_CHAT_TEST_USER_ACCOUNT1_INITIALS }}
REACT_APP_TEST_USER_ACCOUNT2: ${{ secrets.COPILOT_CHAT_TEST_USER_ACCOUNT2 }}
REACT_APP_TEST_USER_PASSWORD: ${{ secrets.COPILOT_CHAT_TEST_USER_PASSWORD }}

- uses: actions/upload-artifact@v3
if: always()
with:
name: service-log
path: samples/apps/copilot-chat-app/webapi/service-log.txt
retention-days: 30
REACT_APP_TEST_JIRA_EMAIL: ${{ secrets.COPILOT_CHAT_TEST_JIRA_EMAIL }}
REACT_APP_TEST_JIRA_ACCESS_TOKEN: ${{ secrets.COPILOT_CHAT_TEST_JIRA_ACCESS_TOKEN }}
REACT_APP_TEST_JIRA_SERVER_URL: ${{ secrets.COPILOT_CHAT_TEST_JIRA_SERVER_URL }}

REACT_APP_TEST_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REACT_APP_TEST_GITHUB_ACCOUNT_OWNER: ${{ secrets.COPILOT_CHAT_TEST_GITHUB_ACCOUNT_OWNER }}
REACT_APP_TEST_GITHUB_REPOSITORY_NAME: ${{ secrets.COPILOT_CHAT_TEST_GITHUB_REPOSITORY_NAME }}
run: yarn playwright test

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: samples/apps/copilot-chat-app/webapp/playwright-report/
retention-days: 30

- uses: actions/upload-artifact@v3
if: always()
with:
name: service-log
path: samples/apps/copilot-chat-app/webapi/service-log.txt
retention-days: 30
2 changes: 0 additions & 2 deletions .github/workflows/dotnet-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
paths:
- 'dotnet/**'
- 'samples/dotnet/**'
- '**.cs'
- '**.csproj'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/java-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ jobs:
pull-requests: write

steps:
- name: Check for command
id: command
uses: xt0rted/slash-command-action@v2
continue-on-error: true
with:
command: spotless
reaction-type: "eyes"

- name: Get command
env:
BODY: ${{ github.event.comment.body }}
Expand Down Expand Up @@ -77,4 +85,4 @@ jobs:
"
gh pr comment $NUMBER --body "$body"
fi
working-directory: java
working-directory: java
45 changes: 45 additions & 0 deletions .github/workflows/label-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Label issues
on:
issues:
types:
- reopened
- opened

jobs:
label_issues:
name: "Issue: add labels"
if: ${{ github.event.action == 'opened' || github.event.action == 'reopened' }}
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_ACTIONS_PR_WRITE }}
script: |
// Get the issue body and title
const body = context.payload.issue.body
let title = context.payload.issue.title
// Define the labels array
let labels = ["triage"]
// Check if the body or the title contains the word 'python' (case-insensitive)
if (body.match(/python/i) || title.match(/python/i)) {
// Add the 'python' label to the array
labels.push("python")
}
// Check if the body or the title contains the word 'java' (case-insensitive)
if (body.match(/java/i) || title.match(/java/i)) {
// Add the 'java' label to the array
labels.push("java")
}
// Add the labels to the issue
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
name: Label pull request
on: [pull_request_target]

jobs:
label:
add_label:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -18,4 +18,4 @@ jobs:
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: "${{ secrets.GH_ACTIONS_PR_WRITE }}"
Loading

0 comments on commit 8787996

Please sign in to comment.