Skip to content

feat: add hulk_clean_everything() and push_to_git() with clean-state guard#135

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/clean-and-push-to-git
Draft

feat: add hulk_clean_everything() and push_to_git() with clean-state guard#135
Copilot wants to merge 2 commits intomainfrom
copilot/clean-and-push-to-git

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Implements two public functions enabling a safe clean-then-push workflow: run cleanup first, push only if the repo is in a clean state.

New module: hulk_git_operations.py

  • hulk_clean_everything() — delegates to existing BunkerCleaner to purge .next, node_modules/.cache, __pycache__ (recursive), and temp_logs; sets a session-scoped _cleaned flag
  • push_to_git() — enforces three guards before pushing:
    1. _cleaned is True (i.e. hulk_clean_everything() was called this session)
    2. E50_GIT_PUSH=1 is set (accidental-push safeguard, consistent with all other push scripts)
    3. git status --porcelain is empty (no uncommitted changes)
  • Respects E50_FORCE_PUSH, E50_GIT_REMOTE, E50_GIT_BRANCH, E50_PROJECT_ROOT
  • Runnable directly as a script:
hulk_clean_everything()
print(push_to_git())

Tests: tests/test_hulk_git_operations.py

10 unit tests covering each guard failure path, force-push flag propagation, git error handling, and the full success path.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryonyou-app Ready Ready Preview, Comment Apr 8, 2026 3:48pm
tryonyou-pilot Error Error Apr 8, 2026 3:48pm

Request Review

Copilot AI changed the title [WIP] Clean workspace and push changes to Git feat: add hulk_clean_everything() and push_to_git() with clean-state guard Apr 8, 2026
Copilot AI requested a review from LVT-ENG April 8, 2026 15:48
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.

2 participants