Repository navigation
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SOVFixerAPIClient.fetch_sov_output(sov_id, filename)builds/api/v1/sov/{sov_id}/output/{filename}and downloads it. Its docstring says to passresult.outputs[].filename.When certified updates are applied to a resubmitted SOV (ENG-11315), the job's outputs come from the
-r001revision:urlis/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_outputreadsGET /api/v1/sov/{sov_id}, finds the output whosefilenamematches (or whoseurlends with the given name), and downloads thaturl. A relative URL gets the API base prepended.fix_sov_downloadfor callers that already have the output.examples/ping-extraction/parse_sov.pyshowed/api/v1/sov/{id}/output/{filename}as the address to request. The code already requestsoutput["url"], and the comment now says to do that. pingintel/docs#48 serves this script as the parse-SOV guide's download.just publish 1.4.14).Tests
tests/test_fetch_sov_output.pyadds 6 unit tests with a mockedget: matching byfilename, by the timestamped last segment, relative URLs, the two fallbacks, andoutput_path. All 6 pass, and all 6 fail againstmain.Includes the change from #61, now closed. Related: pingintel/docs#48 (guide), pingintel/boxandwhisker-sov-scrubber#13259 (API reference).