Skip to content

Fix DPLA API base_uri missing https:// scheme#311

Open
DominicBM wants to merge 1 commit into
mainfrom
fix/dpla-api-https-scheme
Open

Fix DPLA API base_uri missing https:// scheme#311
DominicBM wants to merge 1 commit into
mainfrom
fix/dpla-api-https-scheme

Conversation

@DominicBM
Copy link
Copy Markdown
Contributor

@DominicBM DominicBM commented May 12, 2026

Summary

  • config/settings.yml.template had base_uri: api.dp.la/v2/ with no URL scheme, causing HTTParty to default to http:// and connect to api.dp.la:80
  • api.dp.la only serves HTTPS; port 80 is silently dropped, resulting in Net::OpenTimeout errors
  • Fixed by adding the https:// scheme; also corrected a stale "backslash" → "slash" comment in the same file

The error surfaced in DplaApiResponseBuilder#data_providers_for_items, which looks up dataProvider names for items shown in the hub-level website events table. The exception is caught and Sentry-reported, so users saw a degraded events table (missing contributor names) rather than a 500. Only 5 Sentry events total — this code path requires a hub-level (not contributor-scoped) events view with non-empty GA results.

Note for the next deploy: since settings.yml is baked into the Docker image at build time (it's gitignored but not dockerignored), the local config/settings.yml will also need to be updated before the next ECR build.

Test plan

  • Update local config/settings.yml to use https://api.dp.la/v2/ before rebuilding the Docker image
  • Verify the Michigan Hub click-through events table loads contributor names correctly after deploy

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated DPLA API configuration to use HTTPS endpoint.
    • Clarified configuration documentation for API endpoint formatting requirements.

Review Change Stack

Without the scheme HTTParty defaults to http://, causing Net::OpenTimeout
when connecting to api.dp.la:80 instead of HTTPS on 443.

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

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 41da70f9-b949-4e3d-900a-bb598790dfd4

📥 Commits

Reviewing files that changed from the base of the PR and between a5be117 and d7b1124.

📒 Files selected for processing (1)
  • config/settings.yml.template

📝 Walkthrough

Walkthrough

Configuration template updated to switch DPLA API endpoint from HTTP to HTTPS (https://api.dp.la/v2/). Comments clarified to document trailing slash behavior. API key ERB binding unchanged.

Changes

DPLA Configuration Update

Layer / File(s) Summary
DPLA API HTTPS endpoint and documentation
config/settings.yml.template
The dpla_api section's base_uri is updated from HTTP to https://api.dp.la/v2/, and comments in both dpla_api and dpla sections are corrected to reference trailing slash behavior. The key ERB binding remains intact.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • KevinPayravi

Poem

🐰 A secure shift to HTTPS we see,
The DPLA endpoint now encrypted and free,
With trailing slashes spelled out just right,
The config is fixed and the docs are bright! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: fixing the DPLA API base_uri by adding the missing https:// scheme.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dpla-api-https-scheme

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

2 participants