[SRVLOGIC-1137] Restore host in ProcessDefinition serviceUrl - #133
Merged
baldimir merged 1 commit intoAug 21, 2026
Merged
Conversation
getProcessDefinitionServiceUrl was using URI.create(endpoint).getPath(), which drops the scheme and host and keeps only the path. This made serviceUrl a relative path such as /callbackstatetimeouts/0.0.1 instead of the service address, e.g. http://callbackstatetimeouts.example.com. getProcessInstanceServiceUrl already handles this correctly using URIInfo.buildURIInfo(...).truncatedURI(), which strips the trailing id/version segments while keeping the host. Use the same approach for ProcessDefinition, via the existing (previously unused) URIInfo.buildURIInfo(ProcessDefinition) overload.
ricardozanini
approved these changes
Aug 18, 2026
There was a problem hiding this comment.
Pull request overview
This PR fixes how the Data Index GraphQL layer computes serviceUrl for ProcessDefinition sources by preserving scheme/host and truncating the trailing process id/version segments, aligning the behavior with the existing ProcessInstance URL handling.
Changes:
- Update
getProcessDefinitionServiceUrlto useURIInfo.buildURIInfo(...).truncatedURI()instead ofURI.create(...).getPath(). - Add unit tests covering
ProcessDefinitionserviceUrlextraction (including versioned endpoints).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| data-index/data-index-graphql/src/main/java/org/kie/kogito/index/graphql/AbstractGraphQLSchemaManager.java | Switch ProcessDefinition serviceUrl computation to URIInfo truncation to preserve host/scheme. |
| data-index/data-index-service/data-index-service-common/src/test/java/org/kie/kogito/index/service/graphql/GraphQLSchemaManagerTest.java | Add tests validating correct ProcessDefinition serviceUrl truncation behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
167
to
+171
| ProcessDefinition source = env.getSource(); | ||
| if (source == null || source.getEndpoint() == null) { | ||
| return null; | ||
| } | ||
| return URI.create(source.getEndpoint()).getPath(); | ||
| return URIInfo.buildURIInfo(source).truncatedURI().toString(); |
Comment on lines
21
to
23
| import org.junit.jupiter.api.Test; | ||
| import org.kie.kogito.index.model.ProcessDefinition; | ||
| import org.kie.kogito.index.model.ProcessInstance; |
baldimir
approved these changes
Aug 19, 2026
jankrystof-ibm
self-requested a review
August 20, 2026 06:28
jankrystof-ibm
approved these changes
Aug 20, 2026
baldimir
added a commit
that referenced
this pull request
Aug 24, 2026
…134) getProcessDefinitionServiceUrl was using URI.create(endpoint).getPath(), which drops the scheme and host and keeps only the path. This made serviceUrl a relative path such as /callbackstatetimeouts/0.0.1 instead of the service address, e.g. http://callbackstatetimeouts.example.com. getProcessInstanceServiceUrl already handles this correctly using URIInfo.buildURIInfo(...).truncatedURI(), which strips the trailing id/version segments while keeping the host. Use the same approach for ProcessDefinition, via the existing (previously unused) URIInfo.buildURIInfo(ProcessDefinition) overload. (cherry picked from commit b88b848) Co-authored-by: Matheus Cruz <56329339+mcruzdev@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getProcessDefinitionServiceUrlwas usingURI.create(endpoint).getPath(), which drops the scheme and host and keeps only the path.This made serviceUrl a relative path such as
/callbackstatetimeouts/0.0.1instead of the service address, e.g.http://callbackstatetimeouts.example.com.getProcessInstanceServiceUrlalready handles this correctly usingURIInfo.buildURIInfo(...).truncatedURI(), which strips the trailing id/version segments while keeping the host. Use the same approach for ProcessDefinition, via the existing (previously unused)URIInfo.buildURIInfo(ProcessDefinition)overload.This is MIDSTREAM if you want to send your PR to UPSTREAM use https://github.com/apache/incubator-kie-kogito-apps
REQUIRED Add link to SRVLOGIC Jira!
https://redhat.atlassian.net/browse/SRVLOGIC-1137
Please make sure that your PR meets the following requirements:
SRVLOGIC-XYZ Subject[0.9.x] SRVLOGIC-XYZ SubjectHow to replicate CI configuration locally?
Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.
build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.