Skip to content

chore: Fix deprecations and tests for symfony 6, graphqlite 6 and php8.1 #174

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

Merged
merged 6 commits into from
Jun 25, 2023

Conversation

aszenz
Copy link
Contributor

@aszenz aszenz commented Jun 22, 2023

Can be merged in #166

@aszenz aszenz mentioned this pull request Jun 22, 2023
@nguyenk
Copy link
Member

nguyenk commented Jun 22, 2023

Hello @aszenz thank you alot. PHPUnit tests are failing : https://github.com/thecodingmachine/graphqlite-bundle/actions/runs/5342663710/jobs/9686120137?pr=174

I'd be more then glad to merge once this passes. would ou find the time and strength to fix it ?

@aszenz
Copy link
Contributor Author

aszenz commented Jun 23, 2023

Fixing tests for validator pkg first in thecodingmachine/graphqlite-symfony-validator-bridge#67

@nguyenk
Copy link
Member

nguyenk commented Jun 23, 2023

@aszenz just merged it !

aszenz added 5 commits June 24, 2023 07:12
+ Fix MyException to use GraphQLInterface
Pass enabled argument to service
extensions automatically now
for latest webonyx graphql pkg

+ Use built in sort types option
+ Fix for subscription error
@@ -72,7 +72,7 @@ function($namespace): string {
$container->setParameter('graphqlite.namespace.types', $namespaceType);
$container->setParameter('graphqlite.security.enable_login', $enableLogin);
$container->setParameter('graphqlite.security.enable_me', $enableMe);
$container->setParameter('graphqlite.security.introspection', $config['security']['introspection'] ?? true);
$container->setParameter('graphqlite.security.disableIntrospection', !($config['security']['introspection'] ?? true));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reason for inverting the logic here is because i had to pass this argument to the service DisableIntrospection which now takes $enabled as argument which needs to be true for disabling introspection

@@ -457,7 +457,7 @@ public function testWithIntrospection(): void

public function testDisableIntrospection(): void
{
$kernel = new GraphQLiteTestingKernel(true, null, true, null, false, 2, 2);
$kernel = new GraphQLiteTestingKernel(true, null, true, null, false, 3, 2);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess the webonyx pkg changed how they calculate complexity, it was now failing on 2 raised it to 3

@@ -34,7 +34,7 @@
"require-dev": {
"symfony/security-bundle": "^6",
"symfony/yaml": "^6",
"beberlei/porpaginas": "^1.2",
"beberlei/porpaginas": "^1.2 || ^2.0",
Copy link
Contributor Author

@aszenz aszenz Jun 24, 2023

Choose a reason for hiding this comment

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

Allowed v2, v2 fixed some deprecation's on php 8.1, I couldn't find any breaking change that could affect this pkg.

We could remove support for v1 also

@aszenz
Copy link
Contributor Author

aszenz commented Jun 24, 2023

@nguyenk Fixed all the tests

@@ -72,7 +72,7 @@ function($namespace): string {
$container->setParameter('graphqlite.namespace.types', $namespaceType);
$container->setParameter('graphqlite.security.enable_login', $enableLogin);
$container->setParameter('graphqlite.security.enable_me', $enableMe);
$container->setParameter('graphqlite.security.introspection', $config['security']['introspection'] ?? true);
$container->setParameter('graphqlite.security.disableIntrospection', !($config['security']['introspection'] ?? true));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
$container->setParameter('graphqlite.security.disableIntrospection', !($config['security']['introspection'] ?? true));
$container->setParameter('graphqlite.security.disable_introspection', !($config['security']['introspection'] ?? true));

@@ -74,7 +74,9 @@
</call>
</service>

<service id="GraphQL\Validator\Rules\DisableIntrospection" />
<service id="GraphQL\Validator\Rules\DisableIntrospection">
<argument key="$enabled">%graphqlite.security.disableIntrospection%</argument>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
<argument key="$enabled">%graphqlite.security.disableIntrospection%</argument>
<argument key="$enabled">%graphqlite.security.disable_introspection%</argument>

@aszenz aszenz changed the title chore: Fix deprecations for symfony 6 and php8.2 chore: Fix deprecations and tests for symfony 6 and php8.1 Jun 24, 2023
@aszenz aszenz changed the title chore: Fix deprecations and tests for symfony 6 and php8.1 chore: Fix deprecations and tests for symfony 6, graphqlite 6 and php8.1 Jun 24, 2023
@nguyenk nguyenk merged commit 6ddc70d into thecodingmachine:6.0 Jun 25, 2023
@nguyenk
Copy link
Member

nguyenk commented Jun 25, 2023

Awsome job @aszenz thank you

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