Skip to content

ci(all): scope pull request analysis to changed plugin families - #4013

Open
FaizanUllahDev wants to merge 4 commits into
fluttercommunity:mainfrom
FaizanUllahDev:fix/ci-scope-analyzer-to-changed-packages-2775
Open

FaizanUllahDev wants to merge 4 commits into
fluttercommunity:mainfrom
FaizanUllahDev:fix/ci-scope-analyzer-to-changed-packages-2775

Conversation

@FaizanUllahDev

Copy link
Copy Markdown
Contributor

Description

Addresses #2775.

The shared all_plugins workflow currently runs Dart analysis across the entire Plus Plugins workspace for every pull request, even when a change affects only one plugin.

This can surface unrelated analyzer findings and increases unnecessary CI work.

This PR scopes analysis to the affected plugin families while preserving full-workspace validation when needed.

Changes

  • Determine changed plugin families from the pull request's Git diff against the base branch.
  • Analyze only affected plugin families, including their platform interfaces and example applications.
  • Deduplicate plugin families so each is analyzed once.
  • Preserve full-workspace analysis for changes outside packages/, including CI and workspace configuration.
  • Preserve full-workspace analysis for pushes to main.
  • Retain dart analyze . --fatal-infos so analyzer warnings and errors remain actionable.
  • Configure the analyzer job to fetch full Git history for accurate merge-base comparisons.
  • Add automated shell regression tests for the analysis selector.

Testing

Local verification

  • Shell syntax validation passed.
  • Single-plugin changes select only the affected family.
  • Multi-plugin changes select each affected family once.
  • Workspace configuration changes trigger full analysis.
  • Push events retain full analysis.
  • Missing pull request base references fail safely.
  • Full Flutter/Melos analysis — pending CI.
  • GitHub Actions workflow verification — pending PR creation.

All five local regression scenarios passed.

Changed Files

  • .github/workflows/all_plugins.yaml
  • .github/workflows/scripts/analyze-changed-packages.sh
  • .github/workflows/scripts/test-analyze-changed-packages.sh

Scope

This PR changes only the CI analysis workflow and associated scripts.

No plugin runtime implementations, public APIs, package versions, or changelogs are modified.

Related Issue

#2775

Checklist

  • Followed the repository's contribution conventions.
  • Used a Conventional Commit PR title.
  • Added regression tests.
  • Kept the change focused on CI.
  • Left package versions and changelogs unchanged.
  • Awaiting upstream CI validation and maintainer review.

Breaking Changes

None.

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