feat: configure Python sessions to use PPM instead of PyPI#52
feat: configure Python sessions to use PPM instead of PyPI#52ian-flores wants to merge 2 commits intomainfrom
Conversation
Add PythonPackageManagerUrl to SiteSpec and inject PIP_INDEX_URL
into Workbench sessions via launcher-env DCF config.
By default, derives Python PPM URL from the Package Manager domain
(https://{domain}/pypi/latest/simple). Custom URL override supported.
Closes #21
|
Claude finished @ian-flores's task —— View job PR Review Complete
Reviewed all 6 changed files. The implementation follows existing patterns and is well-tested. Posted review with minor suggestions for test completeness. |
There was a problem hiding this comment.
Code Review
Overall this is a clean implementation that follows existing patterns in the codebase. The new Python Package Manager URL functionality integrates well with the existing R package manager URL handling.
Strengths
- Follows the established pattern for URL override (derive from domain by default, allow explicit override)
- Tests cover the three key scenarios: default URL derivation, custom override, and PATH+PIP_INDEX_URL combination
- API field documentation is clear with examples
Suggestions
internal/controller/core/site_test.go
TestSiteReconciler_PythonPPMUrlWithLauncherEnvPath (line 984-1002): This test doesn't verify the actual PIP_INDEX_URL value, only that it exists. Consider adding an assertion for the expected URL value (derived from defaultSite settings) to make the test more robust and self-documenting:
// Add assertion for expected URL
expectedUrl := "https://packagemanager.test.example.com/pypi/latest/simple" // based on defaultSite
assert.Equal(t, expectedUrl, testWorkbench.Spec.Config.WorkbenchDcfConfig.LauncherEnv.Environment["PIP_INDEX_URL"])api/core/v1beta1/site_types.go
Consider whether +kubebuilder:validation:Pattern would be valuable for PythonPackageManagerUrl to ensure valid URL format at admission time. The existing PackageManagerUrl doesn't have this either, so this is more of a follow-up consideration for both fields.
Controller Checklist
- Reconciliation is idempotent - URL is deterministically derived
- Config flows from Site -> Product correctly
- Unit tests exist (3 new tests)
API Checklist
- Kubebuilder annotations present (omitempty)
- New field has sensible default (derives from Package Manager domain)
- Validation rules - optional, as discussed above
The implementation looks good to merge.
Summary
PythonPackageManagerUrlfield toSiteSpecfor optional overridePIP_INDEX_URLinto Workbench sessions via launcher-env DCF confighttps://{domain}/pypi/latest/simple)Test plan
Closes #21