Replies: 1 comment
-
|
This would be great. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This post outlines an observed pattern within multiple Pelican eggs that may benefit from a more systematic and automated solution. During configuration analysis, it became apparent that certain environment variables become logically required only when another variable is set to a specific value. A representative example is the relationship between
RCON_ENABLEDandRCON_PORT. AlthoughRCON_PORTis defined as nullable, it becomes functionally mandatory whenRCON_ENABLED=1.The idea for this feature emerged while reviewing a Copilot-generated comment in the following discussion:
pelican-eggs/games-standalone#84 (comment)
This behavior is not isolated to a single egg. Similar conditional dependencies appear across various implementations, and the current approach requires manual validation or custom scripting. This introduces potential inconsistencies and increases the likelihood of misconfiguration.
Proposed Enhancement
Introduce a native mechanism within Pelican to define conditional validation rules for environment variables. The following rule formats illustrate the intended concept:
required_if:VAR_X,valueforbidden_if:VAR_Y,valueinteger_if:MODE,advancedmin_if:FEATURE_Z,enabledThese examples demonstrate how conditional logic could be expressed declaratively, allowing Pelican to enforce configuration correctness automatically.
Expected Benefits
Example Scenario
If
RCON_ENABLED=1, thenRCON_PORTmust contain a valid port number.If
RCON_ENABLED=0, the value ofRCON_PORTbecomes irrelevant and should not be required.This pattern appears frequently enough that a built-in solution would provide measurable value to both developers and end users.
Beta Was this translation helpful? Give feedback.
All reactions