Skip to content

fix(macos): register the platform services the merged state requires - #331

Merged
bobtista merged 1 commit into
developmentfrom
fix/macos-service-registrations
Jul 30, 2026
Merged

fix(macos): register the platform services the merged state requires#331
bobtista merged 1 commit into
developmentfrom
fix/macos-service-registrations

Conversation

@bobtista

@bobtista bobtista commented Jul 30, 2026

Copy link
Copy Markdown

Summary

development is currently broken on macOS. GenHub.app aborts at container build:

GenHub.app exited during startup (status 134)
System.InvalidOperationException: Unable to resolve service for type
'IGamePathProvider' while attempting to activate 'GameSettingsService'

This cascades across roughly twenty service descriptors, including MainViewModel, IGameLauncher and IGameProfileManager. The Build macOS job on development is red.

Why neither #328 nor #329 could have caught it

#328 made IGamePathProvider a required constructor dependency — deliberately, so an unregistered provider fails at container build instead of silently resolving to the Windows implementation. #329 added the macOS host and its DI module.

The macOS registrations reference types introduced by #328 and a module introduced by #329, so they compile only once both are merged. Neither PR could carry them, and both were genuinely green in isolation. The failure exists only in the merged state, which per-branch CI cannot reach.

Changes

  • Register IGamePathProvider, ISymlinkCapabilityProvider and IFileOperationsService for macOS.

    Only IGamePathProvider breaks startup. Without the other two, macOS silently copies instead of hard-linking and cannot reach symlink strategies — the exact behaviours feat(platform): make paths, manifests, and Unix workspaces platform-aware #328 set out to fix — so all three land together.

  • Add the missing typeof entries to the shared composition-root assertions.

  • Move the macOS test run before publish. GenHub.Tests.MacOS was already covered by the job's final Run Tests step, but that step sits after Publish macOS App and Smoke Test App Launch. The startup crash killed the job at the smoke test, so the assertion that names the unresolvable service never executed — the breakage surfaced only as a status-134 crash after packaging. MacOSHost_ResolvesEveryRequiredService already asserted exactly this; it was simply reached too late to be useful. Running it before publish fails in seconds and names the service. The project is now skipped in the later sweep so it runs once rather than twice.

    Corrected from the original description of this PR, which claimed the project ran nowhere in CI. It did run — just too late to matter.

Testing

  • MacOSCompositionRootTests: 3 passed. Fails on development without this change.
  • GenHub.Tests.Core: 1408 passed.
  • GenHub.MacOS builds with 0 warnings.
  • Build macOS passes on this branch, against red on development.

Risks and rollback

Registration-only, scoped to the macOS module; no behaviour change on Windows or Linux. Revert-safe, though reverting restores the startup crash.

Related

Unblocks the native-launch PR, which is where these registrations were originally staged. Alpha 4 cannot ship until this lands — #229's promote gate requires a green CI run for the exact release SHA.

Greptile Summary

Registers the macOS implementations required by shared game-settings and workspace services.

  • Adds macOS game-path, symlink-capability, and Unix file-operations registrations.
  • Expands composition-root assertions to cover the newly required platform services.
  • Runs the macOS test project before publishing and avoids rerunning it in the generic test sweep.

Confidence Score: 5/5

The PR appears safe to merge, with the new macOS registrations and CI coverage consistent with existing platform patterns.

The macOS composition root now supplies each required service with available dependencies, all platform modules satisfy the expanded assertions, and the only current macOS test project remains executed exactly once in its native CI job.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Runs the sole macOS-specific test project before publish and excludes it from the later sweep to prevent duplicate execution.
GenHub/GenHub.MacOS/Infrastructure/DependencyInjection/MacOSServicesModule.cs Registers constructible macOS and Unix service implementations using the established platform-wrapper pattern and correct registration order.
GenHub/GenHub.Tests/Shared/CompositionRootAssertions.cs Adds required platform interfaces that are registered and resolved by all current platform composition roots.

Reviews (1): Last reviewed commit: "fix(macos): register the platform servic..." | Re-trigger Greptile

Context used (3)

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved macOS support by registering required game path, symlink, and file operation services.
    • Fixed macOS file handling to support platform-specific hard-link behavior.
  • Tests

    • Added direct macOS test execution in CI to detect missing platform services earlier.
    • Expanded dependency validation to ensure required macOS services are available.

