Skip to content

v0.6.0#21

Open
makegov-mark[bot] wants to merge 2 commits intomainfrom
v0.6.0
Open

v0.6.0#21
makegov-mark[bot] wants to merge 2 commits intomainfrom
v0.6.0

Conversation

@makegov-mark
Copy link
Copy Markdown

@makegov-mark makegov-mark Bot commented May 6, 2026

Summary

Brings the vehicles client up to date with the upstream tango vehicles surface. Cassettes re-recorded against current production; SDK defaults verified to match production's shape contract.

Added

  • Vehicles top-level fields: program_acronym, idv_count, total_obligated, is_synthetic_solicitation, latest_award_date, description, opportunity_id, and a live organization snapshot dict ({organization_id, office_code, office_name, agency_code, agency_name, department_code, department_name}).
  • metrics(*) shape expansion bundling 12 computed metrics (HHI, competed_rate, avg/max order value, top recipient share, recent 24mo windows, etc.). Backed by a new VehicleMetrics schema.
  • list_vehicle_orders(uuid, ...) for /api/vehicles/{uuid}/orders/.
  • ordering parameter on list_vehicles (whitelist: vehicle_obligations, latest_award_date) and list_vehicle_orders (whitelist: award_date, obligated, total_contract_value).
  • ShapeConfig.VEHICLE_ORDERS_MINIMAL. Vehicle and VehicleMetrics exported from the top-level tango package.

Changed

  • ShapeConfig.VEHICLES_MINIMAL and VEHICLES_COMPREHENSIVE updated to include the new top-level fields and the live organization leaf. VEHICLES_COMPREHENSIVE defaults to metrics(*) and no longer includes the deprecated competition_details(*) blob.

Deprecated

  • Vehicles shape fields agency_details, competition_details, and the opportunity expansion — the API now sends Deprecation: true for these. Explicit use in shape=... emits a Python DeprecationWarning. Sunset timeline TBD upstream.

Why

The upstream tango vehicles endpoint surface added 12 new computed metrics, exposed program_acronym / idv_count / total_obligated / is_synthetic_solicitation as first-class fields, and consolidated the awarding-org snapshot under a single organization payload. The SDK was at the prior surface and would have left callers walking dicts manually for any of the new fields.

Production-vs-source-tree gaps that informed this PR

While probing the live API, three gaps between the local ../tango/ HEAD code and what production currently serves shaped the implementation:

  1. organization is a leaf, not a sub-selectable expansion — production rejects shape=...,organization(office_code,...) as Invalid shape. Bare shape=...,organization returns the full dict. SDK treats it as a leaf dict (no nested_model).
  2. organization payload includes organization_id alongside the office-hierarchy fields — 7 keys total.
  3. /api/vehicles/{uuid}/orders/ rejects uuid in shape — accepts key, piid, award_date, obligated, total_contract_value, description, recipient(...) etc. SDK default shape (VEHICLE_ORDERS_MINIMAL) omits uuid.

If/when production catches up to the source-tree expansion syntax, the SDK's leaf handling will keep working with no client-side change required.

Test plan

  • uv run ruff format . — 4 files reformatted (consumed in this PR)
  • uv run ruff check tango/ tests/integration/test_vehicles_idvs_integration.py tests/production/test_production_smoke.py — clean
  • uv run mypy tango/ — adds 0 new errors (24 pre-existing in tango/shapes/{schema,parser,generator,factory}.py, verified via stash diff)
  • uv run pytest -m "not integration and not production" — 215 passed
  • uv run pytest tests/integration/test_vehicles_idvs_integration.py::TestVehiclesIntegration — 7/7 pass on cassettes
  • Cassettes re-recorded against production (TANGO_REFRESH_CASSETTES=true) and replay cleanly without a live key
  • Smoke check: client.list_vehicles(ordering="-vehicle_obligations"), client.get_vehicle(uuid, shape="uuid,metrics(*)"), client.list_vehicle_orders(uuid, ordering="-obligated"), deprecation warning on agency_details

Companion docs

Companion PR against makegov/docs: makegov/docs#3 — refreshes the public data-dictionary page for the new field set, metrics(*) expansion, /orders sub-endpoint, and the organization leaf-vs-expansion behavior.

Risks / next steps

  • Cassettes: recorded against production as it stood today. If you continue to land vehicles changes upstream, CI will need a cassette refresh for any field/payload that drifts.
  • Deprecation timeline: the SDK warns but doesn't break on agency_details / competition_details / opportunity. When tango publishes a Sunset: header, a follow-up SDK release should remove the schema entries.
  • Array fields: descriptions (and using_agencies inside metrics) may come back as null until upstream sync handles array literals; the SDK exposes the schema fields either way.

${MAKEGOV_BOT_SIGNATURE}

vdavez and others added 2 commits May 5, 2026 19:04
Bring the vehicles client up to date with the upstream tango "lakehouse
cutover" (May 2026). Adds new top-level fields, a `metrics(*)` shape
expansion, the `/api/vehicles/{uuid}/orders/` endpoint, an `ordering`
query param, and DeprecationWarning emission for fields the API now
sends a `Deprecation: true` header for.

Cassettes re-recorded against current production. Defaults verified to
match production's shape contract (organization is a leaf dict, /orders/
rejects `uuid`, organization payload includes `organization_id`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace references to the upstream "lakehouse" with neutral language
("computed metrics", "upstream sync") in CHANGELOG, API_REFERENCE,
SHAPES, source comments, and test docstrings. Internal storage details
(e.g. "denormalized lakehouse table") replaced with capability framing
("optimized for fast pagination").

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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