Consolidate bug fixes, resource-safety cleanups, and tests from AI/Copilot autofix branches (Jun-Jul 2026) - #689
Open
echoix wants to merge 15 commits into
Open
Consolidate bug fixes, resource-safety cleanups, and tests from AI/Copilot autofix branches (Jun-Jul 2026)#689echoix wants to merge 15 commits into
echoix wants to merge 15 commits into
Conversation
4 tasks
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> (cherry picked from commit f98c0a5)
Add a pytest test covering the tileIndex bounds check in Rast3d_write_tile: an index equal to nTiles must be rejected as out of range, and the last valid index must be accepted. The invalid call runs in a subprocess using the grass.lib.raster3d ctypes bindings because the rejection is a fatal error which exits the calling process. The out-of-range test fails without the bounds check change in this branch and passes with it. The test was written by Claude Code using the Claude Fable 5 model. (cherry picked from commit 4693358)
…ofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> (cherry picked from commit 8ec6ef9)
4 tasks
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.
Description
Consolidates multiple small behavior-relevant fixes, resource-safety cleanups, and test additions from
ai-findings-autofix/*,alert-autofix-*, andfinding-autofix-*branches (Copilot Autofix / CodeQL / bot suggestions, Jun-Jul 2026,echoix/echoix-orgforks). Each cherry-picked with-xfor traceability.Bug fixes (4)
python/grass/temporal/metadata.py:STR3DSMetadata._print_info_bodyprinted top/bottom resolution usingget_ewres_min/max()instead ofget_tbres_min/max()— wrong values int.info/t.rast3d.infooutput.scripts/r.in.wms/wms_cap_parsers.py: inverted boolean condition (!=→==) when deciding whether to copy elements from the parent WMS layer.raster/r.what.color/main.c: removed an uncontrolled-format-stringfprintf(stdout, fmt, ...)path in favor of the existing safe%spath (CodeQL alert CI(OSGeo4W): Windows 2022 ci 3 #467). A similar pattern still exists elsewhere in the file, untouched — possible follow-up.gui/wxpython/lmgr/layertree.py: removed an unreachable/no-op branch in a sibling-walk loop.Resource-safety cleanups (4) — manual open/close → context manager
scripts/i.oif/i.oif.py,scripts/v.import/v.import.py,scripts/r.in.wms/wms_gdal_drv.py:open()/close()→with open(...) as f:scripts/m.proj/m.proj.py: manual open/write/close →Path(tmpfile).write_text(...)(import already present)Other (3)
docker/debian/Dockerfile:grasssymlink was hardcoded tograss86; now detects the installedgrass*dir dynamically (no edit needed on version bumps).scripts/d.correlate/tests/d_correlate_test.py: adds a test for the primary two-map case.temporal/t.vect.import/tests/t_vect_import_test.py: addsstart_time/end_timeassertions.Branches checked but left out, and why
finding-autofix-960(python/grass/temporal/univar_statistics.py, "file is not always closed"): not included on purpose. It only wraps the header-writing section in awith open(...) as out_file:block, but the same function writes toout_fileagain afterward for the CSV/JSON body and callsout_file.close()at the end — both would raiseValueError: I/O operation on closed fileonce thewithblock exits. Needs a proper rewrite, not a cherry-pick; left for a follow-up.alert-autofix-153/200/239(sscanf checks, URL/email sanitization) andfinding-autofix-382(unused exception object): already fixed independently onmainsince these branches were created.How has this been tested?
Each commit is a small, isolated diff taken as-is from the original suggestion; no test suite was run in this environment.
metadata.pyandwms_cap_parsers.pyare the two most worth a closer look since they change program behavior.Types of changes
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01FWZbrtWRkJPgkvEbtB1q6p