Skip to content

Conversation

@dondonz
Copy link
Member

@dondonz dondonz commented Mar 22, 2024

Backporting #3539 for 21.x. The difficulty is that there were major changes in ExecutableNormalizedOperationFactory in preparation for the new defer feature in v22.

The changes in PR #3539 are harder and riskier to pull into the old ExecutableNormalizedOperationFactory structure. I propose it is safer to update 21.x (and prior versions) to the new file structure

I want to have another close look at this PR with fresh eyes because this is a complicated cherry pick. Here's an early look and we'll get the build going

import graphql.schema.GraphQLNamedOutputType;
import graphql.schema.GraphQLObjectType;
import graphql.schema.GraphQLSchema;
import graphql.schema.GraphQLType;
Copy link
Member Author

Choose a reason for hiding this comment

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

Git is extremely confused by the diff in this file. All other files are pretty much the result of Git cherry pick - this one is the only problematic one

There were major structural changes to this file to prepare for the defer feature to be released in v22. Of course Git can't work out what to do

Instead I've copy pasted the file from master, and deleted any defer references. This is essentially a copy of the non-defer pathway in master.

Copy link
Member

Choose a reason for hiding this comment

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

I think this is a good idea. So basically this is master code without the defer code added. Seems like a great idea.

The tests have not been changed AND they all pass so great approach

import graphql.Assert;

import java.io.File;
import java.io.BufferedReader;
Copy link
Member Author

Choose a reason for hiding this comment

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

This file was changed in another PR due to be included in the forthcoming v22 release. We have to backport this too.

Map<String, FragmentDefinition> fragments,
CoercedVariables coercedVariableValues,
Options options) {
return new ExecutableNormalizedOperationFactoryImpl(
Copy link
Member Author

Choose a reason for hiding this comment

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

Structural change - a ExecutableNormalizedOperationFactoryImpl was added after v21.x, in preparation for defer

return groupByCommonParentsNoDeferSupport(fields);
}

private List<CollectedFieldGroup> groupByCommonParentsNoDeferSupport(Collection<CollectedField> fields) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Keeping in the "no defer" method in

Balance between wanting to make this file look like master (and reduce risk of bad cherry pick) and then having this odd sounding method talking about a feature in the future

I opted for safety

int maxLevel) {
if (curLevel > maxLevel) {
throw new AbortExecutionException("Maximum query depth exceeded " + curLevel + " > " + maxLevel);
private static class ExecutableNormalizedOperationFactoryImpl {
Copy link
Member Author

Choose a reason for hiding this comment

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

New static class introduced to assist with new defer feature

@dondonz dondonz added this to the 21.5 milestone Mar 22, 2024
Copy link
Member

@bbakerman bbakerman left a comment

Choose a reason for hiding this comment

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

Yupp - ENF has great tests and this is passing. I like the approach taken

@dondonz dondonz changed the title WIP 21.x backport of #3539 ENF restriction for introspection 21.x backport of #3539 ENF restriction for introspection Mar 25, 2024
@dondonz dondonz merged commit 25667a1 into 21.x Mar 26, 2024
@dondonz dondonz deleted the 21.x-backport-enf-introspection branch March 26, 2024 05:07
github-merge-queue bot referenced this pull request in camunda/camunda Apr 23, 2024
…#17666)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[com.graphql-java:graphql-java](https://togithub.com/graphql-java/graphql-java)
| `21.4` -> `21.5` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/com.graphql-java:graphql-java/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/com.graphql-java:graphql-java/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/com.graphql-java:graphql-java/21.4/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/com.graphql-java:graphql-java/21.4/21.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>graphql-java/graphql-java
(com.graphql-java:graphql-java)</summary>

###
[`v21.5`](https://togithub.com/graphql-java/graphql-java/releases/tag/v21.5):
21.5

[Compare
Source](https://togithub.com/graphql-java/graphql-java/compare/v21.4...v21.5)

This is a special release to add further limits to introspection
queries.

This release contains a backport of PR
[#&#8203;3539](https://togithub.com/graphql-java/graphql-java/issues/3539).

#### What's Changed

- 21.x backport of
[#&#8203;3539](https://togithub.com/graphql-java/graphql-java/issues/3539)
ENF restriction for introspection by
[@&#8203;dondonz](https://togithub.com/dondonz) in
[https://github.com/graphql-java/graphql-java/pull/3540](https://togithub.com/graphql-java/graphql-java/pull/3540)

**Full Changelog**:
graphql-java/graphql-java@v21.4...v21.5

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 10pm every weekday,before 6am
every weekday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/camunda/zeebe).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWVyZ2UiXX0=-->
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.

3 participants