Skip to content

Dev changes sync to main #110

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 46 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c12643c
workflows and codeowners added to accelerators
Roopan-Microsoft Nov 14, 2024
e80f307
Updated for test and workflow
Roopan-Microsoft Nov 14, 2024
939b62b
temp fix for code coverage
Roopan-Microsoft Nov 14, 2024
7dcdf45
removed test pipeline for now, will add in next PR
Roopan-Microsoft Nov 14, 2024
74695f3
linting issues fixed
Roopan-Microsoft Nov 14, 2024
81f071f
removed lint related files
Roopan-Microsoft Nov 14, 2024
8975162
Added pylint yml file
Roopan-Microsoft Nov 14, 2024
05ca2a2
lint issues fixed for researcher
Roopan-Microsoft Nov 14, 2024
a298f43
Backend test cases added
Roopan-Microsoft Nov 14, 2024
fd9b8a2
Update test_client_advisor.yml
Roopan-Microsoft Nov 14, 2024
03ae270
test cases added
Roopan-Microsoft Nov 14, 2024
e38972e
removed comments
Roopan-Microsoft Nov 14, 2024
dfce90d
remved unwanted test
AjitPadhi-Microsoft Nov 15, 2024
5e1b567
unit test issue fix
AjitPadhi-Microsoft Nov 15, 2024
d98f6d1
unit test issue fix
AjitPadhi-Microsoft Nov 15, 2024
aa5e472
quart package updated
Roopan-Microsoft Nov 18, 2024
afc723b
removed test case related files to move into another PR
Roopan-Microsoft Nov 18, 2024
5657c37
Merge branch 'psl-pylint-fix' of https://github.com/microsoft/Build-y…
Roopan-Microsoft Nov 18, 2024
771830c
test case updated
Roopan-Microsoft Nov 18, 2024
b187485
Add files via upload
Roopan-Microsoft Nov 21, 2024
5d03cfc
Add files via upload
Roopan-Microsoft Nov 21, 2024
5f1dab6
Front end test case added
Roopan-Microsoft Nov 21, 2024
8afd350
added workflow for unit testing
Roopan-Microsoft Nov 21, 2024
6aa4457
workflow updated
Roopan-Microsoft Nov 21, 2024
afc8e07
Chat history test cases added
Roopan-Microsoft Nov 21, 2024
e9a75d7
added models for chat history
Roopan-Microsoft Nov 21, 2024
9c76653
code updated
Roopan-Microsoft Nov 21, 2024
9a19fba
package updated
Roopan-Microsoft Nov 21, 2024
16c8e6e
Answer component updated
Roopan-Microsoft Nov 21, 2024
29df852
SFI Fixes for client advisor
Roopan-Microsoft Nov 21, 2024
bdd232e
Researcher - SFI fixes
Roopan-Microsoft Nov 21, 2024
eef3a6b
updated function app version to latest
Roopan-Microsoft Nov 25, 2024
f7afac3
updated dev tag to latest
Roopan-Microsoft Nov 25, 2024
f1bbfdc
updated bicep
AjitPadhi-Microsoft Nov 25, 2024
4433f04
workflow updated
Roopan-Microsoft Nov 25, 2024
4fd6472
Merge branch 'psl-workflow-codeowners' of https://github.com/microsof…
Roopan-Microsoft Nov 25, 2024
1c37c59
Merge pull request #108 from microsoft/psl-sfi-fixes
Roopan-Microsoft Nov 25, 2024
3aaf46b
Merge pull request #101 from microsoft/psl-workflow-codeowners
Roopan-Microsoft Nov 25, 2024
82ee56b
Merge pull request #107 from microsoft/psl-frontend-testcases
Roopan-Microsoft Nov 25, 2024
f21b46f
Merge branch 'dev' into psl-unit-test-cases
Roopan-Microsoft Nov 25, 2024
f612b30
Merge pull request #102 from microsoft/psl-pylint-fix
Roopan-Microsoft Nov 25, 2024
bcb5746
Merge branch 'dev' into psl-unit-test-cases
Roopan-Microsoft Nov 25, 2024
b4d119b
package updated
Roopan-Microsoft Nov 25, 2024
b5eebcc
Merge pull request #106 from microsoft/psl-unit-test-cases
Roopan-Microsoft Nov 25, 2024
3fd4453
Update WebApp.Dockerfile
Roopan-Microsoft Nov 26, 2024
e13bffc
Merge pull request #109 from microsoft/psl-workflow-codeowners
Roopan-Microsoft Nov 26, 2024
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
10 changes: 10 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft

