-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(web): validate configuration file on launch #42
Conversation
Signed-off-by: KeisukeYamashita <[email protected]>
WalkthroughThis update enhances two components of the project. In the Dockerfile, a new command installs Changes
Sequence Diagram(s)sequenceDiagram
participant Script as 40-envsubst-on-reearth-config.sh
participant jq as JSON Validator (jq)
Script->>jq: Pass generated JSON configuration file
alt JSON is valid
jq-->>Script: Return valid output
Script->>Script: Continue execution
else JSON is invalid
jq-->>Script: Emit error output
Script->>Script: Print error message and exit (code 1)
end
Poem
Tip 🌐 Web search-backed reviews and chat
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
✅ Deploy Preview for reearth-classic ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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: 0
🧹 Nitpick comments (1)
web/docker/40-envsubst-on-reearth-config.sh (1)
39-42
: JSON Validation Block is Correctly Implemented.
The new block utilizesjq empty
to verify the generated JSON configuration file. This check effectively catches invalid JSON before proceeding, ensuring the startup fails fast in case of configuration errors. For enhanced clarity, consider including additional context (e.g., the file path or a suggestion to check the configuration source) in the error message if applicable.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
web/Dockerfile
(1 hunks)web/docker/40-envsubst-on-reearth-config.sh
(1 hunks)
🔇 Additional comments (1)
web/Dockerfile (1)
62-64
: jq Installation Addition is Well-Integrated.
The addition of the command using a cache mount to installjq
viaapk
is correctly set up to support the JSON validation step in the shell script. This should improve build performance by leveraging the cached package data. Ensure that the version ofjq
installed meets the minimum requirements for your JSON validation needs.
Overview
What I've done
What I haven't done
How I tested
Which point I want you to review particularly
Memo
Ref:
reearth_config.json
on container launch reearth-cms#1388Summary by CodeRabbit
Chores
Bug Fixes