Skip to content

chore(uber): delete unlaunched Uber Ride Requests integration#376

Merged
TheRealAgentK merged 5 commits into
masterfrom
feat/uber-sdk-v2-upgrade
Jun 19, 2026
Merged

chore(uber): delete unlaunched Uber Ride Requests integration#376
TheRealAgentK merged 5 commits into
masterfrom
feat/uber-sdk-v2-upgrade

Conversation

@Tram-Nguyen87

@Tram-Nguyen87 Tram-Nguyen87 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Reworked from the original SDK 2.0.0 upgrade into a removal PR.

Per @TheRealAgentK's review, the Uber Ride Requests integration has no registered Uber OAuth provider and has never been launched. Rather than register the provider and request the privileged Uber scopes to launch it, we're dropping the integration.

Changes

  • Delete the uber/ directory (source, config, tests, icon)
  • Remove the Uber Ride Requests entry from the repo README.md
  • Merged latest master so the diff shows only the Uber removal

Notes

  • TEST_STOCKTAKE.md still references uber in two places, but it's a point-in-time test inventory snapshot, not the live README — left untouched (out of scope of the README purge).

Migrate the Uber Ride Requests integration from autohive-integrations-sdk
1.0.2 to 2.0.0.

Source (uber.py):
- Unwrap FetchResponse.data inside the uber_fetch / uber_fetch_v1 helpers
  so the action layer is unchanged (renamed the helper-local var to avoid
  the fetch-pattern linter false positive on callers named `response`).
- Convert both error paths in the handle_uber_errors decorator to return
  ActionError(message=...); error classification preserved in the message.

config.json:
- Bump version to 2.0.0; drop the error/error_type properties from every
  output schema (no longer returned).
- Make output fields the code can emit as null actually nullable
  (driver/vehicle/eta/surge_multiplier, href, last_used, whole-body
  objects). SDK 2.0 validates output, and a freshly-requested ride
  legitimately returns null driver/vehicle — without this the action would
  raise a runtime VALIDATION_ERROR.

requirements.txt: pin autohive-integrations-sdk~=2.0.0.

Tests:
- Replace the old test_uber.py/context.py shim with test_uber_unit.py
  (78 tests, all 15 actions, via execute_action + FetchResponse mocks) and
  test_uber_integration.py (live live_context fixture, read-only + a
  destructive request/status/map/cancel lifecycle).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@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: 268c3fc59b

ℹ️ 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 uber/tests/test_uber_integration.py Outdated
data = await resp.json(content_type=None)
except Exception:
data = await resp.text()
return FetchResponse(status=resp.status, headers=dict(resp.headers), data=data)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mirror SDK failures in the live fetch mock

When the live Uber API returns any non-2xx response (expired token, missing scope, or a restricted/deprecated endpoint), this mock still returns a FetchResponse; SDK 2's ExecutionContext.fetch raises HTTPError/RateLimitError in that situation. The action helpers can then consume the error body as normal data and return ResultType.ACTION with empty defaults, so _data_or_skip will not skip/fail and the new integration suite can pass while every live call is actually failing. Please raise on failed resp.status here, matching the SDK contract.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 37f2487real_fetch now matches the SDK contract (raises RateLimitError/HTTPError on non-2xx), so failed live calls surface as ACTION_ERROR and _data_or_skip skips instead of passing on empty defaults. Thanks!

Tram-Nguyen87 and others added 2 commits June 18, 2026 15:21
…ion warnings

Addresses Codex P2 and the structure/code-check warnings on PR #376.

- tests: the integration `real_fetch` mock now raises `HTTPError`/`RateLimitError`
  on non-2xx, matching `ExecutionContext.fetch`. Previously it returned a
  FetchResponse for error bodies, so a failed live call (expired token, missing
  scope, deprecated endpoint) would be consumed as normal data and surface as an
  empty-but-successful ACTION result — letting the suite pass while every live
  call was actually failing.
- config: dropped the unused `places` OAuth scope (no places endpoint is called).
- uber.py: access required params via `inputs["x"]` instead of `.get()` (SDK
  validates required inputs before execute, so they are guaranteed present) and
  build the optional-field maps with explicit `inputs.get("literal")` calls.
  Both silence config-code sync's false "never accessed"/"safe for missing"
  warnings; behavior is unchanged. Structure + code checks now report 0 warnings.

Verified: 78/78 unit tests pass; integration suite collects & skips without a
token; validate_integration.py and check_code.py both clean (0 warnings).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two issues caught by a self-review pass on the branch.

1. Output schema — array items could throw VALIDATION_ERROR on a 200.
   The migration made top-level output fields nullable but left the
   array-item sub-fields strict. Uber legitimately returns explicit null
   inside list items (low_estimate/high_estimate/duration for metered/TAXI
   fares; end_time/distance for in-progress rides in history; payment-method
   description; product capacity/image). Since these fields aren't `required`
   a *missing* key was fine, but an explicit null fails Draft7 output
   validation and turns a successful call into ResultType.VALIDATION_ERROR.
   Made the affected item fields accept null across get_products,
   get_price_estimate, get_time_estimate, get_ride_history, and
   get_payment_methods. Identifiers (product_id, request_id,
   payment_method_id) stay strict.

2. Integration test — destructive lifecycle could orphan a booked ride.
   Now that real_fetch raises on non-2xx (prior commit), a transient error on
   the status/map step surfaces as ACTION_ERROR and _data_or_skip would exit
   before cancel_ride ran, leaving a real ride uncancelled. Moved the cancel
   into a try/finally so cleanup always runs once request_id is known.

Verified: 78/78 unit tests pass; integration suite collects & skips without a
token; validate_integration.py and check_code.py both clean (0 warnings).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Tram-Nguyen87

Copy link
Copy Markdown
Contributor Author

Pushed 37f2487 + 03bd39c:

  • Codex P2: real_fetch now matches the SDK fetch contract (raises on non-2xx).
  • Removed unused places scope; cleared all 36 config-sync warnings (behaviour unchanged).
  • Self-review fixes: made array-item output fields nullable (Uber sends null in lists → would have thrown VALIDATION_ERROR on a 200), and wrapped cancel_ride in try/finally so booked rides always get cancelled.

On 03bd39c: 78/78 unit tests pass, integration collects/skips cleanly, validate + check_code both 0 warnings.

@TheRealAgentK TheRealAgentK left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@sumitramanga FYI: this integration appears to have no registered Uber OAuth provider and has never been launched. Before we merge/launch this, someone should decide whether we’re registering the provider and requesting the required privileged Uber scopes, or keeping this unlaunched/limiting the supported actions.

Comment thread uber/tests/test_uber_integration.py Outdated

pytestmark = pytest.mark.integration

ACCESS_TOKEN = os.environ.get("UBER_ACCESS_TOKEN", "")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add UBER_ACCESS_TOKEN and UBER_API_BASE_URL to the root .env.example.

Comment thread uber/tests/test_uber_integration.py Outdated
also set UBER_API_BASE_URL=https://sandbox-api.uber.com.

Run all read-only tests:
pytest uber/tests/test_uber_integration.py -m integration

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This command also runs the destructive ride-booking test. Please make the read-only command -m "integration and not destructive".

Comment thread uber/config.json Outdated
"profile",
"history",
"places",
"partner-loyalty.link-account"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These scopes don’t cover ride requests or receipts. Please add Uber’s required request / request_receipt scopes, or remove/disable the unsupported actions.

Comment thread uber/tests/test_uber_unit.py Outdated
@pytest.mark.asyncio
async def test_success(self):
ctx = make_ctx({"total_charged": 15.50, "currency_code": "USD"})
result = await uber_integration.execute_action("get_ride_receipt", {"request_id": "req_123"}, ctx)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add a URL assertion here too: the Riders API receipt endpoint is /requests/{request_id}/receipts (plural), but the action currently calls singular /receipt.

Tram-Nguyen87 and others added 2 commits June 19, 2026 10:18
The Uber integration has no registered OAuth provider and has never been
launched. Per review, drop it instead of upgrading: remove the uber/
directory and its entry from the repo README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Tram-Nguyen87 Tram-Nguyen87 changed the title feat(uber): upgrade to SDK 2.0.0 with unit + integration tests remove(uber): delete unlaunched Uber Ride Requests integration Jun 18, 2026
@TheRealAgentK TheRealAgentK changed the title remove(uber): delete unlaunched Uber Ride Requests integration chore(uber): delete unlaunched Uber Ride Requests integration Jun 19, 2026
@TheRealAgentK TheRealAgentK merged commit 1369af0 into master Jun 19, 2026
4 of 5 checks passed
@TheRealAgentK TheRealAgentK deleted the feat/uber-sdk-v2-upgrade branch June 19, 2026 06:16
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