Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
pull_request:
types: [labeled, unlabeled]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event.label.name }}
cancel-in-progress: true
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ jobs:
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if ! changed="$(git diff --name-only "$fork_point" HEAD 2>/dev/null)"; then
changed_file="$(mktemp)"
trap 'rm -f "$changed_file"' EXIT
if ! git diff -z --no-renames --name-only "$fork_point" HEAD >"$changed_file" 2>/dev/null; then
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if grep -qE '^(Cargo\.lock|(.*/)?Cargo\.toml|deny\.toml|about\.toml|xtask/src/(main|notices)\.rs|(.*/)?THIRD-PARTY-LICENSES\.txt|\.github/scripts/(check-cargo-sources|review-deferrals|ratchet-limits|test_[^/]+)\.py|\.github/workflows/ci\.yml|crates/map/src/color/(scientific|matplotlib)\.rs|crates/tiles/src/(symbols|style)\.rs|crates/data/src/(raster/crs|esripbf)\.rs)$|^(third-party/|\.cargo/)' <<<"$changed"; then
if grep -zqE '^(Cargo\.lock|(.*/)?Cargo\.toml|deny\.toml|about\.toml|xtask/src/(main|notices)\.rs|(.*/)?THIRD-PARTY-LICENSES\.txt|\.github/scripts/[^/]+\.py|\.github/workflows/ci\.yml|crates/map/src/color/(scientific|matplotlib)\.rs|crates/tiles/src/(symbols|style)\.rs|crates/data/src/(raster/crs|esripbf)\.rs)$|^third-party/' "$changed_file" || grep -ziqE '(^|/)\.cargo(/|$)' "$changed_file"; then
echo "run=true" >> "$GITHUB_OUTPUT"
else
echo "No dependency, licence or notice files changed; skipping."
Expand Down Expand Up @@ -237,11 +239,13 @@ jobs:
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if ! changed="$(git diff --name-only "$fork_point" HEAD 2>/dev/null)"; then
changed_file="$(mktemp)"
trap 'rm -f "$changed_file"' EXIT
if ! git diff -z --no-renames --name-only "$fork_point" HEAD >"$changed_file" 2>/dev/null; then
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
if grep -qE '^(crates/(geom|data|map|analysis|tiles|render|plugins|geolibre|engine)/|schema/|Cargo\.(toml|lock)$|rust-toolchain|xtask/src/main\.rs$|\.github/workflows/ci\.yml$)' <<<"$changed"; then
if grep -zqE '^(crates/(geom|data|map|analysis|tiles|render|plugins|geolibre|engine)/|schema/|Cargo\.(toml|lock)$|rust-toolchain|xtask/src/main\.rs$|\.github/workflows/ci\.yml$)' "$changed_file"; then
echo "run=true" >> "$GITHUB_OUTPUT"
else
echo "No schema-related files changed; skipping."
Expand Down Expand Up @@ -331,8 +335,9 @@ jobs:
MERGE_GROUP_REF: ${{ github.event.merge_group.head_ref }}
run: python3 .github/scripts/ratchet-limits.py

# The packages whose tests this run needs, for `test` (.github/scripts/test-selection.sh). Only
# tests are narrowed: lint, the wasm build, licences and the schema check run whole every time.
# The packages whose tests this run needs, for `test` (.github/scripts/test-selection.sh). Lint
# and the wasm build run whole every time; licences and the schema check skip on pull requests
# and merge groups when none of their watched files changed.
select:
name: Tests to run
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
types: [published]
workflow_dispatch:

permissions:
contents: read