Walkthrough

The macOS dependency injection module now registers game path, symlink, and Unix file operation services. Composition assertions require the new services, and CI runs macOS tests before publishing.

Changes

macOS service registration

Layer / File(s) Summary
macOS dependency injection wiring
GenHub/GenHub.MacOS/Infrastructure/DependencyInjection/MacOSServicesModule.cs
Registers IGamePathProvider, ISymlinkCapabilityProvider, and a scoped Unix-backed IFileOperationsService.
Composition validation and CI execution
GenHub/GenHub.Tests/Shared/CompositionRootAssertions.cs, .github/workflows/ci.yml
Requires the new platform services in composition checks and runs the macOS test project before packaging.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: Enhancement, Testing

Poem

A bunny wired services in a row,
With paths and symlinks set to go.
Unix files now hop with care,
CI tests spring through the air.
Then packaging follows—behold! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title uses a valid conventional-commit format and accurately summarizes the macOS DI registration fix.
Description check ✅ Passed The description directly matches the changed macOS services, composition-root assertions, and CI test ordering.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/macos-service-registrations

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.

@coderabbitai coderabbitai Bot added Enhancement New feature or request Testing Topic related to (unit) tests labels Jul 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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/ci.yml:
- Around line 418-421: Update the generic test loop in the CI workflow to also
exclude the macOS test project, while preserving the dedicated “Run macOS Tests”
pre-publish step. Use the existing project-name filtering alongside the Windows
and Linux exclusions so GenHub.Tests.MacOS.csproj is executed only once.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9aa6e09a-7550-409a-9858-bb2deecd78c4

📥 Commits

Reviewing files that changed from the base of the PR and between 34f98db and da7102a.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • GenHub/GenHub.MacOS/Infrastructure/DependencyInjection/MacOSServicesModule.cs
  • GenHub/GenHub.Tests/Shared/CompositionRootAssertions.cs

Comment thread .github/workflows/ci.yml
@kilo-code-bot

kilo-code-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .github/workflows/ci.yml - Updated documentation and fixed duplicate macOS test execution
  • GenHub/GenHub.MacOS/Infrastructure/DependencyInjection/MacOSServicesModule.cs - Added required service registrations for macOS
  • GenHub/GenHub.Tests/Shared/CompositionRootAssertions.cs - Added required platform service types to composition root assertions
Previous Review Summary (commit da7102a)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit da7102a)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .github/workflows/ci.yml - Added macOS test execution step with proper project path and verbosity settings
  • GenHub/GenHub.MacOS/Infrastructure/DependencyInjection/MacOSServicesModule.cs - Added necessary service registrations (IGamePathProvider, ISymlinkCapabilityProvider, IFileOperationsService) with appropriate imports and documentation
  • GenHub/GenHub.Tests/Shared/CompositionRootAssertions.cs - Added required service types to composition root assertions

Reviewed by glm-4.7 · Input: 21.9K · Output: 2.9K · Cached: 271K

#328 made IGamePathProvider a required dependency and #329 added the macOS host, but neither could carry the macOS registrations: they reference types from the first and a module from the second, so they only compile once both are in. Each PR was green in isolation and the merged state is not — GenHub.app now aborts at container build with 'Unable to resolve service for type IGamePathProvider while attempting to activate GameSettingsService', cascading across roughly twenty descriptors including MainViewModel and IGameLauncher.

Registers IGamePathProvider, ISymlinkCapabilityProvider and IFileOperationsService for macOS. Only the first breaks startup; without the other two macOS silently copies instead of hard-linking and cannot reach symlink strategies, which are the behaviours #328 set out to fix.

Also moves the macOS test run before publish. GenHub.Tests.MacOS was already covered by the job's final 'Run Tests' step, but that sits after Publish and Smoke Test App Launch, so the startup crash killed the job first and the assertion naming the service never ran. MacOSHost_ResolvesEveryRequiredService already asserted this; it was reached too late to be useful. The project is skipped in the later sweep so it runs once.
@bobtista
bobtista force-pushed the fix/macos-service-registrations branch from da7102a to e82b75a Compare July 30, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Testing Topic related to (unit) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant