dataiku / dataiku/kiji-proxy

Add unit tests for src/backend/processor/response.go

Open Beginner friendly
#429 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/processor/response.go is the only file in the processor package and has no response_test.go. Response post-processing (PII restoration / streaming handling) is on the hot path and worth testing in isolation.

What to add

Create src/backend/processor/response_test.go with table-driven tests for:

  • Non-streaming JSON response — masked values are restored to originals
  • Streaming/SSE response — chunks are reassembled and restored correctly
  • Empty body / no PII — passes through unchanged
  • Mapping miss (response contains a masked token with no entry in the map) — fallback is documented and tested
Hints
  • Mirror the style of src/backend/pii/database_test.go for table-driven tests.
  • Construct mappings manually rather than wiring up the full detector.
  • Run go test ./src/backend/processor/....

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/processor/response.go to identify the response post-processing entry points and behavior for JSON and streaming responses. Mirror the table-driven style in src/backend/pii/database_test.go, construct mappings manually, and run go test ./src/backend/processor/...; done means the listed restoration, passthrough, and mapping-miss cases are covered.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.