8000 ci: refine workflow triggers with detailed path-based filtering by Harmanpreet-Microsoft · Pull Request #294 · microsoft/Modernize-your-code-solution-accelerator · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@Harmanpreet-Microsoft
Copy link
Contributor

Purpose

This pull request updates several GitHub Actions workflow files to add more granular path filtering and improve when workflows are triggered. The main goal is to ensure that workflows only run when relevant files are changed, which helps optimize CI/CD resources and reduces unnecessary workflow runs.

Key changes by workflow:

Build and Docker workflows:

  • Updated .github/workflows/build-docker-images.yml to include paths filters for both push and pull_request events, so the workflow only runs when files in src/backend, src/frontend, docker, or the workflow files themselves are modified. [1] [2]

Deploy workflow:

  • Modified .github/workflows/deploy.yml to trigger on push and pull_request events affecting infra, scripts, azure.yaml, or the workflow file itself, instead of only on completion of another workflow. Also, added specific pull request event types for finer control.

Linting workflow:

  • Updated .github/workflows/pylint.yml to run only when Python files, requirements, or related config files are changed, for both push and pull_request events.

Testing workflow:

  • Added paths filters to .github/workflows/test.yml so it only runs on changes to backend Python files, backend tests, requirements, or the workflow file itself, for both push and pull_request events. [1] [2]
  • ...

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

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 pull request adds path-based filtering to GitHub Actions workflows to optimize CI/CD resource usage by ensuring workflows only run when relevant files change. The changes affect four workflow files: build-docker-images.yml, deploy.yml, pylint.yml, and test.yml.

Key Changes:

  • Added paths filters to push and pull_request triggers across multiple workflows to restrict when they execute
  • Modified deploy.yml to use path-based push triggers instead of workflow_run dependency
  • Added granular path patterns targeting source code, configuration files, Docker files, and workflow files themselves

Reviewed changes

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

File Description
.github/workflows/test.yml Added path filters for backend Python files, tests, requirements, and workflow file to push and pull_request triggers
.github/workflows/pylint.yml Added path filters for Python files, requirements, pyproject.toml, .flake8 config, and workflow file; added pull_request trigger with same filters
.github/workflows/deploy.yml Replaced workflow_run trigger with path-filtered push trigger for infrastructure and deployment-related files
.github/workflows/build-docker-images.yml Added path filters for backend, frontend, docker directories, and workflow files to push and pull_request triggers

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

Comment on lines +9 to +14
paths:
- 'src/backend/**/*.py'
- 'src/tests/backend/**'
- '.github/workflows/test.yml'
- 'src/backend/requirements.txt'
- 'src/backend/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 filter is missing 'src/frontend/requirements.txt'. Looking at line 90 of this workflow, the test job installs dependencies from 'src/frontend/requirements.txt', so changes to that file should trigger the workflow to ensure tests run with updated frontend dependencies.

Copilot uses AI. Check for mistakes.
Comment on lines +25 to +30
paths:
- 'src/backend/**/*.py'
- 'src/tests/backend/**'
- '.github/workflows/test.yml'
- 'src/backend/requirements.txt'
- 'src/backend/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 filter is missing 'src/frontend/requirements.txt'. Looking at line 90 of this workflow, the test job installs dependencies from 'src/frontend/requirements.txt', so changes to that file should trigger the workflow to ensure tests run with updated frontend dependencies.

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

0