Skip to content

ci: gate omnivoice-tts build to pin changes; drop hanging Intel-Mac leg - #147

Merged
debpalash merged 2 commits into
mainfrom
ci/gate-omnivoice-tts-build
May 29, 2026
Merged

ci: gate omnivoice-tts build to pin changes; drop hanging Intel-Mac leg#147
debpalash merged 2 commits into
mainfrom
ci/gate-omnivoice-tts-build

Conversation

@debpalash

@debpalash debpalash commented May 29, 2026

Copy link
Copy Markdown
Owner

Fixes the perpetually-hanging Build omnivoice-tts (darwin-x86_64) check that sits in "Waiting for a runner…" for hours on every PR.

Root cause

The omnivoice-tts C++ runtime is pinned to a commit SHA in quant_map.json, yet its 4-platform build ran on every PR + push to main. The hosted macOS runners — especially the Intel macos-13 pool — are heavily contended, so that leg queued for hours. It's continue-on-error so it never blocked merge, but it kept every PR in the UNSTABLE state with a stuck "queued" check.

Fix

  • Moved the build into its own workflow (.github/workflows/build-omnivoice-tts.yml) gated to: changes to quant_map.json / scripts/build-omnivoice-tts.sh / the workflow itself, + workflow_dispatch. Normal PRs no longer trigger it → no more hanging check, faster CI. It still rebuilds automatically when the pin changes (its whole purpose).
  • Dropped the Intel darwin-x86_64 (macos-13) leg — unusably contended, and Intel-Mac users already fall back to the in-process OmniVoiceBackend (documented behavior). Kept linux-x86_64, windows-x86_64, darwin-arm64. Easy to re-add if you ever want first-class Intel binaries.

This matches ci.yml's own stated philosophy: "keep the heavy platform build off the per-PR path."

Both workflows YAML-validated.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Moved the omnivoice-tts runtime binary build into a dedicated workflow that produces platform-specific binaries (Linux, Windows, macOS) and uploads build artifacts.
    • Removed the standalone omnivoice-tts build job from the main CI workflow to streamline CI responsibilities.

Review Change Stack

The omnivoice-tts C++ runtime is pinned to a commit SHA in quant_map.json, so
it only needs rebuilding when that pin (or the build script) changes — not on
every PR/push. Running it per-push left the heavily-contended hosted macOS
runners (esp. Intel macos-13) sitting in "Waiting for a runner…" for hours as
a perpetual queued check (the UNSTABLE state on every PR).

- Moved the build out of ci.yml into its own workflow,
  .github/workflows/build-omnivoice-tts.yml, gated to:
  paths [quant_map.json, scripts/build-omnivoice-tts.sh, the workflow] +
  workflow_dispatch. Normal PRs no longer trigger (or hang on) it.
- Dropped the Intel darwin-x86_64 (macos-13) matrix leg: that hosted pool is
  unusably contended and Apple's momentum is on arm64; Intel-Mac users get the
  in-process OmniVoiceBackend fallback (already the documented behavior).
  Kept linux-x86_64, windows-x86_64, darwin-arm64. Re-add macos-13 here if
  first-class Intel binaries are ever needed.

Both workflows YAML-validated. Matches ci.yml's stated philosophy of keeping
heavy platform builds off the per-PR path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR separates the omnivoice-tts C++ binary build job from the main CI workflow into a dedicated GitHub Actions workflow. The new workflow builds the runtime across Linux x86_64, Windows x86_64, and macOS arm64 platforms, reading a pinned commit SHA from quant_map.json, installing platform-specific dependencies, and uploading resulting binaries.

Changes

CI Workflow Refactoring

Layer / File(s) Summary
Workflow triggers and job matrix
.github/workflows/build-omnivoice-tts.yml
Introduces a new build-omnivoice-tts workflow that triggers on main branch PRs/pushes and manual dispatch, with a matrix job strategy spanning Linux x86_64, Windows x86_64, and macOS arm64, plus an experimental flag on the macOS arm64 Metal build.
Runtime pinning and build execution
.github/workflows/build-omnivoice-tts.yml
Extracts the pinned _meta.runtime_commit_sha from backend/engines/omnivoice_gguf/quant_map.json, installs OpenBLAS and pkg-config on Linux only, runs the build script with --platform and --commit-sha parameters, and uploads the resulting platform-specific binaries plus bin/checksums.sha256 as workflow artifacts.

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the root cause, fix, and rationale clearly. However, it does not follow the repository's template structure with required sections like Summary, Changes list, Type checkbox, Testing, and Checklist. Reformat the description to follow the template: add a brief Summary section, reorganize Changes as a bullet list, check the appropriate Type (likely CI/Build), detail Testing steps, and complete the required Checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: gating the omnivoice-tts build workflow to only run on relevant changes and removing the Intel macOS build leg that was causing hangs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/gate-omnivoice-tts-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Extracts the omnivoice-tts C++ binary build out of ci.yml into its own path-gated workflow, and drops the Intel-Mac (macos-13) matrix leg. The new workflow only fires on changes to quant_map.json, the build script, or the workflow file itself — eliminating the perpetual "Waiting for a runner…" check that blocked every PR.

  • Path-gating (pull_request + push on three specific paths) means normal PRs no longer touch this workflow at all.
  • Security hardening vs. the old ci.yml version: persist-credentials: false added to checkout, a strict hex-SHA regex validates runtime_commit_sha before it reaches any shell command, and matrix values are passed through env: rather than direct ${{ }} interpolation in the run: block.
  • timeout-minutes: 45 caps worst-case runner consumption on the experimental darwin-arm64 Metal leg.

Confidence Score: 5/5

Safe to merge — the change is purely additive CI restructuring with no runtime code touched.

Both changed files are GitHub Actions workflow YAML. The new workflow correctly gates itself to path-relevant triggers, carries over all three non-Intel platforms, and actually improves on the original ci.yml job with SHA validation, credential hygiene, and a timeout ceiling. No application logic is modified, and the fallback behavior for Intel-Mac users is unchanged from what was already documented. The previously raised concerns (timeout, parity) are either addressed in this revision or were already covered in prior review threads.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/build-omnivoice-tts.yml New workflow extracted from ci.yml, now gated to path filters; adds timeout-minutes, SHA validation, persist-credentials: false, and env-var injection hardening. No new issues found.
.github/workflows/ci.yml Removes the build-omnivoice-tts job (79 lines) that ran on every push; no other changes to ci.yml logic.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Git event] --> B{Event type?}
    B -->|push / pull_request to main| C{Path filter match?}
    B -->|workflow_dispatch| F[Run build-omnivoice-tts.yml]
    C -->|quant_map.json, build script,\nor workflow file changed| F
    C -->|No matching paths| G[Skip — workflow not triggered]
    F --> H[Checkout with persist-credentials: false]
    H --> I[Read + validate runtime_commit_sha\nregex: ^0-9a-fA-F 7,40 $]
    I -->|invalid SHA| J[::error:: + exit 1]
    I -->|valid SHA| K{Matrix platform?}
    K -->|linux-x86_64| L[apt-get install libopenblas-dev]
    K -->|windows-x86_64| M[No extra deps]
    K -->|darwin-arm64\nexperimental: true| N[No extra deps]
    L --> O[build-omnivoice-tts.sh via env vars]
    M --> O
    N --> O
    O --> P[Upload binary artifact]
    P --> Q{All non-experimental jobs passed?}
    Q -->|Yes| R[Workflow success]
    Q -->|darwin-arm64 failed\ncontinue-on-error: true| R
Loading

Reviews (2): Last reviewed commit: "ci: timeout-minutes + injection-harden t..." | Re-trigger Greptile

