Skip to content

Catch agnostic HTTPError base in rabbitmq and swap the test#24251

Open
mwdd146980 wants to merge 1 commit into
mwdd146980/httpx-migration-basefrom
mwdd146980/w1b-rabbitmq
Open

Catch agnostic HTTPError base in rabbitmq and swap the test#24251
mwdd146980 wants to merge 1 commit into
mwdd146980/httpx-migration-basefrom
mwdd146980/w1b-rabbitmq

Conversation

@mwdd146980

@mwdd146980 mwdd146980 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Widens the _get_data() exception catch in the RabbitMQ check to also catch the backend-agnostic HTTPError base alongside the existing requests RequestException. The unit test injection swaps to the agnostic HTTPStatusError instance.

Motivation

Part of the httpx migration. Once the HTTP layer can raise agnostic errors, a catch that only knows RequestException would let an agnostic status error escape _get_data instead of being re-raised as RabbitMQException. Widening the catch keeps the check correct under either backend. There is no observable behavior change under the shipped requests backend, which never raises the agnostic type.

Verification

Verified red-then-green. With HTTPStatusError("error") injected but _get_data still catching only RequestException, the agnostic error escapes the clause and test__get_data fails with HTTPStatusError (not a TypeError, confirming the instance form is correct). Widening the catch to (RequestException, HTTPError) makes it pass. The full rabbitmq unit suite is green.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mwdd146980 mwdd146980 added the qa/skip-qa Automatically skip this PR for the next QA label Jun 29, 2026
@datadog-official

datadog-official Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Pipelines  Tests  Code Coverage

Fix all issues with BitsAI

⚠️ Warnings

🚦 8 Pipeline jobs failed

PR | test / test-minimum-base-package (linux, ubuntu-22.04, rabbitmq, RabbitMQ (py3.13-3.11-mgmt), py3.13-3.1... / minimum-base-package-RabbitMQ (py3.13-3.11-mgmt)-py3.13-3.11-mgmt   View in Datadog   GitHub Actions

PR | test / test-minimum-base-package (linux, ubuntu-22.04, rabbitmq, RabbitMQ (py3.13-3.11-openmetrics), py3... / minimum-base-package-RabbitMQ (py3.13-3.11-openmetrics)-py3.13-3.11-openmetrics   View in Datadog   GitHub Actions

PR | test / test-minimum-base-package (linux, ubuntu-22.04, rabbitmq, RabbitMQ (py3.13-3.7-mgmt), py3.13-3.7-... / minimum-base-package-RabbitMQ (py3.13-3.7-mgmt)-py3.13-3.7-mgmt   View in Datadog   GitHub Actions

View all 8 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 95.40% (+7.24%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 672456a | Docs | Datadog PR Page | Give us feedback!

@mwdd146980

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 672456a2df

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread rabbitmq/datadog_checks/rabbitmq/rabbitmq.py
@mwdd146980 mwdd146980 changed the title Catch the agnostic HTTPError base in rabbitmq and swap the test Catch agnostic HTTPError base in rabbitmq and swap the test Jun 30, 2026
@mwdd146980 mwdd146980 marked this pull request as ready for review July 1, 2026 00:54
@mwdd146980 mwdd146980 requested a review from a team as a code owner July 1, 2026 00:54
@dd-octo-sts

dd-octo-sts Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Validation Report

Validation Description Status
dep Verify dependency pins are consistent and Agent-compatible

Run ddev validate all changed --fix to attempt to auto-fix supported validations.

Passed validations (20)
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 672456a2df

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread rabbitmq/changelog.d/22676.changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration/rabbitmq qa/skip-qa Automatically skip this PR for the next QA team/agent-integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant