nebari-dev / nebari-dev/llm-serving-pack

Apply the Access webhook invariant to sibling reconciler test fixtures

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: testing ✅ good first issue needs: follow-up 📥 priority: low 🌱 type: maintenance 🛠
Dominant language
Go
Stars
3
Forks
3
Avg merge
16h 31m
Merged PRs (30d)
11

Description

Follow-up from #47.

#47 updated auth_test.go's defaultAuthModel() to include Access.Groups: ["data-scientists"] with a comment explaining the webhook invariant. Other reconciler unit tests still construct Access: AccessSpec{}:

  • operator/internal/controller/reconcilers/modelservice_test.go
  • operator/internal/controller/reconcilers/storage_test.go
  • operator/internal/controller/reconcilers/networkpolicy_test.go
  • operator/internal/controller/reconcilers/inferencepool_test.go
  • operator/internal/controller/reconcilers/routing_test.go

These are pure-function tests that bypass the webhook, so they still compile and pass. The risk is that someone later copies one of these newTestModel/defaultModel helpers into an auth-sensitive test and hits the invariant only at admission time.

Options
  1. Apply the same Access.Groups default (with the same why-comment) to every sibling defaultXxxModel() helper.
  2. Pull a shared reconcilers/testutil.DefaultValidModel() builder and have all _test.go files call it.

(2) is a bigger refactor but leaves only one invariant-documenting comment for future authors to trip over.

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 by comparing auth_test.go's defaultAuthModel() with the helpers in modelservice_test.go, storage_test.go, networkpolicy_test.go, inferencepool_test.go, and routing_test.go. Review the two proposed approaches with a maintainer, then update the fixtures consistently and run the affected reconciler unit tests to confirm they still pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, testing-qa
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.