Skip to content

cono - #3

Open
jew256 wants to merge 377 commits into
CUAir:masterfrom
mavlink:master
Open

cono#3
jew256 wants to merge 377 commits into
CUAir:masterfrom
mavlink:master

Conversation

@jew256

@jew256 jew256 commented May 21, 2023

Copy link
Copy Markdown

Note

High Risk
Large breaking release: workspace split, feature/API renames, and publish workflow that mutates default-branch versions—high impact for downstream crates and release correctness.

Overview
Major architectural refactor that turns the monolithic mavlink crate into a Cargo workspace (mavlink, mavlink-core, mavlink-bindgen), bumps Rust/edition expectations (workspace rust-version 1.85, edition 2024), and relocates the MAVLink XML submodule to mavlink/mavlink.

Codegen moves out of the root build/ scripts into mavlink-bindgen (library + optional CLI), with richer generation: dialect-* feature gates, mavlink_core types, deprecations/superseded metadata, extensions/signing-related hooks, snapshot tests, and updated dialect feature naming in docs/CI.

CI and release are reworked: Dependabot for Cargo and Actions; test.yml splits into fmt, Clippy, per-dialect test matrix (via scripts/list_dialect_features.py), MSRV checks (cargo-hack), cross-target builds using dialect-ardupilotmega, embedded size job, and docs deploy to GitHub Pages on master. Tag deploy uses cargo-workspaces to bump versions, publishes all three crates to crates.io, and pushes version commits to the default branch (replacing katyo/publish-crates).

Supporting changes include expanded README / MAINTAINERS.md, .gitignore updates, and removal of the old in-tree build pipeline.

Reviewed by Cursor Bugbot for commit 8c37663. Bugbot is set up for automated code reviews on this repo. Configure here.

pv42 and others added 24 commits August 25, 2024 21:53
test: add signing to msrv check
test: add signing to internal-tests matrix
test: add signing as msrv matrix option
feat: add async peek reader
feat: change async read fn to use AsyncPeekReader
feat: add read_v1_msg_async, read_v2_msg_async_signed, write_versioned_msg_async_signed, write_v2_msg_async_signed
fix: remove tokio version cap for dev-dep
doc: update for async
fix: remove unused serial code from async connection
dependabot Bot and others added 20 commits May 13, 2026 10:15
Updates the requirements on [quick-xml](https://github.com/tafia/quick-xml) to permit the latest version.
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](tafia/quick-xml@v0.39.0...v0.40.0)

---
updated-dependencies:
- dependency-name: quick-xml
  dependency-version: 0.40.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

* refactor(bytes_mut): replace unsafe copy with safe copy_from_slice

Use `copy_from_slice` in `BytesMut::put_slice` instead of manually calling
`copy_nonoverlapping`. The existing bounds check already ensures the destination
range is valid, so the safe slice API is equivalent and removes unnecessary unsafe
code.

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* add parentheses to slice range expressions

Signed-off-by: Onur Özkan <work@onurozkan.dev>

---------

Signed-off-by: Onur Özkan <work@onurozkan.dev>
* allow rustdoc::broken_intra_doc_links lint in generated code

* adjust snapshots
* generate undersized bitflag variants when fields are undersized, adjust bitflag size check from all to any

* adjust default bitflag size, add undersized doc hint, fix default and reader for undersized enums

* fix typo

* adjust test for #503
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
* update rand to 0.10

* remove rand, arbitrary dependencies from bindgen
Writes payload straight into the destination buffer right after
the header and avoids the intermediate buffer and an extra copy.

Speeds up the `MavFrame::ser` around 20% on a regular x86 CPU.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Avoids per-send allocation and copy for udp send.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: Onur Özkan <work@onurozkan.dev>
* implement send_raw, a way to send unparsed messages

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* add test coverage for send_raw

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* fix tokio build

Signed-off-by: Onur Özkan <work@onurozkan.dev>

---------

Signed-off-by: Onur Özkan <work@onurozkan.dev>
* add script that prints dialects

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* use dynamically calculated dialects on internal-tests

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* add name attribute to new CI step

Signed-off-by: Onur Özkan <work@onurozkan.dev>

* fetch submodule for dialect-features step

Signed-off-by: Onur Özkan <work@onurozkan.dev>

