Skip to content

bazel: Enable rustfmt and clippy in CI#44830

Merged
vitkyrka merged 1 commit intovitkyrka/rustfrom
vitkyrka/rust-checks
Jan 9, 2026
Merged

bazel: Enable rustfmt and clippy in CI#44830
vitkyrka merged 1 commit intovitkyrka/rustfrom
vitkyrka/rust-checks

Conversation

@vitkyrka
Copy link
Copy Markdown
Contributor

@vitkyrka vitkyrka commented Jan 7, 2026

In CI, enable rustfmt and clippy checks for Rust targets during the
build phase.

This ensures that the rules are enforced by CI while still allowing developers
to temporarily ignore them locally during development.

In CI, enable rustfmt and clippy checks for Rust targets during the
build phase.
@vitkyrka vitkyrka added changelog/no-changelog No changelog entry needed qa/done QA done before merge and regressions are covered by tests team/agent-discovery labels Jan 7, 2026
@vitkyrka vitkyrka marked this pull request as ready for review January 7, 2026 13:48
@vitkyrka vitkyrka requested a review from a team as a code owner January 7, 2026 13:48
@vitkyrka vitkyrka added the ask-review Ask required teams to review this PR label Jan 7, 2026
Comment on lines +47 to +50
build:ci --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build:ci --output_groups=+clippy_checks
build:ci --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
build:ci --output_groups=+rustfmt_checks
Copy link
Copy Markdown
Contributor

@rdesgroppes rdesgroppes Jan 7, 2026

Choose a reason for hiding this comment

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

This introduces a dev/prod parity issue: code may build locally but fail in CI due to formatting or lint violations, with no local feedback until after push (and CI latency...)

That said, this follows upstream guidance from https://bazelbuild.github.io/rules_rust/rust_fmt.html:

It's recommended to only enable this aspect in your CI environment so formatting issues do not impact users' ability to rapidly iterate on changes.

There is also an efficiency win: Bazel aspects leverage the cache and dependency graph, making them far more efficient than standalone linters that rescan everything. This is a good precedent for adding similar checks in other languages (in lieu of existing ones).

Approving (despite the dev/prod parity caveat).

Let’s iterate based on developer feedback. If "builds locally, fails in CI" becomes painful, we can generalize later. The efficiency gains and alignment with upstream best practices justify starting here.

@github-actions github-actions bot added the short review PR is simple enough to be reviewed quickly label Jan 7, 2026
@agent-platform-auto-pr
Copy link
Copy Markdown
Contributor

Static quality checks

✅ Please find below the results from static quality gates
Comparison made with ancestor 56f5e9c
📊 Static Quality Gates Dashboard

Successful checks

Info

