Skip to content

GET MY AGENT OVER HERE INSTALLED RUNNING LOCALLY Now!!! There are1027 failed workflows since last night!!! WlORK WITH URGENCY!!! Download to this repository, master branch of WebLabs-MobIDE ; https://huggingface.co/Salesforce/codet5-small#11

Merged
spiralgang merged 4 commits into
masterfrom
@copilot_fix
Sep 13, 2025

Conversation

@spiralgang
Copy link
Copy Markdown
Owner

@spiralgang spiralgang commented Sep 13, 2025

.github/workflows/download-codet5-model-relentless.yml

Run as yaml at .github/workflows/download-codet5-model.yml through githubs server's runner workflow actions feature!!
@copilot
@sourcery-ai
@gemini-ai

name: Relentless CodeT5 Model Download

on:
workflow_dispatch:

jobs:
download:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

  - name: Ensure git-lfs (retry up to 5x)
    run: |
      for i in {1..5}; do
        sudo apt-get update -y && sudo apt-get install -y git-lfs && git lfs install --system && break
        echo "git-lfs install failed (attempt $i), retrying..."
        sleep 5
      done

  - name: Relentless Model Download (git, wget, curl, fallback)
    run: |
      mkdir -p ./codet5-small
      success=0
      # Try git clone up to 5 times
      for i in {1..5}; do
        git clone https://huggingface.co/Salesforce/codet5-small ./codet5-small && success=1 && break
        echo "git clone failed (attempt $i), retrying..."
        sleep 5
      done
      # If git clone fails, try wget
      if [ $success -eq 0 ]; then
        echo "Trying wget fallback..."
        wget -r --no-parent https://huggingface.co/Salesforce/codet5-small/ -P ./codet5-small || true
        # If wget fails, try curl (archive download)
        if [ "$(ls -A ./codet5-small)" == "" ]; then
          echo "Trying curl fallback..."
          curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/pytorch_model.bin -o ./codet5-small/pytorch_model.bin || true
        fi
      fi

  - name: Relentless Cleanup
    run: |
      find ./codet5-small -name ".git" -type d -exec rm -rf {} + || true
      find ./codet5-small -name ".cache" -type d -exec rm -rf {} + || true
      find ./codet5-small -type f -exec chmod 0644 {} + || true

  - name: List all model files (always succeed)
    run: |
      echo "Downloaded files in ./codet5-small:"
      ls -l ./codet5-small || true

  - name: Always complete (never fail the workflow)
    if: always()
    run: echo "Workflow finished, regardless of errors."

References

- Audit: Direct conversion from original shell script and expanded with retry/fallback logic.

- Vault: Canonical engineering standards, error-handling best practices.

- Hugging Face: https://huggingface.co/Salesforce/codet5-small

Summary by Sourcery

Add a GitHub Actions workflow that relentlessly downloads the CodeT5-small model with retry and fallback logic, performs cleanup, and ensures the workflow never fails.

New Features:

  • Introduce a GitHub Actions workflow to download the Salesforce CodeT5-small model from Hugging Face on-demand
  • Implement retry and fallback download methods (git clone, wget, curl) for robust model retrieval

Enhancements:

  • Clean up Git metadata and cache directories and normalize file permissions after download
  • Always complete the workflow without failing, and list downloaded files

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Sep 13, 2025

Reviewer's Guide

Introduces a new GitHub Actions workflow that implements a manual trigger job to download the CodeT5 model from Hugging Face with robust retry and fallback steps, followed by cleanup, permission adjustments, file listing, and guaranteed completion.

Sequence diagram for the CodeT5 model download and fallback logic

sequenceDiagram
  participant Runner as "GitHub Actions Runner"
  participant HuggingFace as "Hugging Face Repository"
  Runner->>Runner: Ensure git-lfs (retry up to 5x)
  alt git clone succeeds
    Runner->>HuggingFace: git clone codet5-small
    HuggingFace-->>Runner: Model files
  else git clone fails
    Runner->>HuggingFace: wget codet5-small
    alt wget fails
      Runner->>HuggingFace: curl download pytorch_model.bin
      HuggingFace-->>Runner: pytorch_model.bin
    end
  end
  Runner->>Runner: Cleanup .git/.cache, set permissions
  Runner->>Runner: List model files
  Runner->>Runner: Always complete (never fail workflow)
Loading

File-Level Changes

Change Details Files
Add Relentless CodeT5 Model Download workflow
  • Define manual workflow_dispatch trigger
  • Set up ‘download’ job on ubuntu-latest
  • Include checkout step
.github/workflows/download-codet5-model-relentless.yml
Implement retry logic for git-lfs installation
  • Loop up to 5 times for apt-get update and git-lfs install
  • Break early on success
  • Log and sleep between attempts
.github/workflows/download-codet5-model-relentless.yml
Add resilient model download with multi-step fallback
  • Perform git clone with 5 retries
  • If clone fails, run wget recursive download
  • If wget yields no files, fetch binary via curl
