Accept numbers and booleans in `withEnvironment`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 65/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker, node.js, typescript
調査の方向性
Read packages/testcontainers/src/types.ts and trace how Environment is consumed by the two withEnvironment methods and exec's env option. Check how subclasses access the protected environment field, then review the related issue #1519 because both changes rewrite withEnvironment. Done means accepting string, number, boolean, and undefined values while stored environment values remain strings and undefined keys are skipped.
索引モデルが issue の本文から書いたものです。
説明
What happens
Environment is { [key: string]: string }, so every non-string value has to be converted at the call site:
.withEnvironment({
PORT: String(port),
MAX_CONNECTIONS: maxConnections.toString(),
DEBUG: "true",
})
Optional values need a conditional spread to avoid passing undefined:
.withEnvironment({ ...(token ? { TOKEN: token } : {}) })
The same type is used by DockerComposeEnvironment.withEnvironment and by exec's env option.
Expected
withEnvironment accepts string | number | boolean values and converts them, and skips keys whose value is undefined:
.withEnvironment({ PORT: port, DEBUG: true, TOKEN: token })
Where
Environmentinpackages/testcontainers/src/types.tswithEnvironmentinpackages/testcontainers/src/generic-container/generic-container.tswithEnvironmentinpackages/testcontainers/src/docker-compose-environment/docker-compose-environment.ts
Notes
- Widening the accepted type is compatible for callers. Subclasses that read the protected
environmentfield should keep seeing strings. - Related: #1519 (duplicate entries when a key is set twice).
Dependencies
- Stack on #1519: both rewrite
withEnvironment.
- 主要言語
- TypeScript
- スター
- 2.6k
- フォーク
- 277
- 平均マージ
- 1日 53分
- マージ済み PR(30日)
- 58
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
testcontainers/testcontainers-node のほかの issue
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
testcontainers/testcontainers-node#1539 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
testcontainers/testcontainers-node#1533 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
testcontainers/testcontainers-node#1531 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
testcontainers/testcontainers-node#1529 ·
メンテナーはふだん 1 日以内に返信
-
enhancement minor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
testcontainers/testcontainers-node#1528 ·
メンテナーはふだん 1 日以内に返信
testcontainers/testcontainers-node の issue をすべて見る
似ている issue
-
Unsampled pageload span is profiled when profileLifecycle is 'trace' (browser UI profiling)対応中かも @Jxxunnn が今日担当しました。 オープンBrowser Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
getsentry/sentry-javascript#25497 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
e2e-failure ready-to-code
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
redhat-developer/rhdh-plugin-export-overlays#4438 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
resource: destroying a resource calls AbortController.abort() without a reason, creating an AbortError with a stack trace each time対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea: core
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
angular/angular#71422 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
facebook/docusaurus#12739 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信