Skip to content

Conversation

tfmorris
Copy link
Member

@tfmorris tfmorris commented Oct 1, 2025

Fixes #192

  • DRY up HTTP handling so that there's only a single place HTTP client headers need to be worried about
  • Add error checking so that it doesn't attempt to parse non-JSON responses
  • Update WDTK dependency to the version that includes the User Agent fix - this was moved to a separate PR to reenable the CI pipeline and was already merged
  • Update to Java 11 to match OpenRefine (and because the code uses Java 11 features like isBlank())

Some non-essential changes which are included, but could be removed (the current code was making my head hurt):

  • rename confusingly overloaded method name which has different functionality
  • refactor URL building to not depend on state stored in fields

@tfmorris tfmorris requested review from Abbe98 and Copilot October 1, 2025 22:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors HTTP handling in the Commons importer to centralize client header management, adds proper error handling for non-JSON responses, and updates dependencies to align with OpenRefine standards.

  • Centralizes HTTP handling logic to eliminate code duplication and improve maintainability
  • Adds error checking and response validation for API calls
  • Updates Java version to 11 and WDTK dependency to stable release

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/main/java/org/openrefine/extensions/commons/importer/FileFetcher.java Refactors HTTP client usage, adds error handling, and extracts URL building logic
pom.xml Updates Java version to 11, OpenRefine version to 3.9.5, and WDTK dependency to stable release

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Abbe98
Copy link
Member

Abbe98 commented Oct 2, 2025

Thank you so much Tom! I will get to this soon and make sure to make another prerelease.

I want to update the release documentation before making a proper release, my hope is to get to that next week giving this a few days in the wild.

@Abbe98 Abbe98 merged commit 31d6a0e into OpenRefine:master Oct 7, 2025
1 check passed
@Abbe98
Copy link
Member

Abbe98 commented Oct 7, 2025

Thank you @tfmorris!

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.

Issues with loading the images from Category
2 participants