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

bug: Changed behaviour of spring.autoconfigure.exclude since com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter:8.5.4 #2032

Open
edee111 opened this issue Oct 11, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@edee111
Copy link

edee111 commented Oct 11, 2024

I wanted to upgrade DGS to the latest version 9.1.2. So I changed the dependency in Gradle:

  • from com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:8.5.8
  • to com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter:9.1.2

But then when starting an application there is a deprecation warning in the log

DEPRECATION WARNING - This project is using the deprecated 'graphql-dgs-spring-boot-starter'. Please switch to 'graphql-dgs-spring-graphql-starter'. For more context: https://netflix.github.io/dgs/spring-graphql-integration

But when changing the dependency to com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter:9.1.2, some unit tests stopped working. See the details bellow.

Expected behavior

When overriding the Spring Boot (SB) property spring.autoconfigure.exclude e.g. in a unit test by the @TestProperties annotation, the value set in the annotation should be present in the application context.

Actual behavior

Setting the spring.autoconfigure.exclude e.g. in unit test by the @TestProperties appends the value to the configuration property already defined e.g. in application.yaml file. Does not override it.

Steps to reproduce

In this repository, the issue is reproduced.
Experiments in the repository show that:

  • with com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter
    • the autoconfiguration exclusion behaves as expected
  • with com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter
    • until DGS version 8.5.3 autoconfiguration exclusion behaves as expected
    • since DGS version 8.5.4 autoconfiguration exclusion behavior changed

More info

I checked the commits between those two versions, and it seems that the cause of this new behavior could be the class com.netflix.graphql.dgs.springgraphql.autoconfig.ExcludeAutoConfigurationsEnvironmentPostProcessor. It manipulates the spring.autoconfigure.exclude property in some way. Also, this class is not present in com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter but is present in com.netflix.graphql.dgs:graphql-dgs-spring-graphql-starter which also supports my assumption.

In my project, I need to exclude some autoconfiguration for all unit tests, but in some cases, I want to keep it included and that is why I changed the spring.autoconfigure.exclude just for a few tests out of thousands.

@edee111 edee111 added the bug Something isn't working label Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants