Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Provide in-network connection details from modules

オープン
#1,567 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
docker, node.js, typescript
領域
databases, testing

調査の方向性

Start with #1536 for network alias support and coordinate the getter name with #1538. Read the alias code in packages/testcontainers/src/test-container.ts and started-generic-container.ts, then inspect connection getters under packages/modules/*/src and the in-network listener approaches in Kafka and Redpanda. Done means modules can provide a URI using a network alias and internal port, with credentials and database name from module configuration.

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

説明

enhancement minor

What happens

Module getters return the address as seen from the test process: the Docker host and a mapped port. A second container on the same Docker network needs a different address, the first container's network alias and its internal port, and no module provides it.

const db = await new PostgreSqlContainer(image).withNetwork(network).withNetworkAliases("db").start();

db.getConnectionUri(); // postgres://test:test@localhost:55012/test, no use to another container

const app = await new GenericContainer(appImage)
  .withNetwork(network)
  .withEnvironment({ DATABASE_URL: "postgres://test:test@db:5432/test" }) // assembled by hand
  .start();

The module knows the internal port, the credentials and the database name. The user has to repeat all of them, and keep them in step with the module's defaults.

Expected

Each module can produce its connection details for use inside a network:

db.getConnectionUri({ network }); // postgres://test:test@db:5432/test

A started container can report its aliases on a network, which this needs.

Where

  • packages/testcontainers/src/test-container.ts and started-generic-container.ts, for the aliases
  • the connection getters in packages/modules/*/src

Notes

  • Kafka and Redpanda already have to deal with in-network listeners. Their approach is a starting point.
  • The naming should follow whatever the modules converge on for connection getters.

Dependencies

  • Blocked by #1536: needs a started container to know its aliases on a network.
  • Coordinate with #1538: for the getter name.
主要言語
TypeScript
スター
2.6k
フォーク
274
平均マージ
1日 14時間
マージ済み PR(30日)
44

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

testcontainers/testcontainers-node のほかの issue

testcontainers/testcontainers-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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