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

Get correct map key for config maps of maps, with tests #5995

Merged
merged 3 commits into from
Dec 9, 2019

Conversation

dmlloyd
Copy link
Member

@dmlloyd dmlloyd commented Dec 6, 2019

Fixes #5982

@dmlloyd
Copy link
Member Author

dmlloyd commented Dec 6, 2019

This PR includes the commit from #5989 for conflict reasons so it should stay in draft until that PR is merged.

@gsmet gsmet added this to the 1.1.0 milestone Dec 6, 2019
@gsmet
Copy link
Member

gsmet commented Dec 7, 2019

I tried to put this one on top of the PR I'm preparing and I have a test failure:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:build (default) on project quarkus-integration-test-keycloak-authorization: Failed to build a runnable JAR: Failed to augment application classes: Build failure: Build failed due to errors
[ERROR] 	[error]: Build step io.quarkus.keycloak.pep.deployment.KeycloakPolicyEnforcerBuildStep#requireBody threw an exception: java.lang.NullPointerException
[ERROR] 	at io.quarkus.keycloak.pep.deployment.KeycloakPolicyEnforcerBuildStep.isBodyClaimInformationPointDefined(KeycloakPolicyEnforcerBuildStep.java:47)
[ERROR] 	at io.quarkus.keycloak.pep.deployment.KeycloakPolicyEnforcerBuildStep.requireBody(KeycloakPolicyEnforcerBuildStep.java:30)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] 	at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] 	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
[ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
[ERROR] 	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1395)
[ERROR] 	at java.lang.Thread.run(Thread.java:748)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

@sberyozkin
Copy link
Member

sberyozkin commented Dec 7, 2019

@gsmet I'm not sure I undertand what line 47 does, it looks like it expects a key be also a key in the values map.
Actually, this code was added as part of the recent fix, but it is likely it was written that way because it was the way the key was prepared as per this bug #5982 :-)

@gsmet
Copy link
Member

gsmet commented Dec 7, 2019

Yes, I agree this code looks suspicious and is probably buggy.

Could you come up with a fix?

@sberyozkin
Copy link
Member

@gsmet Guillaume, can you please check what the value of that map is ? I don't know if it is possible to debug, may be add some temp log message...The fix should be trivial. I'll have to pick up the family...

@sberyozkin
Copy link
Member

entry.getValue().values().contains("request.body") should be enough but not 100% sure :-)

@gsmet
Copy link
Member

gsmet commented Dec 7, 2019

@sberyozkin I will have a look later tonight or tomorrow morning.

@gsmet
Copy link
Member

gsmet commented Dec 7, 2019

I rebased on top of #6005 and pushed a fix for Keycloak Authorization.

Let's see what CI think.

@sberyozkin
Copy link
Member

@gsmet thanks :-)

@gsmet
Copy link
Member

gsmet commented Dec 7, 2019

@dmlloyd I rebased on top of master but it seems the test you added doesn't pass:

Caused by: java.lang.NullPointerException
	at io.quarkus.extest.deployment.TestProcessor.checkMapMap(TestProcessor.java:464)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1395)
	at java.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

Issue reported by CI before my last rebase and reproduced locally with the last rebase.

@gsmet
Copy link
Member

gsmet commented Dec 8, 2019

@dmlloyd I pushed again my Keycloak Authorization fix on top of your commit.

@dmlloyd
Copy link
Member Author

dmlloyd commented Dec 8, 2019

Ah, didn't mean to lose it. Pushed from my phone in bed :-)

@gsmet
Copy link
Member

gsmet commented Dec 8, 2019

Looks like we still have the same issue:

Caused by: java.lang.NullPointerException
	at io.quarkus.extest.deployment.TestProcessor.checkMapMap(TestProcessor.java:464)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:915)
	at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
	at java.lang.Thread.run(Thread.java:748)
	at org.jboss.threads.JBossThread.run(JBossThread.java:479)

@gsmet gsmet added the backport? label Dec 8, 2019
@gsmet gsmet changed the title Get correct map key for config maps of maps, with tests. Get correct map key for config maps of maps, with tests Dec 9, 2019
@dmlloyd dmlloyd marked this pull request as ready for review December 9, 2019 21:09
@dmlloyd
Copy link
Member Author

dmlloyd commented Dec 9, 2019

Looks like everything is OK now.

@gsmet gsmet merged commit 1a6b842 into quarkusio:master Dec 9, 2019
@gsmet gsmet removed the backport? label Dec 9, 2019
@dmlloyd dmlloyd deleted the fix-5982 branch December 9, 2019 23:26
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.

Map config item with the map values gets the wrong keys
3 participants