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

Đang mở
#2,635 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
30/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
postgresql, rust
Lĩnh vực
backend, cli, databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
Rust
Star
2
Fork
0
Merge trung bình
9 giờ 48 phút
Pull request đã merge (30 ngày)
151

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của registrystack/registry-stack

Tất cả issue của registrystack/registry-stack

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.