---------

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [quick-xml](https://github.com/tafia/quick-xml) to permit the latest version.
- [Release notes](https://github.com/tafia/quick-xml/releases)
- [Changelog](https://github.com/tafia/quick-xml/blob/master/Changelog.md)
- [Commits](tafia/quick-xml@v0.40.0...v0.41.0)

---
updated-dependencies:
- dependency-name: quick-xml
  dependency-version: 0.41.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Expose MAVLink frame layout constants through a new public stable API module
`consts` with shared values at the module root and version-specific values
under `consts::v1` and `consts::v2`.

Also clean up the in-tree implementation to use named values instead of
hard-coding frame layout numbers.

Signed-off-by: Onur Özkan <work@onurozkan.dev>
Signed-off-by: 0rlych1kk4 <orlychikka@gmail.com>
cargo install cargo-workspaces
cargo workspaces version custom ${{ steps.get_version.outputs.version }} \
--exact --yes --no-git-tag --no-git-push \
-m "Commit new release ${{ steps.get_version.outputs.version }}" --force "mavlink-*"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Version force pattern skips mavlink

High Severity

The cargo workspaces version command's --force "mavlink-*" argument incorrectly excludes the mavlink crate, while including mavlink-core and mavlink-bindgen. This prevents the mavlink package from receiving version updates, causing it to publish stale versions or fail during the coordinated workspace release.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 90bde67. Configure here.

registry-token: ${{ secrets.CARGO }}
- name: Extract version from tag
id: get_version
run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deploy still uses set-output

High Severity

The deploy.yml workflow uses the deprecated ::set-output command for tag version extraction. This can leave steps.get_version.outputs.version empty, causing cargo workspaces version custom and cargo publish to run with an invalid release version.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 90bde67. Configure here.

- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.event.repository.default_branch }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Deploy publishes default branch, not tag

High Severity

The deploy workflow is triggered by version tags but checks out github.event.repository.default_branch instead of the tagged commit. Previously, a tag push checked out that tag. Crates can now be published from newer or unrelated default-branch tip code while using only the tag name as the version string.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 90bde67. Configure here.

tmp_value
} else {
cnt += 1;
cnt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Enum auto-increment skips zero

High Severity

When an enum entry has no explicit value, the generator does cnt += 1 before using cnt, so the first implicit value is 1 instead of 0. MAVLink assigns omitted values starting at 0, so generated discriminants disagree with the wire protocol and other implementations.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 90bde67. Configure here.

Comment thread .github/workflows/test.yml
Comment thread mavlink/Cargo.toml
Comment thread mavlink/build/main.rs
cargo publish -p mavlink --no-verify
- name: Push commit
run: |
git push origin ${{ github.event.repository.default_branch }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Release push lacks write permission

Medium Severity

The deploy job pushes version-bump commits to the default branch with the default GITHUB_TOKEN, but the workflow never sets permissions: contents: write. On repositories with the default read-only token policy, the final git push fails after crates may already have been published.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 90bde67. Configure here.

0rlych1kk4 and others added 2 commits July 18, 2026 14:57
Signed-off-by: 0rlych1kk4 <orlychikka@gmail.com>
Updates the requirements on [num-derive](https://github.com/rust-num/num-derive) to permit the latest version.
- [Changelog](https://github.com/rust-num/num-derive/blob/main/RELEASES.md)
- [Commits](rust-num/num-derive@num-derive-0.4.0...num-derive-0.5.1)

---
updated-dependencies:
- dependency-name: num-derive
  dependency-version: 0.5.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-m "Commit new release ${{ steps.get_version.outputs.version }}" --force "mavlink-*"
cargo publish -p mavlink-core --no-verify
cargo publish -p mavlink-bindgen --no-verify
cargo publish -p mavlink --no-verify

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Crate publish race on crates.io

High Severity

mavlink-core, mavlink-bindgen, and mavlink are published back-to-back with no wait for crates.io indexing. Downstream publishes often fail because freshly uploaded dependencies are not resolvable yet, so tag releases can partially succeed and leave the workspace half-published.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 34958aa. Configure here.

}
self.additional_primitives
.extend(enm.additional_primitives.clone());
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Enum merge panics on duplicates

Medium Severity

The MavEnum::try_combine function has issues merging enum entries from included dialects. It panics on missing optional values and when encountering identical entries. It also incorrectly appends same-name entries with different values, which can lead to duplicate Rust variants.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 34958aa. Configure here.

Comment thread .github/workflows/test.yml
onur-ozkan and others added 4 commits July 22, 2026 08:47
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Bumps [actions-rs-plus/clippy-check](https://github.com/actions-rs-plus/clippy-check) from 2 to 2.7.
- [Release notes](https://github.com/actions-rs-plus/clippy-check/releases)
- [Changelog](https://github.com/actions-rs-plus/clippy-check/blob/main/CHANGELOG.md)
- [Commits](actions-rs-plus/clippy-check@v2...v2.7.0)

---
updated-dependencies:
- dependency-name: actions-rs-plus/clippy-check
  dependency-version: '2.7'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
)

Bumps [actions-rs-plus/clippy-check](https://github.com/actions-rs-plus/clippy-check) from 2.7.0 to 2.7.1.
- [Release notes](https://github.com/actions-rs-plus/clippy-check/releases)
- [Changelog](https://github.com/actions-rs-plus/clippy-check/blob/main/CHANGELOG.md)
- [Commits](actions-rs-plus/clippy-check@v2.7.0...v2.7.1)

---
updated-dependencies:
- dependency-name: actions-rs-plus/clippy-check
  dependency-version: 2.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Implemented method to retrieve mavlink sha

* moved MAVLINK_DEFINITIONS_SHA inside dialects module

* Mavlink_sha is now optional to avoid breaking on vendor builds

* Removed example from the comments.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

There are 8 total unresolved issues (including 7 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7d31e4a. Configure here.

Comment thread mavlink/Cargo.toml
Signed-off-by: Onur Özkan <work@onurozkan.dev>
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.