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

[ci] Run analyze with minimum resolved packages #6207

Merged
merged 4 commits into from
Aug 5, 2022

Conversation

stuartmorgan-g
Copy link
Contributor

Since our CI always runs on clean projects, they always get the latest resolved versions of dependencies, so won't catch the easy-to-make mistake of introducing use of a new dependency API without updating the minimum version of that dependency to the version that introduced that API.

This adds a new --downgrade flag to analyze to run flutter pub downgrade before analyzing, and adds a new CI step to run in that mode. (This won't catch runtime mistakes, but as with the "legacy analyze" runs this catches the most common type of mistake at a fraction of the CI cost of running all tests again.)

Also fixes all the existing violations flagged by the new step.

Fixes flutter/flutter#108992

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 relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart 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, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@stuartmorgan-g
Copy link
Contributor Author

@bparrishMines Follow-up from discussion today. It did require minor tool changes because we have to run downgrade in every package individually.

# Does a sanity check that plugins pass analysis with the lowest possible
# versions of all dependencies. This is to catch cases where we add use of
# new APIs but forget to update minimum versions of dependencies to when
# those APIs are introduced.
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome! This check seems useful.

Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

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

This is a very cool new check! Ship it!

Copy link
Contributor

@bparrishMines bparrishMines 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-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 5, 2022
@auto-submit auto-submit bot merged commit 004af7f into flutter:main Aug 5, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 8, 2022
yutaaraki-toydium pushed a commit to yutaaraki-toydium/plugins that referenced this pull request Aug 12, 2022
moisefeelin pushed a commit to feelinproject/plugins that referenced this pull request Aug 26, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add plugins/packages analyze step after pub downgrade
4 participants