Add unit tests for name generation, data transformation, and object helpers
@VISHNU0906 がすでに取り組んでいます。
2026年11月11日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 72/100
調査の方向性
internal/controller/devportal_helper.go、internal/controller/apikey_secret_controller.go、api/v1alpha1 の型ファイル、および reconciler にある一覧の関数から始めます。各関数を読み、issue に記載された正常系、境界値、分岐、ミューテーション、ラウンドトリップのケースに対する unit coverage を追加します。make test を実行します。要求されたすべての関数がカバーされ、テストスイートが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Write unit tests for the pure functions that generate deterministic names, transform data between types, and manage object annotations. All testable without envtest.
Testing Guidance
For each function, think about:
- What does it return for normal, expected input?
- What happens at the boundaries — empty strings, nil objects, missing fields?
- If there's branching logic, have you covered each branch?
Scope
internal/controller/devportal_helper.go
APIKeyRequestName()— generates a DNS-1123 compliant name from an APIKey using a SHA-256 hash suffix. Think about: does the output meet DNS-1123 rules? Is it deterministic (same input = same output)? Different namespace/name combinations that could collide without the hash.
internal/controller/apikey_secret_controller.go
enforcementSecretName()— same pattern as above, generates a deterministic name for enforcement secrets. Same considerations apply.
api/v1alpha1/apikey_types.go
APIProductKey()— returns an ObjectKey for the referenced APIProduct, falling back to the APIKey's own namespace if the ref namespace is empty. Test the fallback behaviour.
api/v1alpha1/apikeyrequest_types.go
ClientObject()— converts an APIKeyReference to an ObjectKey. Straightforward struct conversion.
api/v1alpha1/apiproduct_types.go
PlanPolicyIntoPlans()— converts a PlanPolicy's plan list into PlanSpec slice. Test with nil input, empty plan list, and multiple plans.
internal/controller/apiproduct_controller.go
extractIssuerURLFromAuthScheme()— finds the first JWT issuer URL from an auth scheme. Consider: no authentication map, authentication with non-JWT entries, multiple JWT entries (which one wins?), nil auth scheme.
internal/controller/apikeyrequest_controller.go
apiKeyRequestSpecMutator()— compares existing vs desired specs, mutates existing if different, returns whether mutation occurred. Test: specs are equal (no mutation), specs differ (mutation happens), verify the existing object is actually updated.
internal/reconcilers/base_reconcilers.go
TagObjectToDelete()/IsObjectTaggedToDelete()— adds/checks a deletion annotation. Test: object with no annotations, object with existing annotations, round-trip (tag then check).
Review & Verification
PRs should include:
- How to review the changes (areas of interest, suggested review order)
- Steps to confirm locally:
make testruns and passes
- 主要言語
- Go
- スター
- 3
- フォーク
- 15
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 4
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Kuadrant/developer-portal-controller のほかの issue
-
documentation linkinator-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
Add reference documentation for APIKeyRequest CRD対応中かも @amalsaidov が 18 日前に担当しました。 オープンdocumentation good first issue triage/accepted
難易度 2/5 半日 初心者へのやさしさ 74/100
-
triage/accepted
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
Kuadrant/developer-portal-controller#83 · コメント 1 件 ·
-
Add unit tests for status and condition helper functions再び着手できるかも @aviralgarg05 が 21 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement good first issue triage/accepted
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
Kuadrant/developer-portal-controller#75 · コメント 1 件 ·
-
enhancement maintainers-only
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Kuadrant/developer-portal-controller の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mattermost/mattermost-plugin-jira#1397 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add Free CS Systems Workshops, Starter Scaffolds & Zero-Dependency Verification CLI to CS Seriesオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
docs: Route53 EKS Terraform example uses outdated EKS module arguments in main.tf対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
nutmos/expensetrackr#235 ·
メンテナーはふだん 1 日以内に返信