Skip to content

data-raw: handle NCI stamp URL 403 gracefully at call site#1

Merged
billdenney merged 1 commit intomainfrom
fix/nci-stamp-403-fallback
Apr 24, 2026
Merged

data-raw: handle NCI stamp URL 403 gracefully at call site#1
billdenney merged 1 commit intomainfrom
fix/nci-stamp-403-fallback

Conversation

@billdenney
Copy link
Copy Markdown
Member

Summary

  • Wraps fetch_current_release_date() in tryCatch() in both fetch_ct_sdtm.R and fetch_ct_adam.R; on any download error (e.g. HTTP 403) the error is logged as a message and the script falls back to archive-only date discovery
  • all_dates now excludes NA to prevent a spurious NA date entering the processing loop
  • Adds an outer guard that skips the update entirely if both the stamp URL and the archive listing are unreachable
  • utils_nci.R is unchanged — fetch_current_release_date() remains a hard error for any caller that doesn't explicitly handle it

Test plan

  • Merge and trigger update-cdisc-data via workflow_dispatch — the "Run data fetch scripts" step should succeed with a message like "Could not fetch SDTM CT release date stamp … Falling back to archive listing only." followed by "SDTM CT is already up to date."
  • If the stamp URL recovers, normal operation is unaffected (tryCatch only fires on error)

The NCI EVS server now returns HTTP 403 for the Publication Date Stamp
text files. Wrap fetch_current_release_date() in tryCatch() in both
fetch_ct_sdtm.R and fetch_ct_adam.R so that a 403 (or any download
error) is logged as a message and the script falls back to archive-only
date discovery rather than aborting CI.

fetch_current_release_date() itself remains a hard failure (no change to
utils_nci.R) — any caller without a tryCatch will still fail loudly.
The all_dates construction now excludes NA to prevent a spurious NA date
entering the processing loop. An additional guard skips the update
entirely if both the stamp and the archive listing are unreachable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@billdenney billdenney merged commit bb398f0 into main Apr 24, 2026
9 checks passed
@billdenney billdenney deleted the fix/nci-stamp-403-fallback branch April 24, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant