dataiku / dataiku/kiji-proxy

Add unit tests for src/backend/pii/masking_service.go

Open Beginner friendly
#430 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue help wanted
Dominant language
Go
Stars
432
Forks
51
PR merge metrics
No merged PRs in 30d

Description

src/backend/pii/masking_service.go orchestrates detection + generator lookup + mapping persistence, but lacks a dedicated masking_service_test.go. Sibling files (database.go, generators, detectors) all have tests.

What to add

Create src/backend/pii/masking_service_test.go covering:

  • A string containing 2–3 PII types — each is masked, original/masked pairs are stored in the mapper
  • Repeated identical PII — should map to the same dummy value within a session
  • No PII in input — output equals input, no mappings stored
  • Mixed-language / unicode input — does not panic and round-trips correctly
Hints
  • Stub the detector to return a fixed []Entity rather than running ONNX in tests.
  • Reuse database_test.go patterns.
  • Run go test ./src/backend/pii/....

Difficulty: good first issue, ~1–2 hours.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/backend/pii/masking_service.go and the patterns in database_test.go, then run go test ./src/backend/pii/.... Create masking_service_test.go with a stubbed detector and verify masking, repeated-value reuse, no-PII behavior, and mixed-language or Unicode round-tripping, including mapper contents.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, security, testing-qa
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.