Add unit tests for name generation, data transformation, and object helpers
@VISHNU0906 ci sta già lavorando.
Dal 11/11/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 72/100
Direzione di ricerca
Inizia con le funzioni elencate in internal/controller/devportal_helper.go, internal/controller/apikey_secret_controller.go, nei file dei tipi api/v1alpha1 e nei reconcilers. Leggi ogni funzione e aggiungi la copertura con unit test per i casi normali, limite, di branching, di mutazione e di round-trip descritti nell’issue. Esegui make test; il lavoro è completato quando tutte le funzioni richieste sono coperte e la test suite supera tutti i test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 3
- Fork
- 15
- Merge medio
- 1g 21h
- PR unite (30g)
- 4
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Kuadrant/developer-portal-controller
-
documentation linkinator-failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Add reference documentation for APIKeyRequest CRDForse già presa @amalsaidov l’ha presa 18 giorni fa. Apertadocumentation good first issue triage/accepted
Difficoltà 2/5 Mezza giornata Idoneità per principianti 74/100
-
triage/accepted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Kuadrant/developer-portal-controller#83 · 1 commento ·
-
Add unit tests for status and condition helper functionsForse di nuovo libera @aviralgarg05 l’ha presa 21 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement good first issue triage/accepted
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
Kuadrant/developer-portal-controller#75 · 1 commento ·
-
enhancement maintainers-only
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di Kuadrant/developer-portal-controller
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mattermost/mattermost-plugin-jira#1397 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add Free CS Systems Workshops, Starter Scaffolds & Zero-Dependency Verification CLI to CS SeriesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
docs: Route53 EKS Terraform example uses outdated EKS module arguments in main.tfForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
nutmos/expensetrackr#235 ·
I maintainer di solito rispondono entro 1 giorno