-
Notifications
You must be signed in to change notification settings - Fork 132
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
[incubator-kie-issues-834] Support Dynamic GraphQL query registering in Data Audit #1962
Conversation
} | ||
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what users might need here is an additional DELETE endpoint to clean up any queries that have been incorrectly registered or are no longer needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be addressed in another issue.
data-audit/data-audit-common/src/main/java/org/kie/kogito/app/audit/api/SubsystemConstants.java
Outdated
Show resolved
Hide resolved
data-audit/data-audit-common/src/main/java/org/kie/kogito/app/audit/api/SubsystemConstants.java
Outdated
Show resolved
Hide resolved
...t/data-audit-common/src/main/java/org/kie/kogito/app/audit/graphql/GraphQLSchemaManager.java
Outdated
Show resolved
Hide resolved
...t/data-audit-common/src/main/java/org/kie/kogito/app/audit/graphql/GraphQLSchemaManager.java
Outdated
Show resolved
Hide resolved
...t/data-audit-common/src/main/java/org/kie/kogito/app/audit/graphql/GraphQLSchemaManager.java
Outdated
Show resolved
Hide resolved
...-audit-quarkus/src/main/java/org/kie/kogito/app/audit/quarkus/GraphQLJPADataAuditRouter.java
Outdated
Show resolved
Hide resolved
...data-audit-common/src/main/java/org/kie/kogito/app/audit/api/DataAuditStoreProxyService.java
Show resolved
Hide resolved
.../src/main/resources/db/data-audit/postgresql/V1.1.0__Add Query audit dynamic registering.sql
Outdated
Show resolved
Hide resolved
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-apps -u #1962 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution Please look here: https://ci-builds.apache.org/job/KIE/job/test/job/mcimbalek/job/kogito/job/main/job/pullrequest_jobs/job/kogito-apps-pr/job/PR-1962/4/display/redirect Test results:
Those are the test failures: org.kie.kogito.app.audit.quarkus.QuarkusAuditQueryRegistryServiceTest.testRegisterQueryWithDateTimeExpected size: 1 but was: 6 in: [{"eventDate"="2024-01-24T15:03:31.385Z", "eventId"="15ba01c1-2152-4699-9243-dd6c91315e0f"}, {"eventDate"="2024-01-24T15:03:32.275Z", "eventId"="47755a29-3373-4f61-a050-ff981c58145f"}, {"eventDate"="2024-01-24T15:03:31.438Z", "eventId"="7efb595a-58a4-4d5f-bd81-b0a1752d6733"}, {"eventDate"="2024-01-24T15:03:31.442Z", "eventId"="a81f8c5e-899a-47ce-bb4c-7bc439c48cae"}, {"eventDate"="2024-01-24T15:03:31.445Z", "eventId"="ae6f9ea7-0510-41a7-b099-ab3d8215b9a7"}, {"eventDate"="2024-01-24T15:03:31.457Z", "eventId"="283f92be-244f-41c0-b9af-25ec0d84b955"}] |
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-apps -u #1962 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-apps-pr/job/PR-1962/5/display/redirect Test results:
Those are the test failures: org.kie.kogito.app.audit.quarkus.QuarkusAuditQueryRegistryServiceTest.testRegisterQueryWithDateTimeExpected size: 1 but was: 6 in: [{"eventDate"="2024-01-24T15:00:53.568Z", "eventId"="80a1759f-eee3-43d2-86cd-0ec164ab8794"}, {"eventDate"="2024-01-24T15:00:54.458Z", "eventId"="dc68c298-3c16-4c85-9b2c-183150f30d0e"}, {"eventDate"="2024-01-24T15:00:53.625Z", "eventId"="6ed3bca5-2b31-4616-80fc-180806f53037"}, {"eventDate"="2024-01-24T15:00:53.629Z", "eventId"="b6aeb95a-0268-4253-81ad-69ba42969475"}, {"eventDate"="2024-01-24T15:00:53.632Z", "eventId"="7185e815-5f9d-4a2c-baa1-2d746d1cd36c"}, {"eventDate"="2024-01-24T15:00:53.644Z", "eventId"="e259817a-9852-4937-9933-ab8bdad22062"}] |
...dons-data-audit-jpa-common/src/main/java/org/kie/kogito/app/audit/jpa/JPADataAuditStore.java
Show resolved
Hide resolved
@elguardian look at #1962 (comment) I'm also facing same issue locally |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dropped a suggestion regarding a method name, the only issue I have is regarding the broken tests I mention on my previous comment.
Other than I'm ok with the PR as it is.
...t/data-audit-common/src/main/java/org/kie/kogito/app/audit/graphql/GraphQLSchemaManager.java
Outdated
Show resolved
Hide resolved
PR job Reproducerbuild-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-kogito-pipelines/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-kogito-apps -u #1962 --skipParallelCheckout NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution Please look here: https://ci-builds.apache.org/job/KIE/job/kogito/job/main/job/pullrequest_jobs/job/kogito-apps-pr/job/PR-1962/6/display/redirect Test results:
Those are the test failures: org.kie.kogito.index.ProcessDataIndexMongoDBIT.testProcessInstanceEvents1 expectation failed.JSON path errors doesn't match. Expected: null Actual: <[{message=Exception while fetching data (/UserTaskInstances[0]/schema) : Runtime service URL not defined, please review the kogito.service.url system property to point the public URL for this runtime., locations=[{line=1, column=85}], path=[UserTaskInstances, 0, schema], extensions={classification=DataFetchingException}}]> org.kie.kogito.app.audit.quarkus.QuarkusAuditQueryRegistryServiceTest.testRegisterQueryWithDateTimeExpected size: 1 but was: 6 in: [{"eventDate"="2024-01-24T18:35:37.901Z", "eventId"="2102ff47-7a30-4c6b-b78f-5ed718339f8e"}, {"eventDate"="2024-01-24T18:35:39.115Z", "eventId"="6f9bdacf-119a-4990-8d19-f082ab61e0f9"}, {"eventDate"="2024-01-24T18:35:37.975Z", "eventId"="f98f47bd-0669-46e3-be1f-13b7b11edc92"}, {"eventDate"="2024-01-24T18:35:37.980Z", "eventId"="e4557dda-6015-4504-99b6-e047f33dcc4e"}, {"eventDate"="2024-01-24T18:35:37.985Z", "eventId"="4b538011-5c45-42be-b11a-626fe3eade64"}, {"eventDate"="2024-01-24T18:35:37.999Z", "eventId"="d92de807-cc92-4645-8f11-334bb9a05c0c"}] org.kie.kogito.trusty.service.common.KeycloakTrustyServiceIT.(?)java.lang.RuntimeException: Failed to start quarkus |
QuarkusAuditQueryRegistryServiceTest passes if it is run in isolation, but fails if run within the whole testsuite, so it seems the issue is related to data cleanup across tests. I opened up apache/incubator-kie-issues/issues/857 to capture the need for a delete endpoint. |
} | ||
|
||
@Route(path = DATA_AUDIT_QUERY_PATH, type = Route.HandlerType.BLOCKING, order = 2, methods = { GET }) | ||
public void blockingGraphQLHandlerGet(RoutingContext rc) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elguardian what is the purpose of the GET method for the query path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we needed a way to verify that graphQL schema. If you add a new graphql query we needed a way to know the schema as it is build dynamically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't completely understand what this endpoint should return. It returns a 400 error in my tests due to a missing query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, probably you should update. It return a graphQL schema combining everything it jas within the jars plus the queries registered. try again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the test I added below work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that will fail because that is the query path and you need the query string. If you want to test this endpoint
?query=....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove it to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that having this GET to enable get the schema is a good idea. This will be helpful when we build tooling around the data-audit graphql interface.
IMO I wouldn't completely remove it, maybe we could enable it in dev mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I should have paid more attention. +1 to keep it in, but maybe with a test case or additional explanation in the README on how to use it.
...ata-audit-quarkus/src/main/java/org/kie/kogito/app/audit/quarkus/GraphQLDataAuditRouter.java
Outdated
Show resolved
Hide resolved
...ringboot/src/main/java/org/kie/kogito/app/audit/springboot/GraphQLAuditDataRouteMapping.java
Outdated
Show resolved
Hide resolved
...kus/src/test/java/org/kie/kogito/app/audit/quarkus/QuarkusAuditQueryRegistryServiceTest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @elguardian
…in Data Audit (apache#1962) [incubator-kie-issues-834] Support Dynamic GraphQL query registering in Data Audit
Closes: apache/incubator-kie-issues#834