-
Notifications
You must be signed in to change notification settings - Fork 44
fix: drive is production with a env variable #226
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
Conversation
WalkthroughThe changes update configuration files to replace hardcoded property values with references to environment variables, allowing dynamic determination of production mode and CORS origins. Additionally, a merge conflict marker is removed, and a new property for allowed CORS origins is introduced. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant EnvVars
App->>EnvVars: Fetch IS_PRODUCTION
App->>EnvVars: Fetch CORS_ALLOWED_ORIGINS
EnvVars-->>App: Return environment variable values
App->>App: Configure isProduction and cors.allowed-origins dynamically
Possibly related PRs
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
π§Ή Nitpick comments (2)
src/main/environment/common_docker.properties (1)
181-181
: Ensure CORS origins variable is defined or provide fallback
IfCORS_ALLOWED_ORIGINS
is unset, Spring will fail to resolve the property. Consider supplying a default (e.g.,*
) or documenting that itβs mandatory.-cors.allowed-origins=${CORS_ALLOWED_ORIGINS} +cors.allowed-origins=${CORS_ALLOWED_ORIGINS:*}src/main/environment/common_ci.properties (1)
180-180
: Document new CORS property and its expected format
Youβve introducedcors.allowed-origins
. Update deployment docs/README to specify its format (e.g., comma-separated list, wildcard) and verify your CORS filter consumes it.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (2)
src/main/environment/common_ci.properties
(1 hunks)src/main/environment/common_docker.properties
(1 hunks)
β° Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Analyze (java)
- GitHub Check: Package-test
- GitHub Check: Build
π Additional comments (1)
src/main/environment/common_ci.properties (1)
170-170
: Verify resource filtering for CI environment placeholders
The@env.IS_PRODUCTION@
syntax relies on your buildβs resource-filtering setup. Confirm that Maven/Gradle replaces these tokens correctly.#!/bin/bash # Check Maven resource filtering configuration rg -A3 '<resources>' -n pom.xml
@@ -168,7 +168,7 @@ springdoc.api-docs.enabled=false | |||
springdoc.swagger-ui.enabled=false | |||
|
|||
|
|||
isProduction=true | |||
isProduction=${IS_PRODUCTION} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
Validate IS_PRODUCTION
placeholder with default fallback
To prevent startup failures when IS_PRODUCTION
isnβt set, specify a sensible default (e.g., false
).
-isProduction=${IS_PRODUCTION}
+isProduction=${IS_PRODUCTION:false}
π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
isProduction=${IS_PRODUCTION} | |
-isProduction=${IS_PRODUCTION} | |
+isProduction=${IS_PRODUCTION:false} |
π€ Prompt for AI Agents
In src/main/environment/common_docker.properties at line 171, the IS_PRODUCTION
placeholder is used without a default value, which can cause startup failures if
the environment variable is not set. Modify the line to provide a default
fallback value, such as false, by using the syntax for default values in
properties files to ensure the application starts reliably even when
IS_PRODUCTION is undefined.
π Description
JIRA ID: AMM-1625
β Type of Change
Summary by CodeRabbit