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

fix(data): Gen2 hasOne associatedFields compile issue #3700

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

lawmicha
Copy link
Contributor

@lawmicha lawmicha commented May 15, 2024

Issue #

#3699 #3735

Description

This PR allows has-one to reference multiple CodingKey's of the associated model by having an associatedFieldNames, which is the extension of the single value associatedFieldName. This was a change added in Gen2's code generation logic.

The related documentation for testing can be found starting at https://docs.amplify.aws/swift/build-a-backend/data/data-modeling/relationships/#model-a-one-to-one-relationship

The tests for this documentation can be found in GraphQLCartCustomer4Tests

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
    https://github.com/aws-amplify/amplify-swift/actions/runs/9951987862
  • 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.

Base automatically changed from docs.data to main June 3, 2024 15:34
@lawmicha lawmicha force-pushed the fix.data.has-one-compile branch from b21358e to d089dba Compare June 5, 2024 20:41
@lawmicha lawmicha force-pushed the fix.data.has-one-compile branch from d089dba to 55d3f7f Compare July 16, 2024 04:50
@lawmicha lawmicha force-pushed the fix.data.has-one-compile branch from 55d3f7f to f8fd33b Compare July 16, 2024 04:56
@lawmicha lawmicha force-pushed the fix.data.has-one-compile branch from f8fd33b to 7fcb2ce Compare July 16, 2024 05:16
@lawmicha lawmicha force-pushed the fix.data.has-one-compile branch from 7fcb2ce to 58b1346 Compare July 16, 2024 05:25
@lawmicha lawmicha force-pushed the fix.data.has-one-compile branch from 58b1346 to 2cb4714 Compare July 16, 2024 05:38
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 52.63158% with 9 lines in your changes missing coverage. Please review.

Project coverage is 68.49%. Comparing base (151cac6) to head (2cb4714).
Report is 2 commits behind head on main.

Files Patch % Lines
...Model/Internal/Schema/ModelSchema+Definition.swift 0.00% 8 Missing ⚠️
...ources/AWSAPIPlugin/Core/AppSyncListProvider.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3700      +/-   ##
==========================================
- Coverage   68.54%   68.49%   -0.05%     
==========================================
  Files        1079     1079              
  Lines       37580    37591      +11     
==========================================
- Hits        25758    25749       -9     
- Misses      11822    11842      +20     
Flag Coverage Δ
API_plugin_unit_test 68.83% <0.00%> (ø)
AWSPluginsCore 68.56% <100.00%> (ø)
Amplify 47.56% <42.85%> (-0.11%) ⬇️
Analytics_plugin_unit_test 84.52% <ø> (ø)
Auth_plugin_unit_test 79.72% <ø> (+<0.01%) ⬆️
DataStore_plugin_unit_test 81.17% <100.00%> (-0.12%) ⬇️
Geo_plugin_unit_test 72.00% <ø> (ø)
Logging_plugin_unit_test 62.95% <ø> (ø)
Predictions_plugin_unit_test 37.32% <ø> (ø)
PushNotifications_plugin_unit_test 86.21% <ø> (ø)
Storage_plugin_unit_test 76.75% <ø> (ø)
unit_tests 68.49% <52.63%> (-0.05%) ⬇️

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.

@lawmicha lawmicha marked this pull request as ready for review July 16, 2024 06:38
@lawmicha lawmicha requested a review from a team as a code owner July 16, 2024 06:38
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@lawmicha lawmicha temporarily deployed to IntegrationTest July 16, 2024 06:39 — with GitHub Actions Inactive
@harsh62 harsh62 merged commit e886cf0 into main Jul 16, 2024
100 of 121 checks passed
@harsh62 harsh62 deleted the fix.data.has-one-compile branch July 16, 2024 13:07
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