Skip to content
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

Fixing CI build and removing Groovy. #1

Merged
merged 7 commits into from
Mar 27, 2024
Merged

Fixing CI build and removing Groovy. #1

merged 7 commits into from
Mar 27, 2024

Conversation

onukristo
Copy link
Contributor

@onukristo onukristo commented Mar 22, 2024

Context

A new initial version of the library.

Provides information to other libraries in which environment they are running in.

Allows to set default properties for specific environments.

Typical use case is for various Wise libraries to set environment specific default properties in their EnvironmentPostProcessor implementations.

WiseEnvironment.setDefaultProperty("my-library", WiseEnvironment.PRODUCTION, "tw-reliable-jdbc.sslMode", SslMode.VERIFY_FULL);
WiseEnvironment.setDefaultProperty("my-library", WiseEnvironment.STAGING, "tw-reliable-jdbc.sslMode", SslMode.PREFERRED);
WiseEnvironment.setDefaultProperty("my-library", WiseEnvironment.CUSTOM_ENVIRONMENT, "tw-reliable-jdbc.sslMode", SslMode.VERIFY_CA);

See WiseEnvironment class for other optional use cases. E.g. asking which environments are currently active.

The environments themselves can be hierarchical. In that sense, that if you set a default property to STAGING, it would also apply to
CUSTOM_ENVIRONMENT, unless a different value is specifically set for CUSTOM_ENVIRONMENT.

Also, a convenience DSL is available for setting properties. E.g.

WiseEnvironment.setDefaultProperties(dsl -> dsl
    .source("tw-reliable-jdbc")

    .environment(WiseEnvironment.WISE)
    .set(TW_OBS_BASE_EXTREMUM_CONFIG_PATH, gaugeNames)
    .set("spring.flyway.validate-migration-naming", "true")

    .keyPrefix("tw-reliable-jdbc.")
    .environment(WiseEnvironment.PRODUCTION)
    .set("sslMode", SslMode.VERIFY_FULL)
    .set("requiredSslModeLevel", SslMode.VERIFY_CA)
    .set("requireMinPoolSizePct", 100d)

    .environment(WiseEnvironment.STAGING)
    .set("sslMode", SslMode.VERIFY_FULL)
);

Checklist

@onukristo onukristo requested a review from a team as a code owner March 22, 2024 14:42
@onukristo onukristo added the change:standard Not an emergency or impactful change label Mar 22, 2024
@onukristo onukristo merged commit b5c4bb9 into main Mar 27, 2024
18 checks passed
@onukristo onukristo deleted the fix_build branch March 27, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change:standard Not an emergency or impactful change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants