regression-env: refuse compose-era test DB URLs (localhost:543x / *_test_db) instead of reachability timeout

オープン 初心者向け
#696 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
docker-compose, postgresql, typescript
領域
testing-qa

調査の方向性

tests/regression/lib/regression-env.mjs の isDevDatabaseUrl と legacyDevDatabaseUrl から始めて、既存の開発データの形式がどのように照合されているかを確認してください。このチェックを拡張し、ポート 5432〜5435 の localhost postgres URL と、_test_db で終わるデータベース名を拒否するようにしてください。REGRESSION_ALLOW_DEV_DB=1 による上書きは維持します。回帰テストの実行が、pnpm run bos dev または pglite::memory: を案内するメッセージとともに即座に失敗し、これらの URL に対して tests/regression/lib/start-stack.mjs の waitForDatabases に到達しなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Problem

ADR 0038 retired docker-compose: all test databases are in-memory pglite, and CI no longer runs postgres. But a compose-era URL can still sneak into .env.test (or .env) and the current dev-data guard does not catch it.

What happened in practice (PR #403): a new plugin's .env.test entry carried a stale compose-era test URL —

AGENT_CONNECT_DATABASE_URL=postgres://everythingdev:everythingdev@localhost:5434/api_test_db

The regression suite resolved it, waitForDatabases (tests/regression/lib/start-stack.mjs) probed localhost:5434, found nothing listening (line removed from CI), and every regression job failed after its full retry budget with:

Error: test databases not reachable: localhost:5434 ...

Why the guard missed it

legacyDevDatabaseUrl in tests/regression/lib/regression-env.mjs refuses only the dev-data shapes:

  • pglite dev default (pglite:.bos/db)
  • postgres on localhost with user/pass everythingdev:everythingdev and db name exactly api_db or auth_db

api_test_db on port 5434 passes that check, so instead of a fail-fast refusal the run dies on a slow reachability timeout with no pointer at the actual mistake.

Proposal

Teach the guard to also classify compose-era test DB URLs and refuse them (with the same override escape hatch, REGRESSION_ALLOW_DEV_DB=1):

  • localhost postgres URLs pointing at the compose-era test ports/hosts (5432–5435 range on localhost/127.0.0.1)
  • db names matching the compose-test convention (api_test_db, auth_test_db, and any *_test_db)

The refusal message should point at the fix: regenerate .env.test via pnpm run bos dev, or set the secret to pglite::memory: per ADR 0038.

Reference

  • PR #403 incident: fix(agent-connect): .env.test routes the plugin database to in-memory pglite (ADR 0038) (commit d620e39d)
  • Guard lives in tests/regression/lib/regression-env.mjs (isDevDatabaseUrl / legacyDevDatabaseUrl)
  • Timeout lives in tests/regression/lib/start-stack.mjs (waitForDatabases)
主要言語
TypeScript
スター
5
フォーク
3
平均マージ
10時間 44分
マージ済み PR(30日)
189

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NEARBuilders/everything-dev のほかの issue

NEARBuilders/everything-dev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。