conf: support optional include? directive#7919
conf: support optional include? directive#7919olliehcrook wants to merge 1 commit intonats-io:mainfrom
Conversation
b069c58 to
09a557f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09a557f530
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Add parsing support for `include? <path>` so missing include files are ignored. Keep existing behavior for invalid include files and add lexer/parser tests. Implements: nats-io#5297 Signed-off-by: Ollie Hensman-Crook <olliehensmancrook@gmail.com>
09a557f to
929960c
Compare
|
I'm trying to understand in what situation this would be useful. If an include is missing and we ignore it, then the system can and will come up in a possibly-unsupportable or unexpected state. |
|
@neilalexander it is often requested as an alternative to create empty files or having to do it via external template systems, helps simplify that flow |
|
@wallyqs I am concerned mostly about the supportability aspect. What happens in a situation like when you lose or accidentally truncate/delete/mangle an included file with the JetStream These kinds of hidden behaviours always end up being surprising at the worst times, usually during an incident, when you find out that the server isn't doing what you thought it was and it didn't fail-fast when it should have done. |
|
@neilalexander the same thing could happen right now if using |
|
I like the idea though of making it super explicit in terms of behavior in the config to have better protection, something like: then use: |
|
@derekcollison Do you have any thoughts on this one? |
I am ok with this. Since its an opt-in via |
Add parsing support for
include? <path>so missing include files are ignored.Keep existing behavior for invalid include files and add lexer/parser tests.
Implements: #5297
Signed-off-by: Ollie Hensman-Crook olliehensmancrook@gmail.com