Comment thread .github/workflows/build-omnivoice-tts.yml
Comment thread .github/workflows/build-omnivoice-tts.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-omnivoice-tts.yml:
- Around line 68-69: The workflow injects runtime_commit_sha from quant_map.json
into a shell context unsafely (sha and steps.pin.outputs.sha), risking shell
injection; fix by emitting a safely shell-escaped/quoted value from the python
step (e.g., use json.dumps or Python's shlex.quote/print with proper quoting) so
the GITHUB_OUTPUT receives a quoted/escaped sha, and ensure every use in the
workflow is wrapped in double quotes when interpolating (e.g., "${{
steps.pin.outputs.sha }}") to prevent argument-splitting or execution.
- Line 61: Replace the floating action refs with SHA-pinned commits: update
occurrences of actions/checkout@v4 and actions/upload-artifact@v4 in the
workflow to use the corresponding full commit SHAs for those actions (e.g.,
actions/checkout@<commit-sha> and actions/upload-artifact@<commit-sha>),
ensuring you fetch the official commit SHA from the actions' GitHub
repos/releases and commit the updated workflow to lock the exact versions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c4637471-8ab0-496e-a2ce-8ea4a9bf14aa

📥 Commits

Reviewing files that changed from the base of the PR and between adf486e and 2c79105.

📒 Files selected for processing (2)
  • .github/workflows/build-omnivoice-tts.yml
  • .github/workflows/ci.yml
💤 Files with no reviewable changes (1)
  • .github/workflows/ci.yml

# block — the SPIKE-01 ADR records the in-process fallback.
experimental: true
steps:
- uses: actions/checkout@v4

@coderabbitai coderabbitai Bot May 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether all workflow action refs are pinned to full commit SHAs.
# Expected: every "uses:" ref ends with @<40-hex SHA>

file=".github/workflows/build-omnivoice-tts.yml"
echo "Checking $file"
rg -nP '^\s*(uses:|- uses:)\s*\S+@\S+' "$file"

python - <<'PY'
import re, pathlib
p = pathlib.Path(".github/workflows/build-omnivoice-tts.yml")
bad = []
for i, line in enumerate(p.read_text().splitlines(), 1):
    m = re.search(r'^\s*(?:-\s*)?uses:\s*([^\s]+)@([^\s]+)\s*$', line)
    if not m:
        continue
    ref = m.group(2)
    if not re.fullmatch(r'[0-9a-fA-F]{40}', ref):
        bad.append((i, line.strip()))
if bad:
    print("Non-SHA-pinned actions found:")
    for i, l in bad:
        print(f"Line {i}: {l}")
else:
    print("All actions are SHA pinned.")
PY

Repository: debpalash/OmniVoice-Studio

Length of output: 311


Pin GitHub Actions to commit SHAs in .github/workflows/build-omnivoice-tts.yml (avoid floating @v4 tags).

Lines 61 and 86 use non-SHA-pinned refs:

  • actions/checkout@v4
  • actions/upload-artifact@v4
🔧 Suggested pattern
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@<full_commit_sha_for_v4>

@@
-      - name: Upload binary artifact
-        uses: actions/upload-artifact@v4
+      - name: Upload binary artifact
+        uses: actions/upload-artifact@<full_commit_sha_for_v4>
🧰 Tools
🪛 zizmor (1.25.2)

[error] 61-61: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-omnivoice-tts.yml at line 61, Replace the floating
action refs with SHA-pinned commits: update occurrences of actions/checkout@v4
and actions/upload-artifact@v4 in the workflow to use the corresponding full
commit SHAs for those actions (e.g., actions/checkout@<commit-sha> and
actions/upload-artifact@<commit-sha>), ensuring you fetch the official commit
SHA from the actions' GitHub repos/releases and commit the updated workflow to
lock the exact versions.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Declining the SHA-pin here, consistent with the call on #135: the repo's convention is floating major tags across ci.yml and release.yml, so pinning only this one file would be inconsistent, and piecemeal SHA pins rot without Dependabot to bump them. Worth doing — but as a repo-wide hardening pass + github-actions Dependabot, not in this CI-fix PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Understood — that's a reasonable call. Consistent conventions across workflow files are easier to audit, and SHA pins without an automated bump mechanism (Dependabot or Renovate) tend to drift and become a maintenance burden of their own.

Would you like me to open a follow-up issue to track the repo-wide hardening pass (pinning all github-actions refs to SHAs + enabling github-actions Dependabot), so it doesn't get lost?