.github/workflows/download-codet5-model-relentless.yml
Introduce cleanup and permission adjustments
  • Remove .git and .cache directories
  • Set all downloaded files to mode 0644
.github/workflows/download-codet5-model-relentless.yml
Ensure workflow always finishes and lists files
  • List contents of codet5-small directory unconditionally
  • Add final step with if: always() to never fail
.github/workflows/download-codet5-model-relentless.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • The PR title and workflow name come across as urgent and unprofessional—consider renaming them to something concise and descriptive without excessive punctuation.
  • You’re swallowing almost all errors with || true, which will mask real issues; let critical failures bubble up or handle them explicitly so you can catch broken downloads.
  • Installing git-lfs on every run adds overhead—consider using a setup action or caching strategy to avoid repeated apt-get installs and speed up the workflow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The PR title and workflow name come across as urgent and unprofessional—consider renaming them to something concise and descriptive without excessive punctuation.
- You’re swallowing almost all errors with `|| true`, which will mask real issues; let critical failures bubble up or handle them explicitly so you can catch broken downloads.
- Installing git-lfs on every run adds overhead—consider using a setup action or caching strategy to avoid repeated apt-get installs and speed up the workflow.

## Individual Comments

### Comment 1
<location> `.github/workflows/download-codet5-model-relentless.yml:14` </location>
<code_context>
+
+      - name: Ensure git-lfs (retry up to 5x)
+        run: |
+          for i in {1..5}; do
+            sudo apt-get update -y && sudo apt-get install -y git-lfs && git lfs install --system && break
+            echo "git-lfs install failed (attempt $i), retrying..."
+            sleep 5
</code_context>

<issue_to_address>
Consider moving apt-get update outside the retry loop for efficiency.

Running 'apt-get update' on each retry increases network usage. Run it once before the loop unless the package list may change during retries.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
      - name: Ensure git-lfs (retry up to 5x)
        run: |
          for i in {1..5}; do
            sudo apt-get update -y && sudo apt-get install -y git-lfs && git lfs install --system && break
            echo "git-lfs install failed (attempt $i), retrying..."
            sleep 5
          done
=======
      - name: Ensure git-lfs (retry up to 5x)
        run: |
          sudo apt-get update -y
          for i in {1..5}; do
            sudo apt-get install -y git-lfs && git lfs install --system && break
            echo "git-lfs install failed (attempt $i), retrying..."
            sleep 5
          done
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `.github/workflows/download-codet5-model-relentless.yml:33` </location>
<code_context>
+          # If git clone fails, try wget
+          if [ $success -eq 0 ]; then
+            echo "Trying wget fallback..."
+            wget -r --no-parent https://huggingface.co/Salesforce/codet5-small/ -P ./codet5-small || true
+            # If wget fails, try curl (archive download)
+            if [ "$(ls -A ./codet5-small)" == "" ]; then
</code_context>

<issue_to_address>
Wget fallback may not download all necessary model files or handle Hugging Face repo structure.

Wget may miss files managed by LFS or located in subdirectories, leading to incomplete downloads. Consider specifying the limitations of this approach or switching to the Hugging Face CLI for reliability.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
          # If git clone fails, try wget
          if [ $success -eq 0 ]; then
            echo "Trying wget fallback..."
            wget -r --no-parent https://huggingface.co/Salesforce/codet5-small/ -P ./codet5-small || true
            # If wget fails, try curl (archive download)
            if [ "$(ls -A ./codet5-small)" == "" ]; then
              echo "Trying curl fallback..."
              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/pytorch_model.bin -o ./codet5-small/pytorch_model.bin || true
            fi
          fi
=======
          # If git clone fails, try Hugging Face CLI for reliable download.
          # The CLI properly handles LFS and repo structure, unlike wget.
          if [ $success -eq 0 ]; then
            echo "Trying Hugging Face CLI fallback..."
            pip install --upgrade huggingface_hub
            huggingface-cli repo clone Salesforce/codet5-small ./codet5-small || true
            # If CLI fails, try curl (archive download)
            if [ "$(ls -A ./codet5-small)" == "" ]; then
              echo "Trying curl fallback..."
              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/pytorch_model.bin -o ./codet5-small/pytorch_model.bin || true
            fi
          fi
>>>>>>> REPLACE

</suggested_fix>

### Comment 3
<location> `.github/workflows/download-codet5-model-relentless.yml:37` </location>
<code_context>
+            # If wget fails, try curl (archive download)
+            if [ "$(ls -A ./codet5-small)" == "" ]; then
+              echo "Trying curl fallback..."
+              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/pytorch_model.bin -o ./codet5-small/pytorch_model.bin || true
+            fi
+          fi
</code_context>

<issue_to_address>
Curl fallback only downloads the model weights, omitting config and tokenizer files.

Config and tokenizer files are needed for full model functionality. Please update the curl fallback to also download these files.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
              echo "Trying curl fallback..."
              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/pytorch_model.bin -o ./codet5-small/pytorch_model.bin || true
=======
              echo "Trying curl fallback..."
              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/pytorch_model.bin -o ./codet5-small/pytorch_model.bin || true
              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/config.json -o ./codet5-small/config.json || true
              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/tokenizer.json -o ./codet5-small/tokenizer.json || true
              curl -L https://huggingface.co/Salesforce/codet5-small/resolve/main/tokenizer_config.json -o ./codet5-small/tokenizer_config.json || true
>>>>>>> REPLACE

</suggested_fix>

### Comment 4
<location> `.github/workflows/download-codet5-model-relentless.yml:43` </location>
<code_context>
+
+      - name: Relentless Cleanup
+        run: |
+          find ./codet5-small -name ".git" -type d -exec rm -rf {} + || true
+          find ./codet5-small -name ".cache" -type d -exec rm -rf {} + || true
+          find ./codet5-small -type f -exec chmod 0644 {} + || true
+
+      - name: List all model files (always succeed)
</code_context>

<issue_to_address>
Consider also removing .gitattributes and .gitignore files during cleanup.

Deleting only the '.git' directory may leave '.gitattributes' and '.gitignore' files, which could cause confusion if the directory is reused. Please include these files in the cleanup.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
          find ./codet5-small -name ".git" -type d -exec rm -rf {} + || true
          find ./codet5-small -name ".cache" -type d -exec rm -rf {} + || true
          find ./codet5-small -type f -exec chmod 0644 {} + || true
=======
          find ./codet5-small -name ".git" -type d -exec rm -rf {} + || true
          find ./codet5-small -name ".cache" -type d -exec rm -rf {} + || true
          find ./codet5-small -name ".gitattributes" -type f -exec rm -f {} + || true
          find ./codet5-small -name ".gitignore" -type f -exec rm -f {} + || true
          find ./codet5-small -type f -exec chmod 0644 {} + || true
>>>>>>> REPLACE

</suggested_fix>

### Comment 5
<location> `.github/workflows/download-codet5-model-relentless.yml:53` </location>
<code_context>
+          ls -l ./codet5-small || true
+
+      - name: Always complete (never fail the workflow)
+        if: always()
+        run: echo "Workflow finished, regardless of errors."
+
</code_context>

<issue_to_address>
Using 'always()' ensures workflow completion, but may mask errors in earlier steps.

Consider surfacing errors from earlier steps more clearly, such as by summarizing failures in the final step, to aid in debugging.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread .github/workflows/download-codet5-model-relentless.yml
Comment thread .github/workflows/download-codet5-model-relentless.yml
Comment thread .github/workflows/download-codet5-model-relentless.yml
Comment thread .github/workflows/download-codet5-model-relentless.yml
Comment thread .github/workflows/download-codet5-model-relentless.yml
@spiralgang
Copy link
Copy Markdown
Owner Author

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

it can be ran as python script through actions/checkout@v4 action if file formatted in runner action Python script instead and then dropped in folder actions/checkout @gemini-ai review

spiralgang and others added 2 commits September 12, 2025 22:14
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Owner Author

@spiralgang spiralgang left a comment

Choose a reason for hiding this comment

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

@sourcery-ai pathetic. I expected more from you.

@spiralgang spiralgang self-assigned this Sep 13, 2025
@spiralgang spiralgang merged commit fe90ae2 into master Sep 13, 2025
2 of 14 checks passed
@spiralgang spiralgang deleted the @copilot_fix branch September 13, 2025 11:46
@spiralgang spiralgang restored the @copilot_fix branch September 19, 2025 00:47
@spiralgang spiralgang requested a review from Copilot September 19, 2025 00:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a GitHub Actions workflow to download the Salesforce CodeT5-small model from Hugging Face with retry and fallback mechanisms. The workflow ensures reliable model retrieval and handles errors gracefully to prevent workflow failures.

  • Introduces a new GitHub Actions workflow with multiple download strategies (git clone, wget, curl)
  • Implements retry logic and fallback methods for robust model downloading
  • Adds cleanup steps and ensures workflows never fail

Comment on lines +17 to 19
sudo apt-get install -y git-lfs && git lfs install --system && break

for i in {1..5}; do
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

Duplicate retry loops for git-lfs installation. The first loop (lines 16-17) is incomplete and missing the echo/sleep statements, while the second loop (lines 19-20) duplicates the same logic. Remove the incomplete first loop and keep only the complete second loop.

Suggested change
sudo apt-get install -y git-lfs && git lfs install --system && break
for i in {1..5}; do

Copilot uses AI. Check for mistakes.
- name: Ensure git-lfs (retry up to 5x)
run: |

sudo apt-get update -y
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The sudo apt-get update -y command is executed twice - once standalone on line 15 and again within the retry loop on line 20. This is inefficient and should be consolidated into a single execution before the retry loop.

Copilot uses AI. Check for mistakes.
@spiralgang spiralgang deleted the @copilot_fix branch September 19, 2025 00:50
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.

3 participants