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
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
Reviewer's GuideIntroduces 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 logicsequenceDiagram
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)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
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>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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 |
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>
spiralgang
left a comment
There was a problem hiding this comment.
@sourcery-ai pathetic. I expected more from you.
There was a problem hiding this comment.
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
| sudo apt-get install -y git-lfs && git lfs install --system && break | ||
|
|
||
| for i in {1..5}; do |
There was a problem hiding this comment.
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.
| sudo apt-get install -y git-lfs && git lfs install --system && break | |
| for i in {1..5}; do |
| - name: Ensure git-lfs (retry up to 5x) | ||
| run: | | ||
|
|
||
| sudo apt-get update -y |
There was a problem hiding this comment.
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.
.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
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:
Enhancements: