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

PANGOLIN-3193 - New package for model: Type #453

Merged
merged 56 commits into from
Jan 5, 2024

Conversation

jmcreasman
Copy link
Contributor

@jmcreasman jmcreasman commented Dec 20, 2023

This PR consists of:

  • a new Type folder with the basic resource models: Type/TypeDraft
  • a FieldDefinition model needed to support Type
  • 15 CustomFieldType models needed to support FieldDefinition
  • minor edits to State (removing unused imports)

Please note there is a LOT of scaffolding (particularly around graphQL related types) so that when/if those are needed the setup is there but this PR/ticket is focussed around what's needed for the e2e tests in AuditLog.

Happy to answer any questions

Copy link

changeset-bot bot commented Dec 20, 2023

🦋 Changeset detected

Latest commit: 050c814

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 33 packages
Name Type
@commercetools-test-data/state Minor
@commercetools-test-data/type Minor
@commercetools-test-data/core Minor
@commercetools-test-data/graphql-types Minor
@commercetools-test-data/associate-role Minor
@commercetools-test-data/business-unit Minor
@commercetools-test-data/cart-discount Minor
@commercetools-test-data/cart Minor
@commercetools-test-data/category Minor
@commercetools-test-data/channel Minor
@commercetools-test-data/commons Minor
@commercetools-test-data/custom-object Minor
@commercetools-test-data/custom-view Minor
@commercetools-test-data/customer-group Minor
@commercetools-test-data/customer Minor
@commercetools-test-data/discount-code Minor
@commercetools-test-data/inventory-entry Minor
@commercetools-test-data/order Minor
@commercetools-test-data/payment Minor
@commercetools-test-data/product-discount Minor
@commercetools-test-data/product-selection Minor
@commercetools-test-data/product-type Minor
@commercetools-test-data/product Minor
@commercetools-test-data/quote-request Minor
@commercetools-test-data/quote Minor
@commercetools-test-data/review Minor
@commercetools-test-data/shipping-method Minor
@commercetools-test-data/shopping-list Minor
@commercetools-test-data/staged-quote Minor
@commercetools-test-data/store Minor
@commercetools-test-data/tax-category Minor
@commercetools-test-data/zone Minor
@commercetools-test-data/utils Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jmcreasman jmcreasman marked this pull request as ready for review December 20, 2023 20:16
@valoriecarli valoriecarli force-pushed the PANGOLIN-3193-type-model branch from dacd127 to c7012fb Compare December 20, 2023 21:44
@valoriecarli valoriecarli force-pushed the PANGOLIN-3193-type-model branch from 59f6864 to c015cc2 Compare January 4, 2024 21:24

const transformers = {
default: Transformer<TTypeDraft, TTypeDraft>('default', {
buildFields: ['name', 'description'],
Copy link
Contributor

Choose a reason for hiding this comment

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

@jmcreasman bippity

default: Transformer<TTypeDraft, TTypeDraft>('default', {
buildFields: ['name', 'description'],
}),
rest: Transformer<TTypeDraft, TTypeDraft>('rest', {
Copy link
Contributor

Choose a reason for hiding this comment

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

@jmcreasman boppity

}),
// Note that the TypeDraft graphql is provided as scaffolding only and may not be complete at this time.
graphql: Transformer<TTypeDraft, TTypeDraftGraphql>('graphql', {
buildFields: ['name', 'description'],
Copy link
Contributor

@valoriecarli valoriecarli Jan 4, 2024

Choose a reason for hiding this comment

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

@jmcreasman boop

Please add fieldDefinitions to the build fields here, as well as for the final/parent.
TL;DR - If a generator references another model, it will need to be added here... or you will be disappointed later when looking for results. Please see the slack thread regarding this.

Your test passes, but if you force it to fail and look into it, you'll see the issue. This will in turn provide a shape that will error out when called.

Screenshot 2024-01-04 at 15 42 06

Copy link
Contributor

@valoriecarli valoriecarli left a comment

Choose a reason for hiding this comment

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

I will go ahead and approve, but please don't forget to update both transformers as requested before merging.

Really appreciate you taking this one on. I know it was....a bit much. A lot of the grunt work is now complete, and others can come back in for minor tweaks. 💯

@jmcreasman jmcreasman merged commit 60490aa into main Jan 5, 2024
3 checks passed
@jmcreasman jmcreasman deleted the PANGOLIN-3193-type-model branch January 5, 2024 14:18
@ct-changesets ct-changesets bot mentioned this pull request Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants