Skip to content

Add ardupilot_manager to venv2 updated deps - #4073

Open
nicoschmdt wants to merge 3 commits into
bluerobotics:masterfrom
nicoschmdt:bump-ardupilot
Open

Add ardupilot_manager to venv2 updated deps#4073
nicoschmdt wants to merge 3 commits into
bluerobotics:masterfrom
nicoschmdt:bump-ardupilot

Conversation

@nicoschmdt

Copy link
Copy Markdown
Collaborator

Renamed ping exceptions file because it clashes with ardupilot exceptions file

@github-actions

Copy link
Copy Markdown

Automated PR Review

0. Summary

  • Verdict: MINOR SUGGESTIONS ✏️

Moves ardupilot_manager from the primary workspace to the venv2 workspace, bumps its dependencies (notably pydantic 1.10 → 2.12, fastapi 0.105 → 0.125) and applies the corresponding pydantic v1 → v2 migration (.dict().model_dump(), root_validatormodel_validator(mode="before"), @validator@field_validator, constrAnnotated[str, StringConstraints(...)], ClassVar on non-field class attributes, explicit = None on Optional fields). Adjacent tweaks: renames core/services/ping/exceptions.pyping_exceptions.py to avoid a collision with ardupilot_manager/exceptions.py inside the shared venv, points start-blueos-core at $BLUEOS_PYTHON_BIN_SECONDARY for the autopilot service, and enables bootstrap-runtime-deps for the secondary environment in .hooks/pre-push so the mavlink-server / ardupilot_tools install runs there too.

1. Correctness & Implementation Bugs

  • 1.1 [minor] core/services/ardupilot_manager/mavlink_proxy/Endpoint.py:36-42 — the model_validator(mode="before") only handles ArgsKwargs.kwargs; if an Endpoint is ever constructed positionally, values.args is silently dropped, which then produces a misleading Invalid connection_type: None error rather than a proper validation message. All current call sites use kwargs (autopilot_manager.py:57, :66, Endpoint(**endpoint) at :691, :777), so this doesn't manifest today — worth either unwrapping values.args onto the field order too or asserting the invariant with a short comment so a future positional caller isn't debugging a red-herring error.

6. Code Quality & Style

  • 6.1 [nit] core/services/ardupilot_manager/mavlink_proxy/Endpoint.py:39-40 — the if isinstance(values, ArgsKwargs): values = dict(values.kwargs or {}) shim is the kind of pydantic-v2 quirk that will read as noise to anyone who didn't do this migration. A one-line "why" comment (pydantic v2 dataclass validators receive ArgsKwargs for kwarg construction) would age well.
  • 6.2 [nit] core/services/ardupilot_manager/mavlink_proxy/test_all.py:135_bad_endpoint(**kwargs: object) is unusual; **kwargs: Any (or a TypedDict/Mapping[str, Any] param) is closer to the surrounding style and avoids the # type: ignore[arg-type] further down.

9. Nitpicks / Optional

  • 9.1 [nit] .hooks/pre-push:128 — primary run_environment_phase still passes true for run_bootstrap, but with ardupilot_manager gone from the primary workspace the only members left are bridges, commonwealth, cable_guy, none of which need mavlink-server/ardupilot_tools. Not blocking (keeping it true is safe and defensive), but you may be able to flip it to false to shave install time off the primary phase.
  • 9.2 [nit] core/services/ardupilot_manager/pyproject.toml — a lot of bundled version bumps ride along here (aiocache 0.12.2→0.12.3, packaging 20.4→25.0, psutil 5.7.2→7.1.3, etc.). Only pydantic + fastapi are strictly required to align with the rest of venv2; a follow-up commit message explaining why the others were touched at the same time would help git blame later.

Generated by PR Review Bot. This is advisory, a human reviewer must still approve.

@joaoantoniocardoso joaoantoniocardoso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, this one needs a rebase :)

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.

2 participants