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

Env Var Feedback #6223

Merged
merged 24 commits into from
Dec 11, 2024
Merged

Env Var Feedback #6223

merged 24 commits into from
Dec 11, 2024

Conversation

Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UXQA:

  • I get a validation warning "You must select at least one environment" when I open & close the "Edit variable" form, then open the form a second time: Jam
  • When I edit the name of an environment variable so that it would conflict with another, I get a validation error (expected) and the name flips back to its original name (unexpected): Jam. It's confusing that the validation error is presented for the the original valid name, not for the edited invalid name.

@ericokuma
Copy link

ericokuma commented Dec 6, 2024

  • Adding that the validation errors (for key name duplication) doesn't reset when I enter a new name and therefore am not able to actually make editing changes:

https://www.loom.com/share/448bbb48880347a3b81d0847f2ee5ab4?sid=5630da38-0552-496a-bc2d-848c89eef872

@lovincyrus lovincyrus marked this pull request as draft December 6, 2024 19:01
@lovincyrus
Copy link
Contributor Author

Addressed all the recent feedback! @ericokuma @ericpgreen2

@lovincyrus lovincyrus marked this pull request as ready for review December 6, 2024 19:23
@ericpgreen2
Copy link
Contributor

ericpgreen2 commented Dec 6, 2024

  • UXQA: I'm unable to add a key for a second environment: Jam

@lovincyrus lovincyrus marked this pull request as draft December 6, 2024 19:36
@lovincyrus lovincyrus marked this pull request as ready for review December 10, 2024 08:01
Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

UXQA: I'm able to submit a variable for an environment that already exists (Jam). 1). The "Create" button should be disabled. 2). When I submit the form (though this shouldn't be possible), the input gets cleared, showing me a validation error on an empty input element. I'd expect to still see my submitted text.

Approving for you to merge at your discretion!

@ericokuma
Copy link

Ah yeah, good find. That is a bit of an odd behavior.

Ideal:

  • Checking the key name for duplicates should occur either after a user clicks out of the key name input field or selecting/deselecting environments
  • This should be coupled with the disabling/enabling of the Create/Edit buttons

Acceptable solution:

  • Always enable the Create/Edit button and do the validation check only upon user clicking on that button i.e. do not display validation error until button has been clicked

@ericokuma
Copy link

ericokuma commented Dec 10, 2024

A couple of issues I found:
https://www.loom.com/share/a2c39bf392114c9ba3f5ada4150b92ae?sid=cd393837-5fcf-4c4b-be0d-187da4b53530

  1. When adding a new environment and inputting a key name that matches an existing key (with the exception of capitalizing one or more letters so that it's different in terms of case), the form doesn't detect and block creation

  2. [BLOCKER] Instead, it edits the value of the existing variable with the new value inputting with the duplicative entry (looks like it also changes the environments selected as well for the existing variable)

@ericpgreen2 ericpgreen2 added the blocker A release blocker issue that should be resolved before a new release label Dec 10, 2024
@lovincyrus
Copy link
Contributor Author

lovincyrus commented Dec 11, 2024

  • When adding a new environment and inputting a key name that matches an existing key (with the exception of capitalizing one or more letters so that it's different in terms of case), the form doesn't detect and block creation
  • [BLOCKER] Instead, it edits the value of the existing variable with the new value inputting with the duplicative entry (looks like it also changes the environments selected as well for the existing variable)

I looked up the API Schema. It appears that variable name is insensitive.

https://github.com/rilldata/rill/pull/5929/files#diff-5135893de718e4a71cefcbda1d7cece93dbaad8859c7082841e26ccadbee0136R2093

ON CONFLICT (project_id, environment, lower(name)) DO UPDATE SET

https://github.com/rilldata/rill/blob/main/proto/gen/rill/admin/v1/admin.swagger.yaml#L4755

  name:
    type: string
    description: Variable name (case insensitive).

Case insensitivity is already handled at the DB level. When we call UpdateProjectVariables when adding new variables, "john", "John", "JOHN". They are all treated as the same variable. @ericokuma

Update: I'll add the case sensitivity checks on the client side. If a user gets into the state, it will be super weird.

@lovincyrus lovincyrus merged commit ae6298e into main Dec 11, 2024
7 checks passed
@lovincyrus lovincyrus deleted the cyrus/env-var-feedback branch December 11, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker A release blocker issue that should be resolved before a new release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants