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

feat(amplify): make GraphQLOperationType extends from String #3719

Merged
merged 1 commit into from
May 29, 2024

Conversation

5d
Copy link
Contributor

@5d 5d commented May 23, 2024

Issue #

During the amplify-flutter migration to datastore v2, and with SPM not yet supported by the Google Flutter framework, the Amplify Flutter team needs to copy datastore v2 and its dependency packages into the Flutter repository and build for the amplify-flutter project. The GraphQLOperationType data structure appears in both the Amplify package and the AmplifyPluginsCore package, causing a name collision. This issue did not arise in the Swift package due to different package namespaces, but it is problematic in amplify-flutter as all the code shares the same namespace.

Description

In this PR, we propose a solution to retain the GraphQLOperationType declaration in the Amplify package and extend it with a String value. The declaration in the AmplifyPluginsCore package is removed, as it is an internal package.

Is this a breaking change?

Removing the public declaration of GraphQLOperationType in the AmplifyPluginsCore package

This should not be considered a breaking change, as AmplifyPluginsCore is an internal package.

Adding a String value to the existing public declaration of GraphQLOperationType in the Amplify package

It is unclear if this qualifies as a breaking change. While adding a String value is generally considered an additive change, it does alter the definition of the public data structure.

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.65%. Comparing base (cf7fe31) to head (ea22267).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           flutter-datastore-v2    #3719      +/-   ##
========================================================
+ Coverage                 68.46%   68.65%   +0.19%     
========================================================
  Files                      1078     1078              
  Lines                     37552    37552              
========================================================
+ Hits                      25709    25783      +74     
+ Misses                    11843    11769      -74     
Flag Coverage Δ
API_plugin_unit_test 68.97% <ø> (ø)
AWSPluginsCore 68.21% <ø> (ø)
Amplify 47.85% <ø> (-0.02%) ⬇️
Analytics_plugin_unit_test 84.52% <ø> (ø)
Auth_plugin_unit_test 79.46% <ø> (+0.11%) ⬆️
DataStore_plugin_unit_test 82.24% <ø> (+0.92%) ⬆️
Geo_plugin_unit_test 72.00% <ø> (ø)
Logging_plugin_unit_test 62.87% <ø> (ø)
Predictions_plugin_unit_test 37.32% <ø> (ø)
PushNotifications_plugin_unit_test 86.21% <ø> (ø)
Storage_plugin_unit_test 76.75% <ø> (ø)
unit_tests 68.65% <ø> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:47 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 19:48 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:11 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:11 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:11 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:11 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:11 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d temporarily deployed to IntegrationTest May 23, 2024 20:12 — with GitHub Actions Inactive
@5d 5d marked this pull request as ready for review May 24, 2024 17:41
@5d 5d requested a review from a team as a code owner May 24, 2024 17:41
@5d 5d merged commit 7e5883a into flutter-datastore-v2 May 29, 2024
127 checks passed
@5d 5d deleted the 5d/name-collision branch May 29, 2024 16:50
5d added a commit that referenced this pull request Jun 3, 2024
…LBehavior (#3666)

* WIP

* DataStore compiles without SDK dependency

* refactor(datastore-v2): use api plugin with async sequences

* change to use Publisher operators for auth type streams

* add nondeterminsitc operation for better testability

* fix unit test cases

* fix broken unit test cases of AWSAPIPlugin

* fix broken AWSDataStorePlugin unit test cases

* fix OutgoingMutationQueue test case

* remove unused methods

* fix broken test cases of SyncMutationToCloudOperationTests

* fix broken unit test cases of API and DataStore

* resolve plugins build issues (#3654)

* remove lock from SyncMutationToCloudOperation

* remove test case of retryable for signOut error

* resolve comments

* fix(datastore): propagate remote mutationEvents to Hub for sync received (#3697)

* rename the package to InternalAmplifyCredentials

* rewrite NondeterminsticOperation constructor with makeStream

* resolve broken test case after merging latest orgin/main

* feat(amplify): make GraphQLOperationType extends from String (#3719)

* refactor(datastore): new enum to represent inferred and designated authType (#3694)

* refactor(datastore): new enum to represent inferred and designated auth type

* resolve failed multi auth integ tests

* resolve comments

* fix(datastore): use error description to produce clearer error info (#3733)

---------

Co-authored-by: Michael Law <[email protected]>
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.

2 participants