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

adding fields for #894 #896

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

K-ETFreeman
Copy link

solves #894

Copy link
Member

@Sheikah45 Sheikah45 left a comment

Choose a reason for hiding this comment

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

Can you add the integration tests to check the permissions for updates works for these fields.

@K-ETFreeman
Copy link
Author

Can you add the integration tests to check the permissions for updates works for these fields.

You mean writing another .java file like this?
image
MatchmakerQueueMapPoolElideTest.java?

@Sheikah45
Copy link
Member

Yes

@K-ETFreeman
Copy link
Author

MatchmakerQueueMapPoolElideTest.java

i also should probably write prepMatchmakerQueueMapPoolData.sql then

@K-ETFreeman
Copy link
Author

seeing -- matchmaker_queue is populated by R__070_matchmaker_queue.sql from Flyway comment tho, not sure

@K-ETFreeman
Copy link
Author

Yes

image
hm
where API gets data about db schema? i was thinking from commons but seems like not

@Brutus5000
Copy link
Member

private static final GenericContainer<?> flywayMigrationsContainer = new GenericContainer<>("faforever/faf-db-migrations:v133");

@Brutus5000
Copy link
Member

And at runtime here

schema-version: ${DATABASE_SCHEMA_VERSION:133}

Brutus5000
Brutus5000 previously approved these changes Dec 3, 2024
@Brutus5000 Brutus5000 dismissed Sheikah45’s stale review December 3, 2024 18:00

Test have been added

@Brutus5000
Copy link
Member

I have no clue why the java commons project doesn't work anymore

@Ivan-Shaml
Copy link
Contributor

Ivan-Shaml commented Dec 24, 2024

I have no clue why the java commons project doesn't work anymore

Hi, I see a pattern here, If you take a look at the recent failing PRs for the faf-java-api (e.g. the dependa-bot ones for bumping up spring boot to 3.4.1 and Elide to 7.1.4), they all fail on this particular unit test - com.faforever.api.deployment.ExeUploaderControllerTest#testBadRequestUploadFileWithWrongExeExtension

The common between them and this PR is that they bring a change to the class path, by transitively adding a higher version of jackson (this PR as well because it points to a newer version (see the build.gradle change) of the faf-java-commons which has jackson = "2.18.1")

The actual issue boils down to, when Jackson tries to serialize the error response JSON produced by the ControllerAdvice/GlobalExceptionHandler -

Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Conflicting property-based creators: already had explicit creator [constructor for `com.faforever.api.error.ErrorResult` (5 args), annotations: {interface java.beans.ConstructorProperties=@java.beans.ConstructorProperties({"httpStatusCode", "title", "detail", "appCode", "meta"})}, encountered another: [constructor for `com.faforever.api.error.ErrorResult` (3 args), annotations: {interface java.beans.ConstructorProperties=@java.beans.ConstructorProperties({"httpStatusCode", "title", "detail"})} (through reference chain: com.faforever.api.error.ErrorResponse["errors"]->java.util.ArrayList[0])
	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1328)
	at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1475)
	at com.fasterxml.jackson.databind.SerializerProvider.findContentValueSerializer(SerializerProvider.java:811)
	at com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap.findAndAddSecondarySerializer(PropertySerializerMap.java:90)
	at com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase._findAndAddDynamic(AsArraySerializerBase.java:314)
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serializeContents(IndexedListSerializer.java:115)
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:79)
	at com.fasterxml.jackson.databind.ser.impl.IndexedListSerializer.serialize(IndexedListSerializer.java:18)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:732)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:770)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:184)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:502)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:341)
	at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1583)
	at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1061)
	at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:486)
	... 153 common frames omitted

@Ivan-Shaml
Copy link
Contributor

Fixed the problematic class, from the exception in my previous comment in this new PR - #918
I recommend to rebase the spring boot 3.4 PR and this one, when #918 gets merged

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.

4 participants