# A new push to a pull request replaces its earlier run. Runs on main, by hand and for releases
# are never cancelled: a merge landing mid-build must not stop the wheels being built.
concurrency:
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,16 +191,17 @@ Layered crates, each depending only on the ones below it:
| L0 | `rustgis-geom` | coordinates, extents, Web Mercator, geodesic distance/area, scale |
| L1 | `rustgis-data` | features and typed attributes; GeoJSON, CSV, Shapefile, KML, GPX and more; GeoPackage, GeoParquet, FlatGeobuf, LiDAR, PostGIS and MySQL providers; GDAL formats and DuckDB queries through their programs; SQL where clauses; rasters (GeoTIFF, ASCII grid, Zarr) and their coordinate systems |
| L2 | `rustgis-map`, `rustgis-analysis` | layers, symbology, labeling, camera, basemaps; geoprocessing (on `geo`) |
| L2 | `rustgis-tiles` | web map tiles: XYZ/TMS/WMS, Mapbox Vector Tiles, PMTiles and MBTiles archives, MapLibre styles, the tile cache |
| L2 | `rustgis-tiles`, `rustgis-keychain` | web map tiles: XYZ/TMS/WMS, Mapbox Vector Tiles, PMTiles and MBTiles archives, MapLibre styles, the tile cache; the system's secret store |
| L3 | `rustgis-render` | tiny-skia renderer, label placement, PNG export, fonts |
| L3 | `rustgis-plugins` | sandboxed WebAssembly plugins and the plugin registry |
| L3 | `rustgis-geolibre` | the GeoLibre tool suite as geoprocessing tools |
| L4 | `rustgis-engine` | session, undo, command registry, sample project |
| L5 | `rustgis-assistant` | the AI Assistant: a chat agent that acts through commands |
| L6 | `rustgis-ui-egui` | the ribbon front end (swappable) |
| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python` | desktop, command line, browser (WebAssembly), the `rustgis` Python package |
| L7 | `rustgis-ui-touch` | the phone interface around `rustgis-ui-egui`'s map view |
| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python`, `rustgis-mobile` | desktop, command line, browser (WebAssembly), the `rustgis` Python package, Android and iOS |

`cargo xtask ci` runs formatting, clippy, the tests and the layering check. Contributor and
`cargo xtask ci` runs formatting, clippy, the tests, layering, test hygiene, attribution, row-use and schema checks. Contributor and
agent notes: [AGENTS.md](AGENTS.md).

