Fix/ci init and workflow - #1
Conversation
Removed old usage instructions and branch selection logic. Added basic initialization and ensured necessary directories and tools are present.
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 3b09158..89e6c9d
| Severity | Location | Issue | Delete |
|---|---|---|---|
| ci/init_repo.sh:22 | Breaking API change causes workflow crash |
✅ Files analyzed, no issues (1)
• .github/workflows/ci.yml
|
|
||
| echo "repo sync failed after $MAX_ATTEMPTS attempts" | ||
| exit 5 | ||
| echo "Init complete." |
There was a problem hiding this comment.
BREAKING CHANGE: The init_repo.sh script has been gutted, removing all repository initialization logic (repo tool installation, repo init, repo sync) that existing workflows depend on. The unchanged workflow file .github/workflows/build-twrp.yml at lines 81-85 calls this script with 4 parameters expecting it to initialize a TWRP build environment by syncing source code to ~/twrp/. However, the modified script now only creates ~/bin and exports PATH, then exits claiming "Init complete."
This will cause build-twrp.yml to CRASH with the following sequence:
- Line 81-85: Calls init_repo.sh successfully, but no source code is synced
- Line 96: Executes 'source build/envsetup.sh' which will FAIL with error: "bash: build/envsetup.sh: No such file or directory" because the TWRP source tree was never initialized
- The workflow will terminate with a non-zero exit code
The old script accepted parameters: <manifest_url> [desired_branch] [workdir] [jobs] and performed:
- Repo tool installation to $HOME/bin/repo
- Git ls-remote to query available branches
- Branch selection logic
- repo init --depth=1 -u $MANIFEST_URL -b $BRANCH
- repo sync with retry logic (up to 5 attempts)
- Created and populated the working directory (~/twrp by default)
The new script ignores all parameters and performs none of these operations, making build-twrp.yml fail at the 'Setup Build Environment' step when it tries to source the non-existent build/envsetup.sh file.
Affected unchanged code locations:
- .github/workflows/build-twrp.yml:81-85 (script invocation with 4 parameters)
- .github/workflows/build-twrp.yml:96 (source build/envsetup.sh - will fail)
- .github/workflows/build-twrp.yml:103 (source build/envsetup.sh - will fail)
- .github/workflows/build-twrp.yml:106-107 (lunch and mka commands - will fail due to missing environment)
React with 👍 to tell me that this comment was useful, or 👎 if not (and I'll stop posting more comments like this in the future)
High-level PR Summary
This PR simplifies the CI initialization process by replacing a complex repository synchronization script with a minimal, idempotent initialization template and adds a basic GitHub Actions workflow that runs the simplified init script on pushes and pull requests to the main branch.
⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
ci/init_repo.sh.github/workflows/ci.yml