Skip to content

fetch_sov_output and the parse_sov example: use the output's url - #62

Open
neospice wants to merge 2 commits into
mainfrom
sy/eng-11315-fetch-sov-output-url
Open

neospice wants to merge 2 commits into
mainfrom
sy/eng-11315-fetch-sov-output-url

Conversation

@neospice

@neospice neospice commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

SOVFixerAPIClient.fetch_sov_output(sov_id, filename) builds /api/v1/sov/{sov_id}/output/{filename} and downloads it. Its docstring says to pass result.outputs[].filename.

When certified updates are applied to a resubmitted SOV (ENG-11315), the job's outputs come from the -r001 revision: url is /api/v1/sov/<id>-r001/output/<timestamp>-<name>. r0 still has its own unenriched output under the plain <name>. The server resolves a plain name on r0 to r0's own file, so this method silently returns the unenriched output. It doesn't 404, so the server-side fallback in pingintel/boxandwhisker-sov-scrubber#13240 never runs.

Change

  • fetch_sov_output reads GET /api/v1/sov/{sov_id}, finds the output whose filename matches (or whose url ends with the given name), and downloads that url. A relative URL gets the API base prepended.
  • If the status has no matching output (a SUD id, a missing result, a non-2xx response), it falls back to the old constructed address, as before.
  • The signature is unchanged. The docstring points to fix_sov_download for callers that already have the output.
  • The step 3 comment in examples/ping-extraction/parse_sov.py showed /api/v1/sov/{id}/output/{filename} as the address to request. The code already requests output["url"], and the comment now says to do that. pingintel/docs#48 serves this script as the parse-SOV guide's download.
  • Version 1.4.14. Publishing is a separate step (just publish 1.4.14).

Tests

tests/test_fetch_sov_output.py adds 6 unit tests with a mocked get: matching by filename, by the timestamped last segment, relative URLs, the two fallbacks, and output_path. All 6 pass, and all 6 fail against main.

Includes the change from #61, now closed. Related: pingintel/docs#48 (guide), pingintel/boxandwhisker-sov-scrubber#13259 (API reference).

fetch_sov_output(sov_id, filename) requested /api/v1/sov/{sov_id}/output/{filename}. When certified
updates are applied to a resubmitted SOV, the job's outputs live on the -r001 revision under a
timestamped name, while r0 keeps its own unenriched output under the plain filename. The constructed
address therefore returned r0's file (ENG-11315).

It now reads GET /api/v1/sov/{sov_id}, picks the output whose filename (or the last segment of its
url) matches, and downloads that url. It falls back to the old address when the status has no
matching output, e.g. for a SUD id. Bump to 1.4.14.
The step 3 comment showed /api/v1/sov/{id}/output/{filename} as the address to request. The url in
result.outputs can name a later revision of the SOV (-r001 when certified updates are applied) and
its last path segment can differ from filename, so a constructed address can 404 or return the wrong
revision. The code already uses output["url"]; the comment now says so.
@neospice neospice changed the title fetch_sov_output: download the output's url from the SOV status fetch_sov_output and the parse_sov example: use the output's url Nov 20, 2026
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

⌂ Proxy