## Sponsor
Expand Down
7 changes: 4 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ engine scriptable and the front end swappable.
| L0 | `rustgis-geom` | Coordinates, extents, Web Mercator, geodesic distance/area, scale |
| L1 | `rustgis-data` | Features, typed attributes, vector and spreadsheet I/O, SQL where clauses, LiDAR, rasters and EPSG reprojection; indexed file and remote data providers; live PostGIS, MySQL/MariaDB and SQL Server providers on the desktop; optional GDAL and DuckDB programs (see [Data formats](user-guide/data-formats.md)) |
| L2 | `rustgis-map`, `rustgis-analysis` | Layers, symbology, labeling, camera, basemaps and web tile layers; geoprocessing tools |
| L2 | `rustgis-tiles` | Web map tiles: XYZ/TMS/WMS raster tiles, Mapbox Vector Tiles, PMTiles and MBTiles archives and a subset of MapLibre styles; a cache that fetches in the background (worker threads natively, the browser's `fetch` on the web) |
| L2 | `rustgis-tiles`, `rustgis-keychain` | Web map tiles: XYZ/TMS/WMS raster tiles, Mapbox Vector Tiles, PMTiles and MBTiles archives and a subset of MapLibre styles; a cache that fetches in the background (worker threads natively, the browser's `fetch` on the web); the system's secret store |
| L3 | `rustgis-render` | tiny-skia renderer, label placement, font discovery, map and layout export, and UI-independent GPU scene preparation |
| L3 | `rustgis-geolibre` | The [GeoLibre tools](user-guide/analysis.md#geolibre-tools) as geoprocessing tools: run by the optional `geolibre` program natively, by geolibre-rust's WASI runner in the browser |
| L3 | `rustgis-plugins` | [Plugins](plugins.md): sandboxed WebAssembly modules, desktop process plugins and assistant skills packages; `.rgplugin` packages and the plugin registry |
| L4 | `rustgis-engine` | Session, undo, command registry, projects, sample project |
| L5 | `rustgis-assistant` | The [AI Assistant](user-guide/assistant.md): provider request/response formats, conversation loop, command tools, skills and agent integration; native HTTP transport and local agent/MCP connections, with browser I/O supplied by the web app |
| L6 | `rustgis-ui-egui` | Ribbon, panes, map view, dialogs and the optional wgpu map backend |
| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python` | Desktop app, command line, browser (WebAssembly), and the PyO3-backed `rustgis` Python package |
| L7 | `rustgis-ui-touch` | The phone interface around `rustgis-ui-egui`'s map view |
| apps | `rustgis`, `rustgis-cli`, `rustgis-web`, `rustgis-python`, `rustgis-mobile` | Desktop app, command line, browser (WebAssembly), the PyO3-backed `rustgis` Python package, and Android and iOS |
| tooling | `xtask` | Workspace checks, third-party licence notices and web service-worker generation |

## Everything is a command
Expand Down Expand Up @@ -175,7 +176,7 @@ model listing.
## Quality gates

```sh
cargo xtask ci # fmt, clippy -D warnings, tests, layering check
cargo xtask ci # fmt, clippy -D warnings, tests, layers, test-hygiene, attribution, rows, schema --check
```

`cargo xtask layers` checks that workspace dependencies point to lower layers and that crates
Expand Down
15 changes: 11 additions & 4 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ destroy user data.
## Developer checks

`cargo xtask ci` runs `cargo fmt --all --check`,
`cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace -q` and
`cargo xtask layers`. The pre-commit hooks also check TOML, YAML, JSON, whitespace and large files.
`cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace -q`,
`cargo xtask layers`, `cargo xtask test-hygiene`, `cargo xtask attribution`, `cargo xtask rows`
and `cargo xtask schema --check`. The pre-commit hooks also check TOML, YAML, JSON, whitespace and large files.
CI separately builds `rustgis-web` for `wasm32-unknown-unknown` and runs
`cargo deny --locked check licenses sources` against `deny.toml`, including development
dependencies. The fuzz workflow applies the same source policy using `fuzz/deny.toml`, which
Expand All @@ -94,8 +95,9 @@ bug to fix, not a retry to rely on; the retries are a stopgap for tests that wai
A pull request's CI runs the tests of the packages it changes and those that depend on them, as
`cargo xtask changed --list` finds them. The whole workspace is tested for a push to `main`, a
`ci:` label, a manual run on every platform, a change to `Cargo.lock`, `rust-toolchain*`, `.github/`
or `.config/`, and a file outside every package that nothing includes. Lint, the wasm build, the
licence check and the schema check always run whole. The `Tests pass` job fails when any other job
or `.config/`, and a file outside every package that nothing includes. Lint and the wasm build
always run whole; the licence and schema checks run on pull requests and merge groups only when
their watched files change. The `Tests pass` job fails when any other job
does; it is the check to require before merging.

Workflow actions are pinned to full commit SHAs with the previous version or branch in a comment.
Expand All @@ -108,7 +110,12 @@ Other workspace tasks:
| --- | --- |
| `cargo xtask changed [--list] [base]` | Run the `cargo xtask ci` checks on only the packages your branch changes and those that depend on them: a quicker check while you work. A file outside every package that no package includes, such as `Cargo.lock`, checks the whole workspace. `--list` prints the packages without checking them |
| `cargo xtask layers` | Check crate dependency direction (target-specific dependencies included) and keep UI dependencies out of lower layers; a new crate under `crates/` needs a layer in `LAYERS` |
| `cargo xtask test-hygiene` | Check tests for documented timer waits (`// test-wait:`), `#[ignore = "..."]` reasons and tautological assertions |
| `cargo xtask attribution` | Check that every image and font file has a row in `ATTRIBUTION.md` (its path, a directory above it or a pattern in backticks; a bare name covers a file at the repository root) |
| `cargo xtask rows [--update]` | Check that direct `Feature` row accesses outside `rustgis-data` stay within `xtask/row-uses.txt`; `--update` writes a lower count |
| `cargo xtask memory` | Measure peak memory of representative CLI workflows against `xtask/memory-limits.txt` (Linux) |
| `cargo xtask commands` | Refresh `crates/engine/command-surface.txt` after adding, removing or renaming a registered command or parameter |
| `cargo xtask schema [--check]` | Regenerate `schema/project.schema.json` from the saved project types, or verify it is up to date (`--check`) |
| `cargo xtask notices` | Regenerate the shipped `THIRD-PARTY-LICENSES.txt` files after changing dependencies, or after adding code or data from another project to `INCLUDED` in `xtask/src/notices.rs` (with its licence text in `third-party/`); requires `cargo-about` |
| `cargo xtask notices --check` | Check the notices without writing them; stale notices warn in CI but block releases |
| `cargo xtask web-pwa <dir>` | Generate the service worker in a Trunk build output directory, such as `dist/web` |
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ lists the newest 200 that match and says how many there are; type part of a comm
`export`) to filter, or tick **Failed only**.

A right-click on an entry offers **Copy Parameters** and **Copy Command**, the entry as a line for
the Script pane (`layer.buffer {"distance":10}`; undo and redo as themselves). A script run offers
the Script pane (`gp.run {"tool":"buffer","params":{"input":"Cities","distance":10}}`; undo and redo as themselves). A script run offers
**Copy Script** and **Open in Script Pane** instead, which puts the script in the Script pane in
place of its own (Ctrl+Z, ⌘+Z on a Mac, brings that back; not while the pane runs one). Where the
log cut an entry's parameters short or took secrets out of them, copying its command or its
Expand Down
Loading