Skip to content

Load default feature properties from classpath#1785

Open
krowvin wants to merge 1 commit into
developfrom
cda-feature-properties-fallback
Open

Load default feature properties from classpath#1785
krowvin wants to merge 1 commit into
developfrom
cda-feature-properties-fallback

Conversation

@krowvin

@krowvin krowvin commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

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.properties can 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 default features.properties is packaged inside the WAR under WEB-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.CdaFeatureManagerProviderTest

Also ran Checkstyle:

  • ./gradlew.bat :cwms-data-api:checkstyleMain :cwms-data-api:checkstyleTest

Built 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 reported properties.file=null and INCLUDE_ERROR_STACK_TRACES=true.

Then verified explicit override behavior still works by setting -Dproperties.file=/tmp/features-off.properties with INCLUDE_ERROR_STACK_TRACES=false, which reported properties.file=/tmp/features-off.properties and INCLUDE_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.properties
or
/usr/local/tomcat/webapps/cwms-data/WEB-INF/classes/features.properties

Local docker compose had me thinking it would work with this line

Checklist

  • AI tools used

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.

1 participant