Citations: parse json from HTTP response object instead of from disk. - #612
Citations: parse json from HTTP response object instead of from disk.#612PietrH wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the MarineInfo citation retrieval flow to parse dataset JSON directly from the httr2 HTTP response objects, and refreshes test snapshots to reflect the updated citation/tag fields.
Changes:
- Parse MarineInfo dataset JSON via
httr2::resp_body_json()instead ofjsonlite::read_json()from disk. - Update citation snapshot output for additional projects (e.g.,
demer,dijle). - Update receivers snapshot output to include
built_in_acoustic_tag_idfor specific receivers.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| R/cite_imis_dataset.R | Switches JSON parsing to use the HTTP response object. |
| tests/testthat/_snaps/get_package/references.csv | Updates expected citation snapshot output. |
| tests/testthat/_snaps/get_package/receivers.csv | Updates expected receivers snapshot output (tag ID field). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 521-encoding-issue #612 +/- ##
=====================================================
Coverage ? 95.07%
=====================================================
Files ? 34
Lines ? 1646
Branches ? 0
=====================================================
Hits ? 1565
Misses ? 81
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The R4.1 failure is due to a snapshot. A different bug than this PR is trying to fix. |
…g packages. CRAN doesn't provide old binaries.
… building packages. CRAN doesn't provide old binaries." This reverts commit c751e95.
peterdesmet
left a comment
There was a problem hiding this comment.
Did not review in detail but looks like your simplifying code, so I'm all for it.
Use NFC normalisation to normalize citations, avoiding encoding issues. Was already reviewed in #612
Reading the json from disk for every marineinfo request breaks the vcr http response caching in the tests for
get_package()since the temp json files don't exist in the testing env.This PR switches back to parsing these json response bodies directly from the response in memory.