-
Notifications
You must be signed in to change notification settings - Fork 101
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
Add Boolean fields to Data classes for supporting sparse update #664
Add Boolean fields to Data classes for supporting sparse update #664
Conversation
graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/CodeGen.kt
Outdated
Show resolved
Hide resolved
graphql-dgs-codegen-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/CodeGenCli.kt
Outdated
Show resolved
Hide resolved
...en-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/DataTypeGenerator.kt
Outdated
Show resolved
Hide resolved
...en-core/src/main/kotlin/com/netflix/graphql/dgs/codegen/generators/java/DataTypeGenerator.kt
Outdated
Show resolved
Hide resolved
graphql-dgs-codegen-core/src/test/kotlin/com/netflix/graphql/dgs/codegen/CodeGenTest.kt
Outdated
Show resolved
Hide resolved
Hi @srinivasankavitha Can you take a look at the PR |
|
Thanks @srinivasankavitha. I am also working on updating Kotlin codegen. |
yeah that flag is specific to kotlin2. Yes, it would be great of you can add to both since we try to maintain feature parity as much as possible. |
Sounds great, thank you 👍 |
Also, you can run |
This reverts commit cd71b3a.
Linting and some unit tests fixed, please check @srinivasankavitha |
This seems to have fixed the build now, right? I see the CI build is green. |
@srinivasankavitha Yes I was just able to validate this locally as well, this fixed the build. Please help validate and merge the PR. |
@kilink Thanks for reviewing, I have updated as per your feedback. Please check if the changes are good |
Hi @kilink @srinivasankavitha Checking in if you need anything from me before the PR can be merged |
Hi @krutikavk - we are out this week. We will take a look next week. |
@srinivasankavitha following up on this. Will you be able to review this PR? And let us know if you need any further changes to the PR |
@srinivasankavitha Thanks for approving. |
Just merged the PR. Will do a release later this week or early next week. |
Thank you |
Hi @srinivasankavitha Checking in when you are able to create a new release tag for this feature |
Hi @srinivasankavitha @kilink I see this change has been recently reverted in commit 08eb4ad. Will this be updated/released soon? Do update if there are any outstanding issues with the feature. |
Hi @krutikavk - yes, I did a release yesterday and it broke a bunch of our projects and had to rollback. I'm yet to investigate and get a good idea of the failure scenarios (there are multiple). Will post an update, so we can fix forward. At teh very least, we might need to feature flag it and disable by default since the addition of the new field is breaking tests for users that are checking strings using toString(). |
.addJavadoc(it.javadoc) | ||
.returns(builderClassName) | ||
.addStatement("this.${it.name} = ${it.name}") | ||
|
||
val fieldName = it.name | ||
val field = fields.find { it.name.contains(fieldName) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
val field = fields.find { iter-> ReservedKeywordSanitizer.sanitize(iter.name) == fieldName }
Otherwise it matches other fields that are similarly named and is incorrect.
e.g. something
and isSomethingThere
..will generate isSomething
that conflicts with isSomethingThere
field.
Also this is problematic if the field isSomething
is also there as part of the schema.
Ok so couple things that need fixing:
|
@srinivasankavitha Following up on whether you were able to figure out the issue with breaking tests at runtime. Once all necessary changes are identified, I can work on updating this on the feature. Let us know the best path to move forward |
Ok. I have a few urgent priorities to work on before I can get back into investigating this issue. In the meantime, feel free to look into the ones I've already identified when you get a chance. I'll post an update on the last when I get some time to look into it further. |
Ok, so spent quite a bit of time debugging (3) and it turns out it is the same problem as (2). The equality should not include these new isSomething fields because that fails equality checks in data loaders etc. So that shows up as a failure in tests in because there is no data. So same problem basically. So I think if we fix the 2 issues already pointed out, should be good. We should still introduce a feature flag just to disable it in case of issues where the schema has fields explicitly named 'something |
ACK @srinivasankavitha thanks for the detailed feedback. I ll update the PR this week with the following changes:
Let me know in case there is anything else that I'd need since these test cases were not covered as a part of CI build. |
Thanks @krutikavk. For (1), we just need a flag to disable. By default we still want to have the feature be enabled. Perhaps we can even change the name from The rest sounds accurate, thanks. |
@srinivasankavitha @kilink I have opened a separate PR for all changes for this PR: #697. |
Thanks @krutikavk. Heads up that I won't get to this till next week. |
Thanks @srinivasankavitha Are failed scenarios from old PR also a part of CI build now? Any way for us to do a pre-emptive check if the issue is resolved with the updated PR #697 ? |
Description
Issue: #609
Add Boolean fields to all data classes. Here is a gist of changes:
is<Field>Defined
getIs<Field>Defined
is<Field>Defined
Example of data classes created:
Thanks!
Validation
Sample schema and codegen with bitset: https://github.com/krutikavk/dgs-codegen-run