Skip to content

feat: configure Python sessions to use PPM instead of PyPI#52

Draft
ian-flores wants to merge 2 commits intomainfrom
python-ppm-config
Draft

feat: configure Python sessions to use PPM instead of PyPI#52
ian-flores wants to merge 2 commits intomainfrom
python-ppm-config

Conversation

@ian-flores
Copy link
Collaborator

Summary

  • Add PythonPackageManagerUrl field to SiteSpec for optional override
  • Inject PIP_INDEX_URL into Workbench sessions via launcher-env DCF config
  • By default, derives Python PPM URL from Package Manager domain (https://{domain}/pypi/latest/simple)

Test plan

  • Unit tests added (3 new tests covering default URL, custom override, PATH+PIP_INDEX_URL combo)
  • All 103 controller tests pass
  • Manual verification in staging environment

Closes #21

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
Copy link

claude bot commented Jan 26, 2026

Claude finished @ian-flores's task —— View job


PR Review Complete

  • Read review guidelines
  • Create pending review
  • Analyze PR diff
  • Review changed files in detail
  • Add inline comments (submitted in review body due to permissions)
  • Submit review

Reviewed all 6 changed files. The implementation follows existing patterns and is well-tested. Posted review with minor suggestions for test completeness.

Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configure python sessions to use ppm instead of pypi

1 participant