Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Make run-on-changed-packages flag handle repo-level changes #3946

Merged

Conversation

stuartmorgan
Copy link
Contributor

Changes to some files (e.g., CI scripts) have the potential to cause
failures in any packages, without changes to those packages themselves.
This updates the --run-on-changed-packages to consider all packages as
changed if any of those files are changed, to avoid issues where a
change that changes both some repo-level files and some package-specific
files only run presubmit tests on the packages that are directly
changed, causing post-submit-only failures.

Fixes flutter/flutter#82965

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides. (Note that unlike the flutter/flutter repo, the flutter/plugins repo does use dart format. See plugin_tool format)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test exempt.
  • All existing and new tests are passing.

Changes to some files (e.g., CI scripts) have the potential to cause
failures in any packages, without changes to those packages themselves.
This updates the --run-on-changed-packages to consider all packages as
changed if any of those files are changed, to avoid issues where a
change that changes both some repo-level files and some package-specific
files only run presubmit tests on the packages that are directly
changed, causing post-submit-only failures.

Fixes flutter/flutter#82965
Copy link
Contributor

@mvanbeusekom mvanbeusekom left a comment

Choose a reason for hiding this comment

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

LGTM, modulo one small nit

script/tool/lib/src/common.dart Outdated Show resolved Hide resolved
Co-authored-by: Maurits van Beusekom <[email protected]>
@@ -1,8 +1,10 @@
## NEXT
## 0.1.2
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to version this now that it's not published separately in the plugin_tools?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's still published for flutter/packages.


// Returns true if one or more files changed that have the potential to affect
// any plugin (e.g., CI script changes).
Future<bool> _changesRequireFullTest() async {
Copy link
Member

Choose a reason for hiding this comment

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

Another thought would be to let Cirrus trigger tasks based on what files changed since it already has that functionality and we don't need to reinvent the wheel. So have a "Run all tests" and "Run changed packages" respective tasks that run inverse to each other

skip: !changesInclude('.cirrus.yml', '.ci.yaml', '.clang-format', ...)
skip: changesInclude('.cirrus.yml', '.ci.yaml', '.clang-format', ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The primary issue there is that we have some tasks (Windows) that run on LUCI, and over time expect to have more move to LUCI as part of the overall Flutter infra changes, so anything we implement using Cirrus-specific logic would need to be replicated in LUCI, which is a maintenance headache.

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

LGTM

@stuartmorgan
Copy link
Contributor Author

I'm going to land this on red since while it won't fix the tree, it will at least make it easier for us to see what we're doing while fixing it.

@stuartmorgan stuartmorgan merged commit 6b309e3 into flutter:master May 20, 2021
@stuartmorgan stuartmorgan deleted the run-on-changed-repo-wide-files branch May 20, 2021 18:27
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 20, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 20, 2021
fotiDim pushed a commit to fotiDim/plugins that referenced this pull request Sep 13, 2021
…3946)

Changes to some files (e.g., CI scripts) have the potential to cause
failures in any packages, without changes to those packages themselves.
This updates the --run-on-changed-packages to consider all packages as
changed if any of those files are changed, to avoid issues where a
change that changes both some repo-level files and some package-specific
files only run presubmit tests on the packages that are directly
changed, causing post-submit-only failures.

Fixes flutter/flutter#82965
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run all tests for certain flutter/plugin changes
3 participants