Quality gate Delta On disk size (MiB) Delta On wire size (MiB)
agent_deb_amd64 $${+0}$$ $${708.39}$$ < $${708.41}$$ $${-0.02}$$ $${173.92}$$ < $${174.49}$$
agent_deb_amd64_fips $${+0}$$ $${703.68}$$ < $${704.0}$$ $${-0.03}$$ $${172.7}$$ < $${173.75}$$
agent_heroku_amd64 $${0}$$ $${328.83}$$ < $${329.53}$$ $${+0}$$ $${87.45}$$ < $${88.45}$$
agent_msi $${-0}$$ $${570.98}$$ < $${982.08}$$ $${+0.02}$$ $${142.75}$$ < $${143.02}$$
agent_rpm_amd64 $${+0}$$ $${708.38}$$ < $${708.38}$$ $${+0}$$ $${176.4}$$ < $${177.66}$$
agent_rpm_amd64_fips $${+0}$$ $${703.67}$$ < $${703.99}$$ $${-0.02}$$ $${175.88}$$ < $${176.6}$$
agent_rpm_arm64 $${-0}$$ $${689.93}$$ < $${693.52}$$ $${+0.03}$$ $${159.99}$$ < $${161.26}$$
agent_rpm_arm64_fips $${-0}$$ $${686.06}$$ < $${688.48}$$ $${+0.03}$$ $${159.38}$$ < $${160.55}$$
agent_suse_amd64 $${+0}$$ $${708.38}$$ < $${708.38}$$ $${+0}$$ $${176.4}$$ < $${177.66}$$
agent_suse_amd64_fips $${+0}$$ $${703.67}$$ < $${703.99}$$ $${-0.02}$$ $${175.88}$$ < $${176.6}$$
agent_suse_arm64 $${-0}$$ $${689.93}$$ < $${693.52}$$ $${+0.03}$$ $${159.99}$$ < $${161.26}$$
agent_suse_arm64_fips $${-0}$$ $${686.06}$$ < $${688.48}$$ $${+0.03}$$ $${159.38}$$ < $${160.55}$$
docker_agent_amd64 $${+0}$$ $${770.18}$$ < $${770.72}$$ $${+0}$$ $${261.8}$$ < $${262.45}$$
docker_agent_arm64 $${-0}$$ $${776.3}$$ < $${780.2}$$ $${+0}$$ $${250.85}$$ < $${252.63}$$
docker_agent_jmx_amd64 $${+0}$$ $${961.06}$$ < $${961.6}$$ $${-0}$$ $${330.43}$$ < $${331.08}$$
docker_agent_jmx_arm64 $${-0}$$ $${955.9}$$ < $${959.8}$$ $${-0}$$ $${315.46}$$ < $${317.27}$$
docker_cluster_agent_amd64 $${-0}$$ $${180.72}$$ < $${181.08}$$ $${+0}$$ $${63.85}$$ < $${64.49}$$
docker_cluster_agent_arm64 $${-0}$$ $${196.55}$$ < $${198.49}$$ $${+0}$$ $${60.12}$$ < $${61.17}$$
docker_cws_instrumentation_amd64 $${0}$$ $${7.13}$$ < $${7.18}$$ $${+0}$$ $${2.99}$$ < $${3.33}$$
docker_cws_instrumentation_arm64 $${0}$$ $${6.69}$$ < $${6.92}$$ $${+0}$$ $${2.73}$$ < $${3.09}$$
docker_dogstatsd_amd64 $${-0}$$ $${38.81}$$ < $${39.38}$$ $${-0}$$ $${15.02}$$ < $${15.82}$$
docker_dogstatsd_arm64 $${0}$$ $${37.13}$$ < $${37.94}$$ $${-0}$$ $${14.34}$$ < $${14.83}$$
dogstatsd_deb_amd64 $${0}$$ $${30.03}$$ < $${30.61}$$ $${-0}$$ $${7.94}$$ < $${8.79}$$
dogstatsd_deb_arm64 $${0}$$ $${28.18}$$ < $${29.11}$$ $${+0}$$ $${6.82}$$ < $${7.71}$$
dogstatsd_rpm_amd64 $${0}$$ $${30.03}$$ < $${30.61}$$ $${+0}$$ $${7.95}$$ < $${8.8}$$
dogstatsd_suse_amd64 $${0}$$ $${30.03}$$ < $${30.61}$$ $${+0}$$ $${7.95}$$ < $${8.8}$$
iot_agent_deb_amd64 $${0}$$ $${42.97}$$ < $${43.29}$$ $${-0}$$ $${11.25}$$ < $${12.04}$$
iot_agent_deb_arm64 $${0}$$ $${40.1}$$ < $${40.92}$$ $${+0}$$ $${9.62}$$ < $${10.45}$$
iot_agent_deb_armhf $${0}$$ $${40.68}$$ < $${41.03}$$ $${-0}$$ $${9.82}$$ < $${10.62}$$
iot_agent_rpm_amd64 $${0}$$ $${42.98}$$ < $${43.29}$$ $${-0}$$ $${11.26}$$ < $${12.06}$$
iot_agent_suse_amd64 $${0}$$ $${42.98}$$ < $${43.29}$$ $${-0}$$ $${11.26}$$ < $${12.06}$$

@vitkyrka vitkyrka merged commit 266374d into vitkyrka/rust Jan 9, 2026
453 of 455 checks passed
@vitkyrka vitkyrka deleted the vitkyrka/rust-checks branch January 9, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ask-review Ask required teams to review this PR changelog/no-changelog No changelog entry needed qa/done QA done before merge and regressions are covered by tests short review PR is simple enough to be reviewed quickly team/agent-discovery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants