Skip to content

Pass configured headers to tool, service and variable queries - #124

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:developfrom
sylvesterkaczmarek:fix/record-query-headers-20260926
Open

sylvesterkaczmarek wants to merge 1 commit into
nasa:developfrom
sylvesterkaczmarek:fix/record-query-headers-20260926

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Fixes #122.

Changes

Pass headers=self.headers in ToolServiceVariableBaseQuery.get, covering ToolQuery, ServiceQuery and VariableQuery. The configured token, bearer token and custom headers now reach every paginated request, matching the other Query request methods.

The production change only forwards the existing header mapping. Current pagination, JSON/XML response handling, empty results and HTTP exceptions are unchanged. This does not add a client-ID convenience API or alter the separate results iterator.

Validation

Add 18 offline cases across the three query classes. They inspect actual prepared Requests objects at the mocked send boundary, including first and subsequent pages, both token methods, custom headers, XML output, no-header defaults, empty results and HTTP errors. Tests prevent loading credentials from the runner's netrc file.

All 147 repository tests pass locally on macOS arm64 with Python 3.12.11 using the repository-locked HTTP/VCR versions. Mypy passes for all 11 source/test modules, the repository's gating flake8 rules pass, and the new test file passes full flake8. git diff --check passes.

Exact-commit hosted validation passes on Ubuntu 24.04 with Python 3.8, 3.10 and 3.12, using Poetry 1.8.2 and the unmodified poetry.lock, against 67bbf5603951f198663fcce505a69fdca61accd8. Each job passes the full 147-test suite and type/lint checks, restores the original queries.py to reproduce 12 failures alongside six passing controls, then restores the submitted source byte-for-byte and passes all 147 tests again. Logs are retained as artifacts.

The existing VCR recordings are replayed with live socket access disabled. Initial testing with newer, unlocked urllib3/VCR combinations reproduced 13 existing fixture incompatibilities; the repository-locked environment passes the unchanged upstream suite and the updated suite. No dependency or fixture changes are included.

Scope

No live CMR queries, real authentication tokens, Earthdata downloads or deployment changes. The validation workflow is on a separate fork branch and is not included in this PR. Only cmr/queries.py and the new regression test file are changed.

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.

Tool, service and variable get requests omit configured headers

1 participant