You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The geefetch package has been pushed to AAGI-AUS as a private repo. This is the Python-free R interface for extracting spatio-temporal environmental covariates from Google Earth Engine, following the nert architecture.
Requesting your review of the initial codebase. Key areas:
Overall package structure and API design (dispatcher pattern mirroring nert)
Authentication flow (gargle-based, REST-first with optional rgee backend)
Handler registry and convenience aliases (read_modis_ndvi(), read_era5(), etc.)
Documentation and vignettes
The package is at early development stage. Looking forward to your feedback.
We should not be hitting the server for tests. As I understand it, this test hits the API for the data. We should be using mocking, either {httptest2} or {vcr} should be used to create fixtures to use in testing.
Depending on the size of the json files, {yyjsonr} is much faster at ingesting and creating json files than {jsonlite} is and pretty much just drops in if you replace the fn names.
Thanks for the detailed review @adamhsparks — three substantive
comments, addressed below. Status summary first, then per-comment
detail.
#
Your comment (paraphrased)
Status
1
Tests shouldn't hit the live server — use httptest2 or vcr.
✅ Addressed
2
yyjsonr is faster than jsonlite; drops in by fn-name.
⚠️ Deferred to performance PR
3
options() switch to turn caching on/off for targets / memoise users.
✅ Addressed
1. HTTP mocking (addressed)
New test file tests/testthat/test-rest-httptest2.R — six tests
covering 200 / 403 / 429 REST paths, GeoJSON round-trip through .rest_compute_features(), unauthenticated state, and a httptest2::without_internet() boundary assertion. httptest2 is now
both declared and used. Test suite goes from 0 → 6 httptest2-backed
tests, 0 → 4 cli snapshot tests.
Also added tests/testthat/setup.R (scrubs GOOGLE_APPLICATION_CREDENTIALS, GEE_SERVICE_ACCOUNT_KEY, GARGLE_OAUTH_CACHE, isolates disk cache to
a tempdir, pins LC_COLLATE=C / TZ=UTC) so no future test can leak
auth state onto the host machine or into CI logs.
One thing beyond your comment: a Layer-1 live-GEE integration suite — tests/testthat/test-live-gee.R (7 opt-in end-to-end tests, one per
handler tier) + .github/workflows/live-gee-integration.yaml (weekly
cron, fork-guarded, concurrency-grouped, key redacted on teardown).
Skipped by default on CRAN / covr / absence of GEEFETCH_LIVE_TESTS=1, so CI stays green until a service-account
secret is provisioned.
2. yyjsonr (deferred, not dropped)
Agreed — the JSON serialisation in R/backend_rest.R is hot-path
enough to matter at scale, and the fn-name drop-in you describe
makes it a low-risk swap. Deferred to a dedicated performance PR
rather than bundled with this audit; flagged in audit_2026-04-19.md
under "Archetype-6a specific validation" so it can't get lost. Happy
to pick up as the next piece of work after the current two PRs land.
3. options(geefetch.cache) switch (addressed)
Every reader's cache argument now defaults to getOption("geefetch.cache", TRUE) — covers read_gee(), read_modis_ndvi(), read_modis_lst(), read_era5(), read_chirps(), read_srtm(), read_slga(), read_sentinel2(), read_landsat(), read_worldclim(), and collect_gee_data(). Belt-and-braces: .cache_get() and .cache_set() also early-return on the option, so
any internal caller that bypasses the per-call argument still honours
the opt-out.
A targets / memoise user now just needs:
options(geefetch.cache=FALSE) # once, in _targets.R or .Rprofilelist(
tar_target(ndvi, geefetch::read_modis_ndvi(
date="2024-06-15",
region=terra::ext(138, 140, -36, -34)
)) # targets caches the result instead
)
Documented in ?geefetch under "Package options" (with the targets example), ?read_gee under "Caching", and NEWS.md.
Two new tests in test-cache.R prove options(geefetch.cache = FALSE)
produces zero cache files and NULL reads even when a file already
exists on disk; the default TRUE path still round-trips.
Where to find the work
PR review(ahs): match.arg → rlang::arg_match, cli styling, air formatter #2 (this queue): your review/ahs branch → main. Eight
commits preserved verbatim under your authorship; please merge with
"Create a merge commit" or "Rebase and merge" (not squash — squash
would erase your authorship).
Full point-by-point change catalogue lives in two files on the audit
branch: audit_2026-04-19.md (pre-fix Pass / Gap / N/A rubric scoring)
and CHANGES_AUDIT_2026-04-19.md (every fix grouped A-K with
before / after, file inventory, deferred items, and the 10-commit
grouping).
Happy to keep this issue open until the yyjsonr PR also lands if
you'd prefer — or close after the two current PRs merge. Your call.
Activity
adamhsparks commentedon Apr 17, 2026
I started working/reviewing on a new branch, https://github.com/AAGI-AUS/geefetch/tree/review/ahs.
My first comment is that the R package checks won't pass, tests fail.
We should not be hitting the server for tests. As I understand it, this test hits the API for the data. We should be using mocking, either {httptest2} or {vcr} should be used to create fixtures to use in testing.
This is a great resource, https://books.ropensci.org/http-testing/.
adamhsparks commentedon Apr 17, 2026
Depending on the size of the json files, {yyjsonr} is much faster at ingesting and creating json files than {jsonlite} is and pretty much just drops in if you replace the fn names.
adamhsparks commentedon Apr 17, 2026
There should be an option for users to turn on and off caching via
options(). Many would prefer to use {targets} or {memoise} in their workflow.max578 commentedon Apr 19, 2026
Thanks for the detailed review @adamhsparks — three substantive
comments, addressed below. Status summary first, then per-comment
detail.
httptest2orvcr.yyjsonris faster thanjsonlite; drops in by fn-name.options()switch to turn caching on/off fortargets/memoiseusers.1. HTTP mocking (addressed)
New test file
tests/testthat/test-rest-httptest2.R— six testscovering 200 / 403 / 429 REST paths, GeoJSON round-trip through
.rest_compute_features(), unauthenticated state, and ahttptest2::without_internet()boundary assertion.httptest2is nowboth declared and used. Test suite goes from 0 → 6 httptest2-backed
tests, 0 → 4 cli snapshot tests.
Also added
tests/testthat/setup.R(scrubsGOOGLE_APPLICATION_CREDENTIALS,GEE_SERVICE_ACCOUNT_KEY,GARGLE_OAUTH_CACHE, isolates disk cache toa tempdir, pins
LC_COLLATE=C/TZ=UTC) so no future test can leakauth state onto the host machine or into CI logs.
One thing beyond your comment: a Layer-1 live-GEE integration suite —
tests/testthat/test-live-gee.R(7 opt-in end-to-end tests, one perhandler tier) +
.github/workflows/live-gee-integration.yaml(weeklycron, fork-guarded, concurrency-grouped, key redacted on teardown).
Skipped by default on CRAN /
covr/ absence ofGEEFETCH_LIVE_TESTS=1, so CI stays green until a service-accountsecret is provisioned.
2.
yyjsonr(deferred, not dropped)Agreed — the JSON serialisation in
R/backend_rest.Ris hot-pathenough to matter at scale, and the fn-name drop-in you describe
makes it a low-risk swap. Deferred to a dedicated performance PR
rather than bundled with this audit; flagged in
audit_2026-04-19.mdunder "Archetype-6a specific validation" so it can't get lost. Happy
to pick up as the next piece of work after the current two PRs land.
3.
options(geefetch.cache)switch (addressed)Every reader's
cacheargument now defaults togetOption("geefetch.cache", TRUE)— coversread_gee(),read_modis_ndvi(),read_modis_lst(),read_era5(),read_chirps(),read_srtm(),read_slga(),read_sentinel2(),read_landsat(),read_worldclim(), andcollect_gee_data(). Belt-and-braces:.cache_get()and.cache_set()also early-return on the option, soany internal caller that bypasses the per-call argument still honours
the opt-out.
A
targets/memoiseuser now just needs:Documented in
?geefetchunder "Package options" (with thetargetsexample),?read_geeunder "Caching", andNEWS.md.Two new tests in
test-cache.Rproveoptions(geefetch.cache = FALSE)produces zero cache files and
NULLreads even when a file alreadyexists on disk; the default
TRUEpath still round-trips.Where to find the work
review/ahsbranch →main. Eightcommits preserved verbatim under your authorship; please merge with
"Create a merge commit" or "Rebase and merge" (not squash — squash
would erase your authorship).
audit/2026-04-19branch carrying this audit work. Ten commits on top of yours.
Rebased onto the post-review(ahs): match.arg → rlang::arg_match, cli styling, air formatter #2
mainbefore opening so the diff is clean.Full point-by-point change catalogue lives in two files on the audit
branch:
audit_2026-04-19.md(pre-fix Pass / Gap / N/A rubric scoring)and
CHANGES_AUDIT_2026-04-19.md(every fix grouped A-K withbefore / after, file inventory, deferred items, and the 10-commit
grouping).
Happy to keep this issue open until the
yyjsonrPR also lands ifyou'd prefer — or close after the two current PRs merge. Your call.
adamhsparks commentedon Jul 7, 2026
I've fixed the failing test.
adamhsparks commentedon Jul 7, 2026
My next comment is that the vignettes should be precompiled so that the examples are known to work.
See: https://github.com/ropensci/nasapower/blob/main/vignettes/!precompile.R and https://github.com/ropensci/nasapower/blob/main/vignettes/nasapower.Rmd.orig for examples