Skip to content

Build staging desktop artifacts in debug profile#1044

Merged
M3gA-Mind merged 3 commits intotinyhumansai:mainfrom
M3gA-Mind:update/release-files
Apr 30, 2026
Merged

Build staging desktop artifacts in debug profile#1044
M3gA-Mind merged 3 commits intotinyhumansai:mainfrom
M3gA-Mind:update/release-files

Conversation

@M3gA-Mind
Copy link
Copy Markdown
Contributor

@M3gA-Mind M3gA-Mind commented Apr 30, 2026

Summary

  • switch staging desktop release workflow builds to use the debug profile while keeping production on release
  • make sidecar build/staging paths profile-aware so staging resolves binaries and bundles from debug outputs
  • update macOS app discovery and artifact upload paths to follow the selected build profile
  • stabilize default_core_bin env-override tests by serializing env-mutating cases to avoid CI race failures

Test plan

  • Verified workflow YAML updates in .github/workflows/release.yml
  • Pre-push hooks passed (format:check, lint, compile, rust:check)
  • N/A: staging release guard currently enforces main; validated equivalent path via temporary branch/run and documented in PR comments
  • N/A: production release from PR branch is intentionally blocked by main-only guard
  • cargo test --manifest-path app/src-tauri/Cargo.toml

Summary by CodeRabbit

  • Chores

    • Build and packaging pipeline now distinguishes staging (debug) and production (release) profiles, producing environment-appropriate binaries and installer bundles.
    • Artifact discovery and upload steps updated to locate outputs according to the active build profile.
  • Tests

    • Environment-sensitive tests are now serialized to prevent cross-test interference.

Note: No user-facing feature changes.

This keeps production release artifacts unchanged while ensuring staging sidecar, bundle lookup, and upload paths align with debug outputs.

Made-with: Cursor
@M3gA-Mind M3gA-Mind requested a review from a team April 30, 2026 10:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 044f39d6-df98-42c8-8b13-53f13e965198

📥 Commits

Reviewing files that changed from the base of the PR and between af9ca0a and fb307c0.

📒 Files selected for processing (1)
  • app/src-tauri/src/core_process_tests.rs

📝 Walkthrough

Walkthrough

The release workflow computes BUILD_PROFILE from inputs.build_target (debug for staging, release otherwise`) and propagates it to core sidecar compilation, Tauri packaging, artifact discovery/upload paths, and ELF dependency inspection; tests serialize env access via a global env lock.

Changes

Cohort / File(s) Summary
Workflow: release pipeline
.github/workflows/release.yml
Introduce BUILD_PROFILE derived from inputs.build_target. Use profile to conditionally run core sidecar build with/without --release, run Tauri packaging with --debug for staging, and update artifact discovery/upload and macOS .app search paths to target/<triple>/{debug|release}/.... ELF dependency inspection uses profile-dependent binary paths.
Tests: env serialization
app/src-tauri/src/core_process_tests.rs
Add env_lock() helper backed by a global OnceLock<Mutex<()>> and acquire it in tests that mutate std::env to prevent cross-test interference; remove an explicit env removal in one test relying on EnvGuard instead.

Sequence Diagram(s)

sequenceDiagram
  participant GH as GitHub Actions
  participant Inputs as Inputs (build_target)
  participant Build as Cargo (core sidecar)
  participant Tauri as Cargo Tauri
  participant Artifacts as Artifact Lookup/Upload
  participant ELF as ELF Inspector

  Inputs->>GH: provide `build_target`
  GH->>GH: compute `BUILD_PROFILE` (debug|release)
  GH->>Build: cargo build ... (with/without --release) [target/<triple>/{debug|release}]
  GH->>Tauri: cargo tauri build (--debug for staging / default for release)
  GH->>Artifacts: search `target/<triple>/{debug|release}/bundle/**` and upload binaries
  GH->>ELF: inspect ELF deps at profile-dependent `target/.../{debug|release}/OpenHuman`
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through CI with a springy stride,

Debug for staging, release for pride.
Paths now follow the profile's call,
Binaries found, no more stall.
A carrot patch—small, but wide. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly describes the main change: implementing debug profile builds for staging desktop artifacts, which is the core objective of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
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

Review rate limit: 3/5 reviews remaining, refill in 13 minutes and 11 seconds.

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

@M3gA-Mind
Copy link
Copy Markdown
Contributor Author

Test plan update:

Both runs failed immediately at Prepare build context -> Enforce main branch with:
This workflow can only run from main. Current ref: refs/heads/update/release-files

So the remaining two test-plan items are blocked by workflow policy and need a maintainer run from main (or a temporary relaxation of the main-branch guard for PR validation).

@M3gA-Mind
Copy link
Copy Markdown
Contributor Author

Follow-up validation update:

Result:

  • Prepare build context passed (staging no longer blocked by the main-branch guard).
  • The run reached desktop matrix jobs and then failed later at Install vendored tauri-cli (cef-aware bundler) with exit 101 (separate issue).

Cleanup:

  • Temporary branch and patch were fully discarded (local + remote temp branch deleted).
  • PR branch remains unchanged except the original debug-profile staging changes in this PR.

Serialize env-mutating core_process tests with a shared lock so OPENHUMAN_* overrides do not race under parallel test execution in CI.

Made-with: Cursor
@M3gA-Mind M3gA-Mind merged commit 4997a23 into tinyhumansai:main Apr 30, 2026
15 of 18 checks passed
senamakel added a commit to senamakel/openhuman that referenced this pull request May 1, 2026
Resolves conflicts with the core RPC auth (tinyhumansai#881) and "staging in
debug profile" (tinyhumansai#1044) changes that landed on main while this PR
was open.

CodeRabbit nits applied as part of the merge:
  - Cargo.toml: replace `#?` placeholder with the PR reference.
  - core_process.rs: dedupe shutdown/send_terminate_signal via a
    shared abort_task() helper.
  - lib.rs::run_core_from_args: drop the redundant args.to_vec()
    allocation and pass the slice through directly.

Conflict resolution summary:

  app/src-tauri/src/core_process.rs
  - Keep the in-process / no-sidecar architecture from this PR
    (no `Child`, no `core_bin`, no `CoreRunMode`).
  - Pull in the auth token plumbing from main: generate_rpc_token,
    CURRENT_RPC_TOKEN, and an `rpc_token` field on the handle.
    Set OPENHUMAN_CORE_TOKEN as a process-global env var before
    spawning the embedded server so the same-process tokio task
    reads exactly what a child sidecar would have received via
    Command::env. Publish to CURRENT_RPC_TOKEN only after spawn,
    matching upstream's invariant that the global only advertises
    a token a running listener has actually accepted.
  - Note in the harness-attach fast-path warning that an external
    listener won't see this process's token — Tauri-side
    authenticated calls will 401 unless the harness was started
    with the same OPENHUMAN_CORE_TOKEN.

  app/src-tauri/src/core_process_tests.rs
  - Drop run_mode / default_core_bin / same_executable_path /
    sidecar-staging tests (functions removed in this PR).
  - Keep upstream's token-related tests, simplified for the slim
    `CoreProcessHandle::new(port)` constructor.

  app/src-tauri/src/lib.rs
  - Module list: keep `mod core_rpc` (auth helper used by various
    Tauri commands), drop `mod core_update` — core_update.rs is
    deleted with the rest of the sidecar update subsystem.
  - check_core_update: keep the no-op stub; the frontend wrapper
    keeps working via `tauri-plugin-updater`.

  app/src-tauri/src/core_update.rs
  - Stays deleted. Core ships with the desktop app now; per-binary
    update is via tauri-plugin-updater.

  .github/workflows/release.yml
  - Drop upstream's resolve-core-paths / build-sidecar /
    stage-sidecar / cli-paths block; sidecar build is gone.
  - Collapse the split core/Tauri Sentry symbols upload into a
    single step: linked openhuman_core symbols now live under the
    Tauri shell's target dir.
  - Preserve upstream's staging→debug profile path expression in
    the bundle artifact upload.

  app/src-tauri/Cargo.lock
  - Regenerated against the merged Cargo.toml.
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