Skip to content

Commit 6d6aab4

Browse files
2 parents eb13873 + e0128de commit 6d6aab4

File tree

94 files changed

+13986
-2229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+13986
-2229
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E501
4+
exclude = .venv, frontend
5+
ignore = E203, W503, G004, G200
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Broken Link Checker
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**/*.md'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
actions: read
12+
13+
jobs:
14+
markdown-link-check:
15+
name: Check Markdown Broken Links
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout Repo
20+
uses: actions/checkout@v6
21+
with:
22+
fetch-depth: 0
23+
24+
# For PR : Get only changed markdown files
25+
- name: Get changed markdown files (PR only)
26+
id: changed-markdown-files
27+
if: github.event_name == 'pull_request'
28+
uses: tj-actions/changed-files@e0021407031f5be11a464abee9a0776171c79891 # v46
29+
with:
30+
files: |
31+
**/*.md
32+
33+
34+
# For PR: Check broken links only in changed files
35+
- name: Check Broken Links in Changed Markdown Files
36+
id: lychee-check-pr
37+
if: github.event_name == 'pull_request' && steps.changed-markdown-files.outputs.any_changed == 'true'
38+
uses: lycheeverse/lychee-action@v2.7.0
39+
with:
40+
args: >
41+
--verbose --no-progress --exclude ^https?://
42+
${{ steps.changed-markdown-files.outputs.all_changed_files }}
43+
failIfEmpty: false
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
47+
# For manual trigger: Check all markdown files in repo
48+
- name: Check Broken Links in All Markdown Files in Entire Repo (Manual Trigger)
49+
id: lychee-check-manual
50+
if: github.event_name == 'workflow_dispatch'
51+
uses: lycheeverse/lychee-action@v2.7.0
52+
with:
53+
args: >
54+
--verbose --no-progress --exclude ^https?://
55+
'**/*.md'
56+
failIfEmpty: false
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
paths:
7+
- '**/*.py'
8+
- '.github/workflows/codeql.yml'
9+
pull_request:
10+
branches: [ "main" ]
11+
paths:
12+
- '**/*.py'
13+
- '.github/workflows/codeql.yml'
14+
schedule:
15+
- cron: '17 11 * * 0'
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 360
22+
permissions:
23+
actions: read
24+
contents: read
25+
security-events: write
26+
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
language: [ 'python' ]
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v6
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v4
38+
with:
39+
languages: ${{ matrix.language }}
40+
41+
- name: Perform CodeQL Analysis
42+
uses: github/codeql-action/analyze@v4
43+
with:
44+
category: "/language:${{matrix.language}}"
Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
name: Deploy-Test-Cleanup (v2) Linux
1+
name: Deploy-Test-Cleanup (v2)
22
on:
33
pull_request:
44
branches:
55
- main
66
paths:
7-
- 'src/frontend/**'
8-
- 'src/**/*.py'
9-
- 'src/requirements*.txt'
10-
- 'src/WebApp.Dockerfile'
11-
- '!src/tests/**'
12-
- 'infra/**/*.bicep'
13-
- 'infra/**/*.json'
14-
- '*.yaml'
7+
- 'content-gen/src/**'
8+
- '!content-gen/src/tests/**'
9+
- 'content-gen/infra/**/*.bicep'
10+
- 'content-gen/infra/**/*.json'
11+
- 'content-gen/*.yaml'
12+
- 'content-gen/scripts/**'
1513
- '.github/workflows/deploy-*.yml'
1614
workflow_run:
1715
workflows: ["Build Docker and Optional Push"]
@@ -23,6 +21,16 @@ on:
2321
- demo
2422
workflow_dispatch:
2523
inputs:
24+
runner_os:
25+
description: 'Deployment Environment'
26+
required: false
27+
type: choice
28+
options:
29+
- 'codespace'
30+
- 'Devcontainer'
31+
- 'Local'
32+
default: 'codespace'
33+
2634
azure_location:
2735
description: 'Azure Location For Deployment'
2836
required: false
@@ -32,11 +40,14 @@ on:
3240
- 'australiaeast'
3341
- 'centralus'
3442
- 'eastasia'
35-
- 'eastus2'
43+
- 'eastus'
3644
- 'japaneast'
3745
- 'northeurope'
3846
- 'southeastasia'
47+
- 'swedencentral'
3948
- 'uksouth'
49+
- 'westus'
50+
- 'westus3'
4051
resource_group_name:
4152
description: 'Resource Group Name (Optional)'
4253
required: false
@@ -90,17 +101,28 @@ on:
90101
required: false
91102
default: ''
92103
type: string
104+
image_model_choice:
105+
description: 'Image Model to Deploy'
106+
required: false
107+
default: 'gpt-image-1'
108+
type: choice
109+
options:
110+
- 'gpt-image-1'
111+
- 'gpt-image-1.5'
112+
- 'none'
93113

94114
schedule:
95-
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
115+
- cron: '30 4 * * *' # Runs at 10:00 AM IST (4:30 AM UTC)
96116
permissions:
97117
contents: read
98118
actions: read
119+
packages: write # Required by deploy-orchestrator → job-deploy → job-deploy-devcontainer for GHCR
99120
jobs:
100121
validate-inputs:
101122
runs-on: ubuntu-latest
102123
outputs:
103124
validation_passed: ${{ steps.validate.outputs.passed }}
125+
runner_os: ${{ steps.validate.outputs.runner_os }}
104126
azure_location: ${{ steps.validate.outputs.azure_location }}
105127
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
106128
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
@@ -111,11 +133,13 @@ jobs:
111133
azure_env_log_analytics_workspace_id: ${{ steps.validate.outputs.azure_env_log_analytics_workspace_id }}
112134
azure_existing_ai_project_resource_id: ${{ steps.validate.outputs.azure_existing_ai_project_resource_id }}
113135
existing_webapp_url: ${{ steps.validate.outputs.existing_webapp_url }}
136+
image_model_choice: ${{ steps.validate.outputs.image_model_choice }}
114137
steps:
115138
- name: Validate Workflow Input Parameters
116139
id: validate
117140
shell: bash
118141
env:
142+
INPUT_RUNNER_OS: ${{ github.event.inputs.runner_os }}
119143
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
120144
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
121145
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
@@ -126,10 +150,30 @@ jobs:
126150
INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
127151
INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
128152
INPUT_EXISTING_WEBAPP_URL: ${{ github.event.inputs.existing_webapp_url }}
153+
INPUT_IMAGE_MODEL_CHOICE: ${{ github.event.inputs.image_model_choice }}
129154
run: |
130155
echo "🔍 Validating workflow input parameters..."
131156
VALIDATION_FAILED=false
132157
158+
# Validate runner_os (specific allowed values) and derive actual runner
159+
RUNNER_OS_INPUT="${INPUT_RUNNER_OS:-codespace}"
160+
if [[ "$RUNNER_OS_INPUT" != "codespace" && "$RUNNER_OS_INPUT" != "Devcontainer" && "$RUNNER_OS_INPUT" != "Local" ]]; then
161+
echo "❌ ERROR: runner_os must be one of: codespace, Devcontainer, Local, got: '$RUNNER_OS_INPUT'"
162+
VALIDATION_FAILED=true
163+
else
164+
echo "✅ runner_os: '$RUNNER_OS_INPUT' is valid"
165+
fi
166+
167+
# Derive actual runner from runner_os input
168+
if [[ "$RUNNER_OS_INPUT" == "codespace" ]]; then
169+
RUNNER_OS="ubuntu-latest"
170+
elif [[ "$RUNNER_OS_INPUT" == "Devcontainer" ]]; then
171+
RUNNER_OS="devcontainer"
172+
else
173+
RUNNER_OS="windows-latest"
174+
fi
175+
echo "✅ runner_os derived as: '$RUNNER_OS'"
176+
133177
# Validate azure_location (Azure region format)
134178
LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
135179
@@ -252,6 +296,7 @@ jobs:
252296
253297
# Output validated values
254298
echo "passed=true" >> $GITHUB_OUTPUT
299+
echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
255300
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
256301
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
257302
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
@@ -262,13 +307,23 @@ jobs:
262307
echo "azure_env_log_analytics_workspace_id=$INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID" >> $GITHUB_OUTPUT
263308
echo "azure_existing_ai_project_resource_id=$INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID" >> $GITHUB_OUTPUT
264309
echo "existing_webapp_url=$INPUT_EXISTING_WEBAPP_URL" >> $GITHUB_OUTPUT
310+
311+
# Validate and output image_model_choice
312+
IMAGE_MODEL="${INPUT_IMAGE_MODEL_CHOICE:-gpt-image-1}"
313+
ALLOWED_MODELS=("gpt-image-1" "gpt-image-1.5" "none")
314+
if [[ ! " ${ALLOWED_MODELS[@]} " =~ " ${IMAGE_MODEL} " ]]; then
315+
echo "❌ ERROR: image_model_choice '$IMAGE_MODEL' is invalid. Allowed: ${ALLOWED_MODELS[*]}"
316+
exit 1
317+
fi
318+
echo "✅ image_model_choice: '$IMAGE_MODEL' is valid"
319+
echo "image_model_choice=$IMAGE_MODEL" >> $GITHUB_OUTPUT
265320
266321
Run:
267322
needs: validate-inputs
268323
if: needs.validate-inputs.outputs.validation_passed == 'true'
269324
uses: ./.github/workflows/deploy-orchestrator.yml
270325
with:
271-
runner_os: ubuntu-latest
326+
runner_os: ${{ needs.validate-inputs.outputs.runner_os || 'ubuntu-latest' }}
272327
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
273328
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
274329
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
@@ -280,4 +335,5 @@ jobs:
280335
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ needs.validate-inputs.outputs.azure_existing_ai_project_resource_id || '' }}
281336
existing_webapp_url: ${{ needs.validate-inputs.outputs.existing_webapp_url || '' }}
282337
trigger_type: ${{ github.event_name }}
338+
image_model_choice: ${{ needs.validate-inputs.outputs.image_model_choice || 'gpt-image-1' }}
283339
secrets: inherit

.github/workflows/deploy-orchestrator.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
runner_os:
7-
description: 'Runner OS (ubuntu-latest or windows-latest)'
7+
description: 'Runner OS (ubuntu-latest, windows-latest, or devcontainer)'
88
required: true
99
type: string
1010
azure_location:
@@ -61,12 +61,18 @@ on:
6161
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
6262
required: true
6363
type: string
64+
image_model_choice:
65+
description: 'Image model to deploy (gpt-image-1, gpt-image-1.5, none)'
66+
required: false
67+
default: 'gpt-image-1'
68+
type: string
6469

6570
env:
6671
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
6772
permissions:
6873
contents: read
6974
actions: read
75+
packages: write # Required by job-deploy → job-deploy-devcontainer to push devcontainer image to GHCR
7076

7177
jobs:
7278
docker-build:
@@ -94,10 +100,12 @@ jobs:
94100
docker_image_tag: ${{ needs.docker-build.outputs.IMAGE_TAG }}
95101
run_e2e_tests: ${{ inputs.run_e2e_tests }}
96102
cleanup_resources: ${{ inputs.cleanup_resources }}
103+
image_model_choice: ${{ inputs.image_model_choice }}
97104
secrets: inherit
98105

99106
e2e-test:
100-
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
107+
# if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
108+
if: false # Temporarily disable E2E tests
101109
needs: [docker-build, deploy]
102110
uses: ./.github/workflows/test-automation-v2.yml
103111
with:

.github/workflows/deploy-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ on:
8686
permissions:
8787
contents: read
8888
actions: read
89+
packages: write # Required by deploy-orchestrator → job-deploy → job-deploy-devcontainer for GHCR
8990

9091
jobs:
9192
validate-inputs:

0 commit comments

Comments
 (0)