Skip to content

Fix: serverless env variable feature update - #79

Merged
jaakkovarjo merged 6 commits into
mainfrom
fix/serverless-env-vars
Nov 20, 2026
Merged

jaakkovarjo merged 6 commits into
mainfrom
fix/serverless-env-vars

Conversation

@jaakkovarjo

Copy link
Copy Markdown
Contributor

Description

This PR fixes bug where listing deployment env variables worked with deployment name, but modifying required the internal container name as well as added tests.

Type of Change

  • feat: New feature
  • fix: Bug fix
  • refactor: Code refactoring
  • docs: Documentation
  • test: Tests
  • chore: Maintenance
  • ci: CI/CD changes

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally (make test)
  • Pre-commit checks pass (make pre-commit)
  • My changes generate no new warnings or errors

jaakkovarjo and others added 4 commits November 18, 2026 17:44
…e deployment

The container env endpoints key on container_name = the container inside the
deployment, which the API names "<deployment>-0" (we never send a name on
create). env set/unset were sending the deployment name, so every add, update
and delete failed with not_found. Resolve the real container name via a
deployment GET (containerNameOf), the same way update already does.

The GET /environment-variables response is grouped per container
([{container_name, env[]}]); SDK v1.7.1 GetEnvironmentVariables decodes it as
a flat []ContainerEnvVar and yields one blank entry per container. Read the
grouped shape directly (fetchEnvVars via the SDK client) and pick the resolved
container's group. env list warns when a deployment exposes more than one
container. Drop fetchEnvVars once the SDK returns groups.

Tests serve the grouped response and assert container_name is the inner
container; adds a no-containers case and two multi-container cases.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bring container_env.go to full statement coverage (bar the unreachable
NewRequest error branch): missing client, missing name without a terminal,
failures on every env endpoint and on the deployment lookup, a container
absent from the env GET groups, env-flag validation, unset confirm
accept/decline/prompter-failure, and the interactive picker for list, set
and unset including cancel, empty list and list-load failure. Also a unit
test for envVarsOf.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
README gains a usage section for `verda container env` showing that every
subcommand takes the deployment name and the CLI resolves the inner
container. CLAUDE.md lists the env/secret/file-secret/registry-creds
subtrees and the container_env.go file. `env list` gets an in-command
example like set and unset already had.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ajmyyra
ajmyyra previously approved these changes Nov 18, 2026

@ajmyyra ajmyyra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We oughta redo the API at some point. Not sure why containers even need names 😂

@jaakkovarjo jaakkovarjo changed the title Fix/serverless env vars Fix: serverless env variable feature update Nov 20, 2026
@jaakkovarjo
jaakkovarjo merged commit 14538cb into main Nov 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants