feat: .env UI editor#8520
Conversation
|
where to consolidate utils? have the same functions and lots of repeat since they are the same functionality |
looks like we didnt habe this already so claude code/cursor did some work and i rebuild proto... since its new feature it shouldnt effect anything else
|
@begelundmuller , based on Mike's requests to add push-pull button in the UI here: https://rilldata.slack.com/archives/C01A9DYP013/p1765989576246559?thread_ts=1765901488.470909&cid=C01A9DYP013 required some new backend changes, so tagging you as a reviewer for this PR, as well. If this is "too complicated" or adds brittleness to the code base, we can remove the backend changes and buttons for this PR and tackle it in a dedicated PR in the future. Thoughts? |
begelundmuller
left a comment
There was a problem hiding this comment.
The backend code here seems correct at a high level, although it could do with some cleaning up (there are some anti-patterns and no tests)
Code ReviewProfessionalism & Code Quality: ⭐⭐⭐⭐⭐ (Excellent)Strengths:
Issues to Address:
E2E Testing:
|
|
Just spoke to Mike and got confirmed that we want this in UI |
| maps.Copy(vars, existing) | ||
| maps.Copy(vars, resVars) | ||
| path := pathForEnv(env) | ||
| err = godotenv.Write(vars, filepath.Join(projectPath, path)) |
There was a problem hiding this comment.
This means vars from deep .env file like model/.env gets rewritten to root .env. But it was the same behaviour earlier also. Not sure if it was a bug.
| // PullEnv pulls environment variables from cloud to local .env file | ||
| rpc PullEnv(PullEnvRequest) returns (PullEnvResponse) { | ||
| option (google.api.http) = { | ||
| post: "/v1/instances/{instance_id}/env/pull", | ||
| body: "*" | ||
| }; | ||
| } |
There was a problem hiding this comment.
Could this functionality be covered by the existing ReloadConfig function?
Since in cloud, admin calls ReloadConfig on all runtimes when a variable is changed; so ReloadConfig already serves the purpose of triggering re-pull of variables.
There was a problem hiding this comment.
But ReloadConfig is a no-op for rill developer and it is used in web-local UI as well.
I can route it to ReloadConfig for cloud runtimes if we want to avoid env updates from two places.
There was a problem hiding this comment.
Discussed separately; Anshul will update with his findings.
| ProvisionConnector(ctx context.Context, name, driver string, args map[string]any) (map[string]any, error) | ||
| GetDeploymentConfig(ctx context.Context) (*DeploymentConfig, error) | ||
| ListDeployments(ctx context.Context) ([]*Deployment, error) | ||
| GetProjectVariables(ctx context.Context, environment string) (map[string]map[string]string, error) |
There was a problem hiding this comment.
Same question as earlier – isn't this already covered by GetDeploymentConfig?
There was a problem hiding this comment.
Same - local runtimes can't use GetDeploymentConfig
Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
|
FYI the backend implementation has been extracted into this PR: #9294 |
|
okay, ill rework this to a UI only PR after rebasing with main |
This reverts commit 1c48d6d.
# Conflicts: # admin/server/deployment.go # cli/cmd/env/push.go # cli/pkg/local/admin.go # cli/pkg/local/app.go # docs/docs/reference/cli/env/push.md # proto/gen/rill/admin/v1/api.pb.go # proto/gen/rill/runtime/v1/api.pb.go # proto/gen/rill/runtime/v1/api.pb.gw.go # proto/gen/rill/runtime/v1/api.pb.validate.go # proto/gen/rill/runtime/v1/api_grpc.pb.go # proto/gen/rill/runtime/v1/runtime.swagger.yaml # proto/rill/runtime/v1/api.proto # runtime/config_reloader.go # runtime/runtime.go # runtime/server/env.go # runtime/server/instances.go # web-admin/src/routes/[organization]/[project]/-/settings/environment-variables/+page.svelte # web-common/src/proto/gen/rill/runtime/v1/api_connect.ts # web-common/src/proto/gen/rill/runtime/v1/api_pb.ts # web-common/src/runtime-client/v2/gen/runtime-service.ts # web-local/src/routes/(application)/(workspace)/files/[...file]/+page.svelte



QA: https://www.loom.com/share/d863c0a6eb3c404d9a24b49c280ca4ac
Adds a visual editor for
.envfiles in Rill Developer with push/pull sync to Rill Cloud..envand Rill Cloud (disabled when project is not linked, with contextual tooltips).envfile support in the Add dialog{#each}keys, toast notifications on all CRUD operationsdotenvparser consistently (no custom parser)Decision: We dont need to support all CLI paths, just the main one. From the UI, we wont add support for
--pathunless specifically asked for it. We can add an Advanced Tab in the dropdown UI in the future.Checklist: