Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ commands:
command: |
flutter pub global activate melos 1.3.0
melos bootstrap
activate_pana:
steps:
- run:
name: Install and set up pana
command: |
flutter pub global activate pana
install_tuneup:
steps:
- run:
Expand All @@ -62,6 +68,20 @@ jobs:
- run:
name: Analyze Dart/Flutter Code
command: melos run analyze --no-select

pub_analysis:
executor: docker-executor
parameters:
plugin:
type: string
steps:
- install_flutter
- checkout
- install_melos
- activate_pana
- run:
name: Run pub analysis and fail if the score is below the max score
command: melos exec -c 1 --fail-fast --scope="<< parameters.plugin >>" -- pana --no-warning --exit-code-threshold 0 .

unit_test_flutter:
executor: docker-executor
Expand Down Expand Up @@ -181,6 +201,21 @@ workflows:
jobs:
- format_flutter
- analyze_flutter
- pub_analysis:
matrix:
parameters:
plugin:
[
"amplify_authenticator",
# TODO: enable other packages once pub score is addressed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

amplify_authenticator is the only package with a max score right now.

Note: 120 is considered a max score for packages that don't support web, even though adding web support would bump the score to 130. It is still considered a "max" by pana,

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.

It seems like the other packages lose points for, among other things, a dev dependency on unpublished package amplify_test. Any ideas for how to resolve that? Without fixing that, it seems we will either a) have to use only in authenticator b) change the exit-code-threshold to 10 (I think?) to basically ignore that loss of points.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't know off the top of my head. If we cannot figure out how to address that, we could set the threshold to 10, or set different threshold per package.

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.

ok, makes sense. For this PR, I would either

a) merge it like this and figure it out when we add other plugins
b) do this now for any packages that can be published with threshold of 10 or 0.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I updated the PR to use a different threshold for each plugin. The one quirk with this is that the threshold is now in the CI job name. That means we will have to change the list of required jobs each time we adjust the threshold. I think thats fine though as it shouldn't be changed frequently.

# "amplify_analytics_pinpoint",
# "amplify_api",
# "amplify_auth_cognito",
# "amplify_core",
# "amplify_datastore",
# "amplify_flutter",
# "amplify_storage_s3",
]
- unit_test_flutter:
matrix:
parameters:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import 'dart:async';
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
import 'package:amplify_flutter/amplify_flutter.dart';
import 'package:collection/collection.dart';
import 'package:collection/src/iterable_extensions.dart';

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removing this was needed to get the authenticator to a max pub score

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.

I'm assuming it was superfluous and we had access to the extensions via collection.dart?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Correct


abstract class AuthService {
Future<SignInResult> signIn(String username, String password);
Expand Down