Skip to content

Conversation

@Harmanpreet-Microsoft
Copy link
Contributor

Purpose

This pull request updates several GitHub Actions workflow files to trigger jobs more selectively based on file path changes. The main goal is to improve CI/CD efficiency by ensuring workflows only run when relevant files are modified. The changes affect workflows for CodeQL analysis, deployment validation, Docker builds, linting, and testing.

Workflow trigger improvements:

  • Added paths filters to the push and pull_request triggers in .github/workflows/codeql.yml, so the CodeQL workflow only runs when relevant source code, tests, or the workflow file itself are changed.
  • Added paths filters to the push and pull_request triggers in .github/workflows/deploy.yml, restricting deployment validation to infrastructure and workflow file changes.
  • Added paths filters to the push and pull_request triggers in .github/workflows/docker-build-and-push.yml, so Docker builds only run when backend, frontend, server, or the workflow file changes. [1] [2]
  • Added paths filters to the push and pull_request triggers in .github/workflows/pylint.yml, so linting runs only when backend Python files, requirements, or relevant config/workflow files change.
  • Added paths filters to the push and pull_request triggers in .github/workflows/test.yml, so tests only run when backend, server, test files, or relevant config/workflow files are modified.

These changes help reduce unnecessary workflow runs, saving CI resources and speeding up feedback for relevant code changes.

  • ...

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

…eployment, Docker build, PyLint, and testing processes
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enhances CI/CD efficiency by adding path filters to GitHub Actions workflows, ensuring they trigger only when relevant files are modified. The changes affect five workflow files: CodeQL analysis, deployment validation, Docker builds, Python linting, and testing.

Key Changes

  • Added path-based trigger filters to all major workflows (test, lint, Docker build, deploy, CodeQL)
  • Updated branch targeting to include v3 branches (dev-v3, demo-v3) for deployment and Docker workflows
  • Preserved existing trigger types (push, pull_request, workflow_run, schedule, workflow_dispatch)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 17 comments.

Show a summary per file
File Description
.github/workflows/test.yml Added path filters to trigger tests only for Python files, test files, and test configuration changes in backend, tests, and mcp_server directories
.github/workflows/pylint.yml Added path filters to trigger linting only for backend Python files, requirements, and linting configuration
.github/workflows/docker-build-and-push.yml Added path filters to trigger Docker builds only for frontend, backend, mcp_server source code, and the workflow file itself
.github/workflows/deploy.yml Added push and pull_request triggers with path filters for infrastructure files (Bicep templates, parameters, scripts)
.github/workflows/codeql.yml Added path filters to trigger CodeQL analysis only for source code files (Python, JavaScript, TypeScript) and test files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- 'pytest.ini'
- 'conftest.py'
- 'src/backend/requirements.txt'
- 'pyproject.toml'
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path 'pyproject.toml' does not exist at the repository root level. The pyproject.toml files are located at 'src/backend/pyproject.toml' and 'src/mcp_server/pyproject.toml'. This path filter will never match, causing the workflow to miss relevant changes. Update this to 'src/backend/pyproject.toml' and consider adding 'src/mcp_server/pyproject.toml' if mcp_server tests are also covered by this workflow.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +14
paths:
- 'src/frontend/**'
- 'src/backend/**'
- 'src/mcp_server/**'
- '.github/workflows/docker-build-and-push.yml'
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path filters are missing 'src/backend/pyproject.toml', 'src/frontend/pyproject.toml', and 'src/mcp_server/pyproject.toml'. These files are used by the Dockerfiles to define Python dependencies and project configuration. Changes to these files affect what gets built into the Docker images and should trigger rebuilds.

Copilot uses AI. Check for mistakes.
Comment on lines +10 to +14
paths:
- 'src/frontend/**'
- 'src/backend/**'
- 'src/mcp_server/**'
- '.github/workflows/docker-build-and-push.yml'
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding .dockerignore files to the path filters. Each component has a .dockerignore file (src/backend/.dockerignore, src/frontend/.dockerignore) that affects what files are included in the Docker build context. While less critical than Dockerfiles, changes to these files can impact build behavior and image size.

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 38
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'
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path filter 'src/backend/**/*.py' will not trigger for changes to 'src/backend/pyproject.toml', which contains Python project configuration and dependencies used by the test workflow (line 56 installs from requirements.txt, but pyproject.toml can also define test dependencies). Add 'src/backend/pyproject.toml' to ensure dependency changes are tested.

Copilot uses AI. Check for mistakes.
Comment on lines 30 to 38
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'
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path filters are missing 'src/mcp_server/pyproject.toml' and 'src/mcp_server/pytest.ini', which exist in the repository and configure testing for the mcp_server module. Changes to these configuration files should trigger the test workflow since the workflow includes 'src/mcp_server/**/*.py' tests. Add these paths to ensure test configuration changes are properly validated.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +30
paths:
- 'src/frontend/**'
- 'src/backend/**'
- 'src/mcp_server/**'
- '.github/workflows/docker-build-and-push.yml'
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path filters are missing Dockerfiles that directly affect the Docker builds. Each component has a Dockerfile (src/backend/Dockerfile, src/frontend/Dockerfile, src/mcp_server/Dockerfile) that should trigger this workflow when modified. Add these specific Dockerfile paths to ensure build configuration changes are properly validated.

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +30
paths:
- 'src/frontend/**'
- 'src/backend/**'
- 'src/mcp_server/**'
- '.github/workflows/docker-build-and-push.yml'
Copy link

Copilot AI Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding .dockerignore files to the path filters. Each component has a .dockerignore file (src/backend/.dockerignore, src/frontend/.dockerignore) that affects what files are included in the Docker build context. While less critical than Dockerfiles, changes to these files can impact build behavior and image size.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant