nebari-dev / nebari-dev/llm-serving-pack
Apply the Access webhook invariant to sibling reconciler test fixtures
Nobody has claimed this yet.
- 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.gooperator/internal/controller/reconcilers/storage_test.gooperator/internal/controller/reconcilers/networkpolicy_test.gooperator/internal/controller/reconcilers/inferencepool_test.gooperator/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
- Apply the same
Access.Groupsdefault (with the same why-comment) to every siblingdefaultXxxModel()helper. - Pull a shared
reconcilers/testutil.DefaultValidModel()builder and have all_test.gofiles call it.
(2) is a bigger refactor but leaves only one invariant-documenting comment for future authors to trip over.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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