Skip to content

Commit 1c3f5a7

Browse files
author
Harmanpreet Kaur
committed
Revert "Enhance CI workflows: update paths for Docker build, deploy, PyLint, and test workflows; upgrade action versions"
This reverts commit 924c880.
1 parent 924c880 commit 1c3f5a7

4 files changed

Lines changed: 30 additions & 91 deletions

File tree

.github/workflows/build-docker-images.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ on:
77
- dev
88
- demo
99
- hotfix
10-
paths:
11-
- 'src/backend/**'
12-
- 'src/frontend/**'
13-
- 'docker/**'
14-
- '.github/workflows/build-docker-images.yml'
15-
- '.github/workflows/build-docker.yml'
1610
pull_request:
1711
branches:
1812
- main
@@ -24,12 +18,6 @@ on:
2418
- ready_for_review
2519
- reopened
2620
- synchronize
27-
paths:
28-
- 'src/backend/**'
29-
- 'src/frontend/**'
30-
- 'docker/**'
31-
- '.github/workflows/build-docker-images.yml'
32-
- '.github/workflows/build-docker.yml'
3321
merge_group:
3422
workflow_dispatch:
3523

.github/workflows/deploy.yml

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
name: Deploy-Test-Cleanup Pipeline
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
- dev
8-
- demo
9-
paths:
10-
- 'infra/**'
11-
- 'scripts/**'
12-
- 'azure.yaml'
13-
- '.github/workflows/deploy.yml'
14-
schedule:
15-
- cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
16-
workflow_dispatch:
4+
workflow_run:
5+
workflows: ["Build Docker and Optional Push"]
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
- dev
11+
- demo
12+
schedule:
13+
- cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
14+
workflow_dispatch:
1715

1816
env:
1917
GPT_MIN_CAPACITY: 150
@@ -27,7 +25,7 @@ jobs:
2725
WEBAPP_URL: ${{ steps.get_output.outputs.WEBAPP_URL }}
2826
steps:
2927
- name: Checkout Code
30-
uses: actions/checkout@v5
28+
uses: actions/checkout@v3
3129

3230
- name: Setup Azure CLI
3331
run: |
@@ -45,6 +43,7 @@ jobs:
4543
export AZURE_TENANT_ID=${{ secrets.AZURE_TENANT_ID }}
4644
export AZURE_CLIENT_SECRET=${{ secrets.AZURE_CLIENT_SECRET }}
4745
export AZURE_SUBSCRIPTION_ID="${{ secrets.AZURE_SUBSCRIPTION_ID }}"
46+
export GPT_MIN_CAPACITY="${{ env.GPT_MIN_CAPACITY }}"
4847
export AZURE_REGIONS="${{ vars.AZURE_REGIONS }}"
4948
chmod +x scripts/checkquota.sh
5049
if ! scripts/checkquota.sh; then
@@ -73,11 +72,6 @@ jobs:
7372
- name: Fail Pipeline if Quota Check Fails
7473
if: env.QUOTA_FAILED == 'true'
7574
run: exit 1
76-
77-
- name: Set Deployment Region
78-
run: |
79-
echo "Selected Region: $VALID_REGION"
80-
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
8175

8276
- name: Install Bicep CLI
8377
run: az bicep install
@@ -100,7 +94,7 @@ jobs:
10094
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
10195
if [ "$rg_exists" = "false" ]; then
10296
echo "Resource group does not exist. Creating..."
103-
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location australiaeast || { echo "Error creating resource group"; exit 1; }
97+
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location northcentralus || { echo "Error creating resource group"; exit 1; }
10498
else
10599
echo "Resource group already exists."
106100
fi
@@ -132,20 +126,17 @@ jobs:
132126
IMAGE_TAG="latest"
133127
fi
134128
135-
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
136-
current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ")
137-
138129
az deployment group create \
139130
--name ${{ env.SOLUTION_PREFIX }}-deployment \
140131
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
141132
--template-file infra/main.bicep \
142133
--parameters \
143134
solutionName="${{ env.SOLUTION_PREFIX }}" \
144-
azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \
135+
aiDeploymentsLocation="eastus" \
136+
useWafAlignedArchitecture=false \
137+
capacity=${{ env.GPT_MIN_CAPACITY }} \
145138
imageVersion="${IMAGE_TAG}" \
146-
createdBy="Pipeline" \
147-
tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
148-
139+
createdBy="Pipeline"
149140
- name: Assign Contributor role to Service Principal
150141
if: always()
151142
run: |
@@ -194,26 +185,7 @@ jobs:
194185
195186
- name: Login to Azure
196187
run: |
197-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
198-
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
199-
200-
- name: Assign Contributor role to Service Principal
201-
if: always()
202-
run: |
203-
echo "Assigning Contributor role to SPN for RG: ${{ env.RESOURCE_GROUP_NAME }}"
204-
az role assignment create \
205-
--assignee ${{ secrets.AZURE_CLIENT_ID }} \
206-
--role "Contributor" \
207-
--scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ env.RESOURCE_GROUP_NAME }}
208-
209-
echo "Assigning Log Analytics Contributor role for Log Analytics workspace access at RG level..."
210-
az role assignment create \
211-
--assignee ${{ secrets.AZURE_CLIENT_ID }} \
212-
--role "Log Analytics Reader" \
213-
--scope /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ env.RESOURCE_GROUP_NAME }} || echo "Log Analytics Contributor role assignment failed (may already exist)"
214-
215-
echo "Waiting for role assignment propagation..."
216-
sleep 30
188+
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
217189
218190
- name: Get Log Analytics Workspace and OpenAI from Resource Group
219191
if: always()
@@ -384,7 +356,7 @@ jobs:
384356
385357
# Purge OpenAI Resource
386358
echo "Purging the OpenAI Resource..."
387-
if ! az resource delete --ids /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/providers/Microsoft.CognitiveServices/locations/australiaeast/resourceGroups/${{ env.RESOURCE_GROUP_NAME }}/deletedAccounts/${{ env.OPENAI_RESOURCE_NAME }} --verbose; then
359+
if ! az resource delete --ids /subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/providers/Microsoft.CognitiveServices/locations/northcentralus/resourceGroups/${{ env.RESOURCE_GROUP_NAME }}/deletedAccounts/${{ env.OPENAI_RESOURCE_NAME }} --verbose; then
388360
echo "Failed to purge openai resource: ${{ env.OPENAI_RESOURCE_NAME }}"
389361
else
390362
echo "Purged the openai resource: ${{ env.OPENAI_RESOURCE_NAME }}"
@@ -427,7 +399,7 @@ jobs:
427399
428400
EMAIL_BODY=$(cat <<EOF
429401
{
430-
"body": "<p>Dear Team,</p><p>We would like to inform you that the CodeMod Deployment Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> <a href=\"${RUN_URL}\">${RUN_URL}</a><br></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
402+
"body": "<p>Dear Team,</p><p>We would like to inform you that the DocGen Deployment Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> <a href=\"${RUN_URL}\">${RUN_URL}</a><br></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
431403
}
432404
EOF
433405
)
@@ -440,4 +412,4 @@ jobs:
440412
if: always()
441413
run: |
442414
az logout
443-
echo "Logged out from Azure."
415+
echo "Logged out from Azure."

.github/workflows/pylint.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
name: PyLint
22

3-
on:
4-
push:
5-
paths:
6-
- '**/*.py'
7-
- '**/.flake8'
8-
- '.github/workflows/pylint.yml'
9-
pull_request:
10-
paths:
11-
- '**/*.py'
12-
- '**/.flake8'
13-
- '.github/workflows/pylint.yml'
3+
on: [push]
144

155
jobs:
166
lint:
@@ -22,11 +12,11 @@ jobs:
2212
steps:
2313
# Step 1: Checkout code
2414
- name: Checkout code
25-
uses: actions/checkout@v5
15+
uses: actions/checkout@v4
2616

2717
# Step 2: Set up Python environment
2818
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v6
19+
uses: actions/setup-python@v3
3020
with:
3121
python-version: ${{ matrix.python-version }}
3222

.github/workflows/test.yml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ on:
66
- main
77
- dev
88
- demo
9-
paths:
10-
- 'src/backend/**/*.py'
11-
- 'src/tests/backend/**'
12-
- '.github/workflows/test.yml'
13-
- 'src/backend/requirements.txt'
14-
- 'src/backend/pyproject.toml'
159
pull_request:
1610
types:
1711
- opened
@@ -22,20 +16,14 @@ on:
2216
- main
2317
- dev
2418
- demo
25-
paths:
26-
- 'src/backend/**/*.py'
27-
- 'src/tests/backend/**'
28-
- '.github/workflows/test.yml'
29-
- 'src/backend/requirements.txt'
30-
- 'src/backend/pyproject.toml'
3119

3220
jobs:
3321
# frontend_tests:
3422
# runs-on: ubuntu-latest
3523

3624
# steps:
3725
# - name: Checkout code
38-
# uses: actions/checkout@v5
26+
# uses: actions/checkout@v3
3927

4028
# - name: Set up Node.js
4129
# uses: actions/setup-node@v3
@@ -76,17 +64,18 @@ jobs:
7664

7765
steps:
7866
- name: Checkout code
79-
uses: actions/checkout@v5
67+
uses: actions/checkout@v3
8068

8169
- name: Set up Python
82-
uses: actions/setup-python@v6
70+
uses: actions/setup-python@v4
8371
with:
8472
python-version: '3.11'
8573

8674
- name: Install Backend Dependencies
8775
run: |
8876
python -m pip install --upgrade pip
8977
pip install -r src/backend/requirements.txt
78+
pip install -r src/frontend/requirements.txt
9079
pip install pytest-cov
9180
pip install pytest-asyncio
9281
- name: Set PYTHONPATH
@@ -114,4 +103,4 @@ jobs:
114103
- name: Skip Backend Tests
115104
if: env.skip_backend_tests == 'true'
116105
run: |
117-
echo "Skipping backend tests because no test files were found."
106+
echo "Skipping backend tests because no test files were found."

0 commit comments

Comments
 (0)