From d212209c095ed199fcc3896202257f9de748ffe2 Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Tue, 16 Dec 2025 17:15:10 +0530 Subject: [PATCH 1/9] Enhance GitHub workflows by refining triggers and paths for CodeQL, deployment, Docker build, PyLint, and testing processes --- .github/workflows/codeql.yml | 16 +++++++++++- .github/workflows/deploy.yml | 29 ++++++++++++++++++++- .github/workflows/docker-build-and-push.yml | 10 +++++++ .github/workflows/pylint.yml | 16 ++++++++++-- .github/workflows/test.yml | 21 +++++++++++++-- 5 files changed, 86 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 14ce486fd..e67b49487 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,8 +14,22 @@ name: "CodeQL Advanced" on: push: branches: [ "main", "dev", "demo" ] + paths: + - 'src/**/*.py' + - 'src/**/*.js' + - 'src/**/*.ts' + - 'src/**/*.tsx' + - 'tests/**/*.py' + - '.github/workflows/codeql.yml' pull_request: branches: [ "main", "dev", "demo" ] + paths: + - 'src/**/*.py' + - 'src/**/*.js' + - 'src/**/*.ts' + - 'src/**/*.tsx' + - 'tests/**/*.py' + - '.github/workflows/codeql.yml' schedule: - cron: '44 20 * * 2' @@ -91,4 +105,4 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: - category: "/language:${{matrix.language}}" + category: "/language:${{matrix.language}}" \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c2036be6e..0cefc6b42 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,6 +1,33 @@ name: Validate Deployment v3 on: + push: + branches: + - main + - dev-v3 + - hotfix + paths: + - 'infra/main.bicep' + - 'infra/modules/**/*.bicep' + - 'infra/*.parameters.json' + - 'infra/scripts/**' + - '.github/workflows/deploy.yml' + pull_request: + types: + - opened + - ready_for_review + - reopened + - synchronize + branches: + - main + - dev-v3 + - hotfix + paths: + - 'infra/main.bicep' + - 'infra/modules/**/*.bicep' + - 'infra/*.parameters.json' + - 'infra/scripts/**' + - '.github/workflows/deploy.yml' workflow_run: workflows: ["Build Docker and Optional Push v3"] types: @@ -385,4 +412,4 @@ jobs: if: always() run: | az logout - echo "Logged out from Azure." + echo "Logged out from Azure." \ No newline at end of file diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index eb46863e5..7ecd9ffb0 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -7,6 +7,11 @@ on: - dev-v3 - demo-v3 - hotfix + paths: + - 'src/frontend/**' + - 'src/backend/**' + - 'src/mcp_server/**' + - '.github/workflows/docker-build-and-push.yml' pull_request: types: - opened @@ -18,6 +23,11 @@ on: - dev-v3 - demo-v3 - hotfix + paths: + - 'src/frontend/**' + - 'src/backend/**' + - 'src/mcp_server/**' + - '.github/workflows/docker-build-and-push.yml' workflow_dispatch: jobs: diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index bc2851159..a20c50266 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,6 +1,18 @@ name: PyLint -on: [push] +on: + push: + paths: + - 'src/backend/**/*.py' + - 'src/backend/requirements.txt' + - '.flake8' + - '.github/workflows/pylint.yml' + pull_request: + paths: + - 'src/backend/**/*.py' + - 'src/backend/requirements.txt' + - '.flake8' + - '.github/workflows/pylint.yml' jobs: build: @@ -24,4 +36,4 @@ jobs: - name: Run flake8 and pylint run: | - flake8 --config=.flake8 src/backend # Specify the directory to lint + flake8 --config=.flake8 src/backend # Specify the directory to lint \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d8ca7c0b..7672519e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,6 +7,15 @@ on: - dev - demo - hotfix + paths: + - 'src/backend/**/*.py' + - 'src/tests/**/*.py' + - 'src/mcp_server/**/*.py' + - 'pytest.ini' + - 'conftest.py' + - 'src/backend/requirements.txt' + - 'pyproject.toml' + - '.github/workflows/test.yml' pull_request: types: - opened @@ -14,11 +23,19 @@ on: - reopened - synchronize branches: - - main - main - dev - demo - hotfix + paths: + - 'src/backend/**/*.py' + - 'src/tests/**/*.py' + - 'src/mcp_server/**/*.py' + - 'pytest.ini' + - 'conftest.py' + - 'src/backend/requirements.txt' + - 'pyproject.toml' + - '.github/workflows/test.yml' jobs: test: @@ -73,4 +90,4 @@ jobs: - name: Skip coverage report if no tests if: env.skip_tests == 'true' run: | - echo "Skipping coverage report because no tests were found." + echo "Skipping coverage report because no tests were found." \ No newline at end of file From 525c1ab2f9ecfc40090c42fee0ea7788add82f45 Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Tue, 16 Dec 2025 18:02:01 +0530 Subject: [PATCH 2/9] Fix paths in test workflow to correctly include pyproject.toml files --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7672519e7..8709c28b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,10 +11,10 @@ on: - 'src/backend/**/*.py' - 'src/tests/**/*.py' - 'src/mcp_server/**/*.py' + - 'src/**/pyproject.toml' - 'pytest.ini' - 'conftest.py' - 'src/backend/requirements.txt' - - 'pyproject.toml' - '.github/workflows/test.yml' pull_request: types: @@ -34,7 +34,7 @@ on: - 'pytest.ini' - 'conftest.py' - 'src/backend/requirements.txt' - - 'pyproject.toml' + - 'src/**/pyproject.toml' - '.github/workflows/test.yml' jobs: From afdfc68df41566c9986fbbc4d2e9fe77c794d303 Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 17 Dec 2025 11:03:40 +0530 Subject: [PATCH 3/9] Update deployment workflow to enhance clarity and maintainability --- .github/workflows/deploy.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 0cefc6b42..c26773b5d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,6 +12,8 @@ on: - 'infra/*.parameters.json' - 'infra/scripts/**' - '.github/workflows/deploy.yml' + - 'azure.yml' + - 'azure-custom.yml' pull_request: types: - opened @@ -28,6 +30,8 @@ on: - 'infra/*.parameters.json' - 'infra/scripts/**' - '.github/workflows/deploy.yml' + - 'azure.yml' + - 'azure-custom.yml' workflow_run: workflows: ["Build Docker and Optional Push v3"] types: From 5a47f97270c5563f51c38bfa66c31d24f3e2e6be Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 17 Dec 2025 11:28:07 +0530 Subject: [PATCH 4/9] Update PyLint workflow to improve clarity and maintainability --- .github/workflows/pylint.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index a20c50266..4686c9ce3 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -4,13 +4,17 @@ on: push: paths: - 'src/backend/**/*.py' + - 'src/mcp_server/**/*.py' - 'src/backend/requirements.txt' + - 'src/mcp_server/pyproject.toml' - '.flake8' - '.github/workflows/pylint.yml' pull_request: paths: - 'src/backend/**/*.py' + - 'src/mcp_server/**/*.py' - 'src/backend/requirements.txt' + - 'src/mcp_server/pyproject.toml' - '.flake8' - '.github/workflows/pylint.yml' @@ -32,8 +36,9 @@ jobs: run: | python -m pip install --upgrade pip pip install -r src/backend/requirements.txt + pip install -e src/mcp_server/ # Install mcp_server dependencies from pyproject.toml pip install flake8 # Ensure flake8 is installed explicitly - name: Run flake8 and pylint run: | - flake8 --config=.flake8 src/backend # Specify the directory to lint \ No newline at end of file + flake8 --config=.flake8 src/backend src/mcp_server # Lint both backend and mcp_server directories \ No newline at end of file From 632d3721aef2c02943ff1431853283daa7d9fe0a Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 17 Dec 2025 11:34:14 +0530 Subject: [PATCH 5/9] Remove mcp_server directory from flake8 linting in PyLint workflow --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 4686c9ce3..628d6e461 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -41,4 +41,4 @@ jobs: - name: Run flake8 and pylint run: | - flake8 --config=.flake8 src/backend src/mcp_server # Lint both backend and mcp_server directories \ No newline at end of file + flake8 --config=.flake8 src/backend \ No newline at end of file From ce226346e510553ed724e5dac006c262420e923c Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 17 Dec 2025 11:54:59 +0530 Subject: [PATCH 6/9] Remove mcp_server paths from PyLint workflow to streamline linting process --- .github/workflows/deploy.yml | 4 ++-- .github/workflows/pylint.yml | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c26773b5d..5634df8cb 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ on: - 'infra/scripts/**' - '.github/workflows/deploy.yml' - 'azure.yml' - - 'azure-custom.yml' + - 'azure_custom.yml' pull_request: types: - opened @@ -31,7 +31,7 @@ on: - 'infra/scripts/**' - '.github/workflows/deploy.yml' - 'azure.yml' - - 'azure-custom.yml' + - 'azure_custom.yml' workflow_run: workflows: ["Build Docker and Optional Push v3"] types: diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 628d6e461..4fdce9ecb 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -6,7 +6,6 @@ on: - 'src/backend/**/*.py' - 'src/mcp_server/**/*.py' - 'src/backend/requirements.txt' - - 'src/mcp_server/pyproject.toml' - '.flake8' - '.github/workflows/pylint.yml' pull_request: @@ -14,7 +13,6 @@ on: - 'src/backend/**/*.py' - 'src/mcp_server/**/*.py' - 'src/backend/requirements.txt' - - 'src/mcp_server/pyproject.toml' - '.flake8' - '.github/workflows/pylint.yml' @@ -36,7 +34,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -r src/backend/requirements.txt - pip install -e src/mcp_server/ # Install mcp_server dependencies from pyproject.toml pip install flake8 # Ensure flake8 is installed explicitly - name: Run flake8 and pylint From 5375b6653b64a4b1d49b42143a203e9afbcbaaeb Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 17 Dec 2025 12:13:52 +0530 Subject: [PATCH 7/9] Update deployment workflow for improved clarity and maintainability --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5634df8cb..8366b0abd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -12,8 +12,8 @@ on: - 'infra/*.parameters.json' - 'infra/scripts/**' - '.github/workflows/deploy.yml' - - 'azure.yml' - - 'azure_custom.yml' + - 'azure.yaml' + - 'azure_custom.yaml' pull_request: types: - opened From 930fd042dc19b69a76f8b43e65c0df8d81c3783c Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Wed, 17 Dec 2025 12:16:02 +0530 Subject: [PATCH 8/9] Fix file extensions in deployment workflow for consistency --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8366b0abd..6822da2b8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,8 +30,8 @@ on: - 'infra/*.parameters.json' - 'infra/scripts/**' - '.github/workflows/deploy.yml' - - 'azure.yml' - - 'azure_custom.yml' + - 'azure.yaml' + - 'azure_custom.yaml' workflow_run: workflows: ["Build Docker and Optional Push v3"] types: From 0882547272114d7eece319852c045e9c2b53f802 Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Thu, 18 Dec 2025 11:44:37 +0530 Subject: [PATCH 9/9] Refactor workflows: streamline deployment triggers and remove redundant paths from PyLint configuration --- .github/workflows/deploy.yml | 33 +-------------------- .github/workflows/docker-build-and-push.yml | 14 +++++++++ .github/workflows/pylint.yml | 8 +---- 3 files changed, 16 insertions(+), 39 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6822da2b8..c2036be6e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,37 +1,6 @@ name: Validate Deployment v3 on: - push: - branches: - - main - - dev-v3 - - hotfix - paths: - - 'infra/main.bicep' - - 'infra/modules/**/*.bicep' - - 'infra/*.parameters.json' - - 'infra/scripts/**' - - '.github/workflows/deploy.yml' - - 'azure.yaml' - - 'azure_custom.yaml' - pull_request: - types: - - opened - - ready_for_review - - reopened - - synchronize - branches: - - main - - dev-v3 - - hotfix - paths: - - 'infra/main.bicep' - - 'infra/modules/**/*.bicep' - - 'infra/*.parameters.json' - - 'infra/scripts/**' - - '.github/workflows/deploy.yml' - - 'azure.yaml' - - 'azure_custom.yaml' workflow_run: workflows: ["Build Docker and Optional Push v3"] types: @@ -416,4 +385,4 @@ jobs: if: always() run: | az logout - echo "Logged out from Azure." \ No newline at end of file + echo "Logged out from Azure." diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index 7ecd9ffb0..9f1ea0649 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -12,6 +12,13 @@ on: - 'src/backend/**' - 'src/mcp_server/**' - '.github/workflows/docker-build-and-push.yml' + - 'infra/main.bicep' + - 'infra/modules/**/*.bicep' + - 'infra/*.parameters.json' + - 'infra/scripts/**' + - '.github/workflows/deploy.yml' + - 'azure.yaml' + - 'azure_custom.yaml' pull_request: types: - opened @@ -28,6 +35,13 @@ on: - 'src/backend/**' - 'src/mcp_server/**' - '.github/workflows/docker-build-and-push.yml' + - 'infra/main.bicep' + - 'infra/modules/**/*.bicep' + - 'infra/*.parameters.json' + - 'infra/scripts/**' + - '.github/workflows/deploy.yml' + - 'azure.yaml' + - 'azure_custom.yaml' workflow_dispatch: jobs: diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 4fdce9ecb..a18c0c306 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -8,13 +8,7 @@ on: - 'src/backend/requirements.txt' - '.flake8' - '.github/workflows/pylint.yml' - pull_request: - paths: - - 'src/backend/**/*.py' - - 'src/mcp_server/**/*.py' - - 'src/backend/requirements.txt' - - '.flake8' - - '.github/workflows/pylint.yml' + jobs: build: