Skip to content

fix: stop GDAL following references to other files or URLs during conversion - #632

Merged
tombrooks248 merged 1 commit into
mainfrom
fix/convert-gdal-safety
Nov 11, 2026
Merged

tombrooks248 merged 1 commit into
mainfrom
fix/convert-gdal-safety

Conversation

@tombrooks248

@tombrooks248 tombrooks248 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

  • convert_features_to_csv now runs ogr2ogr with an environment from a new gdal_env function, which:
    • skips the GDAL drivers that open other files or URLs named inside the input, or fetch data over the network (OGR_VRT, WFS, OAPIF, OGCAPI, HTTP, GPSBabel, GMLAS), using GDAL_SKIP;
    • points GDAL_HTTP_PROXY and GDAL_HTTPS_PROXY at a closed local port, so any request GDAL tries to make while converting fails, and removes NO_PROXY so it can't be bypassed;
    • keeps the existing OGR_GEOJSON_MAX_OBJ_SIZE setting.
  • Converting a resource never needs the network, so these settings apply to every conversion. The paged WFS plugin runs ogr2ogr separately and is unchanged.

Related Tickets & Documents

QA Instructions, Screenshots, Recordings

  • Real data: 57 resources downloaded from active config endpoints (23 JSON, 9 XML/GML, 15 zipped GML, 6 zipped shapefiles, 4 GeoPackage/SQLite) were converted with the old and new settings on GDAL 3.6.2 (Debian bookworm, collection-task) and GDAL 3.10.3 (Debian trixie, async-request-backend). The output was byte-identical in every case on both versions.
  • Both versions: the new settings were checked on GDAL 3.6.2 and 3.10.3. GDAL_SKIP and the proxy settings work on both. ogr2ogr -if was not used because it isn't available in 3.6.2.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above. Please refer to the Digital Land Testing Guidance for more information.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

[optional] Are there any dependencies on other PRs or Work?

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@tombrooks248 tombrooks248 changed the title fix: convert gdal safety fix: stop GDAL following references to other files or URLs during conversion Nov 11, 2026
@tombrooks248
tombrooks248 marked this pull request as ready for review November 11, 2026 12:09
@tombrooks248
tombrooks248 merged commit e4a2148 into main Nov 11, 2026
9 of 54 checks passed
@tombrooks248
tombrooks248 deleted the fix/convert-gdal-safety branch November 11, 2026 19:11
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