Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 8 additions & 8 deletions .github/workflows/AdminWebpage-Deploy-WF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ permissions:
contents: read

env:
RESOURCE_GROUP: ewu-deliverybotsystem-rg
APP_SERVICE_NAME: WA-DeliveryBot-Admin-dev
BOTNET_API_URL: https://ewu-deliverybotsystem-api.mangocoast-332176b0.westus2.azurecontainerapps.io
SIMULATOR_API_URL: https://deliverybot-robot-simulator.mangocoast-332176b0.westus2.azurecontainerapps.io
ORDER_SERVICE_URL: https://deliverybot-order-service.mangocoast-332176b0.westus2.azurecontainerapps.io
RESOURCE_GROUP: ${{ vars.RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}
APP_SERVICE_NAME: ${{ vars.ADMIN_APP_SERVICE_NAME || 'WA-DeliveryBot-Admin-dev' }}
BOTNET_API_URL: ${{ vars.VITE_BOTNET_API_URL || 'https://ewu-deliverybotsystem-api.mangocoast-332176b0.westus2.azurecontainerapps.io' }}
SIMULATOR_API_URL: ${{ vars.VITE_SIMULATOR_API_URL || 'https://deliverybot-robot-simulator.mangocoast-332176b0.westus2.azurecontainerapps.io' }}
ORDER_SERVICE_URL: ${{ vars.VITE_ORDER_SERVICE_URL || 'https://deliverybot-order-service.mangocoast-332176b0.westus2.azurecontainerapps.io' }}
# Entra ID staff sign-in (issue #54). Blank → auth disabled (app runs open).
# Fill these in from the app registration to switch sign-in on, then push.
# Client/tenant/group IDs are not secrets (a public SPA exposes them anyway).
ENTRA_CLIENT_ID: "b5a029c3-d046-4005-9497-23ba18df70b2"
ENTRA_TENANT_ID: "37321907-14a5-4390-987d-ec0c66c655cd"
ENTRA_ADMIN_GROUP_ID: "14fcd995-e89f-4020-b5ff-4a9b48a5824e"
ENTRA_CLIENT_ID: ${{ vars.ENTRA_CLIENT_ID }}
ENTRA_TENANT_ID: ${{ vars.ENTRA_TENANT_ID }}
ENTRA_ADMIN_GROUP_ID: ${{ vars.ENTRA_ADMIN_GROUP_ID }}

jobs:
build-and-deploy:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/CustomerWebpage-Deploy-WF.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,17 @@ jobs:
- name: Lint application
run: npm run lint

- name: Run unit tests
run: npm test

- name: Build application
run: npm run build
env:
VITE_API_MANAGEMENT_BASE_URL: ${{ vars.VITE_API_MANAGEMENT_BASE_URL }}
VITE_AGENT_API_URL: ${{ vars.VITE_AGENT_API_URL }}
VITE_MAP_TILE_URL: ${{ vars.VITE_MAP_TILE_URL }}
VITE_ORDER_SERVICE_URL: ${{ vars.VITE_ORDER_SERVICE_URL }}
VITE_OSRM_API_URL: ${{ vars.VITE_OSRM_API_URL }}
VITE_SIMULATOR_API_BASE: ${{ vars.VITE_SIMULATOR_API_BASE }}

- name: Azure Login
Expand All @@ -62,5 +69,5 @@ jobs:
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
uses: azure/webapps-deploy@v3
with:
app-name: WA-DeliveryBot-dev
app-name: ${{ vars.CUSTOMER_FRONTEND_APP_SERVICE_NAME || 'WA-DeliveryBot-dev' }}
package: frontend/customer-webapp/dist
89 changes: 89 additions & 0 deletions .github/workflows/agentservice-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Build and Deploy Agent Service

on:
push:
branches: [main]
paths:
- "AgentService/**"
- ".github/workflows/agentservice-deploy.yml"
pull_request:
branches: [main]
paths:
- "AgentService/**"
- ".github/workflows/agentservice-deploy.yml"
workflow_dispatch:
workflow_run:
workflows: ["Infrastructure — Apply All Services"]
types:
- completed

permissions:
id-token: write
contents: read

env:
RESOURCE_GROUP: ${{ vars.RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}
ACR_NAME: ${{ vars.ACR_NAME || 'DeliverybotCR' }}
ACR_LOGIN_SERVER: ${{ vars.ACR_LOGIN_SERVER || 'deliverybotcr.azurecr.io' }}
CONTAINER_APP_NAME: ${{ vars.AGENT_SERVICE_CONTAINER_APP_NAME || 'deliverybot-agent-dev' }}
IMAGE_NAME: agentservice

jobs:
build-and-deploy:
if: github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event != 'pull_request')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"

- name: Run backend checks
run: |
dotnet build AgentService/AgentService/AgentService.csproj --configuration Release
dotnet test AgentService/AgentService.Tests/AgentService.Tests.csproj --configuration Release

- name: Build Docker image for pull request
if: github.event_name == 'pull_request'
run: docker build -t agentservice-pr -f AgentService/AgentService/Dockerfile AgentService

- name: Azure Login (OIDC)
if: github.event_name != 'pull_request'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Log in to Azure Container Registry
if: github.event_name != 'pull_request'
run: az acr login --name "$ACR_NAME"

- name: Build and push Docker image
if: github.event_name != 'pull_request'
run: |
IMAGE_TAG="${ACR_LOGIN_SERVER}/${IMAGE_NAME}:${{ github.sha }}"
docker build -t "$IMAGE_TAG" -f AgentService/AgentService/Dockerfile AgentService
docker push "$IMAGE_TAG"
echo "IMAGE_TAG=$IMAGE_TAG" >> "$GITHUB_ENV"

- name: Update Container App image
if: github.event_name != 'pull_request'
run: |
az containerapp update \
--name "$CONTAINER_APP_NAME" \
--resource-group "$RESOURCE_GROUP" \
--image "$IMAGE_TAG"

- name: Print deployment URL
if: github.event_name != 'pull_request'
run: |
FQDN=$(az containerapp show \
--name "$CONTAINER_APP_NAME" \
--resource-group "$RESOURCE_GROUP" \
--query properties.configuration.ingress.fqdn -o tsv)
echo "Agent Service live at: https://${FQDN}"
echo "POST https://${FQDN}/chat"
12 changes: 6 additions & 6 deletions .github/workflows/botNetApi-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ permissions:
contents: read

env:
RESOURCE_GROUP: ewu-deliverybotsystem-rg
RESOURCE_GROUP: ${{ vars.RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}

# ACR — pre-created, admin credentials stored as Container App registry secret
ACR_NAME: DeliverybotCR
ACR_LOGIN_SERVER: deliverybotcr.azurecr.io
ACR_NAME: ${{ vars.ACR_NAME || 'DeliverybotCR' }}
ACR_LOGIN_SERVER: ${{ vars.ACR_LOGIN_SERVER || 'deliverybotcr.azurecr.io' }}

# Container App — pre-created with system-assigned managed identity
CONTAINER_APP_NAME: ewu-deliverybotsystem-api
CONTAINER_APP_NAME: ${{ vars.BOT_API_CONTAINER_APP_NAME || 'ewu-deliverybotsystem-api' }}

# Azure SQL — pre-created; Container App MI already has db_owner in BotNetApiDb
SQL_SERVER_NAME: deliverybotsystem-sql
SQL_DB_NAME: BotNetApiDb
SQL_SERVER_NAME: ${{ vars.BOT_API_SQL_SERVER_NAME || 'deliverybotsystem-sql' }}
SQL_DB_NAME: ${{ vars.BOT_API_SQL_DATABASE_NAME || 'BotNetApiDb' }}

IMAGE_NAME: botnetapi

Expand Down
38 changes: 33 additions & 5 deletions .github/workflows/iac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ permissions:
contents: read

env:
TFSTATE_STORAGE_ACCOUNT: dbstfstate01
TFSTATE_CONTAINER: tfstate
TFSTATE_RESOURCE_GROUP: ${{ vars.TFSTATE_RESOURCE_GROUP || 'ewu-deliverybotsystem-rg' }}
TFSTATE_STORAGE_ACCOUNT: ${{ vars.TFSTATE_STORAGE_ACCOUNT || 'dbstfstate01' }}
TFSTATE_CONTAINER: ${{ vars.TFSTATE_CONTAINER || 'tfstate' }}
TFSTATE_KEY: ${{ vars.TFSTATE_KEY || 'deliverybot.tfstate' }}

jobs:
terraform:
Expand Down Expand Up @@ -59,6 +61,26 @@ jobs:

# Event Hub — shared by Order Service and Robot Simulator.
TF_VAR_eventhub_connection_string: ${{ secrets.AZURE_EVENTHUB_CONNECTION_STRING }}
TF_VAR_azure_openai_endpoint: ${{ vars.AZURE_OPENAI_ENDPOINT }}
TF_VAR_azure_openai_deployment: ${{ vars.AZURE_OPENAI_DEPLOYMENT }}
TF_VAR_azure_openai_api_key: ${{ secrets.AZURE_OPENAI_API_KEY }}
TF_VAR_resource_group_name: ${{ vars.RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}
TF_VAR_acr_name: ${{ vars.ACR_NAME || 'DeliverybotCR' }}
TF_VAR_container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME || 'managedEnvironment-ewudeliverybots-aa2f' }}
TF_VAR_eventhub_namespace_name: ${{ vars.EVENTHUB_NAMESPACE_NAME || 'DeliverybotSimulator-EVHNS' }}
TF_VAR_existing_container_app_environment_resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}
TF_VAR_existing_app_service_plan_resource_group_name: ${{ vars.APP_SERVICE_PLAN_RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}
TF_VAR_create_container_app_environment: ${{ vars.CREATE_CONTAINER_APP_ENVIRONMENT || 'false' }}
TF_VAR_create_app_service_plan: ${{ vars.CREATE_APP_SERVICE_PLAN || 'false' }}
TF_VAR_app_service_plan_name: ${{ vars.APP_SERVICE_PLAN_NAME || 'ASP-RGDeliveryBotdev-8b82' }}
TF_VAR_customer_frontend_app_service_name: ${{ vars.CUSTOMER_FRONTEND_APP_SERVICE_NAME || 'WA-DeliveryBot-dev' }}
TF_VAR_admin_app_service_name: ${{ vars.ADMIN_APP_SERVICE_NAME || 'WA-DeliveryBot-Admin-dev' }}
TF_VAR_bot_api_container_app_name: ${{ vars.BOT_API_CONTAINER_APP_NAME || 'ewu-deliverybotsystem-api' }}
TF_VAR_order_service_container_app_name: ${{ vars.ORDER_SERVICE_CONTAINER_APP_NAME || 'deliverybot-order-service' }}
TF_VAR_simulator_container_app_name: ${{ vars.SIMULATOR_CONTAINER_APP_NAME || 'deliverybot-robot-simulator' }}
TF_VAR_bot_api_sql_server_name: ${{ vars.BOT_API_SQL_SERVER_NAME || 'deliverybotsystem-sql' }}
TF_VAR_botnet_api_url: ${{ vars.VITE_BOTNET_API_URL || 'https://ewu-deliverybotsystem-api.mangocoast-332176b0.westus2.azurecontainerapps.io' }}
TF_VAR_simulator_api_url: ${{ vars.VITE_SIMULATOR_API_URL || 'https://deliverybot-robot-simulator.mangocoast-332176b0.westus2.azurecontainerapps.io' }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -112,12 +134,18 @@ jobs:
terraform_version: "1.9.5"

- name: Terraform Init
run: terraform init -input=false
run: |
terraform init -input=false \
-backend-config="resource_group_name=$TFSTATE_RESOURCE_GROUP" \
-backend-config="storage_account_name=$TFSTATE_STORAGE_ACCOUNT" \
-backend-config="container_name=$TFSTATE_CONTAINER" \
-backend-config="key=$TFSTATE_KEY" \
-backend-config="use_oidc=true" \
-backend-config="use_azuread_auth=true"

- name: Terraform Plan
run: terraform plan -input=false -out=tfplan

# Apply only on merge to main — PRs stop at plan for review.
- name: Terraform Apply
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
run: terraform apply -input=false tfplan
8 changes: 4 additions & 4 deletions .github/workflows/orderservice-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ permissions:
contents: read

env:
RESOURCE_GROUP: ewu-deliverybotsystem-rg
ACR_NAME: DeliverybotCR
ACR_LOGIN_SERVER: deliverybotcr.azurecr.io
CONTAINER_APP_NAME: deliverybot-order-service
RESOURCE_GROUP: ${{ vars.RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}
ACR_NAME: ${{ vars.ACR_NAME || 'DeliverybotCR' }}
ACR_LOGIN_SERVER: ${{ vars.ACR_LOGIN_SERVER || 'deliverybotcr.azurecr.io' }}
CONTAINER_APP_NAME: ${{ vars.ORDER_SERVICE_CONTAINER_APP_NAME || 'deliverybot-order-service' }}
IMAGE_NAME: orderservice

jobs:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/readable-bot-network-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ permissions:
contents: read

env:
RESOURCE_GROUP: ewu-deliverybotsystem-rg
FUNCTION_APP_NAME: deliverybot-rbnr-dev-rbnr-func-mtgpw6
COSMOS_ACCOUNT_NAME: deliverybot-rbnr-dev-rbnr-mtgpw6
COSMOS_DATABASE_NAME: bot-network
BOTS_CONTAINER_NAME: bots
DIAGNOSTICS_CONTAINER_NAME: function-diagnostics
RESOURCE_GROUP: ${{ vars.RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}
FUNCTION_APP_NAME: ${{ vars.READABLE_BOT_NETWORK_FUNCTION_APP_NAME || 'deliverybot-rbnr-dev-rbnr-func-mtgpw6' }}
COSMOS_ACCOUNT_NAME: ${{ vars.READABLE_BOT_NETWORK_COSMOS_ACCOUNT_NAME || 'deliverybot-rbnr-dev-rbnr-mtgpw6' }}
COSMOS_DATABASE_NAME: ${{ vars.READABLE_BOT_NETWORK_COSMOS_DATABASE_NAME || 'bot-network' }}
BOTS_CONTAINER_NAME: ${{ vars.READABLE_BOT_NETWORK_COSMOS_CONTAINER_NAME || 'bots' }}
DIAGNOSTICS_CONTAINER_NAME: ${{ vars.READABLE_BOT_NETWORK_DIAGNOSTICS_CONTAINER_NAME || 'function-diagnostics' }}

jobs:
update-cosmos:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/simulator-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ permissions:
contents: read

env:
RESOURCE_GROUP: ewu-deliverybotsystem-rg
RESOURCE_GROUP: ${{ vars.RESOURCE_GROUP_NAME || 'ewu-deliverybotsystem-rg' }}

# ACR — pre-created; admin credentials stored as Container App registry secret
ACR_NAME: DeliverybotCR
ACR_LOGIN_SERVER: deliverybotcr.azurecr.io
ACR_NAME: ${{ vars.ACR_NAME || 'DeliverybotCR' }}
ACR_LOGIN_SERVER: ${{ vars.ACR_LOGIN_SERVER || 'deliverybotcr.azurecr.io' }}

# Container App — pre-created with system-assigned managed identity
CONTAINER_APP_NAME: deliverybot-robot-simulator
CONTAINER_APP_NAME: ${{ vars.SIMULATOR_CONTAINER_APP_NAME || 'deliverybot-robot-simulator' }}

IMAGE_NAME: deliverybot-robot-simulator

Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ Thumbs.db
*.swp
*.swo
*~
.dotnet/

# VS Code workspace settings (keep launch/tasks, ignore local overrides)
.vscode/settings.json
.vscode/*.code-workspace

# .NET build output
**/bin/
**/obj/
25 changes: 25 additions & 0 deletions AgentService/AgentService.Tests/AgentService.Tests.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4" />
</ItemGroup>

<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AgentService\AgentService.csproj" />
</ItemGroup>

</Project>
Loading
Loading