bregctl test: a journey cannot wait for automatic application after submit

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
postgresql, rust

调研方向

Start with crates/registry-breg/src/fixtures/proposals.rs for supported journey operations and assertion fields, then read the schema-test runtime in crates/registry-breg/src/fixtures.rs and the journey guide at docs/site/src/content/docs/configure/breg-journeys.mdx. First determine whether the rehearsal starts an application worker; the issue notes this is unconfirmed. Done means a bounded journey wait can observe applicationStatus: applied, read the changed record, report a named timeout diagnostic, and is documented with a runnable product example.

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

描述

Problem

An Action whose Proposal has no review and automatic application is applied by the built-in executor after Submit. A journey in tests/journeys.yaml has no way to wait for that application, so it cannot assert what the Action applied. A get step after Submit races the executor, and the journey format has no polling or wait step.

Evidence

All line numbers are on origin/main at 36d25ef652.

  • crates/registry-breg/src/fixtures/proposals.rs:10 to :22: the journey Proposal operations are Start, Get, Edit, Submit, Revise, Rebase, Retry, Cancel, Apply, GetReviewContext and GetReviewStatus. There is no wait, poll or "until" operation.
  • crates/registry-breg/src/fixtures/proposals.rs:187: Proposal steps may assert only state, submissionVersion, effectDigest and applicationStatus. Any other field is refused as JourneyShapeRefused.
  • rg -i "poll|sleep|wait|eventually|until" over crates/registry-breg/src/fixtures.rs, crates/registry-breg/src/fixtures/ and docs/site/src/content/docs/configure/breg-journeys.mdx finds no wait semantics.
  • crates/registry-breg/src/fixtures.rs:3837 to :3840: the schema-test runtime says no review worker runs in the rehearsal. I found no application worker started there either, but I did not run a journey to confirm that a Submit leaves applicationStatus queued.
  • docs/site/src/content/docs/configure/breg-proposals.mdx:402: automatic application is performed by the built-in executor after approval.
  • docs/site/src/content/docs/configure/breg-journeys.mdx:122 to :126: the page describes the bregctl test run and does not mention automatic application.

Proposed change

Pick the simplest of these and record the choice:

  1. Run the application executor in the schema-test runtime and add a bounded wait expectation on a Get step (for example expect: {applicationStatus: applied} with a step timeout), so the journey can then get the changed record.
  2. Or apply synchronously inside the rehearsal for automatic Actions, so the response to Submit already carries applicationStatus: applied.

Option 2 is smaller but tests a different path from production. Option 1 keeps the production path.

Acceptance

  • A journey can start and submit a review-free Proposal, then assert applicationStatus: applied and read the changed record.
  • The wait is bounded and fails with a named diagnostic on timeout.
  • The journeys page documents the behaviour with a runnable example, and the example journey for such an Action is added to a product example.

Not included

The second half of the original request, that a failed schema test leaves no receipt and the single-use test database costs a fresh database per retry, is not drafted. The code does say "recreate the disposable database before retrying" for execution and database errors (crates/registry-bregctl/src/lib.rs:6858, :6882, :6896), and bregctl dev rebuilds the database on each run (crates/registry-bregctl/src/dev/mod.rs:2869). I could not confirm that a rerun on a used database is refused, because the candidate checks (crates/registry-breg/src/fixtures.rs:5722 to :5742) compare the registry state, not prior journey data. It needs a real run against PostgreSQL.

主要语言
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 摘要。