refactor: migrate to api-server library pattern#1
Merged
Conversation
Replace direct Kubernetes access with api-server service library for unified business logic across CLI and API server. ## Changes ### Architecture - Replace pkg/k8s with pkg/workspace wrapper service - Import api-server/pkg/services/forkspacer as library - All commands delegate to api-server for business logic - Add Get() and List() methods in wrapper (api-server missing these) ### Commands Refactored - create: Uses service.Create() with proper waitForWorkspaceReady polling - list: Uses service.List() with namespace filtering support - get: Uses service.Get() - delete: Uses service.Delete() - hibernate: Uses service.SetHibernation(true) - wake: Uses service.SetHibernation(false) ### Code Quality - Simplified codebase: -178 net lines of code - Fixed 3 go vet errors (non-constant format strings) - Updated to Go 1.25 - Added Makefile for build automation - Improved waitForWorkspaceReady with proper polling and error detection ### Documentation - Updated README architecture section - Documented api-server library pattern - Fixed project structure (removed pkg/k8s references) - Updated development prerequisites to Go 1.25 ### CI/CD - Updated workflow to Go 1.25 - Removed -race flag (Go 1.25 compatibility) - Simplified test execution ## Benefits - Single source of truth for workspace operations - Type-safe compile-time checking - No code duplication for business logic - Consistent validation and error handling - No network overhead (direct library calls) ## Breaking Changes - Removed pkg/k8s (replaced by pkg/workspace) - Added dependency on api-server v1.0.0 - Requires Go 1.25 (updated from 1.24)
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
GitHub Actions runners are amd64/x86_64, so we can only verify the linux-amd64 binary. Trying to execute linux-arm64 binary on amd64 runner causes 'Exec format error'. This ensures we still verify the binary works, but only for the architecture that matches the runner.
joshuasequeira19
added a commit
that referenced
this pull request
Oct 10, 2025
The tarballs were containing platform-specific names like 'forkspacer-darwin-arm64' but the install instructions expect just 'forkspacer'. Now the workflow renames the binary to 'forkspacer' (or 'forkspacer.exe' for Windows) before creating the archive. This matches industry standard practice (kubectl, helm, etc.). Fixes: #1 (install instructions not working)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace direct Kubernetes access with api-server service library for unified business logic across CLI and API server.
Changes
Architecture
Commands Refactored
Code Quality
Documentation
CI/CD
Benefits
Breaking Changes