Skip to content

Allow geoprocessing tools to run on an empty map - #3617

Open
robmarkcole wants to merge 1 commit into
opengeos:mainfrom
robmarkcole:fix/3561-empty-map-tools
Open

robmarkcole wants to merge 1 commit into
opengeos:mainfrom
robmarkcole:fix/3561-empty-map-tools

Conversation

@robmarkcole

@robmarkcole robmarkcole commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Allow a geoprocessing tool to create the first layer in an empty map. Previously, gp.run rejected every tool with “Run Tool: the map has no layers” before checking the tool’s inputs. Removing that command-level check lets the existing tool validation handle required inputs and explicitly selected layers, as it already does for background runs in the desktop Tools pane.

Testing

On Apple Silicon macOS 26.6.2, cargo test --locked -p rustgis-engine --lib plugin_tools_run_ passed all 3 tests. The new regression reproduced the empty-map error before the fix. With the fix, an offline test plugin creates the first point layer through both gp.run and the Tools pane’s background path. Both paths report a named missing layer, and Buffer still reports its missing required input. These tests use the repository’s plugin fixture.

Full local cargo xtask ci passed test hygiene, formatting and workspace Clippy, then stopped in rustgis-data. The data library suite had 2,144 passed, 1 failed and 11 ignored. The failing test, source::external::tests::timeout_returns_while_a_grandchild_holds_the_pipes, reported “the pipe-holder must finish after release” at crates/data/src/source/external.rs:556.

UI evidence

No visible UI change.

Related issue

Closes #3561

Codex assisted with the implementation, tests, and PR description.

Summary by CodeRabbit

  • New Features
    • The run command is now available on maps with no layers. Tools with optional inputs can run in this state and create their output layer.
  • Bug Fixes
    • Missing required inputs are reported consistently when running tools in the foreground or background.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

gp.run no longer uses need_layers to gate command availability. A new test checks required and optional tool inputs on an empty map in foreground and background execution.

Changes: Empty-map tool runs

Layer / File(s) Summary
Command availability and empty-map validation
crates/engine/src/cmd/gp.rs, crates/engine/src/tests.rs
gp.run no longer applies need_layers as a command-availability condition. The test checks required-input errors and successful foreground and background runs that create a layer with one feature.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: mavrick-f

Merge Risk: Minimal · up to de54c

Tools that need no layer input can now run on an empty map, and tools that require a layer still report missing inputs. Risk is low; the Isoliner tools were not tested directly, and one unrelated data-crate CI test failed.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Allow geoprocessing tools to run on an empty map" matches the main change. The PR removes the command-level check in gp.run that rejected every call when the map had no layers, so tools can…
Description check Passed The description follows the repository template. It has Summary, Testing, UI evidence, and Related issue sections. The Summary explains the change and its reason. Testing lists the exact commands, the…
Linked Issues check Passed [#3561] requires that tools without required layer input, or without selected layer-dependent input, run on an empty map through both the Tools pane and gp.run, and that missing-input validation still…
Out of Scope Changes check Passed The reviewed changes are a one-line removal of the need_layers gate from gp.run in crates/engine/src/cmd/gp.rs and a new regression test in crates/engine/src/tests.rs (+39 lines, per the summary). B…
Full details: Title check

Explanation

The title "Allow geoprocessing tools to run on an empty map" matches the main change. The PR removes the command-level check in gp.run that rejected every call when the map had no layers, so tools can create the first layer. The title is specific and concise and does not use vague terms.

Full details: Description check

Explanation

The description follows the repository template. It has Summary, Testing, UI evidence, and Related issue sections. The Summary explains the change and its reason. Testing lists the exact commands, the new regression test, and the failing data-library test. UI evidence correctly states that there is no visible UI change. Related issue links #3561. The description is complete and specific.

Full details: Linked Issues check

Explanation

[#3561] requires that tools without required layer input, or without selected layer-dependent input, run on an empty map through both the Tools pane and gp.run, and that missing-input validation still applies to layer-requiring operations. At head, the gp.run command definition in crates/engine/src/cmd/gp.rs no longer has .when(need_layers), so the command-level empty-map refusal is gone. The PR description states that the Tools pane background path already allowed this and that existing tool validation handles required and selected inputs. The added test plugin_tools_run_on_an_empty_map (crates/engine/src/tests.rs, per the summary) checks that a tool with an optional first parameter creates a layer on an empty map through both foreground and background execution, that a required-input tool still reports its error, and that a missing named input is reported without adding layers. The Isoliner acceptance checks (8.03 LandXML examples, 2.02 Download OSM topographic base) are external plugin behavior and are not tested in this repository; the fixture plugin covers the same rule. The data-crate test failure reported in the PR is outside the engine change and does not affect this assessment.

Full details: Out of Scope Changes check

Explanation

The reviewed changes are a one-line removal of the need_layers gate from gp.run in crates/engine/src/cmd/gp.rs and a new regression test in crates/engine/src/tests.rs (+39 lines, per the summary). Both connect directly to #3561. The gp.run parameter schema, roles and effects are unchanged, per the summary. No unrelated changes were identified. The full-PR text diff could not be read because changed blobs were unavailable in the checkout; this verdict relies on the head file read and the supplied summary.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

A rabbit taps the empty map,
Then runs a tool along its path.
Missing inputs still raise a flag,
While optional ones can make a layer.
One feature springs from empty space,
And foreground joins the background race.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a0428c8a-f9b7-4c0f-96b0-afac949f5e50
Commits

Reviewing files that changed from the base of the PR and between d75248d and de54c79.

Files selected for processing: 2

  • crates/engine/src/cmd/gp.rs
  • crates/engine/src/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@Mavrick-F Mavrick-F closed this Dec 3, 2026
@Mavrick-F Mavrick-F reopened this Dec 3, 2026

This branch has not been deployed

No deployments
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.

[Bug]: Allow geoprocessing tools with no layer inputs to run on an empty map

2 participants