8 Commits

Author SHA1 Message Date
5ad72fe986 Fix remote sync bugs and improve error handling
Fixes two critical issues:
1. Remote clone/sync was never triggered because wmill sync ran before
   checking if workspace was empty. Reordered flow to check/clone/sync
   git repo BEFORE running wmill sync.

2. Push failures were reported as success because GitPython's push()
   doesn't raise exceptions for rejections. Added explicit checking of
   push result flags (ERROR and REJECTED).

Additional improvements:
- When workspace has files but no .git, delete contents and clone from
  remote to ensure proper sync state
- All three cases now properly sync with remote before Windmill overwrites

New flow:
1. Check workspace state and init/clone/sync git repo
2. Run wmill sync (Windmill overwrites files)
3. Commit and push (with proper error detection)

Co-Authored-By: Claude <noreply@anthropic.com>
v0.1.0-alpha.5 v0.1.0
2025-11-09 22:20:52 -05:00
f276beae3b Add remote repository sync support
- Clone remote repository on first sync if workspace is empty
- Sync local repo with remote (fetch + hard reset) on subsequent syncs
- Ensures Windmill workspace changes are built on latest remote commits
- Prevents push failures due to divergent history

New functions:
- is_workspace_empty(): Check if workspace needs cloning
- clone_remote_repository(): Clone and checkout/create branch
- sync_local_with_remote(): Fetch and hard reset to remote

Co-Authored-By: Claude <noreply@anthropic.com>
v0.1.0-alpha.4
2025-11-09 22:09:01 -05:00
ecc598788a Fix wmill sync authentication by using CLI flags
Replace environment variable authentication (WM_TOKEN, WM_WORKSPACE,
WM_BASE_URL) with explicit command-line flags (--token, --workspace,
--base-url) as required by wmill CLI.

According to wmill documentation, when using --base-url, the --token
and --workspace flags are required and no local workspace configuration
will be used. This is the correct approach for a stateless containerized
service where credentials are passed per-request.

This fixes the exit code 255 error that occurred when wmill tried to
run sync without proper workspace configuration.
v0.1.0-alpha.3
2025-11-09 21:32:11 -05:00
d380cee815 Fix wmill CLI installation for multi-architecture support
Replace direct binary download with npm-based installation to properly
support both amd64 and arm64 architectures.

Changes:
- Install Node.js 20 via NodeSource repository
- Install windmill-cli globally via npm
- Remove architecture-specific binary download logic that was failing
  because wmill binaries are not published separately from windmill server

This fixes the "Exec format error" that occurred when attempting to run
the wmill CLI on ARM64 systems.
v0.1.0-alpha.2
2025-11-09 21:22:30 -05:00
441761cc35 Add CHANGELOG.md for v0.1.0 release
Document all features and changes in initial release including:
- Containerized Windmill workspace sync service
- Flask webhook server with API-based secret management
- GitHub workflow for automated Docker builds
- Comprehensive documentation and validation scripts
v0.1.0-alpha.1
2025-11-09 20:41:24 -05:00
6e7d4276ea Add GitHub workflow for automated Docker image builds
Creates workflow that triggers on version tags (v*) to automatically build
and publish Docker images to GitHub Container Registry. Non-alpha releases
also create draft GitHub releases for review before publishing.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-09 20:37:29 -05:00
0509c44497 Add MIT License and Docker build validation script
- Add MIT License with William Ballou as copyright holder
- Create scripts/validate_docker_build.sh for testing Docker builds independently
- Update documentation to reflect API-based secret configuration model
- Refactor sync.py to accept config via function parameters instead of env vars
- Update server.py to parse JSON payloads and validate required fields
- Improve security by removing secrets from environment variables
2025-11-09 20:29:52 -05:00
c838fa568c Initial commit: Windmill Git Sync service
Add containerized service for syncing Windmill workspaces to Git repositories.

Features:
- Flask webhook server for triggering syncs from Windmill
- wmill CLI integration for pulling workspace content
- Automated Git commits and push to remote repository
- Network-isolated (only accessible within Docker network)
- Designed to integrate with existing Windmill docker-compose files

Key components:
- Docker container with Python 3.11, wmill CLI, Git, and Flask
- Sync engine with error handling and logging
- External volume support for persistent workspace data
- Comprehensive documentation (README.md and CLAUDE.md)
2025-11-08 18:40:26 -05:00