Skip to content

ci: Add Dart / Flutter version matrix #874

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
May 12, 2023

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented May 11, 2023

New Pull Request Checklist

Issue Description

CI is only testing against one (presumably the latest) dart framework version.

Closes: #873

Approach

  • Add Dart SDK version matrix for testing of all currently officially supported Dart SDK versions.
  • Add support policy by adding a compatibility table to the README of each package.

@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title ci: add dart version matrix ci: Add dart version matrix May 11, 2023
@parse-github-assistant
Copy link

parse-github-assistant bot commented May 11, 2023

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (d7339cd) 26.71% compared to head (841c9b3) 26.71%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #874   +/-   ##
=======================================
  Coverage   26.71%   26.71%           
=======================================
  Files          47       47           
  Lines        2905     2905           
=======================================
  Hits          776      776           
  Misses       2129     2129           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Nidal-Bakir
Copy link
Member

I see that we need to update the examples to support null safety.

@mtrezza
Copy link
Member Author

mtrezza commented May 11, 2023

I've added the Flutter version matrix now as well. According to our support policy (tbd), we would test with Flutter 3.10 (latest), 3.7, 3.3, 3.0. But only Flutter 3.7 seems to succeed, others failing. Do you know why?

And does the Parse Flutter SDK not define a Flutter version compatibility in pubspec? I only see the range for Dart sdk: ">=2.12.0 <3.0.0".

@mtrezza mtrezza changed the title ci: Add dart version matrix ci: Add Dart / Flutter version matrix May 11, 2023
@mtrezza
Copy link
Member Author

mtrezza commented May 11, 2023

The Flutter 3.0 test fails with:

ERR : The current Dart SDK version is 2.17.6.
|
| Because parse_server_sdk depends on collection >=1.17.1 which requires SDK version >=2.18.0 <3.0.0, version solving failed.
FINE: Exception type: SolveFailure

That's expected because Flutter 3.0.5 requires Dart 2.17.6, but as we now know the Parse Dart SDK requires at least Dart 2.18.0. Just like expected:

Flutter version at least 1 year old, or the Flutter version that requires the lowest supported Dart version by the Parse Dart SDK, whatever is higher.

So the Parse Flutter SDK can only support Flutter >=3.3 and we can actually remove the Flutter 3.0 test from the CI.

@Nidal-Bakir
Copy link
Member

Nidal-Bakir commented May 11, 2023

Flutter 3.10.0 and Dart 3 require full sound null safety but the examples are not null safe

Flutter 3.3

Error: No named parameter with the name 'exclusive'.

I think its because the named parameter 'exclusive' is not present in this version of Flutter/Dart
If this is the case then we can not use Flutter 3.3 and we need to set a constraint for Flutter
like this flutter: >=3.7.0 <=3.10.0 but Flutter 3.7.0 comes with Dart 2.19.0
so we can say that we support sdk: >=2.19.0 <=3.0.0

You can also remove the tests for any dart version <2.18

@mtrezza
Copy link
Member Author

mtrezza commented May 11, 2023

And do you know why Flutter lint fails in this PR?

@Nidal-Bakir
Copy link
Member

Nidal-Bakir commented May 11, 2023

The "format" command is deprecated. Please use the "dart format" sub-command instead, which has the same command-line usage as "flutter format".

Maybe because of the deprecated "format" command

try using the dart format

@mtrezza
Copy link
Member Author

mtrezza commented May 12, 2023

That worked.

Flutter code analysis fails with

The current Dart SDK (3.0.0) only supports null safety.

So the code analysis seems to depend on the Dart / Flutter version. Should we do the code analysis as part of the matrix tests instead of as a separate test? Then the code analysis would run specifically with each Dart / Flutter version in the matrix. It's just 1 line:

flutter analyze packages/flutter --no-fatal-infos

@mtrezza
Copy link
Member Author

mtrezza commented May 12, 2023

If this is the case then we can not use Flutter 3.3 and we need to set a constraint for Flutter
like this flutter: >=3.7.0 <=3.10.0 but Flutter 3.7.0 comes with Dart 2.19.0
so we can say that we support sdk: >=2.19.0 <=3.0.0

Do you mean there is no way to set a Flutter constraint in the pubspec, but it can be done indirectly by setting the Dart constraint?

environment:
  sdk: ">=2.12.0 <3.0.0"

@Nidal-Bakir
Copy link
Member

Nidal-Bakir commented May 12, 2023

That worked.

Flutter code analysis fails with

The current Dart SDK (3.0.0) only supports null safety.

So the code analysis seems to depend on the Dart / Flutter version. Should we do the code analysis as part of the matrix tests instead of as a separate test? Then the code analysis would run specifically with each Dart / Flutter version in the matrix. It's just 1 line:

flutter analyze packages/flutter --no-fatal-infos

That will not fix the error
will pop out on the latest flutter/dart 3.10.0/3

We need to update the examples to support null safety.

@mtrezza
Copy link
Member Author

mtrezza commented May 12, 2023

The version range was just an example, I mean is there no way to set the flutter version range in the pubspec? Can we only set the dart range?

@Nidal-Bakir
Copy link
Member

Nidal-Bakir commented May 12, 2023

Do you mean there is no way to set a Flutter constraint in the pubspec, but it can be done indirectly by setting the Dart constraint?
The version range was just an example, I mean is there no way to set the flutter version range in the pubspec? Can we only set the dart range?

We can set both in the Flutter package
like this:

environment:
  sdk: ">=2.19.0 <=3.0.0"
  flutter: ">=3.7.0 <=3.10.0" 

but on the Dart package we can only set the Dart constraint

environment:
  sdk: ">=2.19.0 <=3.0.0"

@Nidal-Bakir
Copy link
Member

could remove the tests for any ci / Test Dart <2.18 no need for them

@mtrezza
Copy link
Member Author

mtrezza commented May 12, 2023

This PR is only to add the missing CI tests. We'll remove the tests in the other PR where we change the SDK version range. Just for documentation reason, if someone looks at the PRs in a few months from now so they better understand what's going on.

@mtrezza
Copy link
Member Author

mtrezza commented May 12, 2023

I have added the publish dry-run and lint to the matrix, because both of them seem to depend on the dart / flutter version.

- name: Lint
  run: dart format --output=none --set-exit-if-changed packages/flutter
- name: Publish dry run
  run: cd packages/flutter && dart pub publish --dry-run

Does that make sense?

@mtrezza mtrezza requested a review from Nidal-Bakir May 12, 2023 00:38
@Nidal-Bakir
Copy link
Member

I do not see any issue with that.

@mtrezza
Copy link
Member Author

mtrezza commented May 12, 2023

Can we merge this?

@Nidal-Bakir
Copy link
Member

Can we merge this?

We are good to go!

@mtrezza mtrezza merged commit 70a3b70 into parse-community:master May 12, 2023
@mtrezza mtrezza deleted the ci-add-dart-versions branch May 12, 2023 01:15
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.

Add support for Dart 3
2 participants