Skip to content

refactor(http-mock): Remove request tracing#44482

Open
zharinov wants to merge 2 commits into
renovatebot:mainfrom
zharinov:agent/remove-http-mock-trace
Open

refactor(http-mock): Remove request tracing#44482
zharinov wants to merge 2 commits into
renovatebot:mainfrom
zharinov:agent/remove-http-mock-trace

Conversation

@zharinov

@zharinov zharinov commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Changes

This is a prerequisite for running Renovate's tests under Bun.

httpMock.getTrace() exposes a Nock-specific request-observation layer. Tests using it depend on synthesized headers, buffered request bodies, GraphQL parsing, request ordering, and recording timing. A Bun-compatible HTTP mock would otherwise need to reproduce those incidental behaviors.

This PR removes that API and moves assertions to the request boundary:

  • Headers are checked with reqheaders and badheaders.
  • GraphQL requests are matched by exact query and variables.
  • Missing and unused mocks continue to fail during global test cleanup.
  • Completed requests retain only method, URL, and status for failure diagnostics.

The unused GraphQL snapshot helper is removed. Contract tests cover strict cleanup and ensure diagnostics do not expose request headers or bodies.

This does not change production behavior. Transport headers and ordering between unrelated successful requests are intentionally not treated as test contracts.

Context

  • This closes an existing Issue, Closes: #
  • This doesn't close an Issue, but I accept the risk that this PR may be closed if maintainers disagree with its opening or implementation

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

GPT-5.6 Sol implemented the refactor and updated the tests.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests, but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository: N/A

@zharinov zharinov marked this pull request as ready for review July 10, 2026 17:04
@github-actions github-actions Bot requested a review from viceice July 10, 2026 17:04
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