Skip to content

fix: correct attach_yaml name in MQTT request and simplify grpc warnings - #1066

Merged
michaelboulton merged 1 commit into
taverntesting:masterfrom
reachsridhard:fix/mqtt-attach-yaml-name-and-pkg-resources-warnings
Jul 2, 2026
Merged

fix: correct attach_yaml name in MQTT request and simplify grpc warnings#1066
michaelboulton merged 1 commit into
taverntesting:masterfrom
reachsridhard:fix/mqtt-attach-yaml-name-and-pkg-resources-warnings

Conversation

@reachsridhard

@reachsridhard reachsridhard commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

fix: correct attach_yaml name in MQTT request and simplify grpc warnings

Summary

Two small, tangible fixes:

  1. Bug: Wrong attach_yaml name in MQTT request — mqtt/request.py used name="rest_request" (copy-paste from REST plugin) instead of name="mqtt_request". This caused MQTT request payloads to be incorrectly labeled as rest_request in test reports and allure attachments.

  2. Bug: Fragile pkg_resources warning suppression — grpc/init.py had 5 separate warnings.filterwarnings calls with hardcoded lineno values (e.g. lineno=2804). These line numbers are specific to a particular version of pkg_resources and silently stop working when the dependency updates. Replaced with a single module-level filter that suppresses all DeprecationWarning from pkg_resources regardless of line number.

Changes

File Change
tavern/_plugins/mqtt/request.py name="rest_request"name="mqtt_request"
tavern/_plugins/grpc/init.py 5 hardcoded lineno filters → 1 module-level filter

Testing

  • 530 passed, 7 xfailed
  • ruff check + format: clean

Summary by CodeRabbit

  • Bug Fixes
    • Reduced noisy deprecation warnings from the gRPC plugin during normal use.
    • Corrected the YAML attachment label for MQTT requests so saved request data is identified more accurately.

- Fix copy-paste bug in mqtt/request.py: attach_yaml name was
  'rest_request' instead of 'mqtt_request', causing incorrect
  labeling in test reports
- Replace 5 brittle hardcoded lineno filterwarnings in grpc/__init__.py
  with a single module-level filter for pkg_resources DeprecationWarnings.
  The hardcoded line numbers break when dependencies update.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 52902679-f1f6-4aa5-90cb-ef3bf6946e1c

📥 Commits

Reviewing files that changed from the base of the PR and between 202337b and 95d5405.

📒 Files selected for processing (2)
  • tavern/_plugins/grpc/__init__.py
  • tavern/_plugins/mqtt/request.py

📝 Walkthrough

Walkthrough

This PR makes two small, unrelated edits: the gRPC plugin now suppresses pkg_resources DeprecationWarning with a single rule instead of multiple lineno-specific filters, and the MQTT request plugin labels its attached YAML payload as "mqtt_request" instead of "rest_request".

Changes

Miscellaneous plugin fixes

Layer / File(s) Summary
Simplify gRPC deprecation warning suppression
tavern/_plugins/grpc/__init__.py
Multiple lineno-keyed warnings.filterwarnings calls are replaced with a single rule suppressing DeprecationWarning from pkg_resources.
Correct MQTT request attach_yaml label
tavern/_plugins/mqtt/request.py
The attach_yaml call in MQTTRequest.run() now uses name="mqtt_request" instead of name="rest_request".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarises the MQTT attach_yaml rename and the grpc warning filter simplification.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@michaelboulton
michaelboulton merged commit 7829093 into taverntesting:master Jul 2, 2026
12 checks passed
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