Files
WorldTeacher/STATUS.md
2025-11-04 15:28:26 +01:00

5.9 KiB

Implementation Status

Completed

Core Implementations

  • Python implementation (python/main.py)

    • CLI with argparse
    • YAML config loading
    • Git operations via subprocess
    • Embedded licenses (MIT, GPLv3, AGPLv3, Unlicense)
    • HTML entity decoding
    • Cross-platform config path
    • Force remote reset
    • Network-aware push with warnings
    • Tests passing
  • Rust implementation (rust/src/main.rs)

    • CLI with clap (derive API)
    • YAML config via serde_yaml
    • Git operations via git2 crate
    • Embedded licenses via include_str!
    • HTML entity decoding via html-escape
    • Cross-platform config path
    • Identical behavior to Python version
  • Go implementation (go/main.go)

    • CLI with cobra
    • YAML config via gopkg.in/yaml.v3
    • Git operations via subprocess
    • Embedded licenses via //go:embed
    • HTML entity decoding
    • Cross-platform config path
    • Identical behavior to Python/Rust versions

Git Flow

  • Detect or initialize git repository
  • Ensure main branch is default
  • Remove all existing remotes
  • Force set origin to templated URL
  • Add LICENSE (if missing or --force)
  • Add/overwrite .gitignore from embedded template
  • Commit changes with "Initial commit"
  • Create and checkout dev branch (default: "dev")
  • Attempt push to remote with network error handling

Gitea Workflows

  • Workflow directory structure (.gitea/workflows/)
  • Changelog config moved to .gitea/changelog_config.json
  • Python workflows:
    • test-python.yml (name: "Test Python")
    • test-python-docker-build.yml (workflow_run trigger)
    • python_package-release.yml
    • docker-release.yml
  • Rust workflows:
    • test-rust.yml (name: "Test Rust")
    • test-rust-docker-build.yml (workflow_run trigger)
    • cargo-release.yml
  • Go workflows:
    • test-go.yml (name: "Test Go")
    • test-go-docker-build.yml (workflow_run trigger)
    • go-release.yml

Configuration

  • Default config file at ~/.config/GMS/.config.yaml
  • Windows path support (%USERPROFILE%\.config\GMS\.config.yaml)
  • Auto-create config with defaults
  • CLI argument overrides
  • Template substitution in git URL ({owner}, {repo})
  • License placeholder substitution ({year}, {fullname})

Documentation

  • Comprehensive README.md
  • BUILD.md with build instructions for all three languages
  • EXAMPLES.md with usage examples
  • Inline code documentation
  • Workflow comments and descriptions

Asset Embedding

  • Python embed_assets.py helper script
  • Rust include_str! for licenses and .gitignore
  • Go //go:embed for licenses and .gitignore
  • HTML entity decoding for GPL/AGPL/Unlicense

🔄 Partial / In Progress

Workflow Scaffolding

  • Directory creation (.gitea/, .gitea/workflows/)
  • Workflow file templates created
  • Dynamic workflow generation based on deploy_type
    • Currently prints warnings and creates directories
    • TODO: Copy appropriate workflow files based on flag
  • Language detection for automatic workflow selection

Testing

  • Python unit tests (test_main.py)
  • Rust unit tests
  • Go unit tests
  • Integration tests for git operations
  • End-to-end workflow tests

Build System

  • Python pyproject.toml with hatchling
  • Rust Cargo.toml
  • Go go.mod
  • PyInstaller spec for Python binary
  • GitHub Actions / Gitea workflows for building releases
  • Automated cross-platform builds

Not Implemented

Features

  • Interactive mode (prompt for missing args)
  • Dry-run mode (preview changes without applying)
  • Backup existing files before overwriting
  • Git hooks installation
  • Pre-commit configuration
  • Custom workflow templates via config
  • Multiple remote support (beyond origin)

Workflow Features

  • Dockerfile generation (currently just warns)
  • Language-specific .gitignore variants
  • Automatic dependency file generation (requirements.txt, Cargo.toml, etc.)
  • Container registry selection
  • Branch protection rules setup
  • Issue/PR templates

Advanced Git Operations

  • GPG signing setup
  • Git LFS initialization
  • Submodule configuration
  • Sparse checkout setup

Tooling

  • Shell completion scripts (bash, zsh, fish, PowerShell)
  • Man pages
  • GUI wrapper
  • VS Code extension integration

🐛 Known Issues

  1. Python package structure: Required python/__init__.py and [tool.hatch.build.targets.wheel] in pyproject.toml
  2. Workflow generation: Currently only creates directories, doesn't copy workflow files dynamically
  3. Git push errors: Warnings are shown but might not be clear enough
  4. HTML entities: Only basic entities decoded (<, >, &, ") - may miss others
  5. License mapping: "GPLv3" string doesn't match "GPL-3.0.txt" filename automatically in all cases

📋 Next Steps

High Priority

  1. Implement dynamic workflow file copying based on --deploy-type
  2. Add Rust and Go unit tests
  3. Create PyInstaller build script
  4. Test on Linux and macOS
  5. Fix license enum mapping inconsistencies

Medium Priority

  1. Add integration tests for git operations
  2. Create release workflows in .gitea/workflows/ for this repo
  3. Document required Gitea secrets more clearly
  4. Add shell completion scripts
  5. Create example Dockerfiles for each language

Low Priority

  1. Add interactive mode
  2. Support custom workflow templates
  3. Add dry-run mode
  4. Create GUI wrapper
  5. Write man pages

📊 Test Coverage

  • Python: ~60% (basic unit tests only)
  • Rust: 0% (no tests yet)
  • Go: 0% (no tests yet)
  • Integration: 0% (not implemented)

🎯 Goals

  • 100% behavioral parity across Python/Rust/Go
  • 80%+ test coverage for all implementations
  • Full workflow generation support
  • Automated release builds
  • Cross-platform verified (Windows, Linux, macOS)