rstack dev: run a project's products together for development, without Studio

未关闭
#2,635 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
postgresql, rust
领域
backend, cli, databases

调研方向

Start by reading the existing bregctl dev start and bregctl dev stop flows, the product activation steps, and related issue #2214 on port allocation. The proposal defines a cross product runner, isolated PostgreSQL resources, a test issuer, plan validation, TTL cleanup, and Registry Studio integration; it leaves key design questions open. Done means the acceptance scenarios pass on Linux and macOS, including concurrent runs and cleanup.

由索引模型根据 Issue 内容生成。

描述

area:platform enhancement

Why

A project that uses several products, for example a BReg registry and a Casework service for a licensing journey, has no single command that runs them together for development. Each product has its own <product>ctl dev mode with its own database container and issuer, and nothing starts them as one run with shared test people. Registry Studio tests a saved project through its own runner, but an adopter working from a plain Git checkout, an agent or a CI job without Studio cannot do the same.

Proposal

rstack dev runs the products of one project directory as one isolated development run.

rstack dev start <project-dir> [--database-url <url>] [--ttl <duration>] [--json]
rstack dev status <run-id> [--json]
rstack dev token <run-id> --as <test-person> [--json]
rstack dev stop <run-id>

The verbs follow bregctl dev start and bregctl dev stop.

Inputs

  • The project's product files, exactly as they are deployed. rstack dev changes nothing in them and needs no development-only settings inside them.
  • One small dev plan file in the project, with a schema published with each release. It names the test people per role and the client each one acts through, the order the products start in, and the journey to check once the run is ready. Registry Studio writes it when it publishes a project; an adopter writes it by hand.
  • A PostgreSQL server address. Each run creates its own databases and roles there, so a run needs no Docker.

What a run does

  • Starts a test issuer private to the run. It signs under the project's issuer name with a key made for that run, and the products trust it for that run only, so a token from one run is refused by another run and by a deployed system.
  • Activates each product as a deployment does (for BReg: check, package, apply, verify), then serves it on loopback on free ports.
  • Runs the plan's journey check and reports the result.

Output, as text or as JSON with --json: the run ID, each product's URL, the journey result, and how to get a token per test person (rstack dev token). The run holds until stop or until its TTL passes. stop removes the run's databases, roles, keys and scratch files.

Acceptance

  • From a plain Git checkout of a licensing example project (a BReg registry and a Casework service) with no Studio installed, rstack dev start brings both products up and the plan's journey passes, on Linux and macOS.
  • Two runs of the same project at the same time never share a database, role, port, key or token.
  • rstack dev stop and an expired TTL leave nothing behind on the PostgreSQL server or on disk.
  • A malformed dev plan is refused before anything starts, naming the field.
  • Registry Studio's test runs use this command, so there is one implementation of a development run.

Scope

  • First: BReg and Casework. Other runtime products join as their run contracts allow.
  • Later, separate: a browser sign-in page on the test issuer, so a UI host can sign a test person in.
  • Not in scope: TLS between products, production deployment, and hosted previews (a hosting service can build on this command).

Open questions

  1. When no --database-url is given, should rstack dev start start a local PostgreSQL from a pinned image, as the product dev modes do? That is friendlier on a laptop; requiring an address keeps the command free of Docker.
  2. Should the per-product dev modes stay as they are for single-product work, or later delegate to rstack dev?
  3. The dev plan's file name and where it sits in a project.

Related: #2214 (one port block per product for dev starts).

主要语言
Rust
星标
2
派生
0
平均合并
9 小时 48 分钟
30 天内合并 PR
151

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

registrystack/registry-stack 的其他 Issue

查看 registrystack/registry-stack 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。