fix: WebFlux base-path support, precompute fullPath, consistent @RequestMapping#3
Merged
Merged
Conversation
…estMapping - TemplateService now falls back to spring.webflux.base-path when server.servlet.context-path is absent, fixing WebFlux apps under a context path. - Precompute fullPath in constructor since contextPath and the configured j-obs path are immutable post-boot. - Align AlertController and SqlAnalyzerController with the class-level @RequestMapping convention used by the other UI controllers. - Add TemplateServiceTest covering servlet/WebFlux context-path, trailing-slash normalization, and empty context-path scenarios. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
JObsLogAutoConfigurationTest was loading only JObsLogAutoConfiguration, but LogController now depends on TemplateService, whose @bean lives in JObsAutoConfiguration (moved there in #2). Add JObsAutoConfiguration to the test's AutoConfigurations set. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
JohnPitter
added a commit
that referenced
this pull request
Apr 17, 2026
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.
Summary
Follow-up to #2. Three small fixes surfaced during code review, plus test coverage for the new context-path logic.
TemplateServicenow falls back tospring.webflux.base-pathwhenserver.servlet.context-pathis absent. WebFlux apps were silently broken by Refactor: respect server.servlet.context-path for all UI URLs #2.fullPath:contextPathandproperties.getPath()are immutable post-boot, so compute once in the constructor rather than on every request.@RequestMapping:AlertControllerandSqlAnalyzerControllerwere the only UI controllers putting the full path on@GetMappinginstead of at class level. Aligned with the rest.Test plan
mvn -pl j-obs-spring-boot-starter test -Dtest=TemplateServiceTest— 8/8 passingmvn -pl j-obs-spring-boot-starter compile— no regressions across the ~20 call sites touched by Refactor: respect server.servlet.context-path for all UI URLs #2server.servlet.context-path=/my-app(reviewer)spring.webflux.base-path=/api(reviewer)🤖 Generated with Claude Code