feat(explorer): allow client to pass in metadata#104606
Conversation
| payload["metadata"] = metadata | ||
|
|
||
| body = orjson.dumps(payload, option=orjson.OPT_NON_STR_KEYS) |
There was a problem hiding this comment.
Bug: The new metadata field might not be accepted by the external Seer backend, leading to runtime errors.
Severity: HIGH | Confidence: Low
🔍 Detailed Analysis
The client-side code sends a metadata field to an external Seer service, but there's no verification or integration tests to confirm the backend accepts this new parameter. If the backend has not been updated or rejects unknown fields, it could return a 400 Bad Request, causing the client to raise requests.HTTPError() and the feature to fail at runtime.
💡 Suggested Fix
Add integration tests that call the external Seer backend with the metadata parameter to verify its acceptance and proper handling. Coordinate with the Seer backend team to ensure metadata is supported.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/sentry/seer/explorer/client.py#L252-L254
Potential issue: The client-side code sends a `metadata` field to an external Seer
service, but there's no verification or integration tests to confirm the backend accepts
this new parameter. If the backend has not been updated or rejects unknown fields, it
could return a `400 Bad Request`, causing the client to raise `requests.HTTPError()` and
the feature to fail at runtime.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 6582980
There was a problem hiding this comment.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #104606 +/- ##
===========================================
- Coverage 80.63% 80.52% -0.12%
===========================================
Files 9335 9330 -5
Lines 402949 400718 -2231
Branches 25689 25689
===========================================
- Hits 324921 322679 -2242
- Misses 77562 77573 +11
Partials 466 466 |
Allows client to pass in arbitrary metadata when starting a new run and allow it to retrieve it later