Skip to content

[1/2] Decouple Envs from version: Revive-scripts#392

Open
burtenshaw wants to merge 11 commits intomainfrom
revive-scripts
Open

[1/2] Decouple Envs from version: Revive-scripts#392
burtenshaw wants to merge 11 commits intomainfrom
revive-scripts

Conversation

@burtenshaw
Copy link
Collaborator

Summary

This PR updates the scripts and deletes unused ones.

The main aim is to be able to delete all the envs to the hub as a collection like this which allows them to be tested.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • New environment
  • Refactoring

Alignment Checklist

Before submitting, verify:

  • I have read .claude/docs/PRINCIPLES.md and this PR aligns with our principles
  • I have checked .claude/docs/INVARIANTS.md and no invariants are violated
  • I have run /pre-submit-pr (or bash .claude/hooks/lint.sh and tests) and addressed all issues

RFC Status

  • Not required (bug fix, docs, minor refactoring)
  • RFC exists: #___
  • RFC needed (will create before merge)

Test Plan

Claude Code Review

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Feb 17, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 17, 2026

Greptile Summary

This PR consolidates and enhances the Hugging Face deployment scripts. Three unused scripts (CONVERT.md, convert_env.sh, deploy_to_hf.sh) were deleted, while manage_hf_collection.py and prepare_hf_deployment.sh received significant improvements:

  • Versioned collections: Collections can now be created/managed per release version (e.g., "OpenEnv Environment Hub v2.1.0")
  • Enhanced CLI: Better argument parsing with support for --all, --env, --openenv-version, --collection-slug, etc.
  • Version pinning: Automatically pins OpenEnv git dependencies to a specific release tag
  • Improved robustness: Better error handling, cross-platform compatibility, and dry-run support

Critical Issue Found:

  • The GitHub Actions workflow .github/workflows/deploy-hf-env.yml still references the deleted scripts/deploy_to_hf.sh, which will cause deployment failures. This must be updated to use scripts/prepare_hf_deployment.sh instead.

Confidence Score: 1/5

  • This PR has a critical breaking change that will cause deployment failures
  • The deleted deploy_to_hf.sh script is still referenced in the GitHub Actions workflow, which will break all deployments. While the script improvements are excellent, this oversight creates a production-breaking issue that must be fixed before merge.
  • .github/workflows/deploy-hf-env.yml requires immediate attention - it references a deleted script and will fail on execution

Important Files Changed

Filename Overview
scripts/manage_hf_collection.py Enhanced to support versioned collections and explicit space lists. Clean refactoring with improved error handling.
scripts/prepare_hf_deployment.sh Significantly enhanced with better CLI options, version pinning, collection management, and robust error handling.
scripts/deploy_to_hf.sh Deleted but still referenced in .github/workflows/deploy-hf-env.yml - breaks CI/CD workflow.

Flowchart

flowchart TD
    A[Start Deployment] --> B{Deploy All or Single?}
    B -->|All| C[Discover all deployable envs]
    B -->|Single| D[Use specified env]
    
    C --> E[For each environment]
    D --> E
    
    E --> F[Create staging directory]
    F --> G[Pin OpenEnv refs to version]
    G --> H[Strip dev artifacts]
    H --> I[Create Dockerfile with base image]
    I --> J[Generate README with HF metadata]
    
    J --> K{Dry run?}
    K -->|Yes| L[Print actions only]
    K -->|No| M[Upload to HF Space]
    
    M --> N[Add space to versioned collection]
    
    N --> O{Skip collection?}
    O -->|No| P[Update HF collection via manage_hf_collection.py]
    O -->|Yes| Q[Skip collection update]
    
    P --> R[Deployment complete]
    Q --> R
    L --> R
Loading

Last reviewed commit: 6a85f22

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 17, 2026

Additional Comments (2)

.github/workflows/deploy-hf-env.yml
This workflow references deploy_to_hf.sh which was deleted in this PR. Update to use prepare_hf_deployment.sh instead.

          chmod +x scripts/prepare_hf_deployment.sh
          if [ -n "${{ github.event.inputs.base_image_sha }}" ]; then
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}" --base-sha "${{ github.event.inputs.base_image_sha }}"
          else
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}"
          fi
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/deploy-hf-env.yml
Line: 133:138

Comment:
This workflow references `deploy_to_hf.sh` which was deleted in this PR. Update to use `prepare_hf_deployment.sh` instead.

```suggestion
          chmod +x scripts/prepare_hf_deployment.sh
          if [ -n "${{ github.event.inputs.base_image_sha }}" ]; then
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}" --base-sha "${{ github.event.inputs.base_image_sha }}"
          else
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}"
          fi
```

How can I resolve this? If you propose a fix, please make it concise.

.github/workflows/deploy-hf-env.yml
This workflow references deploy_to_hf.sh which was deleted in this PR. Update to use prepare_hf_deployment.sh instead.

          chmod +x scripts/prepare_hf_deployment.sh
          if [ -n "${{ github.event.inputs.base_image_sha }}" ]; then
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}" --base-sha "${{ github.event.inputs.base_image_sha }}"
          else
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}"
          fi
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/deploy-hf-env.yml
Line: 166:171

Comment:
This workflow references `deploy_to_hf.sh` which was deleted in this PR. Update to use `prepare_hf_deployment.sh` instead.

```suggestion
          chmod +x scripts/prepare_hf_deployment.sh
          if [ -n "${{ github.event.inputs.base_image_sha }}" ]; then
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}" --base-sha "${{ github.event.inputs.base_image_sha }}"
          else
            ./scripts/prepare_hf_deployment.sh --env "${{ matrix.environment }}"
          fi
```

How can I resolve this? If you propose a fix, please make it concise.

@burtenshaw burtenshaw changed the title Revive-scripts [1/n] Decouple Envs from version: Revive-scripts Feb 17, 2026
@burtenshaw burtenshaw changed the title [1/n] Decouple Envs from version: Revive-scripts [1/2] Decouple Envs from version: Revive-scripts Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant