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
auto-submit[bot] merged 4 commits into
flutter-team-archive:mainfrom
stuartmorgan-g:tool-downgrade-analyze
Aug 5, 2022
Merged

[ci] Run analyze with minimum resolved packages#6207
auto-submit[bot] merged 4 commits into
flutter-team-archive:mainfrom
stuartmorgan-g:tool-downgrade-analyze

Conversation

@stuartmorgan-g

Copy link
Copy Markdown
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.

Fixesflutter/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
Copy Markdown
ContributorAuthor

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

Comment threadscript/tool/lib/src/analyze_command.dart Outdated
Comment threadscript/tool/lib/src/analyze_command.dart
Comment thread.cirrus.yml
# 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
Copy Markdown
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.

@ditmanditman left a comment

Copy link
Copy Markdown
Contributor

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!

@bparrishMinesbparrishMines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@stuartmorgan-gstuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 5, 2022
@auto-submit
auto-submitBot merged commit 004af7f into flutter-team-archive:mainAug 5, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmitMerge PR when tree becomes green via auto submit Appp: image_pickerp: local_authp: url_launcherp: webview_flutterEdits files for a webview_flutter pluginplatform-androidplatform-iosplatform-webplatform-windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add plugins/packages analyze step after pub downgrade

4 participants

@stuartmorgan-g@ditman@GaryQian@bparrishMines