Skip to content
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

chore(version): bump version for v2 #4811

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion packages/aft/lib/src/command_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0

import 'package:aft/aft.dart';
import 'package:aft/src/commands/review_command.dart';
import 'package:aft/src/commands/save_repo_state_command.dart';
import 'package:args/command_runner.dart';

Expand Down Expand Up @@ -32,7 +33,8 @@ Future<void> run(List<String> args) async {
..addCommand(SaveRepoStateCommand())
..addCommand(RunCommand())
..addCommand(DocsCommand())
..addCommand(ServeCommand());
..addCommand(ServeCommand())
..addCommand(ReviewCommand());

try {
final argResults = runner.argParser.parse(args);
Expand Down
149 changes: 149 additions & 0 deletions packages/aft/lib/src/commands/review_command.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

import 'dart:convert';
import 'dart:io';

import 'package:aft/aft.dart';

class GitHubData {
GitHubData.fromJson(Map<String, dynamic> json)
: title = json['title'] as String,
body = json['body'] as String,
number = json['number'] as int,
changedFiles = json['changedFiles'] as int,
additions = json['additions'] as int,
deletions = json['deletions'] as int,
url = json['url'] as String;

String title;
String body;
int number;
int changedFiles;
int additions;
int deletions;
String url;

final String _legal =
'By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.';
final String _lineBreak = '========================================';

final emojis = {
ReviewPriority.urgent: ':alert:',
ReviewPriority.high: ':arrow_double_up:',
ReviewPriority.normal: ':arrow_up:',
ReviewPriority.low: ':arrow_down:',
};

@override
String toString() {
return '{Title: $title,\nBody: $body,\nNumber: $number,\nChanged Files: $changedFiles,\nAdditions: $additions,\nDeletions: $deletions}';
}

/// Converts the PR data to a Slack-formatted string.
String toMarkdown(ReviewPriority priority) {
return '''
$_lineBreak
${emojis[priority]} *$title - [$number]($url)*
> +$additions -$deletions | files: $changedFiles
${body.replaceAll(_legal, '').trim()}
*Reviewers:*
$_lineBreak''';
}
}

enum ReviewPriority { urgent, high, normal, low }

/// Command to clean all temporary files in the repo.
class ReviewCommand extends AmplifyCommand {
ReviewCommand() {
argParser
..addOption(
'ref',
abbr: 'r',
help:
'The PR reference. Can be a PR number or URL. Defaults to the current branch.',
)
..addOption(
'priority',
abbr: 'p',
help: 'Determines the emoji to use for the PR review.',
allowed: ReviewPriority.values.map((e) => e.name).toList(),
defaultsTo: ReviewPriority.normal.name,
);
}
@override
String get description => 'Creates PR review text for slack';

@override
String get name => 'review';

/// The PR ref to review.
late final ref = argResults?['ref'] as String? ?? '';

/// Determines the emoji to use for the PR review.
late final priority = ReviewPriority.values.firstWhere(
(e) => e.name == argResults!['priority'] as String,
orElse: () => ReviewPriority.normal,
);

/// Verifies that the PR is ready using gh CLI.
Future<void> _verifyPR(String ref) async {
final branchName = await Process.run(
'gh',
['pr', 'ready', ref],
);
if (branchName.exitCode != 0) {
final error = branchName.stderr.toString();
if (error.contains('Could not resolve to a PullRequest')) {
logger.error('A PR is not ready at ref: $ref');
} else {
logger.error('Invalid ref: $error');
}
exit(1);
}
}

/// Fetches PR data from GitHub using gh CLI.
Future<GitHubData> _getGitHubData(String ref) async {
final process = await Process.run(
'gh',
[
'pr',
'view',
ref,
'--json',
'title,body,number,changedFiles,additions,deletions,url',
],
);
if (process.exitCode != 0) {
logger.error('Could not fetch PR data from GitHub');
exit(1);
}
if (process.stdout is! String) {
logger.error('GitHub data is not a string');
exit(1);
}

final prDataJson =
jsonDecode(process.stdout as String) as Map<String, dynamic>;
final prData = GitHubData.fromJson(prDataJson);
return prData;
}

@override
Future<void> run() async {
await super.run();

await _verifyPR(ref);

final ghData = await _getGitHubData(ref);

final slackString = ghData.toMarkdown(priority);

logger
..info(slackString)
..info('After pasting into slack, press CMD+SHIFT+F to format the text.')
..info('Review output was successful!');
}
}
32 changes: 32 additions & 0 deletions packages/amplify/amplify_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## 2.0.0

We are thrilled to release version 2.0 of the Amplify Flutter libraries to add support for Amplify Gen 2. Learn more about Amplify Gen 2 at [https://docs.amplify.aws](https://docs.amplify.aws).

This release enables flexible storage paths when using Amplify Gen 2 Storage. This release also addresses several bugs that required breaking changes to resolve. See the change log below for the full list of updates.

If you are upgrading an existing project using Amplify Flutter v1 (created with Amplify Gen 1 CLI or a custom pipeline) please see the [upgrade guide](https://docs.amplify.aws/gen1/flutter/start/project-setup/upgrade-guide/).

As always, you can find us on [GitHub](https://github.com/aws-amplify/amplify-flutter/) and [Discord](https://discord.gg/jWVbPfC) to answer any questions.

### Breaking Changes
- chore(auth)!: remove deprecated auth types ([#4764](https://github.com/aws-amplify/amplify-flutter/pull/4764))
- fix(auth)!: regenerate cognito sdks to update signup operation for adding limit exceeded exception ([#4781](https://github.com/aws-amplify/amplify-flutter/pull/4781))
- chore(analytics)!: remove deprecated apis
- chore(api)!: Model .fromJson() Refactor ([#4665](https://github.com/aws-amplify/amplify-flutter/pull/4665))
- chore(api)!: Removed deprecated members … ([#4772](https://github.com/aws-amplify/amplify-flutter/pull/4772))
- chore(api)!: remove Model.getId() usages ([#4774](https://github.com/aws-amplify/amplify-flutter/pull/4774))
- chore(core)!: make asyncConfig internal
- chore(core)!: removed toJson fallback ([#4793](https://github.com/aws-amplify/amplify-flutter/pull/4793))
- feat(core)!: use plugin options for optional plugin parameters ([#4762](https://github.com/aws-amplify/amplify-flutter/pull/4762))
- feat(smithy)!: remove error match on http status code ([#4750](https://github.com/aws-amplify/amplify-flutter/pull/4750))
- feat(storage)!: Update storage APIs to accept `StoragePath` ([#4713](https://github.com/aws-amplify/amplify-flutter/pull/4713))
- feat(storage)!: move `delimiter` to `S3ListPluginOptions` ([#4773](https://github.com/aws-amplify/amplify-flutter/pull/4773))
- chore(storage)!: rename StorageNotFoundException ([#4770](https://github.com/aws-amplify/amplify-flutter/pull/4770))

### Features
- feat(api): Add attributeExists query predicate ([#4134](https://github.com/aws-amplify/amplify-flutter/pull/4134))

### Fixes
- fix(auth): Android Intent URI Query Parameter Parsing ([#4546](https://github.com/aws-amplify/amplify-flutter/pull/4546))
- fix(auth): map Lambda exceptions correctly ([#4804](https://github.com/aws-amplify/amplify-flutter/pull/4804))

## 1.8.0

NOTE: This version has been updated to:
Expand Down
8 changes: 4 additions & 4 deletions packages/amplify/amplify_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: amplify_flutter
description: The top level Flutter package for the AWS Amplify libraries.
version: 1.8.0
version: 2.0.0
homepage: https://docs.amplify.aws/lib/q/platform/flutter/
repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify/amplify_flutter
issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues
Expand All @@ -19,9 +19,9 @@ platforms:
web:

dependencies:
amplify_core: ">=1.8.0 <1.9.0"
amplify_secure_storage: ">=0.4.3 <0.5.0"
aws_common: ">=0.6.4 <0.7.0"
amplify_core: ">=2.0.0 <2.1.0"
amplify_secure_storage: ">=0.5.1 <0.6.0"
aws_common: ">=0.7.0 <0.8.0"
collection: ^1.15.0
flutter:
sdk: flutter
Expand Down
32 changes: 32 additions & 0 deletions packages/amplify_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
## 2.0.0

We are thrilled to release version 2.0 of the Amplify Flutter libraries to add support for Amplify Gen 2. Learn more about Amplify Gen 2 at [https://docs.amplify.aws](https://docs.amplify.aws).

This release enables flexible storage paths when using Amplify Gen 2 Storage. This release also addresses several bugs that required breaking changes to resolve. See the change log below for the full list of updates.

If you are upgrading an existing project using Amplify Flutter v1 (created with Amplify Gen 1 CLI or a custom pipeline) please see the [upgrade guide](https://docs.amplify.aws/gen1/flutter/start/project-setup/upgrade-guide/).

As always, you can find us on [GitHub](https://github.com/aws-amplify/amplify-flutter/) and [Discord](https://discord.gg/jWVbPfC) to answer any questions.

### Breaking Changes
- chore(auth)!: remove deprecated auth types ([#4764](https://github.com/aws-amplify/amplify-flutter/pull/4764))
- fix(auth)!: regenerate cognito sdks to update signup operation for adding limit exceeded exception ([#4781](https://github.com/aws-amplify/amplify-flutter/pull/4781))
- chore(analytics)!: remove deprecated apis
- chore(api)!: Model .fromJson() Refactor ([#4665](https://github.com/aws-amplify/amplify-flutter/pull/4665))
- chore(api)!: Removed deprecated members … ([#4772](https://github.com/aws-amplify/amplify-flutter/pull/4772))
- chore(api)!: remove Model.getId() usages ([#4774](https://github.com/aws-amplify/amplify-flutter/pull/4774))
- chore(core)!: make asyncConfig internal
- chore(core)!: removed toJson fallback ([#4793](https://github.com/aws-amplify/amplify-flutter/pull/4793))
- feat(core)!: use plugin options for optional plugin parameters ([#4762](https://github.com/aws-amplify/amplify-flutter/pull/4762))
- feat(smithy)!: remove error match on http status code ([#4750](https://github.com/aws-amplify/amplify-flutter/pull/4750))
- feat(storage)!: Update storage APIs to accept `StoragePath` ([#4713](https://github.com/aws-amplify/amplify-flutter/pull/4713))
- feat(storage)!: move `delimiter` to `S3ListPluginOptions` ([#4773](https://github.com/aws-amplify/amplify-flutter/pull/4773))
- chore(storage)!: rename StorageNotFoundException ([#4770](https://github.com/aws-amplify/amplify-flutter/pull/4770))

### Features
- feat(api): Add attributeExists query predicate ([#4134](https://github.com/aws-amplify/amplify-flutter/pull/4134))

### Fixes
- fix(auth): Android Intent URI Query Parameter Parsing ([#4546](https://github.com/aws-amplify/amplify-flutter/pull/4546))
- fix(auth): map Lambda exceptions correctly ([#4804](https://github.com/aws-amplify/amplify-flutter/pull/4804))

## 1.8.0

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify_core/lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/amplify_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: amplify_core
description: The base package containing common types and utilities that are shared across the Amplify Flutter packages.
version: 1.8.0
version: 2.0.0
homepage: https://docs.amplify.aws/lib/q/platform/flutter/
repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_core
issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues
Expand All @@ -10,8 +10,8 @@ environment:

dependencies:
async: ^2.10.0
aws_common: ">=0.6.4 <0.7.0"
aws_signature_v4: ">=0.5.2 <0.6.0"
aws_common: ">=0.7.0 <0.8.0"
aws_signature_v4: ">=0.6.0 <0.7.0"
collection: ^1.15.0
graphs: ^2.1.0
intl: ">=0.18.0 <1.0.0"
Expand Down
17 changes: 17 additions & 0 deletions packages/amplify_datastore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
## 2.0.0

We are thrilled to release version 2.0 of the Amplify Flutter libraries to add support for Amplify Gen 2. Learn more about Amplify Gen 2 at [https://docs.amplify.aws](https://docs.amplify.aws).

If you are upgrading an existing project using Amplify Flutter v1 (created with Amplify Gen 1 CLI or a custom pipeline) please see the [upgrade guide](https://docs.amplify.aws/gen1/flutter/start/project-setup/upgrade-guide/).

As always, you can find us on [GitHub](https://github.com/aws-amplify/amplify-flutter/) and [Discord](https://discord.gg/jWVbPfC) to answer any questions.

### Breaking Changes
- chore!: Model .fromJson() Refactor ([#4665](https://github.com/aws-amplify/amplify-flutter/pull/4665))
- chore!: Removed deprecated members … ([#4772](https://github.com/aws-amplify/amplify-flutter/pull/4772))
- chore!: remove Model.getId() usages ([#4774](https://github.com/aws-amplify/amplify-flutter/pull/4774))
- feat!: use plugin options for optional plugin parameters ([#4762](https://github.com/aws-amplify/amplify-flutter/pull/4762))

### Features
- feat: Add attributeExists query predicate ([#4134](https://github.com/aws-amplify/amplify-flutter/pull/4134))

## 1.8.0

### Features
Expand Down
6 changes: 3 additions & 3 deletions packages/amplify_datastore/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: amplify_datastore
description: The Amplify Flutter DataStore category plugin, providing a queryable, on-device data store.
version: 1.8.0
version: 2.0.0
homepage: https://docs.amplify.aws/lib/q/platform/flutter/
repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_datastore
issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues
Expand All @@ -12,8 +12,8 @@ environment:
dependencies:
flutter:
sdk: flutter
amplify_datastore_plugin_interface: ">=1.8.0 <1.9.0"
amplify_core: ">=1.8.0 <1.9.0"
amplify_datastore_plugin_interface: ">=2.0.0 <2.1.0"
amplify_core: ">=2.0.0 <2.1.0"
plugin_platform_interface: ^2.0.0
meta: ^1.7.0
collection: ^1.14.13
Expand Down
4 changes: 4 additions & 0 deletions packages/amplify_datastore_plugin_interface/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.0

- Minor bug fixes and improvements

## 1.8.0

### Features
Expand Down
4 changes: 2 additions & 2 deletions packages/amplify_datastore_plugin_interface/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: amplify_datastore_plugin_interface
description: The platform interface for the DataStore module of Amplify Flutter.
version: 1.8.0
version: 2.0.0
homepage: https://docs.amplify.aws/lib/q/platform/flutter/
repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/amplify_datastore_plugin_interface
issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues
Expand All @@ -10,7 +10,7 @@ environment:
flutter: ">=3.19.0"

dependencies:
amplify_core: ">=1.8.0 <1.9.0"
amplify_core: ">=2.0.0 <2.1.0"
collection: ^1.15.0
flutter:
sdk: flutter
Expand Down
11 changes: 11 additions & 0 deletions packages/analytics/amplify_analytics_pinpoint/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 2.0.0

We are thrilled to release version 2.0 of the Amplify Flutter libraries to add support for Amplify Gen 2. Learn more about Amplify Gen 2 at [https://docs.amplify.aws](https://docs.amplify.aws).

If you are upgrading an existing project using Amplify Flutter v1 (created with Amplify Gen 1 CLI or a custom pipeline) please see the [upgrade guide](https://docs.amplify.aws/gen1/flutter/start/project-setup/upgrade-guide/).

As always, you can find us on [GitHub](https://github.com/aws-amplify/amplify-flutter/) and [Discord](https://discord.gg/jWVbPfC) to answer any questions.

### Breaking Changes
- feat!: use plugin options for optional plugin parameters ([#4762](https://github.com/aws-amplify/amplify-flutter/pull/4762))

## 1.8.0

### Features
Expand Down
12 changes: 6 additions & 6 deletions packages/analytics/amplify_analytics_pinpoint/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: amplify_analytics_pinpoint
description: The Amplify Flutter Analytics category plugin using the AWS Pinpoint provider.
version: 1.8.0
version: 2.0.0
homepage: https://docs.amplify.aws/lib/q/platform/flutter/
repository: https://github.com/aws-amplify/amplify-flutter/tree/main/packages/analytics/amplify_analytics_pinpoint
issue_tracker: https://github.com/aws-amplify/amplify-flutter/issues
Expand All @@ -19,11 +19,11 @@ platforms:
web:

dependencies:
amplify_analytics_pinpoint_dart: ">=0.3.8 <0.4.0"
amplify_core: ">=1.8.0 <1.9.0"
amplify_db_common: ">=0.3.6 <0.4.0"
amplify_secure_storage: ">=0.4.3 <0.5.0"
aws_common: ">=0.6.4 <0.7.0"
amplify_analytics_pinpoint_dart: ">=0.4.0 <0.5.0"
amplify_core: ">=2.0.0 <2.1.0"
amplify_db_common: ">=0.4.0 <0.5.0"
amplify_secure_storage: ">=0.5.1 <0.6.0"
aws_common: ">=0.7.0 <0.8.0"
device_info_plus: ^10.0.1
flutter:
sdk: flutter
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.4.0

### Breaking Changes
- feat!: use plugin options for optional plugin parameters ([#4762](https://github.com/aws-amplify/amplify-flutter/pull/4762))

## 0.3.8

### Features
Expand Down
Loading
Loading