drought fix - live tests fix#240
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve reliability of the drought (SPEI) download path and stabilize NASA Earthdata live tests by standardizing token environment variable usage and adjusting CI configuration.
Changes:
- Update
download_drought(source="spei")to try multiple known SPEI source URLs via actual download attempts, stopping only if all candidates fail. - Standardize MODIS live tests to use
NASA_EARTHDATA_TOKEN(and adjust one MOD06_L2 live test to query a month range). - Update GitHub Actions workflows to provide either
EARTHDATA_TOKENorNASA_EARTHDATA_TOKENvia fallback, and run live tests nightly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/testthat/test-modis-live.R |
Uses NASA_EARTHDATA_TOKEN consistently; adjusts MOD06_L2 live-test date range. |
R/download.R |
Changes SPEI URL selection to attempt downloads across candidate endpoints before failing. |
DESCRIPTION |
Bumps package version to 2.0.0.0001. |
.github/workflows/test-live.yaml |
Runs nightly; sets both token env vars via secret fallbacks. |
.github/workflows/test-coverage-local.yaml |
Sets both token env vars via secret fallbacks. |
.github/workflows/check-standard.yaml |
Sets both token env vars via secret fallbacks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+5336
to
+5344
| for (candidate_url in spei_url_candidates) { | ||
| if (amadeus::check_url_status(candidate_url)) { | ||
| url <- candidate_url | ||
| download_result <- amadeus::download_run_method( | ||
| urls = candidate_url, | ||
| destfiles = destfile, | ||
| token = NULL, | ||
| show_progress = show_progress, | ||
| max_tries = max_tries, | ||
| rate_limit = rate_limit | ||
| ) |
| Package: amadeus | ||
| Title: Accessing and Analyzing Large-Scale Environmental Data | ||
| Version: 2.0.0 | ||
| Version: 2.0.0.0001 |
Comment on lines
63
to
65
| version = "8.1_voc", | ||
| voc = "01", | ||
| voc = "1", | ||
| format = "nc", |
Comment on lines
1
to
4
| Package: amadeus | ||
| Title: Accessing and Analyzing Large-Scale Environmental Data | ||
| Version: 2.0.0 | ||
| Version: 2.0.0.0001 | ||
| Authors@R: c( |
Comment on lines
8
to
11
| on: | ||
| schedule: | ||
| - cron: '0 6 * * 1' | ||
| - cron: '0 6 * * *' | ||
| workflow_dispatch: |
Comment on lines
98
to
102
| amadeus::download_modis( | ||
| product = "MOD06_L2", | ||
| nasa_earth_data_token = Sys.getenv("EARTHDATA_TOKEN"), | ||
| date = c("2022-01-01", "2022-01-01"), | ||
| nasa_earth_data_token = Sys.getenv("NASA_EARTHDATA_TOKEN"), | ||
| date = c("2022-01-01", "2022-01-31"), | ||
| extent = c(-79, 35, -78, 36), |
Comment on lines
+62
to
65
| amadeus::download_edgar( | ||
| version = "8.1_voc", | ||
| voc = "01", | ||
| voc = "1", | ||
| format = "nc", |
Comment on lines
1
to
+3
| Package: amadeus | ||
| Title: Accessing and Analyzing Large-Scale Environmental Data | ||
| Version: 2.0.0 | ||
| Version: 2.0.1 |
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.
No description provided.