Skip to content

feat(rde): add Remote Development Environment management commands#637

Merged
evoxmusic merged 6 commits into
mainfrom
feature/rde-commands
May 9, 2026
Merged

feat(rde): add Remote Development Environment management commands#637
evoxmusic merged 6 commits into
mainfrom
feature/rde-commands

Conversation

@evoxmusic
Copy link
Copy Markdown
Contributor

Summary

  • Add qovery rde command group for managing Remote Development Environments (RDE), enabling platform teams to provision isolated, pre-configured dev environments from blueprint templates
  • Implement 21 new command files covering blueprint management, RDE lifecycle, bulk operations, and advanced features (upgrade, urls, logs, info)
  • Use environment variables (BLUEPRINT_PROJECT_ID at project level, BLUEPRINT_KEY at environment level) for blueprint identification -- no naming convention required

Architecture

Identification Model

Blueprint Project
  ├── Project-level env var: BLUEPRINT_PROJECT_ID = <own project ID>
  └── Blueprint Environment
      └── Env-level env var: BLUEPRINT_KEY = <own project ID>

Child Project (cloned RDE)
  └── Child Environment (cloned from blueprint)
      └── Env-level env var: BLUEPRINT_KEY = <blueprint project ID>  ← different from own project

Discovery logic:

  • BLUEPRINT_KEY == own project ID → blueprint master
  • BLUEPRINT_KEY != own project ID → child of that blueprint

Command Tree

qovery rde
  ├── blueprint
  │   ├── create   --project <name>
  │   ├── list     [--json]
  │   ├── delete   --project <name>
  │   ├── status   --project <name>
  │   ├── deploy   --project <name> [--watch]
  │   └── stop     --project <name> [--watch]
  ├── create       --blueprint <name> --name <rde-name> [--email] [--skip-rbac] [--skip-invite] [--skip-deploy]
  ├── list         [--blueprint <name>] [--json]
  ├── status       --name <rde-name>
  ├── start        --name <rde-name> [--watch]
  ├── stop         --name <rde-name> [--watch]
  ├── delete       --name <rde-name>
  ├── stop-all     [--blueprint <name>]
  ├── start-all    [--blueprint <name>]
  ├── delete-all   --confirm [--blueprint <name>]
  ├── upgrade      [--name <rde-name>] [--strategy image|reclone]
  ├── urls         [--blueprint <name>]
  ├── logs         --name <rde-name>
  └── info

RDE Provisioning (rde create) Steps

  1. Create project rde-<name> with description
  2. Create RBAC role RDE-<name> with scoped permissions (optional)
  3. Clone blueprint environment into new project
  4. Handle TTL job from blueprint
  5. Invite developer via email (optional)
  6. Trigger deployment (optional)

API Methods Used

Uses the qovery-client-go typed client throughout (no raw HTTP calls):

  • ProjectsAPI for project CRUD
  • EnvironmentActionsAPI for clone, deploy, stop
  • EnvironmentMainCallsAPI for delete, status
  • OrganizationCustomRoleAPI for RBAC role management
  • MembersAPI for member invitation
  • VariableMainCallsAPI for blueprint identification via env vars
  • ApplicationMainCallsAPI for workspace URL resolution
  • JobsAPI / JobMainCallsAPI for TTL job handling
  • OrganizationApiTokenAPI for cleanup

Testing

  • Binary builds cleanly: go build
  • All cmd package tests pass: go test -tags testing ./cmd/...
  • Pre-existing test failure in utils/context_test.go (unrelated undefined symbols) -- not introduced by this PR

evoxmusic added 6 commits May 9, 2026 13:37
Add the `qovery rde` command group for managing Remote Development
Environments (RDE). This enables platform teams to provision isolated,
pre-configured dev environments from blueprint templates.

Commands added:
- Blueprint management: create, list, delete, status, deploy, stop
- RDE lifecycle: create, list, status, start, stop, delete
- Bulk operations: stop-all, start-all, delete-all
- Advanced: upgrade (image/reclone strategies), urls, logs, info

Blueprint identification uses environment variables:
- Project-level: BLUEPRINT_PROJECT_ID (marks a project as a blueprint)
- Environment-level: BLUEPRINT_KEY (links environments to their blueprint)

RDE provisioning includes optional RBAC role creation, member invitation,
TTL job handling, and automatic deployment.
- S1039: remove unnecessary fmt.Sprintf with no format args
- S1017: use unconditional strings.TrimPrefix instead of HasPrefix+TrimPrefix
- QF1002: use tagged switch on status variable
- QF1003: replace if/else chain with switch statement
Rename 'qovery rde blueprint create' to 'qovery rde blueprint register'
and 'qovery rde blueprint delete' to 'qovery rde blueprint unregister'
since these commands mark/unmark existing projects as blueprints rather
than creating or deleting them.
- Use pterm.DefaultTable for key-value displays in status/info commands
  (consistent with PrintContext pattern)
- Use utils.PrintTable for services listing in status commands
  (consistent with service list command)
- Use pterm.FgBlue.Sprintf for resource names in action messages
  (consistent with deploy/stop/delete commands across the CLI)
- Use 'Request to X has been queued..' phrasing for action confirmations
  (consistent with application/container/helm action commands)
- Add rdePrintKeyValueTable helper for reusable key-value rendering
When creating an RDE, fetch the blueprint environment's cluster ID
and use it as the default for the clone request. The --cluster flag
still works to override this default. Also error out if --cluster
specifies a cluster name that doesn't exist.
Store RDE_OWNER_EMAIL as an environment-level variable when creating
an RDE with --email. Display it in 'rde list' (Owner column) and
'rde status' (Owner row). No additional API calls needed since the
owner email is read from the same ListEnvironmentVariables response
used for BLUEPRINT_KEY discovery.
@evoxmusic evoxmusic merged commit 0453782 into main May 9, 2026
6 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.

2 participants