✏️ Learnings added
Learnt from: debpalash
Repo: debpalash/OmniVoice-Studio PR: 147
File: .github/workflows/build-omnivoice-tts.yml:64-64
Timestamp: 2026-05-29T08:33:41.879Z
Learning: In the `debpalash/OmniVoice-Studio` repository, the convention across GitHub Actions workflow files (`.github/workflows/`) is to use floating major-version tags (e.g., `v4`) rather than pinning actions to full commit SHAs. A repo-wide hardening pass (SHA-pinning + enabling `github-actions` Dependabot) has been deferred to a future dedicated PR. Do not flag individual workflow files for not using SHA-pinned action refs, as the inconsistency is intentional until that hardening pass is done. See PR `#147` and PR `#135` for context.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread .github/workflows/build-omnivoice-tts.yml Outdated
…eview)

- Greptile: add `timeout-minutes: 45` so a hung leg (esp. experimental
  darwin-arm64 Metal) can't run to GitHub's 6h ceiling — same resource-drain
  class this PR addresses.
- CodeRabbit: stop interpolating the pinned SHA / platform directly into the
  run block. Validate the SHA is a git hash in the pin step, then pass it +
  platform via quoted env vars (no shell-injection surface from quant_map.json).

Declined: SHA-pinning actions@v4 — matches the repo's floating-tag convention
(ci.yml/release.yml); belongs in a repo-wide hardening pass + Dependabot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/build-omnivoice-tts.yml:
- Line 74: The workflow's SHA validation uses the regex ^[0-9a-fA-F]{7,40}$ in
the if ! [[ "$sha" =~ ... ]] check, but the build script expects exactly 40 hex
chars (^[0-9a-fA-F]{40}$), causing short SHAs to pass here but fail later;
update the workflow regex to ^[0-9a-fA-F]{40}$ so the "if ! [[ \"$sha\" =~ ...
]]" check enforces a full 40-character hex SHA to match the build script's
validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a984376-9897-43a0-9dae-a9a6a3d108d8

📥 Commits

Reviewing files that changed from the base of the PR and between 2c79105 and 7707058.

📒 Files selected for processing (1)
  • .github/workflows/build-omnivoice-tts.yml

sha=$(python -c "import json; print(json.load(open('backend/engines/omnivoice_gguf/quant_map.json'))['_meta']['runtime_commit_sha'])")
# Validate it's a git SHA before it ever reaches a shell command —
# a crafted quant_map.json value must not be able to inject shell.
if ! [[ "$sha" =~ ^[0-9a-fA-F]{7,40}$ ]]; then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Validation regex mismatch with build script.

The workflow validates the SHA with ^[0-9a-fA-F]{7,40}$ (7–40 hex chars), but the build script at scripts/build-omnivoice-tts.sh line 48 requires exactly 40 characters: ^[0-9a-fA-F]{40}$. A short SHA (e.g., 7–39 chars) will pass here but fail the build step.

🔒 Proposed fix: align with build script validation
-          if ! [[ "$sha" =~ ^[0-9a-fA-F]{7,40}$ ]]; then
+          if ! [[ "$sha" =~ ^[0-9a-fA-F]{40}$ ]]; then
             echo "::error::runtime_commit_sha is not a valid git SHA: '$sha'"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/build-omnivoice-tts.yml at line 74, The workflow's SHA
validation uses the regex ^[0-9a-fA-F]{7,40}$ in the if ! [[ "$sha" =~ ... ]]
check, but the build script expects exactly 40 hex chars (^[0-9a-fA-F]{40}$),
causing short SHAs to pass here but fail later; update the workflow regex to
^[0-9a-fA-F]{40}$ so the "if ! [[ \"$sha\" =~ ... ]]" check enforces a full
40-character hex SHA to match the build script's validation.

@debpalash
debpalash merged commit ee67130 into main May 29, 2026
18 checks passed
@debpalash
debpalash deleted the ci/gate-omnivoice-tts-build branch May 29, 2026 08:37
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.

1 participant