Load default feature properties from classpath#1785
Open
krowvin wants to merge 1 commit into
Open
Conversation
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
The packaged default now has
INCLUDE_ERROR_STACK_TRACES=true(Per 1770), but the dev environment was not reading that value because no runtime feature file existed at the expected filesystem path.Updates CDA feature flag loading so the default packaged
features.propertiescan be used when no external Togglz properties file is configured.CDA configured Togglz with
new File("features.properties"), which only looks in the filesystem relative to the running process. In the container image, the defaultfeatures.propertiesis packaged inside the WAR underWEB-INF/classes, so shared/dev environments that did not mount a separate feature file or set-Dproperties.file=...would not pick up the packaged defaults.Related Issues
Attempted to resolve with
Validation
Created unit tesT:
./gradlew.bat :cwms-data-api:test --tests cwms.cda.features.CdaFeatureManagerProviderTestAlso ran Checkstyle:
./gradlew.bat :cwms-data-api:checkstyleMain :cwms-data-api:checkstyleTestBuilt and ran a local Docker image without Docker Compose, without mounted feature files, and without
-Dproperties.file. Verified that CDA loaded the packaged default and reportedproperties.file=nullandINCLUDE_ERROR_STACK_TRACES=true.Then verified explicit override behavior still works by setting
-Dproperties.file=/tmp/features-off.propertieswithINCLUDE_ERROR_STACK_TRACES=false, which reportedproperties.file=/tmp/features-off.propertiesandINCLUDE_ERROR_STACK_TRACES=false.Pulled down the existing docker image and confirmed it did indeed have the properties file but it was located here:
/usr/local/tomcat/webapps/cwms-data.war > WEB-INF/classes/features.propertiesor
/usr/local/tomcat/webapps/cwms-data/WEB-INF/classes/features.propertiesLocal docker compose had me thinking it would work with this line
cwms-data-api/docker-compose.yml
Line 72 in b7c4e6e
Checklist