'NHDPlus_HR.MapServer' not found
Describe the bug
TADA_GetATTAINS runs fetchNHD within it. See line 511 in GeospatialFunctions.R
nhd_plus_hr_url <- "https://hydro.nationalmap.gov/arcgis/rest/services/NHDPlus_HR/MapServer"
This causes a breaking check error if the service is not available.
See check errors:
- https://github.com/USEPA/EPATADA/actions/runs/11842695612/job/33001900764
- https://github.com/USEPA/EPATADA/actions/runs/11842695612/job/33001901162
--- re-building ‘TADAModule2.Rmd’ using rmarkdown
Quitting from lines 299-300 [unnamed-chunk-8] (TADAModule2.Rmd)
Error: processing vignette 'TADAModule2.Rmd' failed with diagnostics:
Status code: 500
Error: Error handling service request :Service configuration
'NHDPlus_HR.MapServer' not found.
--- failed re-building ‘TADAModule2.Rmd’
Expected behavior
Can we develop a solution that makes it possible for TADA_GetATTAINS to run even if this service is temporarily unavailable or if a user is offline? Or maybe if it fails initially it can be setup to retry at least once.
@kathryn-willi do you have any ideas about how to best handle this scenario?
For a short term fix, to address just the issue of the checks failing related to vignettes requiring the NHDPlus_HR.MapServer, switching the vignette to an article (which is still displayed on the pkgdown site, but not included in the package) because this adds it to .Rbuildignore may work.
I set up a few demos as articles over the summer to prevent some intermittent issues with ATTAINS webservices from causing checks to fail when I was working on unrelated updates.
https://r-pkgs.org/vignettes.html#sec-vignettes-article " An article will be less accessible than a vignette, for certain users, such as those with limited internet access, because it is not present in the local installation. But that might be an acceptable compromise, for example, for a package that wraps a web API."
I like that idea. Let's do that for any vignettes (switch them to articles) that require any services (WQP, ATTAINS, NHD, etc.). If the vignette only requires example data and no service calls, then they can stay in the package.
That option makes sense to me, and seems totally justifiable!