Skip to content

fix: stop the workspace template from enabling coverage builds - #64

Merged
dvadovsz merged 3 commits into
mainfrom
fix/23957-pytest-cov-warnings
Nov 2, 2026
Merged

dvadovsz merged 3 commits into
mainfrom
fix/23957-pytest-cov-warnings

Conversation

@picknik-johnny-5-bot

Copy link
Copy Markdown
Contributor

[written by AI]

Refs PickNikRobotics/moveit_pro#23957

Motivation

Same fix as PickNikRobotics#1141. The template colcon-defaults.yaml enables coverage-gcc and coverage-pytest. The MoveIt Pro image has no pytest-cov, so every ament_add_pytest_test warns 'pytest-cov' was not found, and every library is built with gcov instrumentation. MoveIt Pro's own user defaults and the 10.2.0 release notes already have coverage off by default.

Summary

  • Remove both coverage mixins and document how to opt back in through COLCON_DEFAULTS_FILE.
  • Add a no-coverage-mixins pre-commit hook.
  • COPY --chown the defaults file to the workspace user.

Existing build directories keep the cached coverage flags. Rebuild once with --cmake-clean-cache, or delete build/, install/ and log/.

Validation

  • 10.2.0-rc5 runtime image, using this repo's old and new defaults on an example_ws package: pytest-cov warnings went from 4 to 0, and colcon test passed 16/16 both times.
  • pre-commit run -a and hadolint pass. The new hook rejects the original file.
  • git diff --check origin/main...HEAD

The shipped colcon-defaults.yaml turned on coverage-gcc and
coverage-pytest for every build. coverage-pytest sets
AMENT_CMAKE_PYTEST_WITH_COVERAGE, and the MoveIt Pro runtime image does
not include pytest-cov, so every ament_add_pytest_test call warned at
configure time. coverage-gcc instrumented every library and Behavior
plugin, which slows builds and can slow multithreaded code at runtime.

Drop both mixins to match the defaults MoveIt Pro itself installs for
the runtime user, document how to opt back in, and add a pre-commit
hook that rejects coverage mixins in the template.

Also COPY the defaults file with --chown so it belongs to the workspace
user regardless of the host checkout's mode, including runs that skip
the entrypoint's home directory chown.

Same change as PickNikRobotics/moveit_pro_example_ws for v10.2.

Refs PickNikRobotics/moveit_pro#23957
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: d7cb2f0f-42bf-4fca-82cc-bf3054168746
Commits

Reviewing files that changed from the base of the PR and between f6f7d47 and 80289d4.

Files selected for processing: 3
  • .pre-commit-config.yaml
  • Dockerfile
  • colcon-defaults.yaml
Files skipped from review as they are similar to previous changes: 3
  • Dockerfile
  • colcon-defaults.yaml
  • .pre-commit-config.yaml

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

Summary

Summary by CodeRabbit

  • Configuration
    • Coverage mixins are no longer enabled by default. Coverage can be enabled by adding a desired mixin to a copy of the defaults file and setting COLCON_DEFAULTS_FILE to that copy.
  • Maintenance
    • The defaults file is now owned by the configured workspace user and group.
    • A pre-commit check flags coverage mixins in the defaults file.

The default build mixins no longer include coverage. The defaults file documents an opt-in configuration, Docker copies the file with configured user ownership, and a pre-commit hook flags coverage entries.

Changes: Coverage Mixin Setup

Layer / File(s) Summary
Defaults and opt-in enforcement
colcon-defaults.yaml, Dockerfile, .pre-commit-config.yaml
The defaults file removes coverage mixins and documents how to opt in through COLCON_DEFAULTS_FILE. Docker copies the file with configured user ownership. A pre-commit hook flags coverage entries in the defaults file.

Suggested reviewers: mikewrock

Merge Risk: Minimal · up to 80289

The reviewed changes have no identified merge-blocking issue. Merge after the normal checks.

Pre-merge checks: Passed 4
Check name Status Explanation
Description check Passed The description is specific and related to the changeset. It explains why coverage mixins are removed from colcon-defaults.yaml (the image lacks pytest-cov and gcov slows builds), lists the changes (m…
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.
Human Review Check Passed The PR is low risk under this check. It changes only .pre-commit-config.yaml, Dockerfile, and colcon-defaults.yaml. The changes add a narrow validation hook, remove default coverage mixins, and …
Full details: Description check

Explanation

The description is specific and related to the changeset. It explains why coverage mixins are removed from colcon-defaults.yaml (the image lacks pytest-cov and gcov slows builds), lists the changes (mixin removal, no-coverage-mixins pre-commit hook, COPY --chown), gives rebuild guidance for existing build directories, and reports validation results. The check passes.

Full details: Human Review Check

Explanation

The PR is low risk under this check. It changes only .pre-commit-config.yaml, Dockerfile, and colcon-defaults.yaml. The changes add a narrow validation hook, remove default coverage mixins, and set ownership on one copied defaults file. The Dockerfile change does not add deployment behavior or increase hosting or runner costs; disabling coverage reduces build work. The PR changes no auth, permissions, secrets, public API, launch scripts, tutorials, or MoveIt Pro behavior packages.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread .pre-commit-config.yaml Resolved

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

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread .pre-commit-config.yaml Resolved
@picknik-johnny-5-bot
picknik-johnny-5-bot Bot force-pushed the fix/23957-pytest-cov-warnings branch from f2b472a to 80289d4 Compare November 2, 2026 22:17
@dvadovsz
dvadovsz merged commit 184f2ae into main Nov 2, 2026
4 checks passed
@dvadovsz
dvadovsz deleted the fix/23957-pytest-cov-warnings branch November 2, 2026 22:24
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