Skip to content

Conversation

@Harmanpreet-Microsoft
Copy link
Contributor

Purpose

This pull request introduces comprehensive improvements to the repository's GitHub Actions workflows by adding precise path-based triggers to all workflow YAML files. This ensures that workflows only run when relevant files are changed, optimizing CI/CD performance and providing faster, more targeted feedback. Additionally, a new documentation file has been added to clearly explain the workflows, their triggers, and the benefits of these optimizations.

Workflow trigger optimizations:

  • Added paths filters to the following workflow files to ensure jobs only run when relevant files are modified:

Documentation:

  • Added docs/GitHubActionsWorkflows.md, a thorough guide that documents all workflows, their triggers, purposes, path filters, and the benefits of these optimizations for the development process.

These changes collectively improve CI/CD efficiency by reducing unnecessary workflow runs, providing clearer PR status, and making the workflow system easier to maintain and understand.* ...

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

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 PR adds path-based triggers to five GitHub Actions workflows to optimize CI/CD performance and introduces comprehensive documentation explaining all workflows in the repository.

Key Changes:

  • Added path filters to codeql.yml, deploy.yml, docker-build-and-push.yml, pylint.yml, and test.yml to ensure workflows only run when relevant files are modified
  • Created docs/GitHubActionsWorkflows.md with detailed documentation of all workflows, their triggers, purposes, and path filters
  • Path filters are precisely scoped to files actually used by each workflow (e.g., PyLint only monitors backend Python files, Docker builds only monitor source directories)

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/codeql.yml Added path filters to trigger only on source code files (Python, JS, TS, TSX) and test files
.github/workflows/deploy.yml Added path filters to trigger only on infrastructure files (Bicep templates, parameters, scripts)
.github/workflows/docker-build-and-push.yml Added path filters to trigger only on source directories (frontend, backend, MCP server)
.github/workflows/pylint.yml Added path filters to trigger only on backend Python files, requirements, and Flake8 config
.github/workflows/test.yml Added path filters to trigger only on backend/MCP/test Python files and relevant configs
docs/GitHubActionsWorkflows.md New comprehensive documentation covering all workflows, triggers, path filters, and optimization benefits

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

Comment on lines +131 to +142
**Path Filters** - Only runs when these files change:
```yaml
- 'src/**/*.py' # All Python source files
- 'tests/**' # All test files
- 'src/tests/**' # Source test files
- 'pytest.ini' # Pytest configuration
- 'conftest.py' # Pytest configuration
- 'requirements*.txt' # Any requirements files
- 'src/backend/requirements*.txt' # Backend requirements
- 'src/mcp_server/requirements*.txt' # MCP server requirements
- '.github/workflows/test-automation.yml' # This workflow file
```
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The documentation lists path filters for the Test Automation workflow, but the actual test-automation.yml file does not have any path filters since it only has workflow_dispatch and workflow_call triggers (which don't support path filtering). This section should either be removed or updated to clarify that path filtering is not applicable for this workflow.

Suggested change
**Path Filters** - Only runs when these files change:
```yaml
- 'src/**/*.py' # All Python source files
- 'tests/**' # All test files
- 'src/tests/**' # Source test files
- 'pytest.ini' # Pytest configuration
- 'conftest.py' # Pytest configuration
- 'requirements*.txt' # Any requirements files
- 'src/backend/requirements*.txt' # Backend requirements
- 'src/mcp_server/requirements*.txt' # MCP server requirements
- '.github/workflows/test-automation.yml' # This workflow file
```
**Path Filters**:
_Note: Path filtering is not applicable for this workflow, since it only uses manual (`workflow_dispatch`) and called (`workflow_call`) triggers, which do not support path filters._

Copilot uses AI. Check for mistakes.
| **PyLint** | Push/PR + Paths | Python code linting and quality checks (backend only) | `src/backend/` Python files, requirements.txt, .flake8 config |
| **CodeQL** | Push/PR + Paths + Schedule | Security and code quality analysis | Source code files only (Python, JS, TS, TSX), test Python files |
| **Test Workflow with Coverage** | Push/PR + Paths | Python unit tests with coverage reporting (backend-focused) | Backend, MCP, tests Python files, backend requirements |
| **Test Automation** | Push/PR + Paths + Manual | Run automated tests | Python files, test files, requirements |
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The documentation states that the "Test Automation" workflow runs on "Push/PR + Paths + Manual", but the actual test-automation.yml workflow file only has workflow_dispatch and workflow_call triggers. It does not have push or pull_request triggers, nor does it have path filters. The table entry and detailed description should be updated to accurately reflect that this workflow only runs via manual trigger (workflow_dispatch) or when called by other workflows (workflow_call).

Suggested change
| **Test Automation** | Push/PR + Paths + Manual | Run automated tests | Python files, test files, requirements |
| **Test Automation** | Manual + Called by other workflows | Run automated tests | Python files, test files, requirements |

Copilot uses AI. Check for mistakes.
Comment on lines +125 to +129
**When it runs**:
- **Push** to any branch
- **Pull Requests** to any branch
- **Manual trigger** (`workflow_dispatch`)
- **Called by other workflows** (`workflow_call`)
Copy link

Copilot AI Dec 10, 2025

Choose a reason for hiding this comment

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

The documentation incorrectly states that the Test Automation workflow runs on "Push to any branch" and "Pull Requests to any branch". The actual test-automation.yml workflow file only has workflow_dispatch (manual trigger) and workflow_call (called by other workflows) triggers. It does not run on push or pull_request events. This section should be updated to accurately reflect the actual triggers.

Copilot uses AI. Check for mistakes.
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