# Specific directory ownership
/ClientAdvisor/ @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft

/ResearchAssistant/ @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft
93 changes: 93 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
version: 2
updates:
# 1. React (JavaScript/TypeScript) dependencies
- package-ecosystem: "npm"
directory: "/ClientAdvisor/App/frontend"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "npm"
directory: "/ResearchAssistant/App/frontend"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

# 2. Python dependencies
- package-ecosystem: "pip"
directory: "/ClientAdvisor/App"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "pip"
directory: "/ClientAdvisor/AzureFunction"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "pip"
directory: "/ClientAdvisor/Deployment/scripts/fabric_scripts"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "pip"
directory: "/ClientAdvisor/Deployment/scripts/index_scripts"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "pip"
directory: "/ResearchAssistant/App"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "pip"
directory: "/ResearchAssistant/Deployment/scripts/aihub_scripts"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "pip"
directory: "/ResearchAssistant/Deployment/scripts/fabric_scripts"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 15

- package-ecosystem: "pip"
directory: "/ResearchAssistant/Deployment/scripts/index_scripts"
schedule:
interval: "monthly"
commit-message:
prefix: "build"
target-branch: "dependabotchanges"
open-pull-requests-limit: 16
130 changes: 130 additions & 0 deletions .github/workflows/CAdeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: CI-Validate Deployment-Client Advisor

on:
push:
branches:
- main
paths:
- 'ClientAdvisor/**'
schedule:
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az --version # Verify installation

- name: Login to Azure
run: |
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}

- name: Install Bicep CLI
run: az bicep install

- name: Generate Resource Group Name
id: generate_rg_name
run: |
echo "Generating a unique resource group name..."
TIMESTAMP=$(date +%Y%m%d%H%M%S)
COMMON_PART="pslautomationCli"
UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}"
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
echo "Generated RESOURCE_GROUP_PREFIX: ${UNIQUE_RG_NAME}"

- name: Check and Create Resource Group
id: check_create_rg
run: |
echo "RESOURCE_GROUP: ${{ env.RESOURCE_GROUP_NAME }}"
set -e
echo "Checking if resource group exists..."
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
if [ "$rg_exists" = "false" ]; then
echo "Resource group does not exist. Creating..."
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location uksouth || { echo "Error creating resource group"; exit 1; }
else
echo "Resource group already exists."
fi

- name: Generate Unique Solution Prefix
id: generate_solution_prefix
run: |
set -e
COMMON_PART="pslc"
TIMESTAMP=$(date +%s)
UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3)
UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}"
echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV
echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}"

- name: Deploy Bicep Template
id: deploy
run: |
set -e
az deployment group create \
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file ClientAdvisor/Deployment/bicep/main.bicep \
--parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} cosmosLocation=eastus2

- name: Update PowerBI URL
if: success()
run: |
set -e

COMMON_PART="-app-service"
application_name="${{ env.SOLUTION_PREFIX }}${COMMON_PART}"
echo "Updating application: $application_name"

# Log the Power BI URL being set
echo "Setting Power BI URL: ${{ vars.VITE_POWERBI_EMBED_URL }}"

# Update the application settings
az webapp config appsettings set --name "$application_name" --resource-group "${{ env.RESOURCE_GROUP_NAME }}" --settings VITE_POWERBI_EMBED_URL="${{ vars.VITE_POWERBI_EMBED_URL }}"

# Restart the web app
az webapp restart --resource-group "${{ env.RESOURCE_GROUP_NAME }}" --name "$application_name"

echo "Power BI URL updated successfully for application: $application_name."

- name: Delete Bicep Deployment
if: success()
run: |
set -e
echo "Checking if resource group exists..."
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
if [ "$rg_exists" = "true" ]; then
echo "Resource group exist. Cleaning..."
az group delete \
--name ${{ env.RESOURCE_GROUP_NAME }} \
--yes \
--no-wait
echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}"
else
echo "Resource group does not exists."
fi

- name: Send Notification on Failure
if: failure()
run: |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

# Construct the email body
EMAIL_BODY=$(cat <<EOF
{
"body": "<p>Dear Team,</p><p>We would like to inform you that the Client Advisor Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
}
EOF
)

# Send the notification
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
-H "Content-Type: application/json" \
-d "$EMAIL_BODY" || echo "Failed to send notification"

107 changes: 107 additions & 0 deletions .github/workflows/RAdeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: CI-Validate Deployment-Research Assistant

on:
push:
branches:
- main
paths:
- 'ResearchAssistant/**'
schedule:
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Azure CLI
run: |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az --version # Verify installation

- name: Login to Azure
run: |
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}

- name: Install Bicep CLI
run: az bicep install

- name: Generate Resource Group Name
id: generate_rg_name
run: |
echo "Generating a unique resource group name..."
TIMESTAMP=$(date +%Y%m%d%H%M%S)
COMMON_PART="pslautomationRes"
UNIQUE_RG_NAME="${COMMON_PART}${TIMESTAMP}"
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"

- name: Check and Create Resource Group
id: check_create_rg
run: |
set -e
echo "Checking if resource group exists..."
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
if [ "$rg_exists" = "false" ]; then
echo "Resource group does not exist. Creating..."
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location eastus2 || { echo "Error creating resource group"; exit 1; }
else
echo "Resource group already exists."
fi

- name: Generate Unique Solution Prefix
id: generate_solution_prefix
run: |
set -e
COMMON_PART="pslr"
TIMESTAMP=$(date +%s)
UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 3)
UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}"
echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV
echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}"

- name: Deploy Bicep Template
id: deploy
run: |
set -e
az deployment group create \
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file ResearchAssistant/Deployment/bicep/main.bicep \
--parameters solutionPrefix=${{ env.SOLUTION_PREFIX }}

- name: Delete Bicep Deployment
if: success()
run: |
set -e
echo "Checking if resource group exists..."
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
if [ "$rg_exists" = "true" ]; then
echo "Resource group exist. Cleaning..."
az group delete \
--name ${{ env.RESOURCE_GROUP_NAME }} \
--yes \
--no-wait
echo "Resource group deleted... ${{ env.RESOURCE_GROUP_NAME }}"
else
echo "Resource group does not exists."
fi

- name: Send Notification on Failure
if: failure()
run: |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

# Construct the email body
EMAIL_BODY=$(cat <<EOF
{
"body": "<p>Dear Team,</p><p>We would like to inform you that the Research Assistant Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
}
EOF
)

# Send the notification
curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
-H "Content-Type: application/json" \
-d "$EMAIL_BODY" || echo "Failed to send notification"
39 changes: 39 additions & 0 deletions .github/workflows/build-clientadvisor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build ClientAdvisor Docker Images

on:
push:
branches: [main, dev, demo]
paths:
- ClientAdvisor/**
pull_request:
branches: [main, dev, demo]
types:
- opened
- ready_for_review
- reopened
- synchronize
paths:
- ClientAdvisor/**
merge_group:

jobs:
docker-build:
strategy:
matrix:
include:
- app_name: byc-wa-app
dockerfile: ClientAdvisor/App/WebApp.Dockerfile
password_secret: DOCKER_PASSWORD
- app_name: byc-wa-fn
dockerfile: ClientAdvisor/AzureFunction/Dockerfile
password_secret: DOCKER_PASSWORD

uses: ./.github/workflows/build-docker.yml
with:
registry: bycwacontainerreg.azurecr.io
username: bycwacontainerreg
password_secret: ${{ matrix.password_secret }}
app_name: ${{ matrix.app_name }}
dockerfile: ${{ matrix.dockerfile }}
push: ${{ github.event_name == 'push' && github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' }}
secrets: inherit
Loading