Skip to content

fix(ci): pin submodule to SDK v0.6.0, enable submodule checkout, format#6

Merged
WomB0ComB0 merged 2 commits into
mainfrom
fix/ci-submodule-and-format
Apr 19, 2026
Merged

fix(ci): pin submodule to SDK v0.6.0, enable submodule checkout, format#6
WomB0ComB0 merged 2 commits into
mainfrom
fix/ci-submodule-and-format

Conversation

@WomB0ComB0
Copy link
Copy Markdown
Member

@WomB0ComB0 WomB0ComB0 commented Apr 19, 2026

Summary

Unblocks the three broken status checks on main — all pre-existed PR #5 and are unrelated to it.

What was broken

  1. gates / .NET CI / Build (FAIL) — viz's .csproj references SDK types (SimulatedDrone, WeatherSystem, SimulationWorld, ITerrain, IWeatherSystem, SurfaceType, WeatherConfig) and projects (ResQ.Simulation.Engine, ResQ.Mavlink*) that don't exist at the current submodule pin 5f80948… — an orphan commit not reachable on dotnet-sdk remote.
  2. gates / .NET CI / Format check (FAIL) — 10 files failed dotnet format --verify-no-changes (aligned-column dict initializers + parameter alignment).
  3. scan / CodeQL (csharp) + gates / Security / CodeQL (csharp) (FAIL) — CodeQL's autobuild cascaded from docs(AGENTS): add git-hooks contract + dotnet pre-push #1.
  4. gates / .NET CI / Build (latent) — Dependabot auto-merged Vite.AspNetCore 1.12.0 → 2.4.1 (Bump the nuget group with 2 updates #3) which is a major-version bump that removed the Vite.AspNetCore.Extensions namespace.
  5. CI checkout never pulled submodules — even with a valid pin, resq-software/.github's reusable workflow didn't take a submodules input.

What this PR changes

File Change
lib/dotnet-sdk gitlink 5f80948… (orphan) → 63bf1cb… (SDK v0.6.0)
.github/workflows/ci.yml bump reusable to resq-software/.github@109c36b5 (PR #18); add submodules: recursive
src/ResQ.Viz.Web/Program.cs Vite.AspNetCore.ExtensionsVite.AspNetCore (v2.x API)
10 .cs files (Services/Controllers/Tests) dotnet format applied; aligned-column initializers broken out one-per-line

Local verification

dotnet build ResQ.Viz.sln -c Release   → Build succeeded. 0 Warning(s) 0 Error(s)
dotnet test  ResQ.Viz.sln -c Release   → Passed! 82/82 tests
dotnet format ... --verify-no-changes  → exit 0

Notes

  • SDK v0.6.0 is the last tagged release before dotnet-sdk's chore: sync from monorepo @3b483eb which removed the simulation/mavlink projects in favor of a slimmer ResQ.Simulation API. Once viz is ready to migrate to that API, the submodule can be bumped forward.
  • PR chore: add Apache-2.0 license headers and install canonical git hooks #5 (chore/license-headers-and-hooks) rebases cleanly on this.

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Style

    • Code formatting and whitespace normalization across service classes, controllers, and test files
  • Chores

    • Updated CI workflow configuration and submodule handling
    • Updated .NET SDK subproject reference
    • Refactored Vite framework integration imports

Unblocks the three broken status checks on `main`:

* **Build (CS0246)**: `lib/dotnet-sdk` gitlink now pins to `v0.6.0`
  (`63bf1cb`), which contains `ResQ.Simulation.Engine` and `ResQ.Mavlink*`
  — the prior pin was an orphan commit unreachable on the SDK remote.
* **CI checkout**: bump reusable workflow to
  `resq-software/.github@109c36b5` (PR #18) so `actions/checkout` can take
  `submodules: recursive`, wired into both `dotnet-ci.yml` and the CodeQL
  job in `security-scan.yml`.
* **Format check**: apply `dotnet format` repo-wide (10 source/test files).
  Aligned-column initializers became one-entry-per-line to satisfy
  `dotnet format --verify-no-changes --severity warn`.
* **Build (Vite.AspNetCore 2.x)**: Dependabot auto-merged the 1.12.0 → 2.4.1
  bump (#3), which dropped the `Vite.AspNetCore.Extensions` namespace. Use
  `using Vite.AspNetCore` to match the v2.x API.

Local verification: `dotnet build -c Release` green, 82/82 tests pass,
`dotnet format --verify-no-changes` clean.

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

coderabbitai Bot commented Apr 19, 2026

Warning

Rate limit exceeded

@WomB0ComB0 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 37 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 53 minutes and 37 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 153873fe-3b83-4d2c-a62c-05c676605b6c

📥 Commits

Reviewing files that changed from the base of the PR and between 11b9b41 and 27cb3ab.

📒 Files selected for processing (1)
  • .github/workflows/security.yml
📝 Walkthrough

Walkthrough

This pull request applies formatting and whitespace normalization across multiple source files and test files, updates a GitHub Actions workflow reference, and bumps a dependency submodule commit hash. The functional logic and control flow remain unchanged.

Changes

Cohort / File(s) Summary
CI/Infrastructure
.github/workflows/ci.yml, lib/dotnet-sdk
Updated workflow reference commit hash and added submodules: recursive input to gates job; bumped dotnet-sdk submodule to new pinned commit.
Service Layer Formatting
src/ResQ.Viz.Web/Services/SimulationService.cs, src/ResQ.Viz.Web/Services/SwarmController.cs, src/ResQ.Viz.Web/Services/TerrainNoiseService.cs, src/ResQ.Viz.Web/Services/VizFrameBuilder.cs, src/ResQ.Viz.Web/Services/ScenarioService.cs
Removed excess whitespace and alignment padding in variable declarations, assignments, switch expressions, and method arguments across multiple service classes without altering logic.
Controllers & Configuration
src/ResQ.Viz.Web/Controllers/SimController.cs, src/ResQ.Viz.Web/Program.cs
Reformatted switch expression alignment in SimController; changed Vite namespace import from Vite.AspNetCore.Extensions to Vite.AspNetCore.
Test Code Formatting
tests/ResQ.Viz.Web.Tests/ScenarioServiceTests.cs, tests/ResQ.Viz.Web.Tests/SimControllerTests.cs, tests/ResQ.Viz.Web.Tests/SimulationServiceTests.cs, tests/ResQ.Viz.Web.Tests/SwarmControllerTests.cs
Normalized whitespace alignment in local variable declarations and refactored test configuration dictionaries from multi-entry single-line format to expanded single-line-per-entry style; no changes to test assertions or behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A whisker twitch and hop of glee,
For formatting clean, now all can see!
Whitespace trimmed with careful care,
The code now breathes with proper flair—
No logic changed, just alignment true,
Fresh and tidy through and through!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 51.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: pinning the submodule to SDK v0.6.0, enabling submodule checkout in CI, and applying formatting corrections across multiple files.

✏️ 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 fix/ci-submodule-and-format

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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request primarily consists of widespread formatting cleanup, specifically removing extra whitespace in assignments and switch expressions across the codebase. It also includes a subproject update and a namespace adjustment for Vite. Feedback highlights several technical concerns: a thread-safety issue with _simTime access, an architectural suggestion to use Dependency Injection for complex services, and potential null reference exceptions in SimulationService and VizFrameBuilder.

// Build and broadcast frame outside the lock to avoid holding it during async I/O.
var snapshot = GetSnapshot();
var frame = _frameBuilder.Build(snapshot, _simTime);
var frame = _frameBuilder.Build(snapshot, _simTime);
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.

high

The variable _simTime is accessed here without a lock, but it is modified under a lock in the background loop (line 215) and in the Reset method (line 165). Since double operations are not guaranteed to be atomic in C#, this can lead to torn reads or inconsistent values when the simulation is reset or updated from another thread. It is safer to capture the current simulation time while holding the lock in the main loop.

Comment on lines +82 to +85
_terrain = new TerrainNoiseService();
_weather = new UpdatableWeatherSystem(new WeatherConfig());
_world = new SimulationWorld(new SimulationConfig(), _terrain, _weather);
_swarm = new SwarmController(_terrain);
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.

medium

The constructor directly instantiates several complex dependencies (TerrainNoiseService, UpdatableWeatherSystem, SimulationWorld, and SwarmController). This violates the Dependency Inversion Principle and makes the service difficult to unit test in isolation. Consider registering these as services in the dependency injection container and injecting them through the constructor.

var weatherMode = mode.ToLowerInvariant() switch
{
"steady" => WeatherMode.Steady,
"steady" => WeatherMode.Steady,
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.

medium

The mode parameter is used with ToLowerInvariant() on line 125 (context). If mode is null (which can happen if it is missing from the API request body), this will throw a NullReferenceException. Consider adding a null check or using a null-safe approach before calling ToLowerInvariant().

Radius: h.Radius,
Id: h.Id,
Type: h.Type,
Center: h.Center.Length == 3 ? [h.Center[0], h.Center[1], h.Center[2]] : [0f, 0f, 0f],
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.

medium

If h.Center is null (which can happen if the configuration binder encounters a null value in the JSON), accessing h.Center.Length will throw a NullReferenceException. Using a pattern match or null-conditional operator would be safer.

            Center: h.Center is { Length: 3 } ? [h.Center[0], h.Center[1], h.Center[2]] : [0f, 0f, 0f],

The `security.yml` workflow calls `security-scan.yml` directly (separate
from the `gates` path), so it needs its own `submodules: recursive` to
give CodeQL's autobuild the SDK submodule.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@WomB0ComB0 WomB0ComB0 merged commit 08e6dd3 into main Apr 19, 2026
35 checks passed
@WomB0ComB0 WomB0ComB0 deleted the fix/ci-submodule-and-format branch April 19, 2026 08:41
WomB0ComB0 added a commit that referenced this pull request Apr 20, 2026
Five keyboard-bound camera framings for demo work (item #6 of the
polish plan):

  Shift+1  OVERVIEW   top-down 45° hero shot of the whole swarm
  Shift+2  TACTICAL   45° oblique at mesh altitude, sim-game angle
  Shift+3  COCKPIT    FPV follow of the selected drone
  Shift+4  GROUND     operator eye-level (1.8 m), looking up
  Shift+5  INVESTOR   toggles the 90s scripted dolly (also Ctrl+Shift+R)

Swarm-aware: framings compute swarm centroid + extent from the last
VizFrame, so the same keybinds work for single drone, swarm-5, or
multi-agency-sar without per-scenario tuning. After a preset lands,
user input (orbit, zoom, WASD fly) continues from the new pose.

Changes:
* `client/cameraPresets.ts` (new) — `CameraPresets` class with the
  five framings and a shared swarm-bounds helper.
* `client/cameraControl.ts` — adds public `UnityCamera.setPose(pos, target)`.
  Releases scripted and follow modes; resyncs orbit yaw/pitch/distance
  from the new quaternion so subsequent user input feels continuous.
* `client/app.ts` — instantiate + bind `Shift+Digit1..5` before the
  existing switch; checks shiftKey first so it can't fire the wrong
  handler.
* `client/controls.ts` — early-return on shifted digits so Shift+1
  doesn't also run the `single` scenario.

Verified: tsc clean, build/format green, 82 / 82 tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WomB0ComB0 added a commit that referenced this pull request Apr 20, 2026
Five keyboard-bound camera framings for demo work (item #6 of the
polish plan):

  Shift+1  OVERVIEW   top-down 45° hero shot of the whole swarm
  Shift+2  TACTICAL   45° oblique at mesh altitude, sim-game angle
  Shift+3  COCKPIT    FPV follow of the selected drone
  Shift+4  GROUND     operator eye-level (1.8 m), looking up
  Shift+5  INVESTOR   toggles the 90s scripted dolly (also Ctrl+Shift+R)

Swarm-aware: framings compute swarm centroid + extent from the last
VizFrame, so the same keybinds work for single drone, swarm-5, or
multi-agency-sar without per-scenario tuning. After a preset lands,
user input (orbit, zoom, WASD fly) continues from the new pose.

Changes:
* `client/cameraPresets.ts` (new) — `CameraPresets` class with the
  five framings and a shared swarm-bounds helper.
* `client/cameraControl.ts` — adds public `UnityCamera.setPose(pos, target)`.
  Releases scripted and follow modes; resyncs orbit yaw/pitch/distance
  from the new quaternion so subsequent user input feels continuous.
* `client/app.ts` — instantiate + bind `Shift+Digit1..5` before the
  existing switch; checks shiftKey first so it can't fire the wrong
  handler.
* `client/controls.ts` — early-return on shifted digits so Shift+1
  doesn't also run the `single` scenario.

Verified: tsc clean, build/format green, 82 / 82 tests passing.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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