python icon indicating copy to clipboard operation
python copied to clipboard

Fix Windows Compatibility: Symlink Handling, Permission Fixes, and Test Stability Improvements

Open PraveenMudalgeri opened this issue 4 months ago • 5 comments

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it

This PR fixes multiple Windows-specific issues in the Kubernetes Python client repository to improve developer experience, test stability, and compatibility on Windows systems.

Problem: Windows environments have limited support for Unix-style symbolic links, and strict file permission semantics caused test failures. Additionally, some tests had missing imports and environment-dependent behavior that prevented Windows development.

Solution: This PR introduces targeted fixes and workarounds for these problems, enabling smooth local development and CI testing on Windows without affecting Linux/macOS compatibility.

Which issue(s) this PR fixes

Fixes #2427

Changes Made

🔧 Core Fixes

  • Symlink Handling: Added shim files with dynamic module registration in __init__.py to replace Unix-style symlinks
  • Import Issues: Fixed circular import problems and missing imports in test files
  • Test Stability: Added appropriate Windows-specific test skips for environment-dependent tests (OIDC, exec auth)

📝 Developer Experience

  • Setup Script: Created setup-windows-dev.ps1 for easy Windows development environment setup
  • Documentation: Added WINDOWS_DEVELOPMENT.md with detailed setup instructions and troubleshooting

🚀 CI Integration

  • Windows Testing: Added minimal GitHub Actions workflow (windows-test.yml) to prevent future regressions
  • Test Results: All tests now pass on Windows (123 passed, 19 appropriately skipped, 0 failures)

Testing

  • Local Testing: Complete test suite passes on Windows 11 with Python 3.9
  • Cross-platform: No regressions on Linux/macOS (existing CI still passes)
  • Import Validation: All dynamic imports work correctly without symlinks
  • CI Ready: Windows workflow validates changes automatically

Special notes for reviewers

  • No API Changes: Core Kubernetes client functionality remains unchanged
  • Minimal Impact: Changes only affect test infrastructure and Windows compatibility layer
  • Backward Compatible: All existing functionality preserved on Linux/macOS
  • Targeted Skips: Windows test skips are specific to environment-dependent operations only

Does this PR introduce a user-facing change?

Improved Windows development experience: Fixed symlink issues, test failures, and added comprehensive Windows setup documentation.

Additional documentation

  • WINDOWS_DEVELOPMENT.md - Complete Windows setup and troubleshooting guide
  • setup-windows-dev.ps1 - Automated Windows development environment setup script

PraveenMudalgeri avatar Aug 19 '25 09:08 PraveenMudalgeri

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: PraveenMudalgeri Once this PR has been reviewed and has the lgtm label, please assign roycaihw for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Aug 19 '25 09:08 k8s-ci-robot

/release-note-none

PraveenMudalgeri avatar Aug 19 '25 09:08 PraveenMudalgeri

/assign

roycaihw avatar Aug 28 '25 20:08 roycaihw

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 26 '25 21:11 k8s-triage-robot

/remove-lifecycle stale

PraveenMudalgeri avatar Nov 27 '25 02:11 PraveenMudalgeri