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

Environment variable validation #1622

Closed
jelly opened this issue Mar 15, 2024 · 1 comment · Fixed by #1865
Closed

Environment variable validation #1622

jelly opened this issue Mar 15, 2024 · 1 comment · Fixed by #1865
Labels
bug Something isn't working

Comments

@jelly
Copy link
Member

jelly commented Mar 15, 2024

Some issues with validating env variables:

  • We allow all characters, even invalid ones. The regex should likely be [a-zA-Z_]{1,}[a-zA-Z0-9_]*
  • Empty value is allowed, but that likely makes no sense?
  • Removing an invalid entry shifts the invalidate state to the valid one, see below:

image

Then remove the top one:

image

@jelly jelly added the bug Something isn't working label Mar 15, 2024
@jelly
Copy link
Member Author

jelly commented Mar 15, 2024

The last issue is due to the validationState being wrong compared to this.state.env

(7 entries)

[
    null,
    null,
    null,
    null,
    null,
    {
        "envKey": "Key must not be empty"
    },
    {}
]

While this.state.env is (9 entries):

[
    null,
    null,
    null,
    null,
    null,
    null,
    {
        "key": 6,
        "envKey": null,
        "envValue": null
    },
    {
        "key": 7,
        "envKey": null,
        "envValue": null
    },
    {
        "key": 8,
        "envKey": "jijij",
        "envValue": null
    }
]

While the